Add crab crit, rethink Action datatype slightly
This commit is contained in:
+17
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user