Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- byAreaHuman :: MonadClientUI m => (HumanCmd -> m (Either MError ReqUI)) -> [(CmdArea, HumanCmd)] -> m (Either MError ReqUI)
- byAimModeHuman :: MonadClientUI m => m (Either MError ReqUI) -> m (Either MError ReqUI) -> m (Either MError ReqUI)
- composeIfLocalHuman :: MonadClientUI m => m (Either MError ReqUI) -> m (Either MError ReqUI) -> m (Either MError ReqUI)
- composeUnlessErrorHuman :: MonadClientUI m => m (Either MError ReqUI) -> m (Either MError ReqUI) -> m (Either MError ReqUI)
- compose2ndLocalHuman :: MonadClientUI m => m (Either MError ReqUI) -> m (Either MError ReqUI) -> m (Either MError ReqUI)
- loopOnNothingHuman :: MonadClientUI m => m (Either MError ReqUI) -> m (Either MError ReqUI)
- executeIfClearHuman :: MonadClientUI m => m (Either MError ReqUI) -> m (Either MError ReqUI)
- waitHuman :: MonadClientUI m => m (RequestTimed AbWait)
- waitHuman10 :: MonadClientUI m => m (RequestTimed AbWait)
- moveRunHuman :: MonadClientUI m => Bool -> Bool -> Bool -> Bool -> Vector -> m (FailOrCmd RequestAnyAbility)
- runOnceAheadHuman :: MonadClientUI m => m (Either MError ReqUI)
- moveOnceToXhairHuman :: MonadClientUI m => m (FailOrCmd RequestAnyAbility)
- runOnceToXhairHuman :: MonadClientUI m => m (FailOrCmd RequestAnyAbility)
- continueToXhairHuman :: MonadClientUI m => m (FailOrCmd RequestAnyAbility)
- moveItemHuman :: forall m. MonadClientUI m => [CStore] -> CStore -> Maybe Part -> Bool -> m (FailOrCmd (RequestTimed AbMoveItem))
- projectHuman :: MonadClientUI m => m (FailOrCmd (RequestTimed AbProject))
- applyHuman :: MonadClientUI m => m (FailOrCmd (RequestTimed AbApply))
- alterDirHuman :: MonadClientUI m => [TriggerTile] -> m (FailOrCmd (RequestTimed AbAlter))
- alterWithPointerHuman :: MonadClientUI m => [TriggerTile] -> m (FailOrCmd (RequestTimed AbAlter))
- helpHuman :: MonadClientUI m => (HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI)
- hintHuman :: MonadClientUI m => (HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI)
- dashboardHuman :: MonadClientUI m => (HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI)
- itemMenuHuman :: MonadClientUI m => (HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI)
- chooseItemMenuHuman :: MonadClientUI m => (HumanCmd -> m (Either MError ReqUI)) -> ItemDialogMode -> m (Either MError ReqUI)
- mainMenuHuman :: MonadClientUI m => (HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI)
- settingsMenuHuman :: MonadClientUI m => (HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI)
- challengesMenuHuman :: MonadClientUI m => (HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI)
- gameScenarioIncr :: MonadClientUI m => m ()
- gameDifficultyIncr :: MonadClientUI m => m ()
- gameWolfToggle :: MonadClientUI m => m ()
- gameFishToggle :: MonadClientUI m => m ()
- gameRestartHuman :: MonadClientUI m => m (FailOrCmd ReqUI)
- gameExitHuman :: MonadClientUI m => m ReqUI
- gameSaveHuman :: MonadClientUI m => m ReqUI
- tacticHuman :: MonadClientUI m => m (FailOrCmd ReqUI)
- automateHuman :: MonadClientUI m => m (FailOrCmd ReqUI)
- areaToRectangles :: MonadClientUI m => CmdArea -> m [(X, Y, X, Y)]
- meleeAid :: MonadClientUI m => ActorId -> m (FailOrCmd (RequestTimed AbMelee))
- displaceAid :: MonadClientUI m => ActorId -> m (FailOrCmd (RequestTimed AbDisplace))
- moveSearchAlter :: MonadClientUI m => Vector -> m (FailOrCmd RequestAnyAbility)
- goToXhair :: MonadClientUI m => Bool -> Bool -> m (FailOrCmd RequestAnyAbility)
- multiActorGoTo :: MonadClientUI m => LevelId -> Point -> RunParams -> m (FailOrCmd (Bool, Vector))
- selectItemsToMove :: forall m. MonadClientUI m => [CStore] -> CStore -> Maybe Part -> Bool -> m (FailOrCmd (CStore, [(ItemId, ItemFullKit)]))
- moveItems :: forall m. MonadClientUI m => [CStore] -> (CStore, [(ItemId, ItemFullKit)]) -> CStore -> m (FailOrCmd (RequestTimed AbMoveItem))
- projectItem :: MonadClientUI m => (CStore, (ItemId, ItemFull)) -> m (FailOrCmd (RequestTimed AbProject))
- applyItem :: MonadClientUI m => (CStore, (ItemId, ItemFullKit)) -> m (FailOrCmd (RequestTimed AbApply))
- alterTile :: MonadClientUI m => [TriggerTile] -> Vector -> m (FailOrCmd (RequestTimed AbAlter))
- alterTileAtPos :: MonadClientUI m => [TriggerTile] -> Point -> Text -> m (FailOrCmd (RequestTimed AbAlter))
- verifyAlters :: MonadClientUI m => LevelId -> Point -> m (FailOrCmd ())
- verifyEscape :: MonadClientUI m => m (FailOrCmd ())
- guessAlter :: COps -> [TriggerTile] -> ContentId TileKind -> Text
- artWithVersion :: MonadClientUI m => m [String]
- generateMenu :: MonadClientUI m => (HumanCmd -> m (Either MError ReqUI)) -> [(KM, (Text, HumanCmd))] -> [String] -> String -> m (Either MError ReqUI)
- nxtGameMode :: COps -> Int -> ModeKind
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.
byAimModeHuman :: MonadClientUI m => m (Either MError ReqUI) -> m (Either MError ReqUI) -> m (Either MError ReqUI) Source #
composeIfLocalHuman :: MonadClientUI m => m (Either MError ReqUI) -> m (Either MError ReqUI) -> m (Either MError ReqUI) Source #
composeUnlessErrorHuman :: MonadClientUI m => m (Either MError ReqUI) -> m (Either MError ReqUI) -> m (Either MError ReqUI) Source #
compose2ndLocalHuman :: MonadClientUI m => m (Either MError ReqUI) -> m (Either MError ReqUI) -> m (Either MError ReqUI) Source #
loopOnNothingHuman :: MonadClientUI m => m (Either MError ReqUI) -> m (Either MError ReqUI) Source #
executeIfClearHuman :: MonadClientUI m => m (Either MError ReqUI) -> m (Either MError ReqUI) Source #
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.).
moveRunHuman :: MonadClientUI m => Bool -> Bool -> Bool -> Bool -> Vector -> m (FailOrCmd RequestAnyAbility) Source #
runOnceAheadHuman :: MonadClientUI m => m (Either MError ReqUI) Source #
moveOnceToXhairHuman :: MonadClientUI m => m (FailOrCmd RequestAnyAbility) Source #
runOnceToXhairHuman :: MonadClientUI m => m (FailOrCmd RequestAnyAbility) Source #
continueToXhairHuman :: MonadClientUI m => m (FailOrCmd RequestAnyAbility) Source #
moveItemHuman :: forall m. MonadClientUI m => [CStore] -> CStore -> Maybe Part -> Bool -> m (FailOrCmd (RequestTimed AbMoveItem)) Source #
projectHuman :: MonadClientUI m => m (FailOrCmd (RequestTimed AbProject)) Source #
applyHuman :: MonadClientUI m => m (FailOrCmd (RequestTimed AbApply)) Source #
alterDirHuman :: MonadClientUI m => [TriggerTile] -> m (FailOrCmd (RequestTimed AbAlter)) Source #
Ask for a direction and alter a tile in the specified way, if possible.
alterWithPointerHuman :: MonadClientUI m => [TriggerTile] -> 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.
hintHuman :: MonadClientUI m => (HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI) Source #
Display hint or, if already displayed, display help.
dashboardHuman :: MonadClientUI m => (HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI) Source #
Display the dashboard.
itemMenuHuman :: MonadClientUI m => (HumanCmd -> m (Either MError ReqUI)) -> m (Either MError ReqUI) Source #
chooseItemMenuHuman :: MonadClientUI m => (HumanCmd -> m (Either MError ReqUI)) -> ItemDialogMode -> m (Either MError ReqUI) Source #
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.
gameScenarioIncr :: MonadClientUI m => m () Source #
gameDifficultyIncr :: MonadClientUI m => m () Source #
gameWolfToggle :: MonadClientUI m => m () Source #
gameFishToggle :: MonadClientUI m => m () Source #
Global commands that never take time
gameRestartHuman :: MonadClientUI m => m (FailOrCmd ReqUI) Source #
gameExitHuman :: MonadClientUI m => m ReqUI Source #
gameSaveHuman :: MonadClientUI m => m ReqUI Source #
tacticHuman :: MonadClientUI m => m (FailOrCmd ReqUI) Source #
automateHuman :: MonadClientUI m => m (FailOrCmd ReqUI) Source #
Internal operations
areaToRectangles :: MonadClientUI m => CmdArea -> m [(X, Y, X, Y)] Source #
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.
goToXhair :: MonadClientUI m => Bool -> Bool -> m (FailOrCmd RequestAnyAbility) Source #
multiActorGoTo :: MonadClientUI m => LevelId -> Point -> RunParams -> m (FailOrCmd (Bool, Vector)) Source #
selectItemsToMove :: forall m. MonadClientUI m => [CStore] -> CStore -> Maybe Part -> Bool -> m (FailOrCmd (CStore, [(ItemId, ItemFullKit)])) Source #
moveItems :: forall m. MonadClientUI m => [CStore] -> (CStore, [(ItemId, ItemFullKit)]) -> CStore -> m (FailOrCmd (RequestTimed AbMoveItem)) Source #
projectItem :: MonadClientUI m => (CStore, (ItemId, ItemFull)) -> m (FailOrCmd (RequestTimed AbProject)) Source #
applyItem :: MonadClientUI m => (CStore, (ItemId, ItemFullKit)) -> m (FailOrCmd (RequestTimed AbApply)) Source #
alterTile :: MonadClientUI m => [TriggerTile] -> Vector -> m (FailOrCmd (RequestTimed AbAlter)) Source #
Try to alter a tile using a feature in the given direction.
alterTileAtPos :: MonadClientUI m => [TriggerTile] -> Point -> Text -> m (FailOrCmd (RequestTimed AbAlter)) 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 :: 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.
verifyEscape :: MonadClientUI m => m (FailOrCmd ()) Source #
guessAlter :: COps -> [TriggerTile] -> ContentId TileKind -> Text Source #
Guess and report why the bump command failed.
artWithVersion :: MonadClientUI m => m [String] Source #