Tweak combine inventory regex

This commit is contained in:
2023-02-13 21:18:11 +00:00
parent b5db7a3420
commit 8b39a99194
12 changed files with 78 additions and 88 deletions
-14
View File
@@ -16,7 +16,6 @@ module Dodge.Inventory (
updateTerminal,
closeObjScrollDir,
closeObjectCol,
changeInvSel,
changeSwapInvSel,
changeAugInvSel,
crNumFreeSlots,
@@ -322,19 +321,6 @@ closeObjScrollDir x
| x < 0 = over (hud . closeObjects) rotD
| otherwise = id
changeInvSel :: Int -> World -> World
changeInvSel i w
| i == 0 || n == 0 = w
| otherwise = w
& pointcrInvSel . isel . ispItem %~ (`mod` n) . subtract i
& pointcrInvSel . isel . iselAction .~ NoInvSelAction
& pointcrInvSel . isel . ispCloseObject %~ (`mod` numCO) . subtract i
where
-- arguably this should jump the invpos into the inventory proper
pointcrInvSel = cWorld . lWorld . creatures . ix 0 . crInvSel
n = length $ w ^?! cWorld . lWorld . creatures . ix 0 . crInv
numCO = length $ w ^. hud . closeObjects
changeSwapInvSel :: Int -> World -> World
changeSwapInvSel k w = case you w ^? crInvSel . isel of
Just (SelItem i _) -> w & cWorld . lWorld . creatures . ix 0 %~ updatecreature i