最大等级

This commit is contained in:
xiekaidong 2023-09-04 16:43:07 +08:00
parent b5204ce133
commit 4d79d3ea6c
2 changed files with 21 additions and 9 deletions

View File

@ -1,6 +1,7 @@
local BattleController = require "app/module/battle/controller/battle_controller" local BattleController = require "app/module/battle/controller/battle_controller"
local BattleControllerBossRush = class("BattleControllerBossRush", BattleController) local BattleControllerBossRush = class("BattleControllerBossRush", BattleController)
local SIDE_ATK = GConst.BattleConst.SIDE_ATK local SIDE_ATK = GConst.BattleConst.SIDE_ATK
local MAX_LV = 61
function BattleControllerBossRush:getBoardConfig() function BattleControllerBossRush:getBoardConfig()
return ConfigManager:getConfig("chapter_board_bossrush") return ConfigManager:getConfig("chapter_board_bossrush")
@ -84,6 +85,7 @@ end
function BattleControllerBossRush:initOther() function BattleControllerBossRush:initOther()
self.monsterAtkAddition = GFunc.getConstIntValue("activity_boss_rush_hp_add") self.monsterAtkAddition = GFunc.getConstIntValue("activity_boss_rush_hp_add")
self.monsterHpAddition = GFunc.getConstIntValue("activity_boss_rush_atk_add") self.monsterHpAddition = GFunc.getConstIntValue("activity_boss_rush_atk_add")
self:setMaxBattleLv(MAX_LV)
end end
-- 怪物攻击力加成 -- 怪物攻击力加成
@ -108,15 +110,6 @@ function BattleControllerBossRush:getMonsterHpAddition()
end end
end end
function BattleControllerBossRush:enterNextWave(...)
local waveIndex = self:getWaveIndex()
if waveIndex >= 1 and waveIndex <= 60 then
self.battleData:addBattleLvCount(1)
self.battleUI:refreshLv()
end
BattleController.enterNextWave(self, ...)
end
function BattleControllerBossRush:getNextMonsterId(waveIndex) function BattleControllerBossRush:getNextMonsterId(waveIndex)
self:getInitBoard() self:getInitBoard()
waveIndex = waveIndex or self:getWaveIndex() + 1 waveIndex = waveIndex or self:getWaveIndex() + 1
@ -129,6 +122,14 @@ function BattleControllerBossRush:showBossEnterAni(bornTime, bossName, monsterCo
end end
end end
function BattleControllerBossRush:addBattleExp(...)
if self.battleData:getBattleLv() >= MAX_LV then -- 只能升级60次
return
end
BattleController.addBattleExp(self, ...)
end
function BattleControllerBossRush:controllBattleEnd() function BattleControllerBossRush:controllBattleEnd()
self.combatReport = { self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.ACT_BOSS_RUSH, battleType = GConst.BattleConst.BATTLE_TYPE.ACT_BOSS_RUSH,

View File

@ -48,6 +48,7 @@ function BattleBaseData:init(params, snapInfo)
self:initRogueSkills(SIDE_DEF, params.defFormation) self:initRogueSkills(SIDE_DEF, params.defFormation)
self.atkFormation = params.atkFormation or {} self.atkFormation = params.atkFormation or {}
self.defFormation = params.defFormation or {} self.defFormation = params.defFormation or {}
self:setMaxBattleLv(nil)
if snapInfo then if snapInfo then
if snapInfo.cacheSkillList then if snapInfo.cacheSkillList then
@ -670,9 +671,19 @@ function BattleBaseData:getLvNeedExp(lv)
return cfg[lv].exp return cfg[lv].exp
end end
function BattleBaseData:setMaxBattleLv(maxLv)
self.maxBattleLv = maxLv
end
function BattleBaseData:addExp(exp) function BattleBaseData:addExp(exp)
self.curBattleExp = self.curBattleExp + exp self.curBattleExp = self.curBattleExp + exp
while self.curBattleExp >= self.needBattleExp do while self.curBattleExp >= self.needBattleExp do
if self.maxBattleLv then -- 超过最大等级后跳出
if self.maxBattleLv <= self.battleLv then
break
end
end
self.curBattleExp = self.curBattleExp - self.needBattleExp self.curBattleExp = self.curBattleExp - self.needBattleExp
self.addLvCount = self.addLvCount + 1 self.addLvCount = self.addLvCount + 1
self.battleLv = self.battleLv + 1 self.battleLv = self.battleLv + 1