【解決】毒や吸収のSE
Posted: 2017年11月16日(木) 16:42
コード: 全て選択
# ID指定:アクターが正の数、エネミーが負の数
module FAI_DDSDSE
DRAIN_DAMAGE_SE = {}
DRAIN_DAMAGE_SE[1] = ["Absorb1", 80, 100]
DRAIN_DAMAGE_SE[-1] = ["Absorb1", 80, 100]
SLIP_DAMAGE_SE = {}
SLIP_DAMAGE_SE[1] = ["Poison", 80, 100]
SLIP_DAMAGE_SE[-1] = ["Poison", 80, 100]
end
class Game_Battler
include FAI_DDSDSE
def play_drain_damage
id = actor? ? self.id : -enemy_id
data = DRAIN_DAMAGE_SE[id]
Audio.se_play("Audio/SE/"+data[0], data[1], data[2]) if data
end
def play_slip_damage
id = actor? ? self.id : -enemy_id
data = SLIP_DAMAGE_SE[id]
Audio.se_play("Audio/SE/"+data[0], data[1], data[2]) if data
end
#--------------------------------------------------------------------------
# ● HP の再生
#--------------------------------------------------------------------------
alias fai_ddsdse_regenerate_hp regenerate_hp
def regenerate_hp
fai_ddsdse_regenerate_hp
play_slip_damage if @result.hp_damage > 0
end
end
class Window_BattleLog < Window_Selectable
#--------------------------------------------------------------------------
# ● HP ダメージ表示
#--------------------------------------------------------------------------
alias fai_ddsdse_display_hp_damage display_hp_damage
def display_hp_damage(target, item)
return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
target.play_drain_damage if target.result.hp_drain > 0
fai_ddsdse_display_hp_damage(target, item)
end
#--------------------------------------------------------------------------
# ● MP ダメージ表示
#--------------------------------------------------------------------------
alias fai_ddsdse_display_mp_damage display_mp_damage
def display_mp_damage(target, item)
return if target.dead? || target.result.mp_damage == 0
target.play_drain_damage if target.result.mp_drain > 0
Sound.play_recovery if target.result.mp_damage < 0
fai_ddsdse_display_mp_damage(target, item)
end
end
コード: 全て選択
# ID指定:アクターが正の数、エネミーが負の数
module FAI_DDSDSE
DRAIN_DAMAGE_SE = {}
DRAIN_DAMAGE_SE[1] = [["Absorb1", 80, 100], ["Absorb2", 80, 100]]
DRAIN_DAMAGE_SE[-1] = [["Absorb1", 80, 100], ["Absorb2", 80, 100]]
SLIP_DAMAGE_SE = {}
SLIP_DAMAGE_SE[1] = [["Poison", 80, 100], ["Paralyze2", 80, 100]]
SLIP_DAMAGE_SE[-1] = [["Poison", 80, 100], ["Paralyze2", 80, 100]]
end
class Game_Battler
include FAI_DDSDSE
def play_drain_damage
id = actor? ? self.id : -enemy_id
array = DRAIN_DAMAGE_SE[id]
if array
data = array[rand(array.size)]
Audio.se_play("Audio/SE/"+data[0], data[1], data[2]) if data
end
end
def play_slip_damage
id = actor? ? self.id : -enemy_id
array = SLIP_DAMAGE_SE[id]
if array
data = array[rand(array.size)]
Audio.se_play("Audio/SE/"+data[0], data[1], data[2]) if data
end
end
#--------------------------------------------------------------------------
# ● HP の再生
#--------------------------------------------------------------------------
alias fai_ddsdse_regenerate_hp regenerate_hp
def regenerate_hp
fai_ddsdse_regenerate_hp
play_slip_damage if @result.hp_damage > 0
end
end
class Window_BattleLog < Window_Selectable
#--------------------------------------------------------------------------
# ● HP ダメージ表示
#--------------------------------------------------------------------------
alias fai_ddsdse_display_hp_damage display_hp_damage
def display_hp_damage(target, item)
return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
target.play_drain_damage if target.result.hp_drain > 0
fai_ddsdse_display_hp_damage(target, item)
end
#--------------------------------------------------------------------------
# ● MP ダメージ表示
#--------------------------------------------------------------------------
alias fai_ddsdse_display_mp_damage display_mp_damage
def display_mp_damage(target, item)
return if target.dead? || target.result.mp_damage == 0
target.play_drain_damage if target.result.mp_drain > 0
Sound.play_recovery if target.result.mp_damage < 0
fai_ddsdse_display_mp_damage(target, item)
end
end