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

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Server.PeriodicM

Contents

- Internal operations

Description

Server operations performed periodically in the game loop and related operations.

Synopsis

- spawnMonster :: MonadServerAtomic m => m ()
- addManyActors :: MonadServerAtomic m => Bool -> Int -> Freqs ItemKind -> LevelId -> Time -> Maybe Point -> Int -> m Bool
- advanceTime :: MonadServerAtomic m => ActorId -> Int -> Bool -> m ()
- advanceTimeTraj :: MonadServerAtomic m => ActorId -> m ()
- overheadActorTime :: MonadServerAtomic m => FactionId -> LevelId -> m ()
- swapTime :: MonadServerAtomic m => ActorId -> ActorId -> m ()
- updateCalm :: MonadServerAtomic m => ActorId -> Int64 -> m ()
- leadLevelSwitch :: MonadServerAtomic m => m ()
- endOrLoop :: (MonadServerAtomic m, MonadServerComm m) => m () -> (Maybe (GroupName ModeKind) -> m ()) -> m ()
- addAnyActor :: MonadServerAtomic m => Bool -> Int -> Freqs ItemKind -> LevelId -> Time -> Maybe Point -> m (Maybe (ActorId, Point))
- rollSpawnPos :: COps -> EnumSet Point -> Bool -> Bool -> LevelId -> Level -> FactionId -> State -> Rnd (Maybe Point)
- gameExit :: (MonadServerAtomic m, MonadServerComm m) => m ()

# Documentation

spawnMonster :: MonadServerAtomic m => m () Source #

Spawn, possibly, a monster according to the level's actor groups. We assume heroes are never spawned.

addManyActors :: MonadServerAtomic m => Bool -> Int -> Freqs ItemKind -> LevelId -> Time -> Maybe Point -> Int -> m Bool Source #

advanceTime :: MonadServerAtomic m => ActorId -> Int -> Bool -> m () Source #

Advance the move time for the given actor.

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

Advance the trajectory following time for the given actor.

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

Add communication overhead time delta to all non-projectile, non-dying faction's actors, except the leader. Effectively, this limits moves of a faction on a level to 10, regardless of the number of actors and their speeds. To avoid animals suddenly acting extremely sluggish whenever monster's leader visits a distant arena that has a crowd of animals, overhead applies only to actors on the same level. Since the number of active levels is limited, this bounds the total moves per turn of each faction as well.

Leader is immune from overhead and so he is faster than other faction members and of equal speed to leaders of other factions (of equal base speed) regardless how numerous the faction is. Thanks to this, there is no problem with leader of a numerous faction having very long UI turns, introducing UI lag.

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

Swap the relative move times of two actors (e.g., when switching a UI leader). Notice that their trajectory move times are not swapped.

updateCalm :: MonadServerAtomic m => ActorId -> Int64 -> m () Source #

leadLevelSwitch :: MonadServerAtomic m => m () Source #

endOrLoop :: (MonadServerAtomic m, MonadServerComm m) => m () -> (Maybe (GroupName ModeKind) -> m ()) -> m () Source #

Continue or exit or restart the game.

# Internal operations

addAnyActor :: MonadServerAtomic m => Bool -> Int -> Freqs ItemKind -> LevelId -> Time -> Maybe Point -> m (Maybe (ActorId, Point)) Source #

rollSpawnPos :: COps -> EnumSet Point -> Bool -> Bool -> LevelId -> Level -> FactionId -> State -> Rnd (Maybe Point) Source #

gameExit :: (MonadServerAtomic m, MonadServerComm m) => m () Source #