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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Atomic

Contents

Description

Synopsis

Re-exported from Game.LambdaHack.Atomic.MonadAtomic

class MonadStateRead m => MonadAtomic m where Source #

The monad for executing atomic game state transformations.

Minimal complete definition

execAtomic

Methods

execAtomic :: CmdAtomic -> m () Source #

Execute an arbitrary atomic game state transformation.

execUpdAtomic :: UpdAtomic -> m () Source #

Execute an atomic command that really changes the state.

execSfxAtomic :: SfxAtomic -> m () Source #

Execute an atomic command that only displays special effects.

Instances

MonadAtomic SerImplementation Source #

The game-state semantics of atomic commands as computed on the server.

MonadAtomic (CliImplementation resp req) Source #

The game-state semantics of atomic commands as computed on the client.

broadcastUpdAtomic :: MonadAtomic m => (FactionId -> UpdAtomic) -> m () Source #

Create and broadcast a set of atomic updates, one for each client.

broadcastSfxAtomic :: MonadAtomic m => (FactionId -> SfxAtomic) -> m () Source #

Create and broadcast a set of atomic special effects, one for each client.

Re-exported from Game.LambdaHack.Atomic.CmdAtomic

data CmdAtomic Source #

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

Constructors

UpdAtomic !UpdAtomic

atomic updates

SfxAtomic !SfxAtomic

atomic special effects

Instances

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 

Instances

Eq UpdAtomic Source # 
Show UpdAtomic Source # 
Generic UpdAtomic Source # 

Associated Types

type Rep UpdAtomic :: * -> * #

Binary UpdAtomic Source # 
type Rep UpdAtomic Source # 
type Rep UpdAtomic = D1 (MetaData "UpdAtomic" "Game.LambdaHack.Atomic.CmdAtomic" "LambdaHack-0.5.0.0-6iTxwONgT6uI9E7pr3r3VU" False) ((:+:) ((:+:) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "UpdCreateActor" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Actor)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [(ItemId, Item)]))))) ((:+:) (C1 (MetaCons "UpdDestroyActor" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Actor)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [(ItemId, Item)]))))) (C1 (MetaCons "UpdCreateItem" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Item))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemQuant)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Container))))))) ((:+:) (C1 (MetaCons "UpdDestroyItem" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Item))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemQuant)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Container))))) ((:+:) (C1 (MetaCons "UpdSpotActor" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Actor)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [(ItemId, Item)]))))) (C1 (MetaCons "UpdLoseActor" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Actor)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [(ItemId, Item)])))))))) ((:+:) ((:+:) (C1 (MetaCons "UpdSpotItem" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Item))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemQuant)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Container))))) ((:+:) (C1 (MetaCons "UpdLoseItem" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Item))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemQuant)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Container))))) (C1 (MetaCons "UpdMoveActor" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Point)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Point))))))) ((:+:) (C1 (MetaCons "UpdWaitActor" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Bool)))) ((:+:) (C1 (MetaCons "UpdDisplaceActor" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)))) (C1 (MetaCons "UpdMoveItem" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 CStore)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 CStore)))))))))) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "UpdAgeActor" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (Delta Time))))) ((:+:) (C1 (MetaCons "UpdRefillHP" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int64)))) (C1 (MetaCons "UpdRefillCalm" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int64)))))) ((:+:) (C1 (MetaCons "UpdFidImpressedActor" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 FactionId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 FactionId))))) ((:+:) (C1 (MetaCons "UpdTrajectory" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ([Vector], Speed)))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ([Vector], Speed))))))) (C1 (MetaCons "UpdColorActor" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Color)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Color)))))))) ((:+:) ((:+:) (C1 (MetaCons "UpdQuitFaction" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 FactionId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Actor)))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Status))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Status)))))) ((:+:) (C1 (MetaCons "UpdLeadFaction" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 FactionId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe (ActorId, Maybe Target)))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe (ActorId, Maybe Target))))))) (C1 (MetaCons "UpdDiplFaction" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 FactionId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 FactionId))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Diplomacy)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Diplomacy))))))) ((:+:) ((:+:) (C1 (MetaCons "UpdTacticFaction" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 FactionId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Tactic)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Tactic))))) (C1 (MetaCons "UpdAutoFaction" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 FactionId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Bool))))) ((:+:) (C1 (MetaCons "UpdRecordKill" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (Id ItemKind))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int))))) (C1 (MetaCons "UpdAlterTile" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 LevelId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Point))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (Id TileKind))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (Id TileKind))))))))))) ((:+:) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "UpdAlterClear" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 LevelId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int)))) ((:+:) (C1 (MetaCons "UpdSearchTile" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Point))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (Id TileKind))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (Id TileKind)))))) (C1 (MetaCons "UpdLearnSecrets" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int))))))) ((:+:) (C1 (MetaCons "UpdSpotTile" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 LevelId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [(Point, Id TileKind)])))) ((:+:) (C1 (MetaCons "UpdLoseTile" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 LevelId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [(Point, Id TileKind)])))) (C1 (MetaCons "UpdAlterSmell" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 LevelId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Point))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Time))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Time))))))))) ((:+:) ((:+:) (C1 (MetaCons "UpdSpotSmell" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 LevelId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [(Point, Time)])))) ((:+:) (C1 (MetaCons "UpdLoseSmell" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 LevelId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [(Point, Time)])))) (C1 (MetaCons "UpdTimeItem" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Container))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ItemTimer)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ItemTimer))))))) ((:+:) (C1 (MetaCons "UpdAgeGame" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (Delta Time))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [LevelId])))) ((:+:) (C1 (MetaCons "UpdDiscover" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Container)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (Id ItemKind))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemSeed)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 AbsDepth)))))) (C1 (MetaCons "UpdCover" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Container)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (Id ItemKind))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemSeed)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 AbsDepth)))))))))) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "UpdDiscoverKind" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Container)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (Id ItemKind)))))) ((:+:) (C1 (MetaCons "UpdCoverKind" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Container)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (Id ItemKind)))))) (C1 (MetaCons "UpdDiscoverSeed" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Container)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemSeed)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 AbsDepth))))))) ((:+:) (C1 (MetaCons "UpdCoverSeed" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Container)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemSeed)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 AbsDepth))))) ((:+:) (C1 (MetaCons "UpdPerception" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 LevelId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Perception)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Perception))))) (C1 (MetaCons "UpdRestart" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 FactionId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 DiscoveryKind)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 FactionPers)))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 State)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 DebugModeCli))))))))) ((:+:) ((:+:) (C1 (MetaCons "UpdRestartServer" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 State))) ((:+:) (C1 (MetaCons "UpdResume" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 FactionId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 FactionPers)))) (C1 (MetaCons "UpdResumeServer" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 State))))) ((:+:) ((:+:) (C1 (MetaCons "UpdKillExit" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 FactionId))) (C1 (MetaCons "UpdWriteSave" PrefixI False) U1)) ((:+:) (C1 (MetaCons "UpdMsgAll" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Msg))) (C1 (MetaCons "UpdRecordHistory" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 FactionId)))))))))

data SfxAtomic Source #

Abstract syntax of atomic special effects, that is, atomic commands that only display special effects and don't change the state.

Instances

Eq SfxAtomic Source # 
Show SfxAtomic Source # 
Generic SfxAtomic Source # 

Associated Types

type Rep SfxAtomic :: * -> * #

Binary SfxAtomic Source # 
type Rep SfxAtomic Source # 
type Rep SfxAtomic = D1 (MetaData "SfxAtomic" "Game.LambdaHack.Atomic.CmdAtomic" "LambdaHack-0.5.0.0-6iTxwONgT6uI9E7pr3r3VU" False) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "SfxStrike" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 CStore)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 HitAtomic)))))) ((:+:) (C1 (MetaCons "SfxRecoil" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 CStore)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 HitAtomic)))))) (C1 (MetaCons "SfxProject" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 CStore))))))) ((:+:) (C1 (MetaCons "SfxCatch" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 CStore))))) ((:+:) (C1 (MetaCons "SfxApply" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 CStore))))) (C1 (MetaCons "SfxCheck" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ItemId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 CStore)))))))) ((:+:) ((:+:) (C1 (MetaCons "SfxTrigger" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Point)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Feature))))) ((:+:) (C1 (MetaCons "SfxShun" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Point)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Feature))))) (C1 (MetaCons "SfxEffect" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 FactionId)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Effect))))))) ((:+:) (C1 (MetaCons "SfxMsgFid" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 FactionId)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Msg)))) ((:+:) (C1 (MetaCons "SfxMsgAll" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Msg))) (C1 (MetaCons "SfxActorStart" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ActorId)))))))

data HitAtomic Source #

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

Constructors

HitClear 
HitBlock !Int 

Instances

Eq HitAtomic Source # 
Show HitAtomic Source # 
Generic HitAtomic Source # 

Associated Types

type Rep HitAtomic :: * -> * #

Binary HitAtomic Source # 
type Rep HitAtomic Source # 
type Rep HitAtomic = D1 (MetaData "HitAtomic" "Game.LambdaHack.Atomic.CmdAtomic" "LambdaHack-0.5.0.0-6iTxwONgT6uI9E7pr3r3VU" False) ((:+:) (C1 (MetaCons "HitClear" PrefixI False) U1) (C1 (MetaCons "HitBlock" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int))))

Re-exported from Game.LambdaHack.Atomic.PosAtomicRead

data PosAtomic Source #

The type representing visibility of atomic commands to factions, based on the position of the command, etc. Note that the server sees and smells all positions.

Constructors

PosSight !LevelId ![Point]

whomever sees all the positions, notices

PosFidAndSight ![FactionId] !LevelId ![Point]

observers and the faction notice

PosSmell !LevelId ![Point]

whomever smells all the positions, notices

PosFid !FactionId

only the faction notices

PosFidAndSer !(Maybe LevelId) !FactionId

faction and server notices

PosSer

only the server notices

PosAll

everybody notices

PosNone

never broadcasted, but sent manually

posUpdAtomic :: MonadStateRead m => UpdAtomic -> m PosAtomic Source #

Produce the positions where the atomic update takes place.

The goal of the mechanics is to ensure the commands don't carry significantly more information than their corresponding state diffs would. In other words, the atomic commands involving the positions seen by a client should convey similar information as the client would get by directly observing the changes the commands enact on the visible portion of server game state. The client is then free to change its copy of game state accordingly or not --- it only partially reflects reality anyway.

E.g., UpdDisplaceActor in a black room, with one actor carrying a 0-radius light would not be distinguishable by looking at the state (or the screen) from UpdMoveActor of the illuminated actor, hence such UpdDisplaceActor should not be observable, but UpdMoveActor should be (or the former should be perceived as the latter). However, to simplify, we assing as strict visibility requirements to UpdMoveActor as to UpdDisplaceActor and fall back to UpdSpotActor (which provides minimal information that does not contradict state) if the visibility is lower.

posSfxAtomic :: MonadStateRead m => SfxAtomic -> m PosAtomic Source #

Produce the positions where the atomic special effect takes place.

seenAtomicCli :: Bool -> FactionId -> Perception -> PosAtomic -> Bool Source #

Given the client, it's perception and an atomic command, determine if the client notices the command.

generalMoveItem :: MonadStateRead m => ItemId -> Int -> Container -> Container -> m [UpdAtomic] Source #

Generate the atomic updates that jointly perform a given item move.