From 96597aea3a2130438e0b9fb5fece1aa27164134e Mon Sep 17 00:00:00 2001 From: jarryd229 <15334102+jarryd229@users.noreply.github.com> Date: Thu, 9 May 2024 01:17:22 +1000 Subject: [PATCH] updated soundDefinitions --- .../world/interact/entity/player/combat/melee/Block.kts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/game/src/main/kotlin/world/gregs/voidps/world/interact/entity/player/combat/melee/Block.kts b/game/src/main/kotlin/world/gregs/voidps/world/interact/entity/player/combat/melee/Block.kts index 8a8856a76..065a1f567 100644 --- a/game/src/main/kotlin/world/gregs/voidps/world/interact/entity/player/combat/melee/Block.kts +++ b/game/src/main/kotlin/world/gregs/voidps/world/interact/entity/player/combat/melee/Block.kts @@ -20,6 +20,7 @@ import world.gregs.voidps.world.interact.entity.sound.playSound val styleDefinitions: WeaponStyleDefinitions by inject() val weaponDefinitions: WeaponAnimationDefinitions by inject() val animationDefinitions: AnimationDefinitions by inject() +val soundDefinitions: SoundDefinitions by inject() characterCombatAttack { character -> character.playSound(calculateHitSound(target), delay) @@ -71,9 +72,9 @@ fun hitAnimation(npc: NPC): String { fun calculateHitSound(target: Character): String { if (target is NPC) { - var animation = "${target.id}_hit" - if (animationDefinitions.contains(animation)) { - return animation + var sound = "${target.id}_hit" + if (soundDefinitions.contains(sound)) { + return sound } return "${target.race}_hit" }