def calc_hit(user, obj = nil)
if obj == nil # 普通攻击
if user.agi < self.agi
hit = user.agi/self.agi
elsif hit=user.hit
end
physical = true
elsif obj.is_a?(RPG::Skill) # 技能攻击
hit = obj.hit # 获取命中率
physical = obj.physical_attack
else # 物品攻击
hit = 100 # 设命中率为100%
physical = obj.physical_attack
end
if physical # 物理攻击
hit /= 4 if user.reduce_hit_ratio? # 中了暗黑状态时命中率降低为25%
end
return hit
end 版务信息:本贴由楼主自主结贴~