From 1a42a743c8f7a0f7cf248eb4c32ff2de42f1809e Mon Sep 17 00:00:00 2001 From: Ethan Moffat Date: Wed, 14 Sep 2022 11:42:24 -0700 Subject: [PATCH] Play NPC attack sound --- EndlessClient/Rendering/NPC/NPCActions.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/EndlessClient/Rendering/NPC/NPCActions.cs b/EndlessClient/Rendering/NPC/NPCActions.cs index 3ca18d4df..ca70d08ca 100644 --- a/EndlessClient/Rendering/NPC/NPCActions.cs +++ b/EndlessClient/Rendering/NPC/NPCActions.cs @@ -1,4 +1,5 @@ using AutomaticTypeMapper; +using EndlessClient.Audio; using EndlessClient.ControlSets; using EndlessClient.HUD.Chat; using EndlessClient.HUD.Controls; @@ -19,24 +20,24 @@ public class NPCActions : INPCActionNotifier private readonly INPCRendererRepository _npcRendererRepository; private readonly ICharacterRendererRepository _characterRendererRepository; private readonly IChatBubbleActions _chatBubbleActions; - private readonly IChatBubbleTextureProvider _chatBubbleTextureProvider; private readonly IESFFileProvider _esfFileProvider; + private readonly ISfxPlayer _sfxPlayer; public NPCActions(IHudControlProvider hudControlProvider, INPCStateCache npcStateCache, INPCRendererRepository npcRendererRepository, ICharacterRendererRepository characterRendererRepository, IChatBubbleActions chatBubbleActions, - IChatBubbleTextureProvider chatBubbleTextureProvider, - IESFFileProvider esfFileProvider) + IESFFileProvider esfFileProvider, + ISfxPlayer sfxPlayer) { _hudControlProvider = hudControlProvider; _npcStateCache = npcStateCache; _npcRendererRepository = npcRendererRepository; _characterRendererRepository = characterRendererRepository; _chatBubbleActions = chatBubbleActions; - _chatBubbleTextureProvider = chatBubbleTextureProvider; _esfFileProvider = esfFileProvider; + _sfxPlayer = sfxPlayer; } public void StartNPCWalkAnimation(int npcIndex) @@ -53,6 +54,8 @@ public void StartNPCAttackAnimation(int npcIndex) return; Animator.StartAttackAnimation(npcIndex); + + _sfxPlayer.PlaySfx(SoundEffectID.PunchAttack); } public void RemoveNPCFromView(int npcIndex, int playerId, Option spellId, Option damage, bool showDeathAnimation)