This commit is contained in:
xiekaidong 2023-04-18 18:06:05 +08:00
parent ac5183c0fe
commit 293facc310
2 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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