Improve item combination algorithm

This commit is contained in:
2022-06-08 16:12:44 +01:00
parent 1b3988f961
commit ba8b33a87c
14 changed files with 77 additions and 22 deletions
+2 -2
View File
@@ -52,8 +52,8 @@ rmInvItem :: Int -- ^ Creature id
-> Int -- ^ Inventory position
-> World
-> World
rmInvItem cid invid w = case w ^? creatures . ix cid . crInv . ix invid . itConsumption . itAmount of
Just x | x > 1 -> w & creatures . ix cid . crInv . ix invid . itConsumption . itAmount %~ subtract 1
rmInvItem cid invid w = case w ^? creatures . ix cid . crInv . ix invid . itConsumption . icAmount of
Just x | x > 1 -> w & creatures . ix cid . crInv . ix invid . itConsumption . icAmount %~ subtract 1
_ -> w & creatures . ix cid . crInv %~ f
& creatures . ix cid . crInvSel %~ g
& creatures . ix cid . crLeftInvSel %~ g'