This commit is contained in:
2021-12-09 22:37:14 +00:00
parent 3c35a04531
commit e84b4a29e8
10 changed files with 154 additions and 43 deletions
+5 -6
View File
@@ -121,14 +121,14 @@ doStrategyActionsR cr = return $ case cr ^? crActionPlan . crStrategy of
& crActionPlan . crStrategy .~ strat
_ -> cr
doStrategyActions :: World -> Creature -> Creature
doStrategyActions w cr = case cr ^? crActionPlan . crStrategy of
doStrategyActions :: Creature -> Creature
doStrategyActions cr = case cr ^? crActionPlan . crStrategy of
Just (StrategyActions strat acs) -> cr & crActionPlan . crAction .~ acs
& crActionPlan . crStrategy .~ strat
_ -> cr
reloadOverride :: World -> Creature -> Creature
reloadOverride w cr
reloadOverride :: Creature -> Creature
reloadOverride cr
| cr ^? crInv . ix (_crInvSel cr) . itConsumption . ammoLoaded == Just 0
&& cr ^. crStance . posture == Aiming
= cr & crActionPlan . crStrategy .~ StrategyActions Reload reloadActions
@@ -163,10 +163,9 @@ overrideInternalRRR test update cr = do
overrideInternal
:: (Creature -> Bool)
-> (Creature -> Creature)
-> World
-> Creature
-> Creature
overrideInternal test update w cr
overrideInternal test update cr
| test cr = update cr
| otherwise = cr