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