bug修复
This commit is contained in:
parent
a6489466e9
commit
eb73f1b943
@ -389,6 +389,17 @@ if NOT_PUBLISH then
|
|||||||
Logger.logHighlight("截图保存地址:%s", path)
|
Logger.logHighlight("截图保存地址:%s", path)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if Input.GetKeyDown(KeyCode.G) and Input.GetKey(KeyCode.LeftControl) then
|
||||||
|
if DataManager.BattleData.gridEntities then
|
||||||
|
local map = {}
|
||||||
|
for posId, entity in pairs(DataManager.BattleData.gridEntities) do
|
||||||
|
map[posId] = entity:getSnapshoptInfo()
|
||||||
|
end
|
||||||
|
Logger.logHighlight("——————————战斗棋盘快照如下————————")
|
||||||
|
Logger.printTable(map)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- if Input.GetKeyDown(KeyCode.P) then
|
-- if Input.GetKeyDown(KeyCode.P) then
|
||||||
-- ModuleManager.ChapterManager:showBattleFailUI(nil, true)
|
-- ModuleManager.ChapterManager:showBattleFailUI(nil, true)
|
||||||
-- end
|
-- end
|
||||||
|
|||||||
@ -292,10 +292,15 @@ BattleConst.GRID_TYPE_ICON = {
|
|||||||
|
|
||||||
---- 周围格子或自己消除一次后会变成什么格子
|
---- 周围格子或自己消除一次后会变成什么格子
|
||||||
BattleConst.AROUND_ELIMINATION_TO_TYPE_COUNT = {
|
BattleConst.AROUND_ELIMINATION_TO_TYPE_COUNT = {
|
||||||
[BattleConst.GRID_TYPE.SNOW_BOX] = {BattleConst.GRID_TYPE.EMPTY},
|
[BattleConst.GRID_TYPE.SNOW_BOX] = BattleConst.GRID_TYPE.EMPTY,
|
||||||
[BattleConst.GRID_TYPE.SOLID_SNOW] = {BattleConst.GRID_TYPE.SNOW_BOX},
|
[BattleConst.GRID_TYPE.SOLID_SNOW] = BattleConst.GRID_TYPE.SNOW_BOX,
|
||||||
[BattleConst.GRID_TYPE.VINES] = {BattleConst.GRID_TYPE.EMPTY},
|
[BattleConst.GRID_TYPE.VINES] = BattleConst.GRID_TYPE.EMPTY,
|
||||||
[BattleConst.GRID_TYPE.ICE] = {BattleConst.GRID_TYPE.EMPTY},
|
[BattleConst.GRID_TYPE.ICE] = BattleConst.GRID_TYPE.EMPTY,
|
||||||
|
}
|
||||||
|
|
||||||
|
BattleConst.AROUND_BOOM_TYPE = {
|
||||||
|
ACOUND = 1,
|
||||||
|
LINE = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
---- 不可下落的格子类型
|
---- 不可下落的格子类型
|
||||||
|
|||||||
@ -769,11 +769,13 @@ function BattleController:onLinkOver()
|
|||||||
linkElementType = elementType
|
linkElementType = elementType
|
||||||
lineCount = lineCount + 1
|
lineCount = lineCount + 1
|
||||||
end
|
end
|
||||||
boomGridIds[info.posId] = true
|
boomGridIds[info.posId] = BattleConst.AROUND_BOOM_TYPE.LINE
|
||||||
|
|
||||||
local outline = BattleConst.UP_DOWN_LEFT_RIGHT[info.posId]
|
local outline = BattleConst.UP_DOWN_LEFT_RIGHT[info.posId]
|
||||||
for _, aroundPosId in ipairs(outline) do
|
for _, aroundPosId in ipairs(outline) do
|
||||||
boomGridIds[aroundPosId] = true
|
if not boomGridIds[aroundPosId] then
|
||||||
|
boomGridIds[aroundPosId] = BattleConst.AROUND_BOOM_TYPE.ACOUND
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local entity = self.battleData:getGridEntity(info.posId)
|
local entity = self.battleData:getGridEntity(info.posId)
|
||||||
@ -803,35 +805,36 @@ function BattleController:onLinkOver()
|
|||||||
influenceElementType[elementType] = true
|
influenceElementType[elementType] = true
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
boomGridIds[posId] = true
|
boomGridIds[posId] = BattleConst.AROUND_BOOM_TYPE.LINE
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local gridBreakSfxInfo
|
local gridBreakSfxInfo
|
||||||
for posId, status in pairs(boomGridIds) do
|
for posId, boomType in pairs(boomGridIds) do
|
||||||
local entity = self.battleData:getGridEntity(posId)
|
local entity = self.battleData:getGridEntity(posId)
|
||||||
if entity then
|
if entity then
|
||||||
local gridType = entity:getGridType()
|
local gridType = entity:getGridType()
|
||||||
if BattleConst.GRID_TYPE_BREAK_SFX[gridType] then
|
if entity:addAroundEliminationCount(boomType) then
|
||||||
if not gridBreakSfxInfo then
|
if BattleConst.GRID_TYPE_BREAK_SFX[gridType] then
|
||||||
gridBreakSfxInfo = {}
|
if not gridBreakSfxInfo then
|
||||||
|
gridBreakSfxInfo = {}
|
||||||
|
end
|
||||||
|
if not gridBreakSfxInfo[gridType] then
|
||||||
|
gridBreakSfxInfo[gridType] = {}
|
||||||
|
end
|
||||||
|
table.insert(gridBreakSfxInfo[gridType], posId)
|
||||||
end
|
end
|
||||||
if not gridBreakSfxInfo[gridType] then
|
|
||||||
gridBreakSfxInfo[gridType] = {}
|
local elementTypeInvalid = entity:isElmentTypeInvalid()
|
||||||
end
|
if entity:getIsIdle() then
|
||||||
table.insert(gridBreakSfxInfo[gridType], posId)
|
eliminationPosIds[posId] = true
|
||||||
end
|
if not eliminationPosIds[posId] then
|
||||||
|
table.insert(sequence, {posId = posId, noAni = elementTypeInvalid})
|
||||||
local elementTypeInvalid = entity:isElmentTypeInvalid()
|
if not entity:getSkillId() and not elementTypeInvalid then
|
||||||
entity:addAroundEliminationCount()
|
local elementType = entity:getElementType()
|
||||||
if entity:getIsIdle() then
|
elementTypeMap[elementType] = (elementTypeMap[elementType] or 0) + 1
|
||||||
eliminationPosIds[posId] = true
|
end
|
||||||
if not eliminationPosIds[posId] then
|
|
||||||
table.insert(sequence, {posId = posId, noAni = elementTypeInvalid})
|
|
||||||
if not entity:getSkillId() and not elementTypeInvalid then
|
|
||||||
local elementType = entity:getElementType()
|
|
||||||
elementTypeMap[elementType] = (elementTypeMap[elementType] or 0) + 1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -69,8 +69,6 @@ function GridCell:refresh(gridEntity, curElement, skillPosId)
|
|||||||
self:hideAni()
|
self:hideAni()
|
||||||
end
|
end
|
||||||
self:showHighLight(self.lastShowHlElementType ~= nil, self.lastShowHlElementType)
|
self:showHighLight(self.lastShowHlElementType ~= nil, self.lastShowHlElementType)
|
||||||
--- 测试代码
|
|
||||||
-- uiMap["grid_cell.touch_node.ani_node.count"]:setText(gridEntity:getAroundEliminationCount())
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function GridCell:addTouchListener(func)
|
function GridCell:addTouchListener(func)
|
||||||
|
|||||||
@ -6,7 +6,6 @@ function BattleGridEntity:ctor(data)
|
|||||||
self.posId = data.posId or 0
|
self.posId = data.posId or 0
|
||||||
self.gridType = data.gridType or BattleConst.GRID_TYPE.EMPTY
|
self.gridType = data.gridType or BattleConst.GRID_TYPE.EMPTY
|
||||||
self.elementType = data.elementType or BattleConst.ELEMENT_TYPE.NONE
|
self.elementType = data.elementType or BattleConst.ELEMENT_TYPE.NONE
|
||||||
self.aroundEliminationCount = data.aroundEliminationCount or 0 -- 周围消除次数
|
|
||||||
self.skillId = data.skillId
|
self.skillId = data.skillId
|
||||||
self.linkSkillCount = data.linkSkillCount or 0 -- 任意链接技能激活次数
|
self.linkSkillCount = data.linkSkillCount or 0 -- 任意链接技能激活次数
|
||||||
self.isIdle = false
|
self.isIdle = false
|
||||||
@ -17,7 +16,6 @@ end
|
|||||||
function BattleGridEntity:clear()
|
function BattleGridEntity:clear()
|
||||||
self.gridType = BattleConst.GRID_TYPE.EMPTY
|
self.gridType = BattleConst.GRID_TYPE.EMPTY
|
||||||
self.elementType = BattleConst.ELEMENT_TYPE.RED
|
self.elementType = BattleConst.ELEMENT_TYPE.RED
|
||||||
self.aroundEliminationCount = 0 -- 周围消除次数
|
|
||||||
self.skillId = nil
|
self.skillId = nil
|
||||||
self.linkSkillCount = 0 -- 任意链接技能激活次数
|
self.linkSkillCount = 0 -- 任意链接技能激活次数
|
||||||
self.isIdle = false
|
self.isIdle = false
|
||||||
@ -29,7 +27,6 @@ function BattleGridEntity:getSnapshoptInfo()
|
|||||||
posId = self.posId,
|
posId = self.posId,
|
||||||
gridType = self.gridType,
|
gridType = self.gridType,
|
||||||
elementType = self.elementType,
|
elementType = self.elementType,
|
||||||
aroundEliminationCount = self.aroundEliminationCount,
|
|
||||||
isIdle = self.isIdle,
|
isIdle = self.isIdle,
|
||||||
skillId = self.skillId,
|
skillId = self.skillId,
|
||||||
linkSkillCount = self.linkSkillCount,
|
linkSkillCount = self.linkSkillCount,
|
||||||
@ -40,7 +37,6 @@ function BattleGridEntity:setInfoBySnapshop(snapshot)
|
|||||||
self.posId = snapshot.posId or 0
|
self.posId = snapshot.posId or 0
|
||||||
self.gridType = snapshot.gridType or BattleConst.GRID_TYPE.EMPTY
|
self.gridType = snapshot.gridType or BattleConst.GRID_TYPE.EMPTY
|
||||||
self.elementType = snapshot.elementType or BattleConst.ELEMENT_TYPE.RED
|
self.elementType = snapshot.elementType or BattleConst.ELEMENT_TYPE.RED
|
||||||
self.aroundEliminationCount = snapshot.aroundEliminationCount or 0 -- 周围消除次数
|
|
||||||
self.isIdle = snapshot.isIdle
|
self.isIdle = snapshot.isIdle
|
||||||
self.skillId = snapshot.skillId
|
self.skillId = snapshot.skillId
|
||||||
self.linkSkillCount = snapshot.linkSkillCount
|
self.linkSkillCount = snapshot.linkSkillCount
|
||||||
@ -87,23 +83,21 @@ function BattleGridEntity:isElmentTypeInvalid()
|
|||||||
return BattleConst.AROUND_ELIMINATION_TO_TYPE_COUNT[self.gridType] ~= nil
|
return BattleConst.AROUND_ELIMINATION_TO_TYPE_COUNT[self.gridType] ~= nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleGridEntity:getAroundEliminationCount()
|
function BattleGridEntity:addAroundEliminationCount(boomType)
|
||||||
return self.aroundEliminationCount
|
local nextGridType = BattleConst.AROUND_ELIMINATION_TO_TYPE_COUNT[self.gridType]
|
||||||
end
|
if nextGridType then
|
||||||
|
|
||||||
function BattleGridEntity:addAroundEliminationCount(count)
|
|
||||||
count = count or 1
|
|
||||||
self.aroundEliminationCount = self.aroundEliminationCount + count
|
|
||||||
local gridTypeList = BattleConst.AROUND_ELIMINATION_TO_TYPE_COUNT[self.gridType]
|
|
||||||
if gridTypeList and gridTypeList[self.aroundEliminationCount] then
|
|
||||||
local gridType = gridTypeList[self.aroundEliminationCount]
|
|
||||||
local beforeGridtype = self:getGridType()
|
local beforeGridtype = self:getGridType()
|
||||||
self:setGridType(gridType)
|
if beforeGridtype == BattleConst.GRID_TYPE.VINES and boomType ~= BattleConst.AROUND_BOOM_TYPE.LINE then
|
||||||
if gridType == BattleConst.GRID_TYPE.EMPTY and beforeGridtype ~= BattleConst.GRID_TYPE.ICE then
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
self:setGridType(nextGridType)
|
||||||
|
if nextGridType == BattleConst.GRID_TYPE.EMPTY and beforeGridtype ~= BattleConst.GRID_TYPE.ICE then
|
||||||
self:setIsIdle(true)
|
self:setIsIdle(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self:setDirty()
|
self:setDirty()
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleGridEntity:getPos()
|
function BattleGridEntity:getPos()
|
||||||
@ -124,9 +118,6 @@ end
|
|||||||
|
|
||||||
function BattleGridEntity:setIsIdle(isIdle)
|
function BattleGridEntity:setIsIdle(isIdle)
|
||||||
self.isIdle = isIdle == true
|
self.isIdle = isIdle == true
|
||||||
if self.isIdle then
|
|
||||||
self.aroundEliminationCount = 0
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleGridEntity:canLink()
|
function BattleGridEntity:canLink()
|
||||||
@ -154,7 +145,6 @@ end
|
|||||||
|
|
||||||
function BattleGridEntity:setGridType(gridType)
|
function BattleGridEntity:setGridType(gridType)
|
||||||
self.gridType = gridType
|
self.gridType = gridType
|
||||||
self.aroundEliminationCount = 0
|
|
||||||
self:setDirty()
|
self:setDirty()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user