Partially working change to selected items
This commit is contained in:
@@ -26,6 +26,7 @@ import Dodge.Data.World
|
||||
import Dodge.Zoning.Creature
|
||||
import FoldableHelp
|
||||
import Geometry
|
||||
import Control.Monad
|
||||
|
||||
overrideMeleeCloseTarget :: Creature -> Creature
|
||||
overrideMeleeCloseTarget cr = maybe cr (tryMeleeAttack cr) (_targetCr $ _crIntention cr)
|
||||
@@ -150,11 +151,11 @@ doStrategyActions cr = case cr ^? crActionPlan . apStrategy of
|
||||
_ -> cr
|
||||
|
||||
reloadOverride :: Creature -> Creature
|
||||
reloadOverride cr
|
||||
| cr ^? crInv . ix (crSel cr) . itUse . heldConsumption . laLoaded == Just 0
|
||||
&& cr ^. crStance . posture == Aiming =
|
||||
cr & crActionPlan . apStrategy .~ StrategyActions Reload reloadActions
|
||||
| otherwise = cr
|
||||
reloadOverride cr = fromMaybe cr $ do
|
||||
guard $ cr ^. crStance . posture == Aiming
|
||||
itRef <- cr ^? crInvSel . isel . ispItem
|
||||
guard $ cr ^? crInv . ix itRef . itUse . heldConsumption . laLoaded == Just 0
|
||||
return $ cr & crActionPlan . apStrategy .~ StrategyActions Reload reloadActions
|
||||
where
|
||||
reloadActions =
|
||||
[ holsterWeapon
|
||||
|
||||
Reference in New Issue
Block a user