Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev

This commit is contained in:
chenxi 2023-04-25 10:19:18 +08:00
commit 5bdf637e03
3 changed files with 35 additions and 6 deletions

View File

@ -594,6 +594,8 @@ BattleConst.SKILL_TYPE = {
NORMAL = 0,
ELIMINATION = 1,
CHANGE_AROUND = 2,
-- 3 暂不处理
ELIMINATION_GRID_AND_ELEMENT = 4,
}
BattleConst.SKILL_METHOD_TYPE = {

View File

@ -10,7 +10,7 @@ local function _takeElimination(posId, skillEntity, gridEntities, sequenceEntiti
if boardrange then
local cludePosIdsMap = {}
for posId, entity in pairs(gridEntities) do
if entity:canInfluenceBySkill() then
if entity:isEmptyIdle() then
cludePosIdsMap[posId] = true
end
end
@ -46,9 +46,32 @@ local function _takeChangeAround(posId, skillEntity, gridEntities, sequenceEntit
end
end
local function _takeEliminationGridAndElement(posId, skillEntity, gridEntities, sequenceEntities)
local boardrange = skillEntity:getBoardRange()
if boardrange then
local cludePosIdsMap = {}
for posId, entity in pairs(gridEntities) do
if entity:isNotObstacleIdle() then
cludePosIdsMap[posId] = true
end
end
-- for _, entity in ipairs(sequenceEntities) do
-- cludePosIdsMap[entity:getPosId()] = nil
-- end
local posIdInfos = ModuleManager.BattleManager:getAroundPosIdsByList(posId, boardrange, cludePosIdsMap)
cludePosIdsMap = {}
for _, info in ipairs(posIdInfos) do
cludePosIdsMap[info.posId] = info
end
DataManager.BattleData:cacheSkillInfluenceGrids(cludePosIdsMap)
end
end
BattleBoardSkillHandle._activeBoardSkill = {
[SKILL_TYPE.ELIMINATION] = _takeElimination,
[SKILL_TYPE.CHANGE_AROUND] = _takeChangeAround,
[SKILL_TYPE.ELIMINATION_GRID_AND_ELEMENT] = _takeEliminationGridAndElement,
}
function BattleBoardSkillHandle.activeBoardSkill(posId, skillEntity, gridEntities, sequenceEntities)

View File

@ -173,15 +173,15 @@ function BattleGridEntity:canChangeInfo()
return false
end
function BattleGridEntity:canInfluenceBySkill()
if self:isEmptyType() and not self:getIsIdle() then
function BattleGridEntity:isEmptyIdle()
if self:isEmptyType() and not self:getSkillId() and not self:getIsIdle() then
return true
end
return false
end
function BattleGridEntity:isEmptyIdle()
if self:isEmptyType() and not self:getSkillId() then
function BattleGridEntity:isNotObstacleIdle()
if not self:isObstacleType() and not self:getSkillId() and not self:getIsIdle() then
return true
end
return false
@ -196,7 +196,11 @@ function BattleGridEntity:getNeedChangePos()
return false
end
local cfg = ModuleManager.BattleManager.SKILL_CFG[self:getSkillId()]
local skillEntity = DataManager.BattleData:getSkillEntityBySkillId(self:getSkillId())
if not skillEntity then
return false
end
local cfg = ModuleManager.BattleManager.SKILL_CFG[skillEntity:getSkillId()]
if cfg and cfg.method == BattleConst.SKILL_METHOD_TYPE.ON_FINAL then
return true
end