Tweak rewind gun

This commit is contained in:
2022-12-30 11:43:29 +00:00
parent 5bc764655d
commit 29d6307076
9 changed files with 24 additions and 15 deletions
+4 -4
View File
@@ -65,8 +65,8 @@ itNeedsLoading it = _laLoaded ic == 0 || not (_laPrimed ic)
activateEquipmentAt :: RightButtonOptions -> Creature -> World -> World
activateEquipmentAt rbo cr =
cWorld . lWorld . creatures . ix (_crID cr) %~ case (rbo ^? opActivateEquipment . activateEquipment, rbo ^? opActivateEquipment . deactivateEquipment) of
(Just i, _) -> crLeftInvSel ?~ i
(_, Just _) -> crLeftInvSel .~ Nothing
(Just i, _) -> crLeftInvSel . lisMPos ?~ i
(_, Just _) -> crLeftInvSel . lisMPos .~ Nothing
_ -> id
toggleEquipmentAt :: RightButtonOptions -> Int -> Creature -> World -> World
@@ -114,7 +114,7 @@ useLeftItem cid w
| itmIsConsumable = useItem cr w -- I believe this ONLY sets equipment options
| itmIsEquipable = useItem cr w -- I believe this ONLY sets equipment options
| otherwise = fromMaybe w $ do
invid <- _crLeftInvSel cr
invid <- cr ^. crLeftInvSel . lisMPos
itm <- cr ^? crInv . ix invid
f <- cr ^? crInv . ix invid . itUse . leftUse
return
@@ -127,6 +127,6 @@ useLeftItem cid w
isJust (cr ^? crInv . ix (crSel cr) . itUse . cUse)
itmIsEquipable =
isJust (cr ^? crInv . ix (crSel cr) . itUse . equipEffect . eeUse)
&& _crLeftInvSel cr /= Just (crSel cr)
&& cr ^. crLeftInvSel . lisMPos /= Just (crSel cr)
-- TODO determine itmShouldBeUsed with reference to config options