Add burst fire, tentative inventory locking
This commit is contained in:
@@ -210,9 +210,14 @@ dropItem cr invid = rmInvItem cid invid . copyInvItemToFloor cr invid . mayberem
|
||||
Just i | i == invid -> creatures . ix cid . crLeftInvSel .~ Nothing
|
||||
_ -> id
|
||||
|
||||
{- | Get your creature to drop the item under the cursor. -}
|
||||
youDropItem :: World -> World
|
||||
youDropItem w = case yourItem w ^? _Just . itCurseStatus of
|
||||
youDropItem w
|
||||
| _crInvLock (you w) = w
|
||||
| otherwise = youDropItem' w
|
||||
|
||||
{- | Get your creature to drop the item under the cursor. -}
|
||||
youDropItem' :: World -> World
|
||||
youDropItem' w = case yourItem w ^? _Just . itCurseStatus of
|
||||
Just Uncursed -> w
|
||||
& dropItem cr (_crInvSel cr)
|
||||
& soundStart (CrSound (_crID cr)) (_crPos cr) whiteNoiseFadeOutS Nothing
|
||||
|
||||
@@ -38,7 +38,11 @@ itemEffect cr it w = case it ^? itUse of
|
||||
|
||||
--this is ugly
|
||||
useLeftItem :: Int -> World -> World
|
||||
useLeftItem cid w = case cr ^? crInv . ix crinvsel . itUse . lUse of
|
||||
useLeftItem cid w | _crInvLock $ _creatures w IM.! cid = w
|
||||
| otherwise = useLeftItem' cid w
|
||||
|
||||
useLeftItem' :: Int -> World -> World
|
||||
useLeftItem' cid w = case cr ^? crInv . ix crinvsel . itUse . lUse of
|
||||
Just f -> f cr crinvsel (w & creatures . ix cid . crLeftInvSel ?~ crinvsel)
|
||||
Nothing -> case _crLeftInvSel cr of
|
||||
Just invid -> case _itUse $ _crInv cr IM.! invid of
|
||||
|
||||
Reference in New Issue
Block a user