本帖最后由 soulsaga 于 2018-5-21 14:24 编辑
class Game_Battler #-------------------------------------------------------------------------- # ● 特技动作 #-------------------------------------------------------------------------- def perform_skill(user, skill) # 命中判定 if judge_skill_hit(user, skill) # 计算伤害 calculate_skill_damage(user, skill) power = skill.power + user.atk * skill.atk_f / 100 if power > 0 power -= self.pdef * skill.pdef_f / 200 power -= self.mdef * skill.mdef_f / 200 power = [power, 0].max end # 计算倍率 rate = 20 rate += (user.str * skill.str_f / 100) rate += (user.dex * skill.dex_f / 100) rate += (user.agi * skill.agi_f / 100) rate += (user.int * skill.int_f / 100) # 计算基本伤害 self.damage = power * rate / 20 # 属性修正 self.damage *= elements_correct(skill.element_set) self.damage /= 100 # 伤害符号正确的情况下 if self.damage > 0 # 防御修正 if self.guarding? self.damage /= 2 end end # 分散 if skill.variance > 0 and self.damage.abs > 0 amp = [self.damage.abs * skill.variance / 100, 1].max self.damage += rand(amp+1) + rand(amp+1) - amp end @damage = self.damage # 应用击中效果 apply_hit(user, skill) else # 应用未击中效果 apply_miss(user, skill) end end end end
class Game_Battler
#--------------------------------------------------------------------------
# ● 特技动作
#--------------------------------------------------------------------------
def perform_skill(user, skill)
# 命中判定
if judge_skill_hit(user, skill)
# 计算伤害
calculate_skill_damage(user, skill)
power = skill.power + user.atk * skill.atk_f / 100
if power > 0
power -= self.pdef * skill.pdef_f / 200
power -= self.mdef * skill.mdef_f / 200
power = [power, 0].max
end
# 计算倍率
rate = 20
rate += (user.str * skill.str_f / 100)
rate += (user.dex * skill.dex_f / 100)
rate += (user.agi * skill.agi_f / 100)
rate += (user.int * skill.int_f / 100)
# 计算基本伤害
self.damage = power * rate / 20
# 属性修正
self.damage *= elements_correct(skill.element_set)
self.damage /= 100
# 伤害符号正确的情况下
if self.damage > 0
# 防御修正
if self.guarding?
self.damage /= 2
end
end
# 分散
if skill.variance > 0 and self.damage.abs > 0
amp = [self.damage.abs * skill.variance / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
@damage = self.damage
# 应用击中效果
apply_hit(user, skill)
else
# 应用未击中效果
apply_miss(user, skill)
end
end
end
end
这些应该就是修改伤害公式的地方吧..分得这么散..实在头大.. |