Project1

标题: 物理反击、魔法反射 [打印本页]

作者: 小小西    时间: 2017-4-29 22:54
标题: 物理反击、魔法反射
本帖最后由 小小西 于 2017-4-30 13:48 编辑

很久以前把反击脚本改动了,默认反击是没受到伤害反击敌人,现在状况是:受到物理攻击受伤后再反击敌人,魔法反射也是先受伤再反射回去。
物理反击和魔法反射用的是同一个公式吗?

问题已解决。
RUBY 代码复制
  1. #--------------------------------------------------------------------------
  2.     # ● 发动技能/物品
  3.     #--------------------------------------------------------------------------
  4.  
  5.   def invoke_item(target, item)
  6.  
  7.     if rand < target.item_cnt(@subject, item)
  8.  
  9.       apply_item_effects(apply_substitute(target, item), item)  #如果删掉这行,触发物理反击时不会受伤
  10.  
  11.       invoke_counter_attack(target, item) if !(target.state?(1))  
  12.  
  13.     elsif rand < target.item_mrf(@subject, item)
  14.  
  15.       #apply_item_effects(apply_substitute(target, item), item)#如果删掉这行,触发魔法反射时不会受伤
  16.  
  17.       invoke_magic_reflection(target, item) if !(target.state?(1))
  18.  
  19.     else
  20.  
  21.       apply_item_effects(apply_substitute(target, item), item)
  22.  
  23.     end
  24.  
  25.     @subject.last_target_index = target.index
  26.  
  27.   end

作者: QQ蚊子湯    时间: 2017-4-30 00:19
上面都沒貼到核心方法我也不知道你改成怎樣(小聲)
RUBY 代码复制
  1. class Game_Battler < Game_BattlerBase
  2.   def invoke_item(target, item)
  3.     if rand < target.item_tct(@subject, item)
  4.       apply_item_effects(apply_substitute(target, item), item)
  5.       invoke_counter_attack(target, item)
  6.     elsif rand < target.item_mrf(@subject, item)
  7.       invoke_magic_reflection(target, item)
  8.     else
  9.       apply_item_effects(apply_substitute(target, item), item)
  10.     end
  11.     @subject.last_target_index = target.index
  12.   end
  13. end





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