diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua index c6af1843..1663c42f 100644 --- a/lua/app/module/battle/controller/battle_base_controller.lua +++ b/lua/app/module/battle/controller/battle_base_controller.lua @@ -1436,7 +1436,7 @@ function BattleBaseController:onFillBoardOver(isRoundBeginCheck) end) else self:generateSkill(function() - self.battleUI:refreshSkill() + self.battleUI:refreshSkill(nil, nil, self:getCurActionSide()) if self.onFillBoardOverCallback then local callback = self.onFillBoardOverCallback self.onFillBoardOverCallback = nil @@ -2059,7 +2059,7 @@ function BattleBaseController:onSelectSkill(skillId, value, pos, side) self.battleUI:gotOneSkillAni(skillId, elementType, function() self:selectSKillNextToStep() self.battleUI:refreshBoard() - self.battleUI:refreshSkill() + self.battleUI:refreshSkill(nil, nil, self:getCurActionSide()) end, pos) return end diff --git a/lua/app/module/battle/skill/battle_board_skill_handle.lua b/lua/app/module/battle/skill/battle_board_skill_handle.lua index 58b12d80..e35908db 100644 --- a/lua/app/module/battle/skill/battle_board_skill_handle.lua +++ b/lua/app/module/battle/skill/battle_board_skill_handle.lua @@ -435,9 +435,10 @@ local function _takeAddSkillEnergy(atkUnitComp, skillEntity, battleController) elementType = boardSkills[math.random(1, count)] end + local side = battleController:getCurActionSide() elementTypeMap = {[elementType] = addEnergy} - battleController:addSkillEnergy(elementTypeMap) - battleController.battleUI:refreshSkill() + battleController:addSkillEnergy(elementTypeMap, side) + battleController.battleUI:refreshSkill(nil, nil, side) end local function _takeChangeElementType(atkUnitComp, skillEntity, battleController) diff --git a/lua/app/ui/battle/battle_base_ui.lua b/lua/app/ui/battle/battle_base_ui.lua index 04c107b4..2f1e9f7b 100644 --- a/lua/app/ui/battle/battle_base_ui.lua +++ b/lua/app/ui/battle/battle_base_ui.lua @@ -1519,7 +1519,7 @@ function BattleBaseUI:generateSkillAni(map, callback, side) local entity = self.generateSkillGridEntities[elementType] if entity and entity:getCell() then count = count + 1 - entity:setSkilId(info.skillId) + entity:setSkilId(info.skillId, false, side) local cell = entity:getCell() cell:refresh(entity) self.generateSkillAniSeq:AppendCallback(function() @@ -1853,7 +1853,7 @@ function BattleBaseUI:doCacheAni(skillInfo, callback) for index, info in ipairs(skillInfo) do local entity = self.root.skillAniGridEntities[index] if entity then - entity:setSkilId(info.skillId) + entity:setSkilId(info.skillId, false, self.battleController:getCurActionSide()) local pos = self:getPosInfo(info.posId) local cell = entity:getCell() if cell then @@ -1928,7 +1928,7 @@ function BattleBaseUI:doCachePopAni(skillInfo, callback) for index, info in ipairs(skillInfo) do local entity = self.root.skillAniGridEntities[index] if entity then - entity:setSkilId(info.skillId) + entity:setSkilId(info.skillId, false, self.battleController:getCurActionSide()) local cell = entity:getCell() if cell then cell:refresh(entity) diff --git a/lua/app/ui/battle/cell/grid_cell.lua b/lua/app/ui/battle/cell/grid_cell.lua index 5b563cde..83667d75 100644 --- a/lua/app/ui/battle/cell/grid_cell.lua +++ b/lua/app/ui/battle/cell/grid_cell.lua @@ -91,17 +91,19 @@ function GridCell:refresh(gridEntity, curElement, skillPosId) end end - local ignoreElementType = skillEntity:getIgnoreElementType() - local skillBg - if ignoreElementType and not self.lastShowHlElementType then - skillBg = GConst.BattleConst.SKILL_ELEMENT_BG_2.skill - else - local mainElementType = self.lastShowHlElementType or skillEntity:getPosition() - skillBg = GConst.BattleConst.SKILL_ELEMENT_BG_2[mainElementType] - end - if self.lastSkillBg ~= skillBg then - self.lastSkillBg = skillBg - downBg:setSprite(GConst.ATLAS_PATH.BATTLE, self.lastSkillBg) + if skillEntity then + local ignoreElementType = skillEntity:getIgnoreElementType() + local skillBg + if ignoreElementType and not self.lastShowHlElementType then + skillBg = GConst.BattleConst.SKILL_ELEMENT_BG_2.skill + else + local mainElementType = self.lastShowHlElementType or skillEntity:getPosition() + skillBg = GConst.BattleConst.SKILL_ELEMENT_BG_2[mainElementType] + end + if self.lastSkillBg ~= skillBg then + self.lastSkillBg = skillBg + downBg:setSprite(GConst.ATLAS_PATH.BATTLE, self.lastSkillBg) + end end else skillIcon:setVisible(false)