Project1

标题: 为何每次战斗第一次都不进行这些判断 [打印本页]

作者: 负零    时间: 2015-2-7 21:23
标题: 为何每次战斗第一次都不进行这些判断
为何每次战斗第一次都不进行这些判断?第二次才进行。
以下为脚本

RUBY 代码复制
  1. value = item.damage.eval(user, self, $game_variables)
  2.   #-------------------------   a     b      v
  3.   # ● 公式
  4.   #-------------------------               
  5.                 if item.is_a?(RPG::Skill)
  6.                         case item.id
  7.                         when 5
  8.                                 value = (user.atk+user.def)*2 +user.add_state(5).to_i
  9.  
  10.  
  11.                         when 1
  12.  
  13.                                 p"ddd"
  14.                                 if user.skills.include?($data_skills[10])
  15.                                         p"第二部判断"
  16.                                 value = 1<30 ? user.atk+100 : user.atk if user.is_a?(Game_Actor)
  17.  
  18.                               end
  19.  
  20.                         end
  21.  
  22.  
  23.  
  24.  
  25.                 end
  26.  
  27.          #-------------------------
  28.   # ● end
  29.   #-------------------------        
  30.     value *= item_element_rate(user, item)
  31.     value *= pdr if item.physical?
  32.     value *= mdr if item.magical?
  33.     value *= rec if item.damage.recover?
  34.     value = apply_critical(value) if @result.critical
  35.     value = apply_variance(value, item.damage.variance)
  36.     value = apply_guard(value)
  37.     @result.make_damage(value.to_i, item)
  38.   end

作者: 三途亚梦    时间: 2015-2-7 22:16
这猎奇的代码缩进……
从这里看并没有发生会导致“第一次”不进行的问题。

make_damage_value的方法是在技能命中且技能伤害类型不是“无”的前提下才会被调用的。




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1