Implement copier, an item that copies the value displayed by other items
This commit is contained in:
@@ -49,7 +49,7 @@ selectedItemScroll yi w = do
|
||||
|
||||
itemScroll :: Int -> Int -> Item -> World -> World
|
||||
itemScroll yi invid itm w
|
||||
| isJust $ itm ^? itUse . uInt = w & itmlens . itUse . uInt +~ yi
|
||||
-- | isJust $ itm ^? itUse . uInt = w & itmlens . itUse . uInt +~ yi
|
||||
| Just xs <- itm ^? itUse . uaParams . apProjectiles = w
|
||||
& itmlens . itUse . uaParams . apProjectiles .~ rotateList yi xs
|
||||
| ATTACH ZOOMSCOPE <- itm ^. itType = updateScopeZoom invid w
|
||||
@@ -58,6 +58,9 @@ itemScroll yi invid itm w
|
||||
w
|
||||
& itmlens . itUse . heldAim . aimMuzzles . ix 0 . mzAmmoSlot
|
||||
%~ ((`mod` 2) . (+ 1))
|
||||
| isJust $ itm ^? itScroll . itsInt = w & itmlens . itScroll . itsInt +~ yi
|
||||
| Just y <- itm ^? itScroll . itsMax = w & itmlens . itScroll . itsRangeInt
|
||||
%~ ((`mod` y) . (+ yi))
|
||||
| otherwise = w
|
||||
where
|
||||
itmlens = cWorld . lWorld . creatures . ix 0 . crInv . ix invid
|
||||
|
||||
Reference in New Issue
Block a user