This commit is contained in:
2024-12-19 23:40:04 +00:00
parent f3cfe8cb5f
commit e1989eaa1e
28 changed files with 285 additions and 300 deletions
-3
View File
@@ -22,13 +22,10 @@ newHotkey lw = fromMaybe maxBound $
-- this will not remove the hotkey from its old slot, assumes there is a hotkey
-- to swap with instead
-- requires there actually is equipment in the slot, too
assignHotkey :: Int -> Hotkey -> LWorld -> LWorld
assignHotkey invid hk lw = fromMaybe lw $ do
--guard (invid `IM.member` (cr ^. crInvEquipped))
guard $ lw ^? creatures . ix 0 . crInv . ix invid . itUse . useCondition
== Just UseableAnytime
-- _ <- lw ^? creatures . ix 0 . crInv . ix invid . itUse . leftUse
return $ (setHotkey invid hk . moveOldHotkey invid hk) lw
moveOldHotkey :: Int -> Hotkey -> LWorld -> LWorld