Tweak perception. Bug: CloseToMelee is not getting applied

This commit is contained in:
2026-04-03 14:38:37 +01:00
parent 4e415a41ed
commit 532628c6da
5 changed files with 63 additions and 56 deletions
+2 -6
View File
@@ -29,10 +29,6 @@ perceptionUpdate ::
Creature
perceptionUpdate is w = rememberSounds w . basicAwarenessUpdate w . basicAttentionUpdate is w
--chaseCritPerceptionUpdate :: [Int] -> World -> Creature -> Creature
--chaseCritPerceptionUpdate is w =
-- rememberSounds w . chaseCritAwarenessUpdate w . basicAttentionUpdate is w
{- | Update a creatures awareness based upon the creatures' current direction
of attention
-} -- TODO delete?
@@ -64,9 +60,9 @@ basicAwarenessUpdate w cr = case _cpAttention $ _crPerception cr of
crImpulsesOnCognizant :: World -> Creature -> [[Impulse]]
crImpulsesOnCognizant w cr = case cr ^. crType of
ChaseCrit {} | Just sid <- cognizantVoc w cr -> [Bark sid]: replicate 5 [RandomImpulse $ RandImpulseCircMove 3]
<> [[ChangeStrategy $ CloseToMelee 0]]
++ [[ChangeStrategy $ CloseToMelee 0]]
HoverCrit {} | Just sid <- cognizantVoc w cr -> [[Bark sid]]
<> [[ChangeStrategy $ CloseToMelee 0]]
++ [[ChangeStrategy $ CloseToMelee 0]]
_ | Just sid <- cognizantVoc w cr -> [Bark sid]: replicate 5 [RandomImpulse $ RandImpulseCircMove 1]
_ -> replicate 5 [RandomImpulse $ RandImpulseCircMove 3]