diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 83997f09..9240e0b8 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -1402,7 +1402,17 @@ function BattleUnitComp:onSkillTakeEffect(skill, isFinalBlock, validEffectIdx) end local soundHit = skill:getSoundHit() if soundHit then - BattleHelper:playSkillSound(soundHit, 0) + local blocks = skill:getEffectBlock() + if blocks then + local soundIndex = 1 + for i, endIdx in ipairs(blocks) do + if endIdx == effectEndIdx then + soundIndex = i + break + end + end + BattleHelper:playSkillSound(soundHit[soundIndex], 0) + end end end end diff --git a/lua/app/module/battle/helper/battle_helper.lua b/lua/app/module/battle/helper/battle_helper.lua index 99229286..9a2128fd 100644 --- a/lua/app/module/battle/helper/battle_helper.lua +++ b/lua/app/module/battle/helper/battle_helper.lua @@ -242,7 +242,7 @@ function BattleHelper:recycleBuffEffect(buffEffect) end function BattleHelper:playSkillSound(name, delay) - if self.skillSoundPath == nil then + if self.skillSoundPath == nil or not name then return end local soundFullPath = self.skillSoundPath[name]