Safe Haskell | None |
---|
Weapons, treasure and all the other items in the game.
No operation in this module
involves the State
or Action
type.
TODO: Document after it's rethought and rewritten wrt separating
inventory manangement and items proper.
- data Item = Item {}
- newItem :: Ops ItemKind -> Int -> Int -> Rnd Item
- viewItem :: Ops ItemKind -> Id ItemKind -> FlavourMap -> (Char, Color)
- itemPrice :: Ops ItemKind -> Item -> Int
- strongestSearch :: Ops ItemKind -> [Item] -> Maybe Item
- strongestSword :: Ops ItemKind -> [Item] -> Maybe Item
- strongestRegen :: Ops ItemKind -> [Item] -> Maybe Item
- joinItem :: Item -> [Item] -> (Item, [Item])
- removeItemByLetter :: Item -> [Item] -> [Item]
- equalItemIdentity :: Item -> Item -> Bool
- removeItemByIdentity :: Item -> [Item] -> [Item]
- assignLetter :: Maybe Char -> Char -> [Item] -> Maybe Char
- letterLabel :: Maybe Char -> String
- cmpLetterMaybe :: Maybe Char -> Maybe Char -> Ordering
- maxLetter :: Char -> Char -> Char
- letterRange :: [Char] -> String
- type FlavourMap = Map (Id ItemKind) Flavour
- getFlavour :: Ops ItemKind -> FlavourMap -> Id ItemKind -> Flavour
- dungeonFlavourMap :: Ops ItemKind -> Rnd FlavourMap
- type Discoveries = Set (Id ItemKind)
Teh Item
type
Game items in inventories or strewn around the dungeon.
viewItem :: Ops ItemKind -> Id ItemKind -> FlavourMap -> (Char, Color)Source
Represent an item on the map.
Inventory search
Inventory management
joinItem :: Item -> [Item] -> (Item, [Item])Source
Adds an item to a list of items, joining equal items. Also returns the joined item.
removeItemByLetter :: Item -> [Item] -> [Item]Source
equalItemIdentity :: Item -> Item -> BoolSource
removeItemByIdentity :: Item -> [Item] -> [Item]Source
assignLetter :: Maybe Char -> Char -> [Item] -> Maybe CharSource
Assigns a letter to an item, for inclusion in the inventory of a hero. Takes a remembered letter and a starting letter.
Inventory symbol operations
letterLabel :: Maybe Char -> StringSource
letterRange :: [Char] -> StringSource
The FlavourMap
type
getFlavour :: Ops ItemKind -> FlavourMap -> Id ItemKind -> FlavourSource
dungeonFlavourMap :: Ops ItemKind -> Rnd FlavourMapSource
Randomly chooses flavour for all item kinds for this game.
The Discoveries
type
type Discoveries = Set (Id ItemKind)Source
The type of already discovered items.