Safe Haskell | None |
---|---|
Language | Haskell2010 |
Game.LambdaHack.Common.Item
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.
- data ItemId
- data Item = Item {}
- seedToAspectsEffects :: ItemSeed -> ItemKind -> AbsDepth -> AbsDepth -> ItemAspectEffect
- data ItemKindIx
- type DiscoveryKind = EnumMap ItemKindIx (Id ItemKind)
- data ItemSeed
- data ItemAspectEffect = ItemAspectEffect {}
- type DiscoveryEffect = EnumMap ItemId ItemAspectEffect
- data ItemFull = ItemFull {}
- data ItemDisco = ItemDisco {
- itemKindId :: !(Id ItemKind)
- itemKind :: !ItemKind
- itemAE :: !(Maybe ItemAspectEffect)
- itemNoDisco :: (Item, Int) -> ItemFull
- itemNoAE :: ItemFull -> ItemFull
- type ItemTimer = [Time]
- type ItemQuant = (Int, ItemTimer)
- type ItemBag = EnumMap ItemId ItemQuant
- type ItemDict = EnumMap ItemId Item
- type ItemKnown = (ItemKindIx, ItemAspectEffect)
The Item
type
A unique identifier of an item in the dungeon.
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 | |
seedToAspectsEffects :: ItemSeed -> ItemKind -> AbsDepth -> AbsDepth -> ItemAspectEffect Source #
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.
Instances
Enum ItemKindIx Source # | |
Eq ItemKindIx Source # | |
Ord ItemKindIx Source # | |
Show ItemKindIx Source # | |
Ix ItemKindIx Source # | |
Binary ItemKindIx Source # | |
Hashable ItemKindIx Source # | |
type DiscoveryKind = 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.
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 DiscoveryEffect = EnumMap ItemId ItemAspectEffect Source #
The map of item ids to item aspects and effects. The full map is known by the server.
Constructors
ItemFull | |
Constructors
ItemDisco | |
Fields
|
Inventory management types
type ItemDict = EnumMap ItemId Item Source #
All items in the dungeon (including in actor inventories), indexed by item identifier.
type ItemKnown = (ItemKindIx, ItemAspectEffect) Source #
The essential item properties, used for the ItemRev
hash table
from items to their ids, needed to assign ids to newly generated items.
All the other meaningul properties can be derived from the two.
Note that jlid
is not meaningful; it gets forgotten if items from
different levels roll the same random properties and so are merged.