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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Server.PeriodicServer

Description

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

Synopsis

Documentation

spawnMonster :: (MonadAtomic m, MonadServer m) => LevelId -> m () Source

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

advanceTime :: (MonadAtomic m, MonadServer m) => ActorId -> m () Source

Advance the move time for the given actor

swapTime :: (MonadAtomic m, MonadServer m) => ActorId -> ActorId -> m () Source

Swap the relative move times of two actors (e.g., when switching a UI leader).

managePerTurn :: (MonadAtomic m, MonadServer m) => ActorId -> m () Source

Check if the given actor is dominated and update his calm. We don't update calm once per game turn (even though it would make fast actors less overpowered), beucase the effects of close enemies would sometimes manifest only after a couple of player turns (or perhaps never at all, if the player and enemy move away before that moment). A side effect is that under peaceful circumstances, non-max calm causes a consistent Calm regeneration UI indicator to be displayed each turn (not every few turns).