class Game_Battler < Game_BattlerBase
STATE_ID = 15 #魔法盾状态的id号
MP_RATE = 0.4 #魔法盾吸收伤害的比率0.4就是10点伤害hp6点mp4点
MP_DAMAGE_RATE = 2
VARIABLE_ID = 3 #1点mp抵消(3号变量的值+2)点伤害,如果不需要变量功能,就把这个值设为0或负数
#--------------------------------------------------------------------------
# ● 计算伤害
#--------------------------------------------------------------------------
def make_damage_value(user, item)
value = item.damage.eval(user, self, $game_variables)
value *= item_element_rate(user, item)
value *= pdr if item.physical?
value *= mdr if item.magical?
value *= rec if item.damage.recover?
value = apply_critical(value) if @result.critical
value = apply_variance(value, item.damage.variance)
value = apply_guard(value)
if item.damage.to_hp? and self.state?(STATE_ID)
mrate = MP_DAMAGE_RATE
mrate += $game_variables[VARIABLE_ID] if $game_variables[VARIABLE_ID]
mp_value = [(value * MP_RATE/mrate).to_i , self.mp].min
value -= mp_value * mrate
self.mp -= mp_value
end
@result.make_damage(value.to_i, item)
end
end