Add modules to items, upgrades the can persist through combinations
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user