Allow for separate equipment positions on body
This commit is contained in:
@@ -51,8 +51,9 @@ rmInvItem cid invid w = case w ^? creatures . ix cid . crInv . ix invid . itCons
|
||||
_ -> w & creatures . ix cid . crInv %~ f
|
||||
& creatures . ix cid . crInvSel %~ g
|
||||
& creatures . ix cid . crLeftInvSel . _Just %~ g
|
||||
& creatures . ix cid . crInvEquipped %~ IS.delete invid
|
||||
& creatures . ix cid . crInvEquipped %~ IS.map g
|
||||
& creatures . ix cid . crInvEquipped %~ IM.delete invid
|
||||
& creatures . ix cid . crInvEquipped %~ IM.mapKeys g
|
||||
-- TODO check whether this can be mapKeysMonotonic
|
||||
where
|
||||
maxk = fmap fst $ IM.lookupMax $ _crInv $ _creatures w IM.! cid
|
||||
f inv = let (xs,ys) = IM.split invid inv
|
||||
@@ -186,7 +187,7 @@ changeSwapInvSel k w
|
||||
updatecreature = ( crInv %~ IM.swapKeys (i `mod` n) swapi )
|
||||
. (crLeftInvSel . _Just %~ updateLeftInvSel)
|
||||
. (crInvSel %~ (`mod` n) . subtract k)
|
||||
. (crInvEquipped %~ swapIntSetKeys i swapi)
|
||||
. (crInvEquipped %~ IM.swapKeys i swapi)
|
||||
swapi = (i - k) `mod` n
|
||||
updateLeftInvSel li | i == li = swapi
|
||||
| swapi == li = i
|
||||
|
||||
Reference in New Issue
Block a user