#================================================
# > Use tag <hurt: SE_name, volume, pitch>
# Example: <hurt: Damage1, 100, 100>
#================================================
class RPG::BaseItem
def hurt_sounds
return @hsounds if @hsounds
@hsounds = []
note.split(/[\r\n]+/).each do |line|
if line =~ /<hurt\s*:\s*(\w+),\s*(\d+),\s*(\d+)>/i
@hsounds << RPG::SE.new($1.to_s, $2.to_i, $3.to_i)
end
end
return @hsounds
end
end
class Game_Battler
def data_battler
actor? ? actor : enemy
end
alias theo_hurt_sound_exe_damage execute_damage
def execute_damage(user)
theo_hurt_sound_exe_damage(user)
sounds = data_battler.hurt_sounds
return if sounds.empty? || @result.hp_damage <= 0
sounds.sample.play
end
end
#================================================
# > Use tag <hurt: SE_name, volume, pitch>
# Example: <hurt: Damage1, 100, 100>
#================================================
class RPG::BaseItem
def hurt_sounds
return @hsounds if @hsounds
@hsounds = []
note.split(/[\r\n]+/).each do |line|
if line =~ /<hurt\s*:\s*(\w+),\s*(\d+),\s*(\d+)>/i
@hsounds << RPG::SE.new($1.to_s, $2.to_i, $3.to_i)
end
end
return @hsounds
end
end
class Game_Battler
def data_battler
actor? ? actor : enemy
end
alias theo_hurt_sound_exe_damage execute_damage
def execute_damage(user)
theo_hurt_sound_exe_damage(user)
sounds = data_battler.hurt_sounds
return if sounds.empty? || @result.hp_damage <= 0
cnt = sounds.size
plsnd = rand(cnt)
audsnd = sounds[plsnd]
audsnd.play
end
end
