本帖最后由 ninesound 于 2013-7-6 14:32 编辑
救世小树 发表于 2013-7-6 09:46
可以变通一下,用技能编号来分歧~注意各种细节上的变化~
非常感谢哦
如果要再加入判断武器
是不是我这样子写就可以了?
def make_damage_value(user, item) value = item.damage.eval(user, self, $game_variables) if item.is_a?(RPG::Skill) case item.id when 101,102 if user.armors.include?($data_armors[50]) value 101= 1.5 end if user.weapons.include?($data_weapons[51]) value 102 = 2.5 end when 999 end end #判断武器防具 #################### when 235 if self.state?(57) make_damage_extra(user,item) end #################### when 232 if self.state?(57) make_damage_extra(user,item) end #################### end end 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) @result.make_damage(value.to_i, item) end def make_damage_extra(user,item) if item.is_a?(RPG::Skill) case item.id when 235 value = user.mat * 10 when 232 value = ( a.atk* 5 + a.mat * 9 ) * 1.5 #↑↑↑↑↑↑↑↑写hp伤害的公式,底下的各种修正很据情况可删可留 #user→a self→b end 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) @result.hp_damage = value.to_i end end
def make_damage_value(user, item)
value = item.damage.eval(user, self, $game_variables)
if item.is_a?(RPG::Skill)
case item.id
when 101,102
if user.armors.include?($data_armors[50])
value 101= 1.5
end
if user.weapons.include?($data_weapons[51])
value 102 = 2.5
end
when 999
end
end #判断武器防具
####################
when 235
if self.state?(57)
make_damage_extra(user,item)
end
####################
when 232
if self.state?(57)
make_damage_extra(user,item)
end
####################
end
end
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)
@result.make_damage(value.to_i, item)
end
def make_damage_extra(user,item)
if item.is_a?(RPG::Skill)
case item.id
when 235
value = user.mat * 10
when 232
value = ( a.atk* 5 + a.mat * 9 ) * 1.5
#↑↑↑↑↑↑↑↑写hp伤害的公式,底下的各种修正很据情况可删可留
#user→a self→b
end
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)
@result.hp_damage = value.to_i
end
end
|