Make launcherX use multiple ammo sources
This commit is contained in:
@@ -34,16 +34,8 @@ useItemRightClick cr' w = fromMaybe (f w) $ do
|
||||
|
||||
getAmmoMags :: Item -> Creature -> [Item]
|
||||
getAmmoMags itm cr = fromMaybe [] $ do
|
||||
atypes <- itm ^? itUse . heldConsumption
|
||||
i <- itm ^? itLocation . ipInvID
|
||||
let amags = cr ^.. crInv . dropping (i + 1) traverse
|
||||
mmags = zipWith f atypes amags
|
||||
return $ catMaybes mmags
|
||||
where
|
||||
f atype itm' = do
|
||||
itype <- itm' ^? itUse . amagType
|
||||
guard $ itype == atype
|
||||
return $ itm'
|
||||
return $ cr ^.. crInv . dropping (i + 1) traverse
|
||||
|
||||
itemEffect :: Creature -> Item -> World -> World
|
||||
itemEffect cr it w = case it ^. itUse of
|
||||
|
||||
Reference in New Issue
Block a user