From 9b24d69fbdd1a9630a3f248dfd78159ed05136e9 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Wed, 14 Jun 2023 10:41:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A4=E6=8D=A2=E4=B8=80=E4=B8=8B=E6=88=98?= =?UTF-8?q?=E6=96=97=E5=8F=8C=E6=96=B9=E6=AD=BB=E4=BA=A1=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../battle/controller/battle_controller.lua | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 8aa379ac..660d925a 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -499,14 +499,6 @@ end ---- start 回合步骤 function BattleController:enterNextWave() - local atkTeam = self.battleData:getAtkTeam() - if not atkTeam or atkTeam:getIsDead() then - self.victory = false - self:postWaveOver(true) - self:battleEnd() - return - end - if self.waveIndex ~= 0 then if self.isBossWave then self:addTaskProgress(BattleConst.BATTLE_TASK_FIELD.KILL_BOSS, 1) @@ -523,6 +515,14 @@ function BattleController:enterNextWave() return end + local atkTeam = self.battleData:getAtkTeam() + if not atkTeam or atkTeam:getIsDead() then + self.victory = false + self:postWaveOver(true) + self:battleEnd() + return + end + if self.waveIndex ~= 0 then -- 第一波 self:postWaveOver(false) end @@ -705,12 +705,6 @@ function BattleController:enterNextTeamAction() end function BattleController:checkTeamIsDead(callback) - local atkTeam = self.battleData:getAtkTeam() - if not atkTeam or atkTeam:getIsDead() then -- 英雄死了, 直接结算 - self:enterNextWave() - return true - end - local defTeam = self.battleData:getDefTeam() if not defTeam or defTeam:getIsDead() then -- 怪物死了, 直接进入刷新逻辑 self:onDefDead(function() @@ -731,6 +725,13 @@ function BattleController:checkTeamIsDead(callback) end) return true end + + local atkTeam = self.battleData:getAtkTeam() + if not atkTeam or atkTeam:getIsDead() then -- 英雄死了, 直接结算 + self:enterNextWave() + return true + end + return false end