Partially working change to selected items
This commit is contained in:
@@ -32,13 +32,14 @@ import Dodge.Data.World
|
||||
import Geometry
|
||||
|
||||
crIsReloading :: Creature -> Bool
|
||||
crIsReloading cr = case cr ^? crInvSel . iselAction of
|
||||
crIsReloading cr = case cr ^? crInvSel . isel . iselAction of
|
||||
Just ReloadAction{} -> True
|
||||
_ -> False
|
||||
|
||||
crWeaponReady :: Creature -> Bool
|
||||
crWeaponReady cr = fromMaybe False $ do
|
||||
ic <- cr ^? crInv . ix (crSel cr) . itUse . heldConsumption
|
||||
i <- cr ^? crInvSel . isel . ispItem
|
||||
ic <- cr ^? crInv . ix i . itUse . heldConsumption
|
||||
return (_laLoaded ic > 0 && _laPrimed ic)
|
||||
|
||||
crCanSeeCr :: Creature -> (World, Creature) -> Bool
|
||||
@@ -79,7 +80,11 @@ crCanShoot cr = crIsAiming cr && crWeaponReady cr
|
||||
crInAimStance :: AimStance -> Creature -> Bool
|
||||
crInAimStance as cr =
|
||||
crIsAiming cr
|
||||
&& cr ^? crInv . ix (crSel cr) . itUse . heldAim . aimStance == Just as
|
||||
&& mitstance == Just as
|
||||
where
|
||||
mitstance = do
|
||||
i <- cr ^? crInvSel . isel . ispItem
|
||||
cr ^? crInv . ix i . itUse . heldAim . aimStance
|
||||
|
||||
oneH :: Creature -> Bool
|
||||
oneH = crInAimStance OneHand
|
||||
|
||||
Reference in New Issue
Block a user