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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Client.UI.HandleHumanGlobalM

Contents

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 => (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 => m (RequestTimed AbWait) Source #

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

waitHuman10 :: MonadClientUI m => m (RequestTimed AbWait) Source #

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

alterDirHuman :: MonadClientUI m => [Trigger] -> m (FailOrCmd (RequestTimed AbAlter)) Source #

Ask for a direction and alter a tile in the specified way, if possible.

alterWithPointerHuman :: MonadClientUI m => [Trigger] -> m (FailOrCmd (RequestTimed AbAlter)) Source #

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

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

Display command help.

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

Display the main menu.

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

Display the settings menu.

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

Display the challenges menu.

Global commands that never take time

Internal operations

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

Actor attacks an enemy actor or his own projectile.

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

Actor swaps position with another.

moveSearchAlter :: MonadClientUI m => Vector -> m (FailOrCmd RequestAnyAbility) Source #

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

alterTile :: MonadClientUI m => [Trigger] -> Vector -> m (FailOrCmd (RequestTimed AbAlter)) Source #

Try to alter a tile using a feature in the given direction.

alterTileAtPos :: MonadClientUI m => [Trigger] -> Point -> Text -> m (FailOrCmd (RequestTimed AbAlter)) Source #

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

verifyAlters :: MonadClientUI m => LevelId -> Point -> m (FailOrCmd ()) Source #

Verify important effects, such as fleeing the dungeon.

This is contrived for now, the embedded items are not analyzed, but only recognized by name.

guessAlter :: COps -> [Trigger] -> Id TileKind -> Text Source #

Guess and report why the bump command failed.