Add modules to items, upgrades the can persist through combinations

This commit is contained in:
2022-02-20 14:13:12 +00:00
parent 3f20398ed0
commit 7afc367abc
16 changed files with 108 additions and 32 deletions
+8 -3
View File
@@ -1,9 +1,14 @@
module Dodge.Inventory.ItemSpace where
module Dodge.Inventory.ItemSpace
( itSlotsTaken
) where
import Dodge.Data
import Dodge.Module
import Control.Lens
--import Data.Maybe
itSlotsTaken :: Item -> Int
itSlotsTaken it = case it ^? itConsumption . itAmount of
Nothing -> ceiling (_itInvSize it)
Just i -> ceiling (_itInvSize it * fromIntegral i)
Nothing -> moduleSizes it + ceiling (_itInvSize it)
Just i -> moduleSizes it + ceiling (_itInvSize it * fromIntegral i)