#===============================================================================
# ● [XP] ◦ Rei Footstep Script ◦ □
# * Event dan player bakal punya suara langkah kaki . . . *
#-------------------------------------------------------------------------------
# ◦ by reijubv [aruyasoft@comic.com]
# ◦ Rpgmakerid
# ◦ Dipublikasikan pada: 02/10/2009
# ◦ Versi: 1.0 (2 Oktober 2009)
#-------------------------------------------------------------------------------
# Untuk membuat sebuah event memiliki suara footsptep, di nama event itu, tambah
# kan kata <ftsp>.
# Jangan lupa untuk mengeset terrain tag di tile editor!
#===============================================================================
# Credit to reijubv
#-------------------------------------------------------------------------------
# ◦ Installation:
# Taroh diatas Main dibawah Scene_Debug, edit dibawah
#===============================================================================
$imported = {} if $imported == nil
$imported["Rei_"+"Footstep"] = true
#-------------------------------------------------------------------------------
# Rei Module
#-------------------------------------------------------------------------------
module Rei
module Footstep
TAG = []
#------------------------------------------------------------------------
# Edit di dalam array yang ada dibawah, tambahkan sebanyak mungkin sound
# effect dalam 1 array sesuai yang kamu mau
# Semua sound effect harus ada di folder Audio/SE/
#------------------------------------------------------------------------
# Sound effects yang akan muncul saat player/event berjalan di tile dengan
# Terran tag 0
TAG[0] = ["sound1", "sound2"]
# Sound effects yang akan muncul saat player/event berjalan di tile dengan
# Terran tag 1
TAG[1] = ["sound1", "sound2", "sound3", "sound4", "sound5"]
# Sound effects yang akan muncul saat player/event berjalan di tile dengan
# Terran tag 2
TAG[2] = ["sound1", "sound2", "sound3", "sound4", "sound5", "sound6"]
# Sound effects yang akan muncul saat player/event berjalan di tile dengan
# Terran tag 3
TAG[3] = ["sound1", "sound2", "sound3", "sound4", "sound5", "sound6",
"sound7", "sound8"]
# Sound effects yang akan muncul saat player/event berjalan di tile dengan
# Terran tag 4
TAG[4] = ["sound1", "sound2", "sound3", "sound4", "sound5", "sound6",
"sound7", "sound8"]
# Sound effects yang akan muncul saat player/event berjalan di tile dengan
# Terran tag 5
TAG[5] = ["sound1", "sound2", "sound3", "sound4", "sound5", "sound6",
"sound7", "sound8"]
# Sound effects yang akan muncul saat player/event berjalan di tile dengan
# Terran tag 6
TAG[6] = ["sound1", "sound2", "sound3", "sound4", "sound5", "sound6",
"sound7", "sound8"]
# Sound effects yang akan muncul saat player/event berjalan di tile dengan
# Terran tag 7
TAG[7] = ["sound1", "sound2", "sound3", "sound4", "sound5", "sound6",
"sound7", "sound8"]
# Apakah secara default, event memiliki suara footstep juga ?
EVENT_FOOTSTEP = false
# Switch Id untuk menyalakan/mematikan efek footstepnya player
PS = 1
# Switch Id untuk menyalakan/mematikan efek footstepnya event
ES = 2
end
end
#==============================================================================
# ** Game_Character
#==============================================================================
class Game_Character
include Rei::Footstep
attr_accessor :footstep_se
def play_se
vol = rand(30) + 70
pitch = rand(30) + 70
case $game_map.terrain_tag(@x, @y)
when 0
Audio.se_play(TAG[rand(TAG[0].size-1)], vol, pitch)
when 1
Audio.se_play(TAG[rand(TAG[1].size-1)], vol, pitch)
when 2
Audio.se_play(TAG[rand(TAG[2].size-1)], vol, pitch)
when 3
Audio.se_play(TAG[rand(TAG[3].size-1)], vol, pitch)
when 4
Audio.se_play(TAG[rand(TAG[4].size-1)], vol, pitch)
when 5
Audio.se_play(TAG[rand(TAG[5].size-1)], vol, pitch)
when 6
Audio.se_play(TAG[rand(TAG[6].size-1)], vol, pitch)
when 7
Audio.se_play(TAG[rand(TAG[7].size-1)], vol, pitch)
end
end
end
#==============================================================================
# ** Game_Player
#==============================================================================
class Game_Player < Game_Character
alias rei_ftstp_initialize_gp initialize
def initialize;@footstep_se = true;rei_ftstp_initialize_gp
end
alias rei_gp_ftstp_increase_steps increase_steps
def increase_steps;rei_gp_ftstp_increase_steps
play_se if @footstep_se == true and $game_switches[Rei::Footstep::PS]
end
end
#==============================================================================
# ** Game_Event
#==============================================================================
class Game_Event < Game_Character
alias rei_ftstp_initialize_ge initialize
def initialize(map_id, event)
rei_ftstp_initialize_ge(map_id, event)
@footstep_se = false
if @event.name.upcase.include?('<ftsp>') or Rei::Footstep::EVENT_FOOTSTEP
@footstep_se = true
end
end
alias rei_ge_ftstp_increase_steps increase_steps
def increase_steps;rei_ge_ftstp_increase_steps
play_se if @footstep_se == true and $game_switches[Rei::Footstep::ES]
end
end
#==============================================================================
# ** End of Script
#============================================================================== |
0 komentar:
Posting Komentar