LambdaHack-0.2.14: A roguelike game engine in early development

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Server.ItemRev

Contents

Description

Server types and operations for items that don't involve server state nor our custom monads.

Synopsis

Documentation

type ItemRev = HashMap ItemKnown ItemId Source

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

buildItem :: FlavourMap -> DiscoRev -> Id ItemKind -> ItemKind -> LevelId -> Item Source

Build an item with the given stats.

newItem :: COps -> FlavourMap -> DiscoRev -> Freqs -> LevelId -> AbsDepth -> AbsDepth -> Rnd (Maybe (ItemKnown, ItemFull, ItemSeed, Int, Text)) Source

Generate an item based on level.

Item discovery types

type DiscoRev = EnumMap (Id ItemKind) ItemKindIx Source

The reverse map to Discovery, needed for item creation.

type ItemSeedDict = EnumMap ItemId ItemSeed Source

The map of item ids to item seeds. The full map is known by the server.

The FlavourMap type

data FlavourMap Source

Flavours assigned by the server to item kinds, in this particular game.

dungeonFlavourMap :: Ops ItemKind -> Rnd FlavourMap Source

Randomly chooses flavour for all item kinds for this game.