Add randomness to multiple crab evasions

This commit is contained in:
2026-04-09 13:28:39 +01:00
parent 0a8a2210c0
commit c8a06bc084
14 changed files with 194 additions and 179 deletions
+15 -13
View File
@@ -26,20 +26,22 @@ chaseCritInternal w cr =
, const (crVocalization %~ updateVocTimer)
]
crabCritInternal :: World -> Creature -> Creature
crabCritInternal w =
(crVocalization %~ updateVocTimer)
. (crType . meleeCooldownL %~ max 0 . subtract 1)
. (crType . meleeCooldownR %~ max 0 . subtract 1)
. (crType . dodgeCooldown %~ max 0 . subtract 1)
. searchIfDamaged
. targetYouWhenCognizant w
. perceptionUpdate [0] w
. crabActionUpdate w
. setMvPosToTargetCr w
. setViewPos w
crabCritInternal :: Int -> World -> World
crabCritInternal cid w =
-- (crVocalization %~ updateVocTimer)
(tocr %~ ((crType . meleeCooldownL %~ max 0 . subtract 1)))
. (tocr %~ ((crType . meleeCooldownR %~ max 0 . subtract 1)))
. (tocr %~ ((crType . dodgeCooldown %~ max 0 . subtract 1)))
. (tocr %~ (searchIfDamaged))
. (tocr %~ (targetYouWhenCognizant w))
. (tocr %~ (perceptionUpdate [0] w))
. crabActionUpdate cid
. (tocr %~ (setMvPosToTargetCr w))
. (tocr %~ (setViewPos w))
-- . overrideMeleeCloseTarget w
. doStrategyActions
$ (tocr %~ doStrategyActions) w
where
tocr = cWorld . lWorld . creatures . ix cid
hoverCritInternal :: World -> Creature -> Creature
hoverCritInternal w cr =