Safe Haskell | None |
---|---|
Language | Haskell2010 |
Server operations performed periodically in the game loop and related operations.
Synopsis
- spawnMonster :: MonadServerAtomic m => m ()
- addAnyActor :: MonadServerAtomic m => Bool -> Freqs ItemKind -> LevelId -> Time -> Maybe Point -> m (Maybe ActorId)
- advanceTime :: MonadServerAtomic m => ActorId -> Int -> Bool -> m ()
- overheadActorTime :: MonadServerAtomic m => FactionId -> LevelId -> m ()
- swapTime :: MonadServerAtomic m => ActorId -> ActorId -> m ()
- udpateCalm :: MonadServerAtomic m => ActorId -> Int64 -> m ()
- leadLevelSwitch :: MonadServerAtomic m => m ()
- rollSpawnPos :: COps -> EnumSet Point -> Bool -> LevelId -> Level -> FactionId -> State -> Rnd Point
Documentation
spawnMonster :: MonadServerAtomic m => m () Source #
Spawn, possibly, a monster according to the level's actor groups. We assume heroes are never spawned.
addAnyActor :: MonadServerAtomic m => Bool -> Freqs ItemKind -> LevelId -> Time -> Maybe Point -> m (Maybe ActorId) Source #
advanceTime :: MonadServerAtomic m => ActorId -> Int -> Bool -> m () Source #
Advance the move 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).
udpateCalm :: MonadServerAtomic m => ActorId -> Int64 -> m () Source #
leadLevelSwitch :: MonadServerAtomic m => m () Source #