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