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