LambdaHack-0.8.1.2: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Game.LambdaHack.Server.ItemRev

Description

Creation of items on the server. Types and operations that don't involve server state nor our custom monads.

Synopsis

# Documentation

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 them. Note 1: jlid is not meaningful; it gets forgotten if items from different levels roll the same random properties and so are merged. However, the first item generated by the server wins, which in case of normal items (not organs), is most of the time the lower absolute jlid (shallower depth) item, which makes sense for the client. Note 2: ItemSeed instead of AspectRecord is not enough, becaused different seeds may result in the same AspectRecord and we don't want such items to be distinct in UI and elsewhere.

Reverse item map, for item creation, to keep items and item identifiers in bijection.

Build an item with the given stats.

Generate an item based on level.

# Item discovery types

The reverse map to DiscoveryKind, needed for item creation. This is total and never changes, hence implemented as vector. Morally, it's indexed by ContentId ItemKind and elements are ItemKindIx.

Instances
 Source # Instance detailsDefined in Game.LambdaHack.Server.ItemRev MethodsshowList :: [DiscoveryKindRev] -> ShowS # Source # Instance detailsDefined in Game.LambdaHack.Server.ItemRev MethodsputList :: [DiscoveryKindRev] -> Put #

The map of item ids to item seeds, needed for item creation.

# The FlavourMap type

Flavours assigned by the server to item kinds, in this particular game. This is total and never changes, hence implemented as vector. Morally, it's indexed by ContentId ItemKind and elements are Flavour.

Instances
 Source # Instance detailsDefined in Game.LambdaHack.Server.ItemRev MethodsshowList :: [FlavourMap] -> ShowS # Source # Instance detailsDefined in Game.LambdaHack.Server.ItemRev MethodsputList :: [FlavourMap] -> Put #

Randomly chooses flavour for all item kinds for this game.