Improve chase crit responsiveness
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user