This commit is contained in:
2021-12-11 22:08:43 +00:00
parent 7116129a37
commit 6cd59d99bc
17 changed files with 115 additions and 170 deletions
+6 -6
View File
@@ -23,7 +23,7 @@ sentinelAI w = reloadOverride .
[ (crHasTargetLOS
, \ _ cr -> StrategyActions (ShootAt (fromJust $ tcid cr))
[ DoActionIf
(not . crIsAiming)
(const $ not . crIsAiming)
(drawWeapon `DoActionThen` (50 `WaitThen` NoAction))
`DoActionThen` lostest
`DoActionWhile` advanceShoot
@@ -38,7 +38,7 @@ sentinelAI w = reloadOverride .
where
advanceShoot = DoImpulses [UseItem, MoveForward 3]
tcid cr = _crID <$> _targetCr (_crIntention cr)
lostest (w',cr) = maybe False (\cid -> canSee (_crID cr) cid w') (tcid cr)
lostest w' cr = maybe False (\cid -> canSee (_crID cr) cid w') (tcid cr)
--chainCreatureUpdates :: [World -> Creature -> Creature] -> World -> Creature -> Creature
--chainCreatureUpdates ls w cr = foldr (\f -> f w) cr ls
@@ -53,7 +53,7 @@ sentinelFireType f = chainCreatureUpdatesLR
, aiming
]
)
, (crAwayFromPost, goToPostStrat)
, (const crAwayFromPost, const goToPostStrat)
]
, Left $ perceptionUpdate' [0]
-- , Left $ perceptionUp 0
@@ -65,21 +65,21 @@ sentinelFireType f = chainCreatureUpdatesLR
(crActionPlan . crStrategy .~ WatchAndWait)
]
where
drawwp = DoActionIfElse NoAction crIsAiming (DoActionThen drawWeapon (WaitThen 50 NoAction))
drawwp = DoActionIfElse NoAction (const crIsAiming) (DoActionThen drawWeapon (WaitThen 50 NoAction))
aiming = AimAt
{ _targetID = 0
, _targetSeenAt = V2 0 0 -- hack
}
sentinelExtraWatchUpdate
:: [((World, Creature) -> Bool , World -> Creature -> Strategy)]
:: [(World -> Creature -> Bool , World -> Creature -> Strategy)]
-> World
-> Creature
-> Creature
sentinelExtraWatchUpdate xs = chainCreatureUpdatesLR
[ Left performActions
, Left $ watchUpdateStrat
( xs ++ [(crAwayFromPost, goToPostStrat)] )
( xs ++ [(const crAwayFromPost, const goToPostStrat)] )
, Left $ perceptionUpdate' [0]
, Right doStrategyActions
, Left targetYouWhenCognizant