Make creature vocalizations stop on death

This commit is contained in:
2021-11-18 02:42:12 +00:00
parent f6d5d5a201
commit 94552ff658
7 changed files with 43 additions and 13 deletions
+15
View File
@@ -0,0 +1,15 @@
module Dodge.Creature.Vocalization where
import Dodge.Data
import Sound.Data
import Control.Lens
vocalizationTest :: Creature -> Maybe SoundID
vocalizationTest cr = case cr ^? crVocalization . vcCoolDown of
Just 0 -> Just $ _vcSound $ _crVocalization cr
_ -> Nothing
resetCrVocCoolDown :: Creature -> Creature
resetCrVocCoolDown cr = case cr ^? crVocalization . vcMaxCoolDown of
Just i -> cr & crVocalization . vcCoolDown .~ i
Nothing -> cr