This commit is contained in:
xiekaidong 2023-09-12 10:49:44 +08:00
parent b9b8a10cc4
commit e151b5329e
2 changed files with 35 additions and 4 deletions

View File

@ -20,12 +20,25 @@ function BattleControllerDungeonRune:getChapterId()
end
function BattleControllerDungeonRune:initOther()
local runeData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.RUNES_OPEN)
self.canRebirthTimes = 1 -- 每次只能复活一次
self.addRoundCount = runeData:getRebirthAddRoundCount()
self.dungeonRuneRemainRoundCount = self:getChapterConfig()[self.chapterId].round or 1
if self.battleUI then
self.battleUI:refreshWave(self.dungeonRuneRemainRoundCount, GConst.ATLAS_PATH.COMMON, "common_dec_15")
end
self.runeMaxLv = runeData:getBattleMaxlv() or 1
self.battleData:setMaxBattleLv(self.runeMaxLv)
end
function BattleControllerDungeonRune:addBattleExp(...)
if self.battleData:getBattleLv() >= self.runeMaxLv then
return
end
BattleController.addBattleExp(self, ...)
end
-- 怪物攻击力固定
@ -132,10 +145,10 @@ end
function BattleControllerDungeonRune:enterRoundBegin()
if self.dungeonRuneRemainRoundCount <= 0 then
if self.canRebirthTimes > 0 then
if self.canRebirthTimes > 0 and not self.isBossChapter then
ModuleManager.DungeonRuneManager:showRebirthUI(function()
self.canRebirthTimes = self.canRebirthTimes - 1
self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount + 5 -- 5回合
self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount + self.addRoundCount
self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount - 1
if self.battleUI then
self.battleUI:refreshWave(self.dungeonRuneRemainRoundCount + 1, GConst.ATLAS_PATH.COMMON, "common_dec_15")
@ -175,6 +188,7 @@ function BattleControllerDungeonRune:getInitBoard()
self.mysteryBoxIndexMap = {}
self.monsterList = {}
self.elementWeightMap = {}
self.isBossChapter = false
local boardCfg = self:getBoardConfig()
local info = self:getChapterConfig()[self.chapterId]
@ -190,6 +204,9 @@ function BattleControllerDungeonRune:getInitBoard()
end
end
end
if #self.monsterList <= 1 then
self.isBossChapter = true
end
end
return self.boradList, self.fixedRandomGrid, self.mysteryBoxIndexMap
@ -262,7 +279,7 @@ end
function BattleControllerDungeonRune:tryShowRebirth(callback)
local atkTeam = self.battleData:getAtkTeam()
if atkTeam:getIsDead() and self.canRebirthTimes > 0 then
if atkTeam:getIsDead() and self.canRebirthTimes > 0 and not self.isBossChapter then
ModuleManager.DungeonRuneManager:showRebirthUI(function()
self.canRebirthTimes = self.canRebirthTimes - 1
local mainUnit = self.atkTeam:getMainUnit()
@ -357,7 +374,7 @@ function BattleControllerDungeonRune:getRuneTaskNumByType(taskInfo)
elseif taskType == GConst.DungeonRuneConst.TASK_TYPE.BREAK_GRID_TYPE then
return self.totalBreakedGridType[taskParams1] or 0
elseif taskType == GConst.DungeonRuneConst.TASK_TYPE.KILL_MONSTER then
return self:getTaskProgress()[GConst.BattleConst.BATTLE_TASK_FIELD.KILL_NORMAL_MONSTER]
return self:getTaskProgress[GConst.BattleConst.BATTLE_TASK_FIELD.KILL_NORMAL_MONSTER]
end
end

View File

@ -90,6 +90,20 @@ function DungeonRuneEntity:getTodayRemainLimitCount()
return DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_GLOD_WING)
end
function DungeonRuneEntity:getRebirthAddRoundCount()
if not self.rebirthAddRoundCount then
self.rebirthAddRoundCount = GFunc.getConstIntValue("dungeon_rune_revival")
end
return self.rebirthAddRoundCount
end
function DungeonRuneEntity:getBattleMaxlv()
if not self.battleMaxLv then
self.battleMaxLv = GFunc.getConstIntValue("dungeon_rune_lvlimit")
end
return self.battleMaxLv
end
function DungeonRuneEntity:getBuySliverWingCost()
if not self.buySliverWingCost then
self.buySliverWingCost = GFunc.getConstReward("dungeon_rune_cost")