diff --git a/lua/app/module/battle/battle_const.lua b/lua/app/module/battle/battle_const.lua index 3214e7f1..4673900a 100644 --- a/lua/app/module/battle/battle_const.lua +++ b/lua/app/module/battle/battle_const.lua @@ -1012,7 +1012,7 @@ BattleConst.OUTLINE_SFX = { BattleConst.SKILL_LIGHT_POINT_SFX = "assets/prefabs/effects/battle/sfx_skill_b05.prefab" BattleConst.SKILL_LIGHT_LINE_SFX = "assets/prefabs/effects/battle/sfx_skill_b04.prefab" BattleConst.LINE_SFX = "assets/prefabs/effects/battle/sfx_c1_ui_line_b0%s.prefab" -BattleConst.CHANGE_ELEMENT_SFX = "assets/prefabs/effects/battle/sfx_skill_b02.prefab" +BattleConst.CHANGE_ELEMENT_SFX = "assets/prefabs/effects/battle/sfx_c1_ui_qizi_color_b0%s.prefab" BattleConst.LINK_SMOKE = "assets/prefabs/effects/battle/sfx_piece_smoke_b0%s.prefab" BattleConst.GRID_KILL_SFX = { [BattleConst.ELEMENT_TYPE.RED] = "assets/prefabs/effects/battle/sfx_piece_qizi_posui_b04.prefab", diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua index c4e3e59e..e907f187 100644 --- a/lua/app/module/battle/controller/battle_base_controller.lua +++ b/lua/app/module/battle/controller/battle_base_controller.lua @@ -2469,7 +2469,7 @@ function BattleBaseController:changeElementTypeByMap(changeMap) local index = 1 for entity, elementType in pairs(changeMap) do self.battleData:setGridInfo(entity:getPosId(), {gridType = entity:getGridType(), elementType = elementType}) - self.battleUI:playChangeElementSfx(entity:getPosId(), index) + self.battleUI:playChangeElementSfx(elementType, entity:getPosId(), index) index = index + 1 end end @@ -2598,7 +2598,7 @@ function BattleBaseController:shuffleBoard(callback) local count = 1 for posId, info in pairs(resetInfo) do self.battleData:setInfoBySnapshop(posId, info) - self.battleUI:playChangeElementSfx(posId, count) + self.battleUI:playChangeElementSfx(info.elementType, posId, count) count = count + 1 end self.resetGridSid = nil diff --git a/lua/app/module/battle/controller/battle_controller_pvp.lua b/lua/app/module/battle/controller/battle_controller_pvp.lua index 222ce6ff..522de4b0 100644 --- a/lua/app/module/battle/controller/battle_controller_pvp.lua +++ b/lua/app/module/battle/controller/battle_controller_pvp.lua @@ -224,7 +224,8 @@ function BattleControllerPVP:onFillBoardOver(...) local skillEntity = self.battleData:getSkillEntityByElement(skillMatchType, self.curActionSide) if skillEntity then entity:setSkilId(skillEntity:getSkillId(), false, self.curActionSide) - self.battleUI:playChangeElementSfx(posId, index) + --@ TODO 2025-08-28 20:45:55 先写死 + self.battleUI:playChangeElementSfx(1, posId, index) index = index + 1 if unitComp.unitEntity then if unitComp.unitEntity:getActiveSkillLimit() then diff --git a/lua/app/ui/battle/battle_base_ui.lua b/lua/app/ui/battle/battle_base_ui.lua index b0ce0eff..9d98fa02 100644 --- a/lua/app/ui/battle/battle_base_ui.lua +++ b/lua/app/ui/battle/battle_base_ui.lua @@ -756,13 +756,11 @@ function BattleBaseUI:playSkillLightSfxs(tartgetPos, pos, index, isPoint) end end -function BattleBaseUI:playChangeElementSfx(posId, index) - if not self.root.changeElementSfxs then - self.root.changeElementSfxs = {} - end - +function BattleBaseUI:playChangeElementSfx(elementType, posId, index) + self.root.changeElementSfxs = self.root.changeElementSfxs or {} + self.root.changeElementSfxs[elementType] = self.root.changeElementSfxs[elementType] or {} local pos = self:getPosInfo(posId) - local info = self.root.changeElementSfxs[index] + local info = self.root.changeElementSfxs[elementType][index] if info then local obj = info.obj if obj then @@ -771,11 +769,12 @@ function BattleBaseUI:playChangeElementSfx(posId, index) obj:play() end else - self.root.changeElementSfxs[index] = { + self.root.changeElementSfxs[elementType][index] = { isLoaded = true } - EffectManager:loadUIEffectAsync(GConst.BattleConst.CHANGE_ELEMENT_SFX, self, self.gridNode, GConst.UI_EFFECT_ORDER.LEVEL5, function(obj) - self.root.changeElementSfxs[index].obj = obj + local path = string.format(GConst.BattleConst.CHANGE_ELEMENT_SFX, elementType) + EffectManager:loadUIEffectAsync(path, self, self.gridNode, GConst.UI_EFFECT_ORDER.LEVEL5, function(obj) + self.root.changeElementSfxs[elementType][index].obj = obj obj:setAnchoredPosition(pos.x, pos.y) obj:play() end)