LambdaHack-0.4.99.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone

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 ItemIdSource

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

buildItem :: FlavourMap -> DiscoveryKindRev -> Id ItemKind -> ItemKind -> LevelId -> ItemSource

Build an item with the given stats.

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

Generate an item based on level.

Item discovery types

type DiscoveryKindRev = EnumMap (Id ItemKind) ItemKindIxSource

The reverse map to DiscoveryKind, needed for item creation.

type ItemSeedDict = EnumMap ItemId ItemSeedSource

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

The FlavourMap type

data FlavourMap Source

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

dungeonFlavourMap :: COps -> Rnd FlavourMapSource

Randomly chooses flavour for all item kinds for this game.