Improve chase crit responsiveness
This commit is contained in:
@@ -39,6 +39,7 @@ chaseCrit = defaultCreature
|
||||
, chaseCritMv
|
||||
, chaseCritPerceptionUpdate [0]
|
||||
, targetYouWhenCognizant
|
||||
, const turnIfDamaged
|
||||
, const (crMeleeCooldown %~ max 0 . subtract 1)
|
||||
]
|
||||
, _crName = "chaseCrit"
|
||||
|
||||
@@ -7,6 +7,7 @@ module Dodge.Creature.ReaderUpdate
|
||||
, watchUpdateStrat
|
||||
, reloadOverride
|
||||
, overrideInternal
|
||||
, turnIfDamaged
|
||||
, goToTarget
|
||||
, flockACC
|
||||
, chaseCritMv
|
||||
@@ -162,3 +163,11 @@ targetYouWhenCognizant w cr = case cr ^? crPerception . crAwarenessLevel . ix 0
|
||||
-- consider changing targeted creature to be just an index
|
||||
Just (Cognizant _) -> _creatures w IM.! 0 `seq` cr & crIntention . targetCr ?~ _creatures w IM.! 0
|
||||
_ -> cr & crIntention . targetCr .~ Nothing
|
||||
|
||||
turnIfDamaged :: Creature -> Creature
|
||||
turnIfDamaged cr
|
||||
| _crPastDamage cr > 0 = case _crStrategy (_crActionPlan cr) of
|
||||
WatchAndWait -> cr & crPerception . crAwakeLevel .~ Vigilant
|
||||
& crActionPlan . crStrategy .~ StrategyActions LookAround [TurnToA (_crPos cr -.- unitVectorAtAngle (_crDir cr))]
|
||||
_ -> cr
|
||||
| otherwise = cr
|
||||
|
||||
@@ -1171,6 +1171,7 @@ data Strategy
|
||||
| FollowImpulses
|
||||
| WatchAndWait
|
||||
| WarningCry
|
||||
| LookAround
|
||||
| CloseToMelee Int
|
||||
| StrategyActions Strategy [Action]
|
||||
| GetTo Point2
|
||||
|
||||
Reference in New Issue
Block a user