From 293facc310973f5d6c651f62aacbaafcf0ae7616 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Tue, 18 Apr 2023 18:06:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BB=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/battle_const.lua | 1 - .../module/battle/controller/battle_controller.lua | 11 +++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lua/app/module/battle/battle_const.lua b/lua/app/module/battle/battle_const.lua index 30aa0dfa..e66e3dcc 100644 --- a/lua/app/module/battle/battle_const.lua +++ b/lua/app/module/battle/battle_const.lua @@ -4,7 +4,6 @@ BattleConst.ROW_COUNT = 7 BattleConst.COLUMN_COUNT = 7 BattleConst.HALF_ROW_COUNT = 4 -- 计算偏移 math.ceil(ROW_COUNT / 2) BattleConst.HALF_COLUMN_COUNT = 4 -- 计算偏移 math.ceil(COLUMN_COUNT / 2) -BattleConst.ELIMINATION_MIN_COUNT = 2 BattleConst.GRID_STEP_H = 94 BattleConst.ROW_STEP = 10 BattleConst.ONE_STEP_TIME = 0.2 diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 2552bb0f..1be735b0 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -52,6 +52,13 @@ function BattleController:getMaxWave() return 1 end +function BattleController:getMinEliminationCount() + if not self.minEliminationCount then + self.minEliminationCount = GFunc.getConstIntValue("element_combo") + end + return self.minEliminationCount +end + function BattleController:initDefUnits(callback) callback() end @@ -475,7 +482,7 @@ function BattleController:onTouchEvent(eventType, posId) self.battleUI:showBoardMask(nil) local sequence = self.battleData:getGridSequence() local count = #sequence - if count < BattleConst.ELIMINATION_MIN_COUNT then + if count < self:getMinEliminationCount() then if count <= 0 then self.battleData:clearGridSequence() self:onLinkChange() @@ -504,7 +511,7 @@ end function BattleController:onLinkOver() local sequence = self.battleData:getGridSequence() local count = #sequence - if count < BattleConst.ELIMINATION_MIN_COUNT then + if count < self:getMinEliminationCount() then return end