楼主也是懂代码的,我就大概给个思路吧 (未测试)
class Game_BattlerBase def refresh @last_mhp ||= mhp if @last_mhp != mhp old_hp_rate = hp.fdiv @last_mhp @last_mhp = mhp self.hp = (old_hp_rate * @last_mhp).to_i end # invoke original method `refresh' end end
class Game_BattlerBase
def refresh
@last_mhp ||= mhp
if @last_mhp != mhp
old_hp_rate = hp.fdiv @last_mhp
@last_mhp = mhp
self.hp = (old_hp_rate * @last_mhp).to_i
end
# invoke original method `refresh'
end
end
|