Implement copier, an item that copies the value displayed by other items

This commit is contained in:
2025-01-08 14:29:25 +00:00
parent 47aa8655b1
commit 21b7b863c7
12 changed files with 184 additions and 142 deletions
+4 -1
View File
@@ -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