LambdaHack-0.11.0.1: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Server.CommonM

Contents

- Internal operations

Description

Server operations common to many modules.

Synopsis

- revealAll :: MonadServerAtomic m => FactionId -> m ()
- generalMoveItem :: MonadStateRead m => Bool -> ItemId -> Int -> Container -> Container -> m [UpdAtomic]
- deduceQuits :: MonadServerAtomic m => FactionId -> Status -> m ()
- writeSaveAll :: MonadServerAtomic m => Bool -> Bool -> m ()
- verifyCaches :: MonadServer m => m ()
- deduceKilled :: MonadServerAtomic m => ActorId -> m ()
- electLeader :: MonadServerAtomic m => FactionId -> LevelId -> ActorId -> m ()
- setFreshLeader :: MonadServerAtomic m => FactionId -> ActorId -> m ()
- updatePer :: MonadServerAtomic m => FactionId -> LevelId -> m ()
- projectFail :: MonadServerAtomic m => ActorId -> ActorId -> Point -> Point -> Int -> Bool -> ItemId -> CStore -> Bool -> m (Maybe ReqFailure)
- addActorFromGroup :: MonadServerAtomic m => GroupName ItemKind -> FactionId -> Point -> LevelId -> Time -> m (Maybe ActorId)
- registerActor :: MonadServerAtomic m => Bool -> ItemKnown -> ItemFullKit -> FactionId -> Point -> LevelId -> Time -> m ActorId
- discoverIfMinorEffects :: MonadServerAtomic m => Container -> ItemId -> ContentId ItemKind -> m ()
- pickWeaponServer :: MonadServer m => ActorId -> ActorId -> m (Maybe (ItemId, CStore))
- currentSkillsServer :: MonadServer m => ActorId -> m Skills
- allGroupItems :: MonadServerAtomic m => CStore -> GroupName ItemKind -> ActorId -> m [(ItemId, ItemQuant)]
- addCondition :: MonadServerAtomic m => Bool -> GroupName ItemKind -> ActorId -> m ()
- removeConditionSingle :: MonadServerAtomic m => GroupName ItemKind -> ActorId -> m Int
- addSleep :: MonadServerAtomic m => ActorId -> m ()
- removeSleepSingle :: MonadServerAtomic m => ActorId -> m ()
- addKillToAnalytics :: MonadServerAtomic m => ActorId -> KillHow -> FactionId -> ItemId -> m ()
- revealItems :: MonadServerAtomic m => FactionId -> m ()
- revealPerceptionLid :: MonadServerAtomic m => FactionId -> (LevelId, Level) -> m ()
- containerMoveItem :: MonadStateRead m => Bool -> ItemId -> Int -> Container -> Container -> m [UpdAtomic]
- quitF :: MonadServerAtomic m => Status -> FactionId -> m ()
- keepArenaFact :: Faction -> Bool
- anyActorsAlive :: MonadServer m => FactionId -> ActorId -> m Bool
- updatePerFromNew :: MonadServerAtomic m => FactionId -> LevelId -> Perception -> m ()
- recomputeCachePer :: MonadServer m => FactionId -> LevelId -> m Perception
- projectBla :: MonadServerAtomic m => ActorId -> ActorId -> Point -> [Point] -> ItemId -> CStore -> Bool -> m ()
- addProjectile :: MonadServerAtomic m => ActorId -> Point -> [Point] -> ItemId -> ItemQuant -> LevelId -> FactionId -> Time -> m ()
- addNonProjectile :: MonadServerAtomic m => Bool -> ItemId -> ItemFullKit -> FactionId -> Point -> LevelId -> Time -> m ActorId
- addActorIid :: MonadServerAtomic m => ItemId -> ItemFull -> Bool -> FactionId -> Point -> LevelId -> (Actor -> Actor) -> m ActorId
- getCacheLucid :: MonadServer m => LevelId -> m FovLucid
- getCacheTotal :: MonadServer m => FactionId -> LevelId -> m CacheBeforeLucid

# Documentation

revealAll :: MonadServerAtomic m => FactionId -> m () Source #

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

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

deduceQuits :: MonadServerAtomic m => FactionId -> Status -> m () Source #

writeSaveAll :: MonadServerAtomic m => Bool -> Bool -> m () Source #

Save game on server and all clients.

verifyCaches :: MonadServer m => m () Source #

deduceKilled :: MonadServerAtomic m => ActorId -> m () Source #

electLeader :: MonadServerAtomic m => FactionId -> LevelId -> ActorId -> m () Source #

setFreshLeader :: MonadServerAtomic m => FactionId -> ActorId -> m () Source #

updatePer :: MonadServerAtomic m => FactionId -> LevelId -> m () Source #

projectFail Source #

Arguments

:: MonadServerAtomic m |
=> ActorId | actor causing the projection
-> ActorId | actor projecting the item (is on current level)
-> Point | starting position of the projectile; usually, but not always, position of `origin`
-> Point | target position of the projectile
-> Int | digital line parameter
-> Bool | whether to start at the origin's position
-> ItemId | the item to be projected
-> CStore | which store the items comes from
-> Bool | whether the item is a blast
-> m (Maybe ReqFailure) |

addActorFromGroup :: MonadServerAtomic m => GroupName ItemKind -> FactionId -> Point -> LevelId -> Time -> m (Maybe ActorId) Source #

registerActor :: MonadServerAtomic m => Bool -> ItemKnown -> ItemFullKit -> FactionId -> Point -> LevelId -> Time -> m ActorId Source #

discoverIfMinorEffects :: MonadServerAtomic m => Container -> ItemId -> ContentId ItemKind -> m () Source #

pickWeaponServer :: MonadServer m => ActorId -> ActorId -> m (Maybe (ItemId, CStore)) Source #

currentSkillsServer :: MonadServer m => ActorId -> m Skills Source #

allGroupItems :: MonadServerAtomic m => CStore -> GroupName ItemKind -> ActorId -> m [(ItemId, ItemQuant)] Source #

addCondition :: MonadServerAtomic m => Bool -> GroupName ItemKind -> ActorId -> m () Source #

removeConditionSingle :: MonadServerAtomic m => GroupName ItemKind -> ActorId -> m Int Source #

addSleep :: MonadServerAtomic m => ActorId -> m () Source #

removeSleepSingle :: MonadServerAtomic m => ActorId -> m () Source #

addKillToAnalytics :: MonadServerAtomic m => ActorId -> KillHow -> FactionId -> ItemId -> m () Source #

# Internal operations

revealItems :: MonadServerAtomic m => FactionId -> m () Source #

revealPerceptionLid :: MonadServerAtomic m => FactionId -> (LevelId, Level) -> m () Source #

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

quitF :: MonadServerAtomic m => Status -> FactionId -> m () Source #

keepArenaFact :: Faction -> Bool Source #

Tell whether a faction that we know is still in game, keeps arena. Keeping arena means, if the faction is still in game, it always has a leader in the dungeon somewhere. So, leaderless factions and spawner factions do not keep an arena, even though the latter usually has a leader for most of the game.

anyActorsAlive :: MonadServer m => FactionId -> ActorId -> m Bool Source #

updatePerFromNew :: MonadServerAtomic m => FactionId -> LevelId -> Perception -> m () Source #

recomputeCachePer :: MonadServer m => FactionId -> LevelId -> m Perception Source #

projectBla Source #

Arguments

:: MonadServerAtomic m |
=> ActorId | actor causing the projection
-> ActorId | actor projecting the item (is on current lvl)
-> Point | starting point of the projectile
-> [Point] | rest of the trajectory of the projectile
-> ItemId | the item to be projected
-> CStore | which store the items comes from
-> Bool | whether the item is a blast
-> m () |

addProjectile :: MonadServerAtomic m => ActorId -> Point -> [Point] -> ItemId -> ItemQuant -> LevelId -> FactionId -> Time -> m () Source #

addNonProjectile :: MonadServerAtomic m => Bool -> ItemId -> ItemFullKit -> FactionId -> Point -> LevelId -> Time -> m ActorId Source #

addActorIid :: MonadServerAtomic m => ItemId -> ItemFull -> Bool -> FactionId -> Point -> LevelId -> (Actor -> Actor) -> m ActorId Source #

getCacheLucid :: MonadServer m => LevelId -> m FovLucid Source #

getCacheTotal :: MonadServer m => FactionId -> LevelId -> m CacheBeforeLucid Source #