Allow for creature death sounds

This commit is contained in:
2026-01-02 15:06:02 +00:00
parent b414da7dab
commit 71f56c0638
10 changed files with 367 additions and 320 deletions
+19
View File
@@ -1,5 +1,7 @@
{-# LANGUAGE LambdaCase #-}
module Dodge.Creature.Vocalization (
crWarningSounds,
crDeathSounds,
vocalizationTest,
resetCrVocCoolDown,
) where
@@ -39,6 +41,23 @@ crWarningSounds cr = case cr ^. crType of
BarrelCrit{} -> mempty
LampCrit{} -> mempty
crDeathSounds :: Creature -> DeathType -> [SoundID]
crDeathSounds cr dt = case cr ^. crType of
Avatar{} -> mempty
AvatarDead -> mempty
ChaseCrit{} -> defaultDeathSounds dt
SwarmCrit -> mempty
AutoCrit -> mempty
BarrelCrit{} -> mempty
LampCrit{} -> mempty
defaultDeathSounds :: DeathType -> [SoundID]
defaultDeathSounds = \case
CookDeath -> mempty
PoisonDeath -> mempty
PlainDeath -> mempty
GibsDeath -> mempty
vocalizationTest :: Creature -> Maybe SoundID
vocalizationTest cr = case cr ^? crVocalization . vcCoolDown of
Just 0 -> crVocalizationSound cr