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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Atomic.HandleAtomicWrite

Contents

Description

Semantics of atomic commands shared by client and server. See https://github.com/LambdaHack/LambdaHack/wiki/Client-server-architecture.

Synopsis

Documentation

handleUpdAtomic :: MonadStateWrite m => UpdAtomic -> m () Source #

The game-state semantics of atomic game commands. Special effects (SfxAtomic) don't modify state.

Internal operations

updCreateActor :: MonadStateWrite m => ActorId -> Actor -> [(ItemId, Item)] -> m () Source #

Creates an actor. Note: after this command, usually a new leader for the party should be elected (in case this actor is the only one alive).

updDestroyActor :: MonadStateWrite m => ActorId -> Actor -> [(ItemId, Item)] -> m () Source #

Kills an actor.

updCreateItem :: MonadStateWrite m => ItemId -> Item -> ItemQuant -> Container -> m () Source #

Create a few copies of an item that is already registered for the dungeon (in sitemRev field of StateServer).

updDestroyItem :: MonadStateWrite m => ItemId -> Item -> ItemQuant -> Container -> m () Source #

Destroy some copies (possibly not all) of an item.

updRecordKill :: MonadStateWrite m => ActorId -> Id ItemKind -> Int -> m () Source #

Record a given number (usually just 1, or -1 for undo) of actor kills for score calculation.

updAlterTile :: MonadStateWrite m => LevelId -> Point -> Id TileKind -> Id TileKind -> m () Source #

Alter an attribute (actually, the only, the defining attribute) of a visible tile. This is similar to e.g., UpdTrajectory.

For now, we don't remove embedded items when altering a tile and neither do we create fresh ones. It works fine, e.g., for tiles on fire that change into burnt out tile and then the fire item can no longer be triggered due to alterMinSkillKind excluding items without Embed, even if the burnt tile has low enough talter.

updAgeGame :: MonadStateWrite m => [LevelId] -> m () Source #

Age the game.