完善一下结算

This commit is contained in:
xiekaidong 2023-08-07 11:45:16 +08:00
parent 82823526d9
commit 8b2d0c6046
3 changed files with 10 additions and 2 deletions

View File

@ -1743,7 +1743,7 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d
team:checkPassiveEvent(BattleConst.PASSIVE_EVENT.ON_DEAD_WITH_BLEED) team:checkPassiveEvent(BattleConst.PASSIVE_EVENT.ON_DEAD_WITH_BLEED)
end end
if self.actionOverCallback then -- 被反时死亡 if self.actionOverCallback then -- 被反时死亡
self:onAttackOver() self:onAttackOver()
end end

View File

@ -1048,6 +1048,12 @@ end
function BattleBaseController:checkTeamIsDead(callback) function BattleBaseController:checkTeamIsDead(callback)
local defTeam = self.battleData:getDefTeam() 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 -- 怪物死了, 直接进入刷新逻辑 if not defTeam or defTeam:getIsDead() then -- 怪物死了, 直接进入刷新逻辑
self.curWaveMonsterDead = true self.curWaveMonsterDead = true
self:onDefDead(function() self:onDefDead(function()
@ -1069,7 +1075,6 @@ function BattleBaseController:checkTeamIsDead(callback)
return true return true
end end
local atkTeam = self.battleData:getAtkTeam()
if not atkTeam or atkTeam:getIsDead() then -- 英雄死了, 直接结算 if not atkTeam or atkTeam:getIsDead() then -- 英雄死了, 直接结算
self:enterNextWave() self:enterNextWave()
return true return true

View File

@ -597,6 +597,9 @@ function BattleTeam:setIsFinalBlock(isFinalBlock)
end end
function BattleTeam:getIsFinalBlock() function BattleTeam:getIsFinalBlock()
if self.isFinalBlock == nil then -- 容错一下,用于受伤时侯的判定
return true
end
return self.isFinalBlock return self.isFinalBlock
end end