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