From e151b5329ecaa13666c41581d9205773d3e7fc1e Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Tue, 12 Sep 2023 10:49:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../battle_controller_dungeon_rune.lua | 25 ++++++++++++++++--- .../userdata/dungeon/dungeon_rune_entity.lua | 14 +++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/lua/app/module/battle/controller/battle_controller_dungeon_rune.lua b/lua/app/module/battle/controller/battle_controller_dungeon_rune.lua index c79db9c5..e551a9c3 100644 --- a/lua/app/module/battle/controller/battle_controller_dungeon_rune.lua +++ b/lua/app/module/battle/controller/battle_controller_dungeon_rune.lua @@ -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 diff --git a/lua/app/userdata/dungeon/dungeon_rune_entity.lua b/lua/app/userdata/dungeon/dungeon_rune_entity.lua index 8fd67a0a..c5780933 100644 --- a/lua/app/userdata/dungeon/dungeon_rune_entity.lua +++ b/lua/app/userdata/dungeon/dungeon_rune_entity.lua @@ -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")