This commit is contained in:
puxuan 2025-10-22 10:13:37 +08:00
parent 8263a37038
commit 71bb3ff422
2 changed files with 28 additions and 9 deletions

View File

@ -3269,9 +3269,6 @@ function BattleBaseController:adRevive(revive)
self:onBattleEnd(not revive)
else
self.atkTeam:revive()
-- local unitEntity = self.defTeam:getMainUnit().unitEntity
-- self:refreshBossSkill(unitEntity)
-- self:enterNextTeamAction()
self:enterRoundEnd()
end
end

View File

@ -63,6 +63,7 @@ function BattleBoardTouchHelper:onLinkStart(entity, posId, isVirtual)
self.battleData:insertGridSequence(posId, self.battleController:snapshotBoard(), isVirtual)
local skillEntity = self.battleController:getSkillEntityBySkillId(entity:getSkillId())
local maskElementType = entity:getElementType(skillEntity, true)
self.battleController.currLinkElementType = maskElementType
self.battleUI:showBoardMask(maskElementType, skillEntity and entity:getPosId())
self.battleController:findSkillInfluenceGrids()
self.battleController:onLinkChange()
@ -118,18 +119,19 @@ function BattleBoardTouchHelper:onLinkEnter(entity, posId, isVirtual)
local lastElementType = lastEntity:getElementType(lastSkillEntity, true)
local hadSkillId, skillPosId = self.battleData:getSequenceHadSkill()
-- 已经有技能
if skillEntity and hadSkillId then
return
end
if not elementType or not lastElementType then
if not elementType or not self.battleController.currLinkElementType then
else
if lastElementType ~= elementType then
if self.battleController.currLinkElementType ~= elementType then
return
end
end
local maskElementType = elementType or lastElementType
local maskElementType = elementType or self.battleController.currLinkElementType
if not skillPosId then
if skillId then
skillPosId = posId
@ -145,12 +147,15 @@ function BattleBoardTouchHelper:onLinkEnter(entity, posId, isVirtual)
skillPosId = posId
end
local newElementType = elementType or lastElementType
local newElementType = elementType or self.battleController.currLinkElementType
if newElementType then
entity:setElementType(newElementType)
lastEntity:setElementType(newElementType)
end
self.battleUI:showBoardMask(maskElementType, skillPosId)
if not self.battleController.currLinkElementType then
self.battleController.currLinkElementType = newElementType
end
entity:addLinkSkillCount()
@ -244,10 +249,27 @@ function BattleBoardTouchHelper:clearSequenceByPosId(posId)
end
local gridEntity = self.battleData:getGridEntity(posId)
local skillEntity = self.battleController:getSkillEntityBySkillId(gridEntity:getSkillId())
local maskElementType = gridEntity:getElementType(skillEntity, true)
-- local maskElementType = gridEntity:getElementType(skillEntity, true)
-- 计算当前颜色
local sequence = self.battleData:getGridSequence()
local currElementType
if #sequence > 1 then
for i = #sequence - 1, 1, -1 do
local entityTmp = self.battleData:getGridEntity(sequence[i].posId)
local skillId = entityTmp:getSkillId()
if not skillId then
local maskElementType = entityTmp:getElementType(nil, true)
if maskElementType then
currElementType = maskElementType
break
end
end
end
end
local _, skillPosId = self.battleData:getSequenceHadSkill()
self.battleUI:showBoardMask(maskElementType, skillPosId)
self.battleController.currLinkElementType = currElementType
self.battleUI:showBoardMask(self.battleController.currLinkElementType, skillPosId)
self.battleController:findSkillInfluenceGrids()
self.battleController:onLinkChange()