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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Client.CommonClient

Description

Common client monad operations.

Synopsis

Documentation

getPerFid :: MonadClient m => LevelId -> m Perception Source #

Get the current perception of a client.

aidTgtToPos :: MonadClient m => ActorId -> LevelId -> Maybe Target -> m (Maybe Point) Source #

Calculate the position of an actor's target.

aidTgtAims :: MonadClient m => ActorId -> LevelId -> Maybe Target -> m (Either Msg Int) Source #

Check whether one is permitted to aim at a target (this is only checked for actors; positions let player shoot at obstacles, e.g., to destroy them). This assumes aidTgtToPos does not return Nothing. Returns a different seps, if needed to reach the target actor.

Note: Perception is not enough for the check, because the target actor can be obscured by a glass wall or be out of sight range, but in weapon range.

makeLine :: MonadClient m => Bool -> Actor -> Point -> Int -> m (Maybe Int) Source #

Counts the number of steps until the projectile would hit an actor or obstacle. Starts searching with the given eps and returns the first found eps for which the number reaches the distance between actor and target position, or Nothing if none can be found.

partAidLeader :: MonadClient m => ActorId -> m Part Source #

The part of speech describing the actor (designated by actor id and present in the dungeon) or a special name if a leader of the observer's faction.

partActorLeader :: MonadClient m => ActorId -> Actor -> m Part Source #

The part of speech describing the actor or "you" if a leader of the client's faction. The actor may be not present in the dungeon.

partPronounLeader :: MonadClient m => ActorId -> Actor -> m Part Source #

The part of speech with the actor's pronoun or "you" if a leader of the client's faction. The actor may be not present in the dungeon.