Safe Haskell | None |
---|---|
Language | Haskell2010 |
Weapons, treasure and all the other items in the game.
- data ItemId
- data Item = Item {}
- itemPrice :: (Item, Int) -> Int
- isMelee :: Item -> Bool
- goesIntoEqp :: Item -> Bool
- goesIntoInv :: Item -> Bool
- goesIntoSha :: Item -> Bool
- data AspectRecord = AspectRecord {}
- type DiscoveryAspect = EnumMap ItemId AspectRecord
- emptyAspectRecord :: AspectRecord
- sumAspectRecord :: [(AspectRecord, Int)] -> AspectRecord
- aspectRecordToList :: AspectRecord -> [Aspect]
- meanAspect :: ItemKind -> AspectRecord
- data ItemKindIx
- data ItemSeed
- data ItemDisco = ItemDisco {}
- data ItemFull = ItemFull {}
- data KindMean = KindMean {}
- type DiscoveryKind = EnumMap ItemKindIx KindMean
- type ItemIxMap = EnumMap ItemKindIx [ItemId]
- data Benefit = Benefit {}
- type DiscoveryBenefit = EnumMap ItemId Benefit
- itemNoDisco :: (Item, Int) -> ItemFull
- itemToFull6 :: COps -> DiscoveryKind -> DiscoveryAspect -> ItemId -> Item -> ItemQuant -> ItemFull
- aspectsRandom :: ItemKind -> Bool
- seedToAspect :: ItemSeed -> ItemKind -> AbsDepth -> AbsDepth -> AspectRecord
- aspectRecordFull :: ItemFull -> AspectRecord
- type ItemTimer = [Time]
- type ItemQuant = (Int, ItemTimer)
- type ItemBag = EnumMap ItemId ItemQuant
- type ItemDict = EnumMap ItemId Item
- castAspect :: AbsDepth -> AbsDepth -> AspectRecord -> Aspect -> Rnd AspectRecord
- addMeanAspect :: AspectRecord -> Aspect -> AspectRecord
- ceilingMeanDice :: Dice -> Int
The Item
type and operations
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.
Item | |
|
goesIntoEqp :: Item -> Bool Source #
goesIntoInv :: Item -> Bool Source #
goesIntoSha :: Item -> Bool Source #
The AspectRecord
type and operations
data AspectRecord Source #
Record of sums of aspect values of an item, container, actor, etc.
type DiscoveryAspect = EnumMap ItemId AspectRecord Source #
The map of item ids to item aspects. The full map is known by the server.
sumAspectRecord :: [(AspectRecord, Int)] -> AspectRecord Source #
aspectRecordToList :: AspectRecord -> [Aspect] Source #
meanAspect :: ItemKind -> AspectRecord Source #
Item discovery types and operations
data ItemKindIx Source #
An index of the kind identifier of an item. Clients have partial knowledge how these idexes map to kind ids. They gain knowledge by identifying items. The indexes and kind identifiers are 1-1.
A seed for rolling aspects of an item Clients have partial knowledge of how item ids map to the seeds. They gain knowledge by identifying items.
The secret part of the information about an item. If a faction
knows the aspects of the item (the itemAspect
field is not empty),
this is a complete secret information/.
Full information about an item.
Partial information about item kinds. These are assigned to each
ItemKindIx
. There is an item kinda, mean aspect value computed
(and here cached) for items of that kind and a flag saying whether
the item's aspects are constant rather than random or dependent
on dungeon level where the item is created.
type DiscoveryKind = EnumMap ItemKindIx KindMean Source #
The map of item kind indexes to item kind ids. The full map, as known by the server, is 1-1.
type ItemIxMap = EnumMap ItemKindIx [ItemId] Source #
The map of item kind indexes to identifiers of items that have that kind.
Fields are intentionally kept non-strict, because they are recomputed often, but not used every time. The fields are, in order: 1. whether the item should be kept in equipment (not in pack nor stash) 2. the total benefit from picking the item up (to use or to put in equipment) 3. the benefit of applying the item to self 4. the (usually negative) benefit of hitting a foe in meleeing with the item 5. the (usually negative) benefit of flinging an item at an opponent
itemToFull6 :: COps -> DiscoveryKind -> DiscoveryAspect -> ItemId -> Item -> ItemQuant -> ItemFull Source #
aspectsRandom :: ItemKind -> Bool Source #
seedToAspect :: ItemSeed -> ItemKind -> AbsDepth -> AbsDepth -> AspectRecord Source #
Inventory management types
type ItemQuant = (Int, ItemTimer) Source #
Number of items in a bag, together with recharging timer, in case of items that need recharging, exists only temporarily or auto-activate at regular intervals.
type ItemBag = EnumMap ItemId ItemQuant Source #
A bag of items, e.g., one of the stores of an actor or the items on a particular floor position or embedded in a particular map tile.
type ItemDict = EnumMap ItemId Item Source #
All items in the dungeon (including in actor inventories), indexed by item identifier.
Internal operations
castAspect :: AbsDepth -> AbsDepth -> AspectRecord -> Aspect -> Rnd AspectRecord Source #
addMeanAspect :: AspectRecord -> Aspect -> AspectRecord Source #
ceilingMeanDice :: Dice -> Int Source #