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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Atomic.CmdAtomic

Description

A set of atomic commands shared by client and server. These are the largest building blocks that have no components that can be observed in isolation.

We try to make atomic commands respect the laws of energy and mass conservation, unless they really can't, e.g., monster spawning. For example item removal from inventory is not an atomic command, but item dropped from the inventory to the ground is. This makes it easier to undo the commands. In principle, the commands are the only way to affect the basic game state (State).

See https://github.com/LambdaHack/LambdaHack/wiki/Client-server-architecture.

Synopsis

Documentation

data CmdAtomic Source

Abstract syntax of atomic commands, that is, atomic game state transformations.

Constructors

UpdAtomic !UpdAtomic

atomic updates

SfxAtomic !SfxAtomic

atomic special effects

data UpdAtomic Source

Abstract syntax of atomic updates, that is, atomic commands that really change the state. Most of them are an encoding of a game state diff, though they also carry some intentional hints that help clients determine whether and how to communicate them to players.

Constructors

UpdCreateActor !ActorId !Actor ![(ItemId, Item)] 
UpdDestroyActor !ActorId !Actor ![(ItemId, Item)] 
UpdCreateItem !ItemId !Item !ItemQuant !Container 
UpdDestroyItem !ItemId !Item !ItemQuant !Container 
UpdSpotActor !ActorId !Actor ![(ItemId, Item)] 
UpdLoseActor !ActorId !Actor ![(ItemId, Item)] 
UpdSpotItem !ItemId !Item !ItemQuant !Container 
UpdLoseItem !ItemId !Item !ItemQuant !Container 
UpdMoveActor !ActorId !Point !Point 
UpdWaitActor !ActorId !Bool 
UpdDisplaceActor !ActorId !ActorId 
UpdMoveItem !ItemId !Int !ActorId !CStore !CStore 
UpdAgeActor !ActorId !(Delta Time) 
UpdRefillHP !ActorId !Int64 
UpdRefillCalm !ActorId !Int64 
UpdFidImpressedActor !ActorId !FactionId !FactionId 
UpdTrajectory !ActorId !(Maybe ([Vector], Speed)) !(Maybe ([Vector], Speed)) 
UpdColorActor !ActorId !Color !Color 
UpdQuitFaction !FactionId !(Maybe Actor) !(Maybe Status) !(Maybe Status) 
UpdLeadFaction !FactionId !(Maybe (ActorId, Maybe Target)) !(Maybe (ActorId, Maybe Target)) 
UpdDiplFaction !FactionId !FactionId !Diplomacy !Diplomacy 
UpdTacticFaction !FactionId !Tactic !Tactic 
UpdAutoFaction !FactionId !Bool 
UpdRecordKill !ActorId !(Id ItemKind) !Int 
UpdAlterTile !LevelId !Point !(Id TileKind) !(Id TileKind) 
UpdAlterClear !LevelId !Int 
UpdSearchTile !ActorId !Point !(Id TileKind) !(Id TileKind) 
UpdLearnSecrets !ActorId !Int !Int 
UpdSpotTile !LevelId ![(Point, Id TileKind)] 
UpdLoseTile !LevelId ![(Point, Id TileKind)] 
UpdAlterSmell !LevelId !Point !(Maybe Time) !(Maybe Time) 
UpdSpotSmell !LevelId ![(Point, Time)] 
UpdLoseSmell !LevelId ![(Point, Time)] 
UpdTimeItem !ItemId !Container !ItemTimer !ItemTimer 
UpdAgeGame !(Delta Time) ![LevelId] 
UpdDiscover !Container !ItemId !(Id ItemKind) !ItemSeed !AbsDepth 
UpdCover !Container !ItemId !(Id ItemKind) !ItemSeed !AbsDepth 
UpdDiscoverKind !Container !ItemId !(Id ItemKind) 
UpdCoverKind !Container !ItemId !(Id ItemKind) 
UpdDiscoverSeed !Container !ItemId !ItemSeed !AbsDepth 
UpdCoverSeed !Container !ItemId !ItemSeed !AbsDepth 
UpdPerception !LevelId !Perception !Perception 
UpdRestart !FactionId !DiscoveryKind !FactionPers !State !Int !DebugModeCli 
UpdRestartServer !State 
UpdResume !FactionId !FactionPers 
UpdResumeServer !State 
UpdKillExit !FactionId 
UpdWriteSave 
UpdMsgAll !Msg 
UpdRecordHistory !FactionId 

data HitAtomic Source

Determine if a strike special effect should depict a block of an attack.

Constructors

HitClear 
HitBlock !Int