Work on inventory management
This commit is contained in:
@@ -232,7 +232,7 @@ dropItem cr invid = rmInvItem cid invid . copyInvItemToFloor cr invid . mayberem
|
||||
|
||||
{- | Get your creature to drop the item under the cursor. -}
|
||||
youDropItem :: World -> World
|
||||
youDropItem w = case yourItem w ^? itCurseStatus of
|
||||
youDropItem w = case yourItem w ^? _Just . itCurseStatus of
|
||||
Just Uncursed -> w
|
||||
& dropItem cr (_crInvSel cr)
|
||||
& soundStart (CrSound (_crID cr)) (_crPos cr) whiteNoiseFadeOutS Nothing
|
||||
@@ -250,7 +250,7 @@ pickUpItem cid flit w = case maybeInvSlot of
|
||||
Just i -> w
|
||||
& soundStart (CrSound cid) (_flItPos flit) pickUpS Nothing
|
||||
& updateItLocation i
|
||||
& floorItems %~ IM.delete (_flItID flit)
|
||||
& floorItems %~ IM.delete (_flItID flit)
|
||||
& creatures . ix cid . crInv %~ IM.insertWith (const $ itAmount +~ 1) i it
|
||||
where
|
||||
it = _flIt flit
|
||||
|
||||
Reference in New Issue
Block a user