Remove old ammo code, add magazines to some test loadouts
This commit is contained in:
@@ -142,7 +142,7 @@ withThickSmokeI eff item cr w =
|
||||
ammoCheckI :: ChainEffect
|
||||
ammoCheckI eff itm cr w = fromMaybe (failsound w) $ do
|
||||
invid <- itm ^? itLocation . ipInvID
|
||||
x <- cr ^? crInv . ix (invid + 1) . itUse . attachParams . ammoAttachParams . iaLoaded
|
||||
x <- cr ^? crInv . ix (invid + 1) . itUse . attachParams . ammoLoadStatus . iaLoaded
|
||||
guard $ x > 0
|
||||
return $ eff itm cr $ w & cWorld . lWorld . creatures . ix (_crID cr) %~ crCancelReloading
|
||||
where
|
||||
@@ -340,13 +340,13 @@ useAllAmmo eff item cr = fromMaybe id $ do
|
||||
invid <- item ^? itLocation . ipInvID
|
||||
return $ eff item cr
|
||||
. (cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix (invid + 1)
|
||||
. itUse . attachParams . ammoAttachParams . iaLoaded .~ 0)
|
||||
. itUse . attachParams . ammoLoadStatus . iaLoaded .~ 0)
|
||||
|
||||
useAmmoUpTo :: Int -> ChainEffect
|
||||
useAmmoUpTo amAmount eff itm cr = fromMaybe id $ do
|
||||
invid <- itm ^? itLocation . ipInvID
|
||||
return $ eff itm cr
|
||||
. ( cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix (invid + 1) . itUse . attachParams . ammoAttachParams . iaLoaded
|
||||
. ( cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix (invid + 1) . itUse . attachParams . ammoLoadStatus . iaLoaded
|
||||
%~ (max 0 . subtract amAmount)
|
||||
)
|
||||
|
||||
@@ -358,7 +358,7 @@ useAmmoAmount amAmount eff item cr =
|
||||
itref = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
|
||||
|
||||
useAmmoAmount' :: Int -> Int -> IM.IntMap Item -> IM.IntMap Item
|
||||
useAmmoAmount' itref x inv = inv & ix (itref + 1) . itUse . attachParams . ammoAttachParams . iaLoaded -~ x
|
||||
useAmmoAmount' itref x inv = inv & ix (itref + 1) . itUse . attachParams . ammoLoadStatus . iaLoaded -~ x
|
||||
|
||||
-- . crInv . ix itRef . itUse . heldConsumption . laSource
|
||||
|
||||
@@ -659,7 +659,7 @@ duplicateLoaded eff it cr w = foldr f w (take numbul [1::Int .. ])
|
||||
f _ = eff it cr
|
||||
numbul = fromMaybe 0 $ do
|
||||
i <- cr ^? crManipulation . manObject . inInventory . ispItem
|
||||
cr ^? crInv . ix (i+1) . itUse . attachParams . ammoAttachParams . iaLoaded
|
||||
cr ^? crInv . ix (i+1) . itUse . attachParams . ammoLoadStatus . iaLoaded
|
||||
|
||||
duplicateNumBarrels :: Int -> ChainEffect
|
||||
duplicateNumBarrels n eff itm cr w = foldr f w (take n $ itm ^?! itUse . heldAim . aimMuzzles)
|
||||
@@ -681,7 +681,7 @@ duplicateLoadedBarrels eff itm cr = duplicateNumBarrels numbul eff itm cr
|
||||
numbul :: Int
|
||||
numbul = fromMaybe 0 $ do
|
||||
i <- cr ^? crManipulation . manObject . inInventory . ispItem
|
||||
cr ^? crInv . ix (i+1) . itUse . attachParams . ammoAttachParams . iaLoaded
|
||||
cr ^? crInv . ix (i+1) . itUse . attachParams . ammoLoadStatus . iaLoaded
|
||||
|
||||
duplicateOffsetsFocus :: [Float] -> ChainEffect
|
||||
duplicateOffsetsFocus xs eff item cr w = foldr f w poss
|
||||
|
||||
Reference in New Issue
Block a user