diff --git a/src/Dodge/Creature/Perception.hs b/src/Dodge/Creature/Perception.hs index 2f8c6601a..77e57dc9e 100644 --- a/src/Dodge/Creature/Perception.hs +++ b/src/Dodge/Creature/Perception.hs @@ -65,13 +65,14 @@ chaseCritAwarenessUpdate w cr = case _crAttentionDir $ _crPerception cr of becomesCognizant = any isCognizant $ IM.unionWith cogRaised oldAwareness newAwareness randBool = takeOne [False,True] & evalState $ _randGen w maybeBark - | becomesCognizant && randBool = - crActionPlan . crStrategy .~ StrategyActions WarningCry - [DoImpulses [Bark $ fromJust $ vocalizationTest cr] + | becomesCognizant && randBool = case vocalizationTest cr of + Just soundid -> crActionPlan . crStrategy .~ StrategyActions WarningCry + [DoImpulses [Bark soundid] `DoActionThen` 20 `WaitThen` DoImpulses [ChangeStrategy $ CloseToMelee 0] , AimAt 0 (_crPos $ _creatures w IM.! 0) ] + Nothing -> id | otherwise = id cogRaised :: AwarenessLevel -> AwarenessLevel -> AwarenessLevel