优化一版战斗结构
This commit is contained in:
parent
5be91b491c
commit
1c46acc425
@ -46,14 +46,6 @@ function BattleController:getInitBoard()
|
|||||||
table.insert(self.fixedRandomGrid, GFunc.getTable(cfg.control_element))
|
table.insert(self.fixedRandomGrid, GFunc.getTable(cfg.control_element))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if config.mystery_box and config.mystery_box_reward then
|
|
||||||
for i, index in ipairs(config.mystery_box) do
|
|
||||||
if not DataManager.ChapterData:getChapterMysteryBoxIsGot(self.chapterId, i) then
|
|
||||||
self.mysteryBoxIndexMap[index] = config.mystery_box_reward[i]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return self.boradList, self.fixedRandomGrid, self.mysteryBoxIndexMap
|
return self.boradList, self.fixedRandomGrid, self.mysteryBoxIndexMap
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
local BattleHelper = require "app/module/battle/helper/battle_helper"
|
|
||||||
|
|
||||||
local BattleController = require "app/module/battle/controller/battle_controller"
|
local BattleController = require "app/module/battle/controller/battle_controller"
|
||||||
local BattleControllerStage = class("BattleControllerStage", BattleController)
|
local BattleControllerStage = class("BattleControllerStage", BattleController)
|
||||||
|
|
||||||
@ -15,6 +13,34 @@ function BattleControllerStage:getChapterId()
|
|||||||
return DataManager.ChapterData:getChapterId()
|
return DataManager.ChapterData:getChapterId()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleControllerStage:getInitBoard()
|
||||||
|
if not self.boradList then
|
||||||
|
self.boradList = {}
|
||||||
|
self.fixedRandomGrid = {}
|
||||||
|
self.mysteryBoxIndexMap = {}
|
||||||
|
|
||||||
|
local config = self:getChapterConfig()[self.chapterId]
|
||||||
|
local boardCfg = self:getBoardConfig()
|
||||||
|
for _, boardId in ipairs(config.board) do
|
||||||
|
local cfg = boardCfg[boardId]
|
||||||
|
if cfg then
|
||||||
|
table.insert(self.boradList, {board = GFunc.getTable(cfg.board), mysteryBoard = GFunc.getTable(cfg.mystery_box_board)})
|
||||||
|
table.insert(self.fixedRandomGrid, GFunc.getTable(cfg.control_element))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if config.mystery_box and config.mystery_box_reward then
|
||||||
|
for i, index in ipairs(config.mystery_box) do
|
||||||
|
if not DataManager.ChapterData:getChapterMysteryBoxIsGot(self.chapterId, i) then
|
||||||
|
self.mysteryBoxIndexMap[index] = config.mystery_box_reward[i]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return self.boradList, self.fixedRandomGrid, self.mysteryBoxIndexMap
|
||||||
|
end
|
||||||
|
|
||||||
function BattleControllerStage:getFixedRogueSkill()
|
function BattleControllerStage:getFixedRogueSkill()
|
||||||
if not self.fixedRogueSkill then
|
if not self.fixedRogueSkill then
|
||||||
local config = ConfigManager:getConfig("chapter")[self.chapterId]
|
local config = ConfigManager:getConfig("chapter")[self.chapterId]
|
||||||
|
|||||||
@ -58,7 +58,6 @@ function DungeonDifficultyUI:onLoadRootComplete()
|
|||||||
end)
|
end)
|
||||||
self.btnStart:addClickListener(function()
|
self.btnStart:addClickListener(function()
|
||||||
-- 开始挑战
|
-- 开始挑战
|
||||||
ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD)
|
|
||||||
end)
|
end)
|
||||||
self.btnSweep:addClickListener(function()
|
self.btnSweep:addClickListener(function()
|
||||||
-- 开始扫荡
|
-- 开始扫荡
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user