当使用者(进攻者)拥有30号状态时,暴击伤害为5倍,否则则为3倍
具体的数值和状态ID可以自己设置,在apply_critical里面设置(也可以按照格式自己添加)
class Game_Battler < Game_BattlerBase 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(user,value) if @result.critical value = apply_variance(value, item.damage.variance) value = apply_guard(value) @result.make_damage(value.to_i, item) end def apply_critical(user,damage) return damage * 5 if user.state?(30) return damage * 3 end end
class Game_Battler < Game_BattlerBase
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(user,value) if @result.critical
value = apply_variance(value, item.damage.variance)
value = apply_guard(value)
@result.make_damage(value.to_i, item)
end
def apply_critical(user,damage)
return damage * 5 if user.state?(30)
return damage * 3
end
end
|