Work on cleaning up item effects/attachments etc

This commit is contained in:
2022-07-27 16:39:58 +01:00
parent 8d17ce66e9
commit b52adddd5d
39 changed files with 693 additions and 841 deletions
+2 -2
View File
@@ -53,7 +53,7 @@ tryReload cr it w f
| _crID cr == _yourID (_cWorld w) && itNeedsLoading it && _mouseButtons w M.!? SDL.ButtonLeft == Just False =
crToggleReloading cr
| otherwise =
(runIdentity . pointerToItem (_itPos it) (return . (itUse . useHammer .~ HammerDown)))
(runIdentity . pointerToItemLocation (_itLocation it) (return . (itUse . useHammer .~ HammerDown)))
. f
itNeedsLoading :: Item -> Bool
@@ -116,7 +116,7 @@ useLeftItem cid w
itm <- cr ^? crInv . ix invid
f <- cr ^? crInv . ix invid . itUse . lUse
return
. (runIdentity . pointerToItem (_itPos itm) (return . (itUse . useHammer .~ HammerDown)))
. (runIdentity . pointerToItemLocation (_itLocation itm) (return . (itUse . useHammer .~ HammerDown)))
. useL f itm cr
$ w
where
+1 -1
View File
@@ -213,7 +213,7 @@ itemUpdate cr i
| otherwise = baseupdate False
where
baseupdate bool = updateAutoRecharge . (itUse %~ useUpdate)
. (itPos .~ InInv (_crID cr) i)
. (itLocation .~ InInv (_crID cr) i)
. (itIsHeld .~ bool)
updateAutoRecharge :: Item -> Item
updateAutoRecharge it = case it ^? itUse . leftConsumption of