Remove internal ammo
This commit is contained in:
@@ -38,24 +38,12 @@ crIsReloading cr = case cr ^? crManipulation . manObject . inInventory . iselAct
|
||||
Just ReloadAction{} -> True
|
||||
_ -> False
|
||||
|
||||
-- Assumes the ammotype below the selected item is correct
|
||||
crWeaponReady :: Creature -> Bool
|
||||
crWeaponReady cr = fromMaybe False $ do
|
||||
i <- cr ^? crManipulation . manObject . inInventory . ispItem
|
||||
asource <- cr ^? crInv . ix i . itUse . heldConsumption . laSource
|
||||
case asource of
|
||||
InternalSource ia -> return (_iaLoaded ia > 0 && _iaPrimed ia)
|
||||
AboveSource -> do
|
||||
x <- cr ^? crInv . ix (i - 1) . itUse . equipEffect . eeUse . euseAmmoAmount
|
||||
return (x > 0)
|
||||
BelowSource -> do
|
||||
x <- cr ^? crInv . ix (i + 1) . itUse . equipEffect . eeUse . euseAmmoAmount
|
||||
return (x > 0)
|
||||
EitherSource -> return $
|
||||
justIsPositive (cr ^? crInv . ix (i - 1) . itUse . equipEffect . eeUse . euseAmmoAmount)
|
||||
|| justIsPositive (cr ^? crInv . ix (i + 1) . itUse . equipEffect . eeUse . euseAmmoAmount)
|
||||
where
|
||||
justIsPositive Nothing = False
|
||||
justIsPositive (Just x) = x > 0
|
||||
x <- cr ^? crInv . ix (i + 1) . itUse . attachParams . ammoAttachParams . iaLoaded
|
||||
return (x > 0)
|
||||
|
||||
crCanSeeCr :: Creature -> (World, Creature) -> Bool
|
||||
crCanSeeCr tcr (w, cr) = hasLOS (_crPos cr) (_crPos tcr) w
|
||||
|
||||
Reference in New Issue
Block a user