LambdaHack-0.2.14: A roguelike game engine in early development

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Common.Item

Contents

Description

Weapons, treasure and all the other items in the game. No operation in this module involves the state or any of our custom monads.

Synopsis

The Item type

data ItemId Source

A unique identifier of an item in the dungeon.

data Item Source

Game items in actor possesion or strewn around the dungeon. The fields jsymbol, jname and jflavour make it possible to refer to and draw an unidentified item. Full information about item is available through the jkindIx index as soon as the item is identified.

Constructors

Item 

Fields

jkindIx :: !ItemKindIx

index pointing to the kind of the item

jlid :: !LevelId

the level on which item was created

jsymbol :: !Char

individual map symbol

jname :: !Text

individual generic name

jflavour :: !Flavour

individual flavour

jfeature :: ![Feature]

public properties

jweight :: !Int

weight in grams, obvious enough

Item discovery types

data ItemKindIx Source

An index of the kind id of an item. Clients have partial knowledge how these idexes map to kind ids. They gain knowledge by identifying items.

type Discovery = EnumMap ItemKindIx (Id ItemKind) Source

The map of item kind indexes to item kind ids. The full map, as known by the server, is a bijection.

data ItemSeed Source

A seed for rolling aspects and effects of an item Clients have partial knowledge of how item ids map to the seeds. They gain knowledge by identifying items.

type DiscoAE = EnumMap ItemId ItemAspectEffect Source

The map of item ids to item aspects and effects. The full map is known by the server.

data ItemFull Source

Constructors

ItemFull 

Fields

itemBase :: !Item
 
itemK :: !Int
 
itemDisco :: !(Maybe ItemDisco)
 

Instances

Inventory management types

type ItemDict = EnumMap ItemId Item Source

All items in the dungeon (including in actor inventories), indexed by item identifier.