LambdaHack- A roguelike game engine in early and active development

Safe HaskellNone




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.


Teh Item type

data Item Source

Game items in inventories or strewn around the dungeon.




jkind :: !(Id ItemKind)

kind of the item

jpower :: !Int

power of the item

jletter :: Maybe Char

inventory symbol

jcount :: !Int

inventory count


newItem :: Ops ItemKind -> Int -> Int -> Rnd ItemSource

Generate an item.

viewItem :: Ops ItemKind -> Id ItemKind -> FlavourMap -> (Char, Color)Source

Represent an item on the map.

itemPrice :: Ops ItemKind -> Item -> IntSource

Price an item, taking count into consideration.

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.

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

The FlavourMap type

type FlavourMap = Map (Id ItemKind) FlavourSource

Flavours assigned to items in this game.

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.