Continue reload removal

This commit is contained in:
2024-09-08 10:33:16 +01:00
parent e03c8dd830
commit 1006bb5529
17 changed files with 220 additions and 490 deletions
+1 -18
View File
@@ -4,7 +4,6 @@ module Dodge.Creature.ReaderUpdate (
targetYouWhenCognizant,
overrideMeleeCloseTarget,
watchUpdateStrat,
reloadOverride,
overrideInternal,
searchIfDamaged,
goToTarget,
@@ -24,7 +23,7 @@ import LensHelp
import Data.Bifunctor
import Data.Maybe
import Dodge.Base
import Dodge.Creature.Volition
--import Dodge.Creature.Volition
import Dodge.Data.CreatureEffect
import Dodge.Data.World
import Dodge.Zoning.Creature
@@ -170,22 +169,6 @@ doStrategyActions cr = case cr ^? crActionPlan . apStrategy of
& crActionPlan . apStrategy .~ strat
_ -> cr
reloadOverride :: Creature -> Creature
reloadOverride cr = fromMaybe cr $ do
guard $ cr ^. crStance . posture == Aiming
itRef <- cr ^? crManipulation . manObject . inInventory . ispItem
guard $ cr ^? crInv . ix (itRef + 1) . itUse . amagLoadStatus . iaLoaded == Just 0
return $ cr & crActionPlan . apStrategy .~ StrategyActions Reload reloadActions
where
reloadActions =
[ holsterWeapon
, 1
`WaitThen` DoActionWhileInterrupt
NoAction
(WdCrBlfromCrBl CrIsReloading)
(DoImpulses [ChangeStrategy WatchAndWait])
]
overrideInternal :: (Creature -> Bool) -> (Creature -> Creature) -> Creature -> Creature
overrideInternal test update cr
| test cr = update cr