From 8b2d0c60461b5ba0def5a90d368e26cb5f450a6e Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 7 Aug 2023 11:45:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=B8=80=E4=B8=8B=E7=BB=93?= =?UTF-8?q?=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/component/battle_unit_comp.lua | 2 +- .../module/battle/controller/battle_base_controller.lua | 7 ++++++- lua/app/module/battle/team/battle_team.lua | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index ecf8856b..5562b34a 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -1743,7 +1743,7 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d team:checkPassiveEvent(BattleConst.PASSIVE_EVENT.ON_DEAD_WITH_BLEED) end - if self.actionOverCallback then -- 被反击时死亡 + if self.actionOverCallback then -- 被反伤时死亡 self:onAttackOver() end diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua index 364765ca..1e121b3d 100644 --- a/lua/app/module/battle/controller/battle_base_controller.lua +++ b/lua/app/module/battle/controller/battle_base_controller.lua @@ -1048,6 +1048,12 @@ end function BattleBaseController:checkTeamIsDead(callback) local defTeam = self.battleData:getDefTeam() + local atkTeam = self.battleData:getAtkTeam() + if atkTeam:getIsDead() and defTeam:getIsDead() then -- 都死了,直接结算 + self:enterNextWave() + return true + end + if not defTeam or defTeam:getIsDead() then -- 怪物死了, 直接进入刷新逻辑 self.curWaveMonsterDead = true self:onDefDead(function() @@ -1069,7 +1075,6 @@ function BattleBaseController:checkTeamIsDead(callback) return true end - local atkTeam = self.battleData:getAtkTeam() if not atkTeam or atkTeam:getIsDead() then -- 英雄死了, 直接结算 self:enterNextWave() return true diff --git a/lua/app/module/battle/team/battle_team.lua b/lua/app/module/battle/team/battle_team.lua index 03aa3023..dd7e5fed 100644 --- a/lua/app/module/battle/team/battle_team.lua +++ b/lua/app/module/battle/team/battle_team.lua @@ -597,6 +597,9 @@ function BattleTeam:setIsFinalBlock(isFinalBlock) end function BattleTeam:getIsFinalBlock() + if self.isFinalBlock == nil then -- 容错一下,用于受伤时侯的判定 + return true + end return self.isFinalBlock end