查看: 2183|回复: 2

[已经解决] 反伤被敌人到0血,空血仍然能进行战斗

[复制链接]
梦石
0
星屑
1442
在线时间
171 小时
注册时间
2019-10-4
回帖
162
发表于 2023-1-1 10:03:07 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
[pre lang="ruby"]#--------------------------------------------------------------------------
  # ● 刷新画面 (主回合步骤 5 : 显示伤害)
  #--------------------------------------------------------------------------
  def update_phase4_step5
    # 隐藏帮助窗口
    @help_window.visible = false
    # 刷新状态窗口
    @status_window.refresh
    # 显示伤害
    for target in @target_battlers
      if target.damage != nil
        target.damage_pop = true
        
        #反伤甲,荆棘铠甲
      if target.is_a?(Game_Actor) && target.state?(17)
        if @active_battler.is_a?(Game_Enemy) && target.damage <=0
              @active_battler.animation_id = @animation2_id
              @active_battler.animation_hit = (target.damage != "Miss")
             @active_battler.hp-= 1000
          # else
       # if target.damage > 0
          # target.remove_state(17)
         end
         end
#解释下上面的意思:角色在17号状态下被敌人使用技能击打的时候如果伤害<=0
#则行动者会受到自己的动画反弹并且掉去10000的血量
#如果伤害》0的话 那么被击打的对象就会失去17号状态 切伤害正常化
#我测试过有用啊  是你自己没有在事件里面设定吧
#17号状态是否勾去战后解除 还是不解除你要检查一下
#我测试过没问题的啊
   
      end
    end
    # 移至步骤 6
    @phase4_step = 6
  end[/pre]

[pre lang="ruby"]   #反伤
      #if self.state?(17)
        #attacker.hp -= self.damage/3
      #end[/pre]

Scene_Battle 4 600行
Game_Battler 3 60行
两种方法反伤 都在被打死的 情况下扔可以继续战斗
梦石
0
星屑
8003
在线时间
1184 小时
注册时间
2007-7-29
回帖
2014
发表于 2023-1-3 23:37:09 | 显示全部楼层
你可以检查以下确认角色或者敌人死亡在第几个step,很可能你的反伤在确认死亡的步骤之后。

点评

谢谢大佬,其他大佬帮我解决了,其实是我定义复活甲状态和反伤状态重叠了。  发表于 2023-1-5 16:15
回复 1 0

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部