| 赞 | 0  | 
 
| VIP | -1 | 
 
| 好人卡 | 5 | 
 
| 积分 | 1 | 
 
| 经验 | 4478 | 
 
| 最后登录 | 2019-11-1 | 
 
| 在线时间 | 75 小时 | 
 
 
 
 
 
Lv1.梦旅人 
	- 梦石
 - 0 
 
        - 星屑
 - 54 
 
        - 在线时间
 - 75 小时
 
        - 注册时间
 - 2009-9-8
 
        - 帖子
 - 56
 
 
 
 | 
	
def calc_hit(user, obj = nil) 
    if obj == nil                                   # for a normal attack 
      hit = user.hit + user.agi - self.agi  # get hit ratio 
      physical = true 
    elsif obj.is_a?(RPG::Skill)                 # for a skill 
      if obj.hit = 100  
        hit = 100 
        else 
        hit = obj.hit + user.agi - self.agi   # 获取命中率 
    end                                              # get success rate 
        physical = obj.physical_attack 
    else                                                # for an item 
      hit = 100                                     # the hit ratio is made 100% 
      physical = obj.physical_attack 
    end 
    if physical                                         # for a physical attack 
      hit /= 4 if user.reduce_hit_ratio?    # when the user is blinded 
    end 
    return hit 
  end 
 
为什么我特技命中率设置不是100也不执行 
else 
        hit = obj.hit + user.agi - self.agi   # 获取命中率 
#------------------------------------------------------------ 
我想要的效果就是 当特技命中率设置为100的时候,特技必中。 
                 当特技命中率设置不是100(小于100)的时候,特技命中率执行另一种算法。 |   
 
 
 
 |