class Scene_Battle < Scene_Base def add_battlelog(text) @log_window.add_text(text) end end class Game_Actor < Game_Battler alias no_log_regenerate_hp regenerate_hp def regenerate_hp no_log_regenerate_hp scene = SceneManager.scene if scene.respond_to?(:add_battlelog) && @result.hp_damage < 0 scene.add_battlelog "#{name}的HP恢复了#{[email][email protected]_damage[/email]}点!" end end end
taroxd 发表于 2014-6-14 12:40
class Scene_Battle < Scene_Base
def add_battlelog(text)
@log_window.add_text(text)
#-------------------------------------------------------------------------- # ● 显示回避 (追加定义) #-------------------------------------------------------------------------- alias hzhj_old_display_evasion_for_display_damage_wnd_btlog display_evasion def display_evasion(target, item) target.hzhj_damage = [:eva, :evasion, false] hzhj_old_display_evasion_for_display_damage_wnd_btlog(target, item) end #-------------------------------------------------------------------------- # ● 显示 HP 伤害 (追加定义) #-------------------------------------------------------------------------- alias hzhj_old_display_hp_damage_for_display_damage_wnd_btlog display_hp_damage def display_hp_damage(target, item) return if target.result.hp_damage == 0 && item && !item.damage.to_hp? value = target.result.hp_damage critical = target.result.critical target.hzhj_damage = [:hp, value, critical] hzhj_old_display_hp_damage_for_display_damage_wnd_btlog(target, item) end #-------------------------------------------------------------------------- # ● 显示 MP 伤害 (追加定义) #-------------------------------------------------------------------------- alias hzhj_old_display_mp_damage_for_display_damage_wnd_btlog display_mp_damage def display_mp_damage(target, item) return if target.dead? || target.result.mp_damage == 0 value = target.result.mp_damage critical = target.result.critical target.hzhj_damage = [:mp, value, critical] hzhj_old_display_mp_damage_for_display_damage_wnd_btlog(target, item) end #-------------------------------------------------------------------------- # ● 显示 TP 伤害 (追加定义) #-------------------------------------------------------------------------- alias hzhj_old_display_tp_damage_for_display_damage_wnd_btlog display_tp_damage def display_tp_damage(target, item) return if target.dead? || target.result.tp_damage == 0 value = target.result.tp_damage critical = target.result.critical target.hzhj_damage = [:tp, value, critical] hzhj_old_display_tp_damage_for_display_damage_wnd_btlog(target, item) end end
1.png (6.56 KB, 下载次数: 24)
class Game_Actor < Game_Battler alias no_log_regenerate_hp regenerate_hp def regenerate_hp no_log_regenerate_hp @hzhj_damage = [:hp, @result.hp_damage, false] if @result.hp_damage != 0 scene = SceneManager.scene if scene.respond_to?(:add_battlelog) && @result.hp_damage < 0 scene.add_battlelog "#{name}的HP恢复了#{[email][email protected]_damage[/email]}点!" elsif scene.respond_to?(:add_battlelog) && @result.hp_damage > 0 scene.add_battlelog "#{name}的HP失去了#{[email][email protected]_damage[/email]}点!" end end alias no_log_regenerate_mp regenerate_mp def regenerate_mp no_log_regenerate_mp @hzhj_damage = [:mp, @result.hp_damage, false] if @result.mp_damage != 0 scene = SceneManager.scene if scene.respond_to?(:add_battlelog) && @result.mp_damage < 0 scene.add_battlelog "#{name}的MP恢复了#{[email][email protected]_damage[/email]}点!" elsif scene.respond_to?(:add_battlelog) && @result.mp_damage > 0 scene.add_battlelog "#{name}的MP失去了#{[email][email protected]_damage[/email]}点!" end end end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |