Add crab crit, rethink Action datatype slightly

This commit is contained in:
2026-04-07 15:29:02 +01:00
parent 35d169b585
commit f0e568e694
25 changed files with 606 additions and 465 deletions
+17 -2
View File
@@ -1,5 +1,6 @@
module Dodge.Humanoid (
chaseCritInternal,
crabCritInternal,
hoverCritInternal,
) where
@@ -16,7 +17,7 @@ chaseCritInternal w cr =
[ const doStrategyActions
, overrideMeleeCloseTarget
, setViewPos
, setMvPos
, setMvPosToTargetCr
, chaseCritMv
, perceptionUpdate [0]
, targetYouWhenCognizant
@@ -25,6 +26,20 @@ chaseCritInternal w cr =
, const (crVocalization %~ updateVocTimer)
]
crabCritInternal :: World -> Creature -> Creature
crabCritInternal w =
(crVocalization %~ updateVocTimer)
. (crType . meleeCooldown %~ max 0 . subtract 1)
. (crType . dodgeCooldown %~ max 0 . subtract 1)
. searchIfDamaged
. targetYouWhenCognizant w
. perceptionUpdate [0] w
. crabCritMv w
. setMvPosToTargetCr w
. setViewPos w
. overrideMeleeCloseTarget w
. doStrategyActions
hoverCritInternal :: World -> Creature -> Creature
hoverCritInternal w cr =
foldl'
@@ -33,7 +48,7 @@ hoverCritInternal w cr =
[ const doStrategyActions
, overrideMeleeCloseTarget
, setViewPos
, setMvPos
, setMvPosToTargetCr
, hoverCritMv
, perceptionUpdate [0]
, targetYouWhenCognizant