LambdaHack-0.11.0.0: A game engine library for tactical squad ASCII roguelike dungeon crawlers
Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Client.UI.HandleHumanGlobalM

Description

Semantics of Game.LambdaHack.Client.UI.HumanCmd client commands that return server requests. A couple of them do not take time, the rest does. Here prompts and menus are displayed, but any feedback resulting from the commands (e.g., from inventory manipulation) is generated later on, by the server, for all clients that witness the results of the commands.

Synopsis

Meta commands

byAreaHuman :: MonadClientUI m => (KM -> HumanCmd -> m (Either MError ReqUI)) -> [(CmdArea, HumanCmd)] -> m (Either MError ReqUI) Source #

Pick command depending on area the mouse pointer is in. The first matching area is chosen. If none match, only interrupt.

Global commands that usually take time

waitHuman :: MonadClientUI m => ActorId -> m (FailOrCmd RequestTimed) Source #

Leader waits a turn (and blocks, etc.).

waitHuman10 :: MonadClientUI m => ActorId -> m (FailOrCmd RequestTimed) Source #

Leader waits a 1/10th of a turn (and doesn't block, etc.).

yellHuman :: MonadClientUI m => ActorId -> m (FailOrCmd RequestTimed) Source #

Leader yells or yawns, if sleeping.

alterDirHuman :: MonadClientUI m => ActorId -> m (FailOrCmd RequestTimed) Source #

Ask for a direction and alter a tile, if possible.

alterWithPointerHuman :: MonadClientUI m => ActorId -> m (FailOrCmd RequestTimed) Source #

Try to alter a tile using a feature under the pointer.

closeDirHuman :: MonadClientUI m => ActorId -> m (FailOrCmd RequestTimed) Source #

Close nearby open tile; ask for direction, if there is more than one.

helpHuman :: MonadClientUI m => (KM -> HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI) Source #

Display command help.

hintHuman :: MonadClientUI m => (KM -> HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI) Source #

Display hint or, if already displayed, display help.

dashboardHuman :: MonadClientUI m => (KM -> HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI) Source #

Display the dashboard.

mainMenuHuman :: MonadClientUI m => (KM -> HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI) Source #

Display the main menu.

mainMenuAutoOnHuman :: MonadClientUI m => (KM -> HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI) Source #

Display the main menu and set swasAutomated.

mainMenuAutoOffHuman :: MonadClientUI m => (KM -> HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI) Source #

Display the main menu and unset swasAutomated.

settingsMenuHuman :: MonadClientUI m => (KM -> HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI) Source #

Display the settings menu.

challengeMenuHuman :: MonadClientUI m => (KM -> HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI) Source #

Display the challenge menu.

Global commands that never take time

data ExitStrategy Source #

Constructors

Restart 
Quit 

Internal operations

meleeAid :: (MonadClient m, MonadClientUI m) => ActorId -> ActorId -> m (FailOrCmd RequestTimed) Source #

Actor attacks an enemy actor or his own projectile.

displaceAid :: MonadClientUI m => ActorId -> ActorId -> m (FailOrCmd RequestTimed) Source #

Actor swaps position with another.

moveSearchAlter :: MonadClientUI m => ActorId -> Bool -> Vector -> m (FailOrCmd RequestTimed) Source #

Leader moves or searches or alters. No visible actor at the position.

alterTileAtPos :: MonadClientUI m => ActorId -> Point -> m (FailOrCmd RequestTimed) Source #

Try to alter a tile using a feature at the given position.

We don't check if the tile is interesting, e.g., if any embedded item can be triggered, because the player explicitely requested the action. Consequently, even if all embedded items are recharching, the time will be wasted and the server will describe the failure in detail.

verifyAlters :: forall m. MonadClientUI m => ActorId -> Bool -> Point -> m (FailOrCmd ()) Source #

Verify that the tile can be transformed or any embedded item effect triggered and the player is aware if the effect is dangerous or grave, such as ending the game.

closeTileAtPos :: MonadClientUI m => ActorId -> Point -> m (FailOrCmd RequestTimed) Source #

Close tile at given position.

msgAddDone :: MonadClientUI m => Bool -> ActorId -> Point -> Text -> m () Source #

Adds message with proper names.

pickPoint :: MonadClientUI m => ActorId -> Text -> m (Maybe Point) Source #

Prompts user to pick a point.