Add burst fire, tentative inventory locking
This commit is contained in:
@@ -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