Skip to content

Commit

Permalink
Play NPC attack sound
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanmoffat committed Sep 14, 2022
1 parent a15932c commit 1a42a74
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions 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;
Expand All @@ -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)
Expand All @@ -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<short> spellId, Option<int> damage, bool showDeathAnimation)
Expand Down

0 comments on commit 1a42a74

Please sign in to comment.