class Scene_Map
alias cld99_update update
def update
cld99_update
update_recover_hp if $game_switches[1] #1号开关打开时原地回血
end
def update_recover_hp
@time ||= 0
Input.dir4 == 0 ? @time += 1 : @time = 0
if @time == 300
$game_party.members.each do |actor|
actor.change_hp(actor.mhp / 5, true)
end
@time = 0
end
end
end
[/pre]
...