符文副本复活处理

This commit is contained in:
xiekaidong 2023-09-20 10:47:30 +08:00
parent 27e4a79d88
commit 7dc298a2bb

View File

@ -153,6 +153,16 @@ function BattleControllerDungeonRune:enterRoundBegin()
if self.canRebirthTimes > 0 and not self.isBossChapter then if self.canRebirthTimes > 0 and not self.isBossChapter then
ModuleManager.DungeonRuneManager:showRebirthUI(function() ModuleManager.DungeonRuneManager:showRebirthUI(function()
self.canRebirthTimes = self.canRebirthTimes - 1 self.canRebirthTimes = self.canRebirthTimes - 1
local mainUnit = self.atkTeam:getMainUnit()
mainUnit:rebirth()
local hp = mainUnit.unitEntity:getMaxHp() * 5000 // GConst.BattleConst.DEFAULT_FACTOR -- 回血50%
local x = mainUnit:takeDamageOrCure(mainUnit, hp, GConst.BattleConst.EFFECT_TYPE.HEAL, 0, BattleConst.SPECIAL_DAMAGE_OR_CURE_TYPE.AD_REBIRTH)
local hpPercent = mainUnit.unitEntity:getHpPercent()
self:refreshHp(mainUnit:getSide(), mainUnit.unitEntity:getHp(), hpPercent)
self.atkTeam:checkPassiveEvent(PASSIVE_EVENT.HP_LOWER_THAN, mainUnit, hpPercent)
mainUnit:changeState(UNIT_STATE.IDLE)
mainUnit:initPosition()
self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount + self.addRoundCount self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount + self.addRoundCount
self.dungeonRuneMaxRoundCount = self.dungeonRuneMaxRoundCount + self.addRoundCount self.dungeonRuneMaxRoundCount = self.dungeonRuneMaxRoundCount + self.addRoundCount
self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount - 1 self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount - 1
@ -345,10 +355,16 @@ function BattleControllerDungeonRune:tryShowRebirth(callback)
local hpPercent = mainUnit.unitEntity:getHpPercent() local hpPercent = mainUnit.unitEntity:getHpPercent()
self:refreshHp(mainUnit:getSide(), mainUnit.unitEntity:getHp(), hpPercent) self:refreshHp(mainUnit:getSide(), mainUnit.unitEntity:getHp(), hpPercent)
self.atkTeam:checkPassiveEvent(PASSIVE_EVENT.HP_LOWER_THAN, mainUnit, hpPercent) self.atkTeam:checkPassiveEvent(PASSIVE_EVENT.HP_LOWER_THAN, mainUnit, hpPercent)
mainUnit:changeState(UNIT_STATE.IDLE) mainUnit:changeState(UNIT_STATE.IDLE)
mainUnit:initPosition() mainUnit:initPosition()
self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount + self.addRoundCount
self.dungeonRuneMaxRoundCount = self.dungeonRuneMaxRoundCount + self.addRoundCount
self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount - 1
if self.battleUI then
local desc = self.dungeonRuneRemainRoundCount + 1
self.battleUI:refreshWave(desc, GConst.ATLAS_PATH.COMMON, "common_dec_15")
end
if callback then if callback then
callback() callback()
end end