boss_rush战斗
This commit is contained in:
parent
049d7508ea
commit
b6b342c435
@ -153,9 +153,19 @@ function BattleBaseController:getMinEliminationCount()
|
||||
return self.minEliminationCount
|
||||
end
|
||||
|
||||
function BattleBaseController:generateNextMonster()
|
||||
function BattleBaseController:getNextMonsterId(waveIndex)
|
||||
waveIndex = waveIndex or self.waveIndex + 1
|
||||
local config = self:getChapterConfig()[self.chapterId]
|
||||
local monsterId = config.monster[self.waveIndex + 1]
|
||||
local monsterId = config.monster[waveIndex]
|
||||
return monsterId
|
||||
end
|
||||
|
||||
function BattleBaseController:showBossEnterAni(bornTime, bossName, monsterComp, callback)
|
||||
self.battleUI:showBossEnterAni(bornTime, bossName, monsterComp, callback)
|
||||
end
|
||||
|
||||
function BattleBaseController:generateNextMonster()
|
||||
local monsterId = self:getNextMonsterId()
|
||||
if monsterId == nil then
|
||||
return self:enterNextWave()
|
||||
end
|
||||
@ -185,7 +195,7 @@ function BattleBaseController:generateNextMonster()
|
||||
isBoss = self.defTeam:getIsBoss()
|
||||
if isBoss then
|
||||
local monsterInfo = ConfigManager:getConfig("monster")[monsterId]
|
||||
self.battleUI:showBossEnterAni(bornTime, ModuleManager.HeroManager:getMonsterName(monsterInfo.monster_base), monsterComp, function()
|
||||
self:showBossEnterAni(bornTime, ModuleManager.HeroManager:getMonsterName(monsterInfo.monster_base), monsterComp, function()
|
||||
monsterComp:playEnterBattlefield(true, onFinish)
|
||||
end)
|
||||
else
|
||||
@ -204,7 +214,7 @@ function BattleBaseController:generateNextMonster()
|
||||
isBoss = self.defTeam:getIsBoss()
|
||||
if isBoss then
|
||||
local monsterInfo = ConfigManager:getConfig("monster")[monsterId]
|
||||
self.battleUI:showBossEnterAni(bornTime, ModuleManager.HeroManager:getMonsterName(monsterInfo.monster_base), monsterComp, function()
|
||||
self:showBossEnterAni(bornTime, ModuleManager.HeroManager:getMonsterName(monsterInfo.monster_base), monsterComp, function()
|
||||
monsterComp:playEnterBattlefield(false, onFinish)
|
||||
end)
|
||||
else
|
||||
@ -700,7 +710,8 @@ function BattleBaseController:initDefUnits(callback)
|
||||
if self.waveIndex <= 0 then
|
||||
initIndex = 1
|
||||
end
|
||||
local unitEntity = self.battleData:addMonster(config.monster[initIndex], nil, self)
|
||||
local monsterId = self:getNextMonsterId(initIndex)
|
||||
local unitEntity = self.battleData:addMonster(monsterId, nil, self)
|
||||
local modelId = unitEntity:getModelId()
|
||||
BattleHelper:loadBattleHeroModel(modelId, self.battleUI:getBattleNode(), function(spineObject)
|
||||
local monsterComp = spineObject:addLuaComponent(BattleConst.TYPEOF_LUA_COMP.BATTLE_MONSTER_COMPONENT)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
local BattleController = require "app/module/battle/controller/battle_controller"
|
||||
local BattleControllerBossRush = class("BattleControllerBossRush", BattleController)
|
||||
local BattleBuffEntity = require "app/userdata/battle/skill/battle_buff_entity"
|
||||
local SIDE_ATK = GConst.BattleConst.SIDE_ATK
|
||||
|
||||
function BattleControllerBossRush:getBoardConfig()
|
||||
return ConfigManager:getConfig("chapter_board_bossrush")
|
||||
@ -20,7 +21,7 @@ function BattleControllerBossRush:getChessBoardBgName()
|
||||
end
|
||||
|
||||
function BattleControllerBossRush:getScene()
|
||||
return "bg_1"
|
||||
return "boss_rush"
|
||||
end
|
||||
|
||||
function BattleControllerBossRush:getChapterId()
|
||||
@ -28,7 +29,8 @@ function BattleControllerBossRush:getChapterId()
|
||||
end
|
||||
|
||||
function BattleControllerBossRush:getMaxWave()
|
||||
return ConfigManager:getConfigNum("activity_boss_rush_chapter") * 5 -- 每次5波,一共770
|
||||
self:getInitBoard()
|
||||
return #self.monsterList
|
||||
end
|
||||
|
||||
function BattleControllerBossRush:getInitBoard()
|
||||
@ -36,19 +38,96 @@ function BattleControllerBossRush:getInitBoard()
|
||||
self.boradList = {}
|
||||
self.fixedRandomGrid = {}
|
||||
self.mysteryBoxIndexMap = {}
|
||||
self.monsterList = {}
|
||||
|
||||
local boardCfg = self:getBoardConfig()
|
||||
for id, info in ipairs(self:getChapterConfig()) do
|
||||
for _, id in ipairs(DataManager.ActBossRushData:getStageList()) do
|
||||
local info = self:getChapterConfig()[id]
|
||||
if info then
|
||||
for index, montserId in ipairs(info.monster) do
|
||||
table.insert(self.monsterList, montserId)
|
||||
end
|
||||
local cfg = boardCfg[info.board_id]
|
||||
if cfg then
|
||||
table.insert(self.boradList, {board = GFunc.getTable(cfg.board), gridEdge = GFunc.getTable(cfg.grid_edge)})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return self.boradList, self.fixedRandomGrid, self.mysteryBoxIndexMap
|
||||
end
|
||||
|
||||
function BattleControllerBossRush:onLoadComplete(...)
|
||||
-- 处理技能
|
||||
local unlockAllSkill = function(side)
|
||||
local skillPool = self.battleData:getSkillPool(side)
|
||||
if skillPool then
|
||||
for elementType, list in pairs(skillPool) do -- 先遍历一下未解锁的技能
|
||||
if not self.battleData:isUnlockedSkillElementType(elementType, side) then
|
||||
local skillEntity = self.battleData:getSkillEntityByElement(elementType, side)
|
||||
if skillEntity then
|
||||
local skillId = skillEntity:getUnlockId()
|
||||
if skillId then
|
||||
self:dealSelectSkill(skillId, nil, side)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
self.battleUI:refreshSkill(nil, nil, side)
|
||||
end
|
||||
end
|
||||
unlockAllSkill(SIDE_ATK)
|
||||
|
||||
BattleController.onLoadComplete(self, ...)
|
||||
end
|
||||
|
||||
function BattleControllerBossRush:initOther()
|
||||
self.monsterAtkAddition = GFunc.getConstIntValue("activity_boss_rush_hp_add")
|
||||
self.monsterHpAddition = GFunc.getConstIntValue("activity_boss_rush_atk_add")
|
||||
end
|
||||
|
||||
-- 怪物攻击力加成
|
||||
function BattleControllerBossRush:getMonsterAtkAddition()
|
||||
if not self.lastAtkWaveIndex ~= self.waveIndex then
|
||||
self.lastAtkWaveIndex = self.waveIndex
|
||||
return self.monsterAtkAddition * (self.waveIndex + 1)
|
||||
else
|
||||
return self.monsterAtkAddition * self.lastAtkWaveIndex
|
||||
end
|
||||
end
|
||||
|
||||
-- 怪物血量加成
|
||||
function BattleControllerBossRush:getMonsterHpAddition()
|
||||
if not self.lastHpWaveIndex ~= self.waveIndex then
|
||||
self.lastHpWaveIndex = self.waveIndex
|
||||
return self.monsterHpAddition * (self.waveIndex + 1)
|
||||
else
|
||||
return self.monsterHpAddition * self.lastHpWaveIndex
|
||||
end
|
||||
end
|
||||
|
||||
function BattleControllerBossRush:enterNextWave(...)
|
||||
if self.waveIndex >= 1 and self.waveIndex <= 60 then
|
||||
self.battleData:addBattleLvCount(1)
|
||||
end
|
||||
BattleController.enterNextWave(self, ...)
|
||||
end
|
||||
|
||||
function BattleControllerBossRush:getNextMonsterId(waveIndex)
|
||||
self:getInitBoard()
|
||||
waveIndex = waveIndex or self.waveIndex + 1
|
||||
local config = self:getChapterConfig()[self.chapterId]
|
||||
local monsterId = config.monster[waveIndex]
|
||||
return self.monsterList[monsterId]
|
||||
end
|
||||
|
||||
function BattleControllerBossRush:showBossEnterAni(bornTime, bossName, monsterComp, callback)
|
||||
if callback then
|
||||
callback()
|
||||
end
|
||||
end
|
||||
|
||||
function BattleControllerBossRush:controllBattleEnd()
|
||||
-- self.combatReport = {
|
||||
-- battleType = GConst.BattleConst.BATTLE_TYPE.ACT_BOSS_RUSH,
|
||||
|
||||
@ -140,6 +140,11 @@ function ActBossRushData:getIsFirstDay()
|
||||
end
|
||||
|
||||
---- 战斗
|
||||
function ActBossRushData:getStageList()
|
||||
return self.stageList
|
||||
end
|
||||
|
||||
|
||||
function ActBossRushData:getTodayMaxWave()
|
||||
return self.todayMaxWave or 0
|
||||
end
|
||||
|
||||
@ -690,6 +690,11 @@ function BattleBaseData:useAddlvCount()
|
||||
return true
|
||||
end
|
||||
|
||||
function BattleBaseData:addBattleLvCount(count)
|
||||
self.addLvCount = self.addLvCount + count
|
||||
self.battleLv = self.battleLv + count
|
||||
end
|
||||
|
||||
function BattleBaseData:addCommonSelectSkillCount(count)
|
||||
self.commonSelectSkillCount = self.commonSelectSkillCount + (count or 1)
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user