diff --git a/lua/app/module/battle/battle_const.lua b/lua/app/module/battle/battle_const.lua index 41dcf7c1..d4deea9b 100644 --- a/lua/app/module/battle/battle_const.lua +++ b/lua/app/module/battle/battle_const.lua @@ -301,9 +301,15 @@ BattleConst.AROUND_ELIMINATION_TO_TYPE_COUNT = { [BattleConst.GRID_TYPE.ICE] = BattleConst.GRID_TYPE.EMPTY, } +BattleConst.ELEMENT_TYPE_INVALID = { + [BattleConst.GRID_TYPE.SNOW_BOX] = true, + [BattleConst.GRID_TYPE.SOLID_SNOW] = true, +} + BattleConst.AROUND_BOOM_TYPE = { ACOUND = 1, LINE = 2, + SKILL = 3, } ---- 不可下落的格子类型 diff --git a/lua/app/module/battle/battle_manager.lua b/lua/app/module/battle/battle_manager.lua index 5b6e8c52..77bcf10d 100644 --- a/lua/app/module/battle/battle_manager.lua +++ b/lua/app/module/battle/battle_manager.lua @@ -166,7 +166,7 @@ function BattleManager:getAroundPosIds(posId, direction, range, cludePosIdsMap, local count = math.min(#cludePosIds, range) for i = 1, count do - table.insert(posIdList, {posId = cludePosIds[math.random(1, #cludePosIds)], direction = direction}) + table.insert(posIdList, {posId = table.remove(cludePosIds, math.random(1, #cludePosIds)), direction = direction}) end end elseif direction == BattleConst.BOARD_RANGE_TYPE.UP then diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index a4082ef4..27d048d0 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -834,7 +834,7 @@ function BattleController:onLinkOver() influenceElementType[elementType] = true end else - boomGridIds[posId] = BattleConst.AROUND_BOOM_TYPE.LINE + boomGridIds[posId] = BattleConst.AROUND_BOOM_TYPE.SKILL end end end @@ -844,6 +844,7 @@ function BattleController:onLinkOver() local entity = self.battleData:getGridEntity(posId) if entity then local gridType = entity:getGridType() + local elementTypeInvalid = entity:isElmentTypeInvalid() if entity:addAroundEliminationCount(boomType) then if BattleConst.GRID_TYPE_BREAK_SFX[gridType] then if not gridBreakSfxInfo then @@ -855,12 +856,11 @@ function BattleController:onLinkOver() table.insert(gridBreakSfxInfo[gridType], posId) end - local elementTypeInvalid = entity:isElmentTypeInvalid() if entity:getIsIdle() then - eliminationPosIds[posId] = true if not eliminationPosIds[posId] then + eliminationPosIds[posId] = true table.insert(sequence, {posId = posId, noAni = elementTypeInvalid}) - if not entity:getSkillId() and not elementTypeInvalid then + if not entity:getSkillId() and not elementTypeInvalid then local elementType = entity:getElementType() elementTypeMap[elementType] = (elementTypeMap[elementType] or 0) + 1 end diff --git a/lua/app/userdata/battle/battle_grid_entity.lua b/lua/app/userdata/battle/battle_grid_entity.lua index 8be0e549..1e8608c8 100644 --- a/lua/app/userdata/battle/battle_grid_entity.lua +++ b/lua/app/userdata/battle/battle_grid_entity.lua @@ -80,14 +80,14 @@ function BattleGridEntity:isEmptyType() end function BattleGridEntity:isElmentTypeInvalid() - return BattleConst.AROUND_ELIMINATION_TO_TYPE_COUNT[self.gridType] ~= nil + return BattleConst.ELEMENT_TYPE_INVALID[self.gridType] ~= nil end function BattleGridEntity:addAroundEliminationCount(boomType) local nextGridType = BattleConst.AROUND_ELIMINATION_TO_TYPE_COUNT[self.gridType] if nextGridType then local beforeGridtype = self:getGridType() - if beforeGridtype == BattleConst.GRID_TYPE.VINES and boomType ~= BattleConst.AROUND_BOOM_TYPE.LINE then + if beforeGridtype == BattleConst.GRID_TYPE.VINES and boomType <= BattleConst.AROUND_BOOM_TYPE.ACOUND then return false end