module CLD99
module YOMIGAERU
SKILL_ID = 5
# 死后满血复活的被动技能,只能设置一个
FMT = "因为某个被动技能,%s满血复活了。"
# 复活后显示的消息,%s处会变为复活者的名字
SOUND = "Audio/SE/Saint7"
# 复活时的音效
end
end
class << BattleManager
#--------------------------------------------------------------------------
# ● [别名修改]设置
#--------------------------------------------------------------------------
alias :setup_for_yomigaeru :setup
def setup(*args)
setup_for_yomigaeru(*args)
$yomigaeru = {} # 是否重生过的标志
end
#--------------------------------------------------------------------------
# ● [别名修改]判断胜负
#--------------------------------------------------------------------------
alias judge_win_loss_for_yomigaeru judge_win_loss
def judge_win_loss
return false if $wait_yomigaeru # 先等待重生
judge_win_loss_for_yomigaeru
end
#--------------------------------------------------------------------------
# ● [追加]战斗消息
#--------------------------------------------------------------------------
def show_log(text)
return unless SceneManager.scene_is?(Scene_Battle)
SceneManager.scene.show_log(text)
end
end
class Scene_Battle
#--------------------------------------------------------------------------
# ● [追加]战斗消息
#--------------------------------------------------------------------------
def show_log(text)
@log_window.add_text(text)
@log_window.wait
end
end
class Game_Actor
#--------------------------------------------------------------------------
# ● [别名修改]刷新
#--------------------------------------------------------------------------
alias refresh_for_yomigaeru refresh
def refresh
return refresh_for_yomigaeru unless $game_party.in_battle # 非战斗中不触发
$wait_yomigaeru = true # 延迟胜负判断
refresh_for_yomigaeru # 原方法
if @states.include?(death_state_id)
if @skills.include?(CLD99::YOMIGAERU::SKILL_ID) && !$yomigaeru[@actor_id]
remove_state(death_state_id)
change_hp(self.mhp, enable_death = false)
BattleManager.show_log(sprintf(CLD99::YOMIGAERU::FMT, @name))
Audio.se_play(CLD99::YOMIGAERU::SOUND)
$yomigaeru[@actor_id] = true
end
end
$wait_yomigaeru = false # 恢复胜负判断
end
end