Dataify impulse/action/strategy function fields

This commit is contained in:
2022-07-21 21:45:31 +01:00
parent 14f3c8bc52
commit 583027112d
7 changed files with 45 additions and 36 deletions
+3 -3
View File
@@ -23,7 +23,7 @@ sentinelAI w = reloadOverride .
[ (crHasTargetLOS
, \ _ cr -> StrategyActions (ShootAt (fromJust $ tcid cr))
[ DoActionIf
(const $ not . crIsAiming)
(WdCrNegate $ WdCrBlfromCrBl 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 = WdCrLOSTarget -- 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
@@ -65,7 +65,7 @@ sentinelFireType f = chainCreatureUpdates
(crActionPlan . apStrategy .~ WatchAndWait)
]
where
drawwp = DoActionIfElse NoAction (const crIsAiming) (DoActionThen drawWeapon (WaitThen 50 NoAction))
drawwp = DoActionIfElse NoAction (WdCrBlfromCrBl CrIsAiming) (DoActionThen drawWeapon (WaitThen 50 NoAction))
aiming = AimAt
{ _targetID = 0
, _targetSeenAt = V2 0 0 -- hack