Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 {}
- data ItemSource
- itemPrice :: (Item, Int) -> Int
- goesIntoEqp :: Item -> Bool
- isMelee :: Item -> Bool
- goesIntoInv :: Item -> Bool
- goesIntoSha :: Item -> Bool
- seedToAspect :: ItemSeed -> ItemKind -> AbsDepth -> AbsDepth -> AspectRecord
- meanAspect :: ItemKind -> AspectRecord
- aspectRecordToList :: AspectRecord -> [Aspect]
- aspectRecordFull :: ItemFull -> AspectRecord
- aspectsRandom :: ItemKind -> Bool
- data ItemKindIx
- data ItemSeed
- data KindMean = KindMean {
- kmKind :: Id ItemKind
- kmMean :: AspectRecord
- type DiscoveryKind = EnumMap ItemKindIx KindMean
- data Benefit = Benefit {}
- type DiscoveryBenefit = EnumMap ItemId Benefit
- data AspectRecord = AspectRecord {}
- emptyAspectRecord :: AspectRecord
- sumAspectRecord :: [(AspectRecord, Int)] -> AspectRecord
- type DiscoveryAspect = EnumMap ItemId AspectRecord
- data ItemFull = ItemFull {}
- data ItemDisco = ItemDisco {}
- itemNoDisco :: (Item, Int) -> ItemFull
- itemToFull :: COps -> DiscoveryKind -> DiscoveryAspect -> ItemId -> Item -> ItemQuant -> ItemFull
- type ItemTimer = [Time]
- type ItemQuant = (Int, ItemTimer)
- type ItemBag = EnumMap ItemId ItemQuant
- type ItemDict = EnumMap ItemId Item
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.
Item | |
|
data ItemSource Source #
goesIntoEqp :: Item -> Bool Source #
goesIntoInv :: Item -> Bool Source #
goesIntoSha :: Item -> Bool Source #
seedToAspect :: ItemSeed -> ItemKind -> AbsDepth -> AbsDepth -> AspectRecord Source #
meanAspect :: ItemKind -> AspectRecord Source #
aspectRecordToList :: AspectRecord -> [Aspect] Source #
aspectsRandom :: ItemKind -> Bool 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.
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.
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.
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
sumAspectRecord :: [(AspectRecord, Int)] -> AspectRecord Source #
type DiscoveryAspect = EnumMap ItemId AspectRecord Source #
The map of item ids to item aspects. The full map is known by the server.
itemToFull :: COps -> DiscoveryKind -> DiscoveryAspect -> ItemId -> Item -> ItemQuant -> ItemFull Source #