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

Game.LambdaHack.Client.UI.HandleHumanLocalM

Description

Semantics of Game.LambdaHack.Client.UI.HumanCmd client commands that do not return server requests,, but only change internal client state. None of such commands takes game time.

Synopsis

Meta commands

macroHumanTransition :: [KM] -> KeyMacroFrame -> [KeyMacroFrame] -> (KeyMacroFrame, [KeyMacroFrame]) Source #

Push a new macro frame to the stack whenever repeating a macro.

Local commands

chooseItemHuman :: MonadClientUI m => ActorId -> ItemDialogMode -> m MError Source #

Display items from a given container store and possibly let the user chose one.

psuitReq :: (MonadClient m, MonadClientUI m) => ActorId -> m (Either Text (ItemFull -> Either ReqFailure (Point, Bool))) Source #

On top of permittedProjectClient, it also checks legality of aiming at the target and projection range. It also modifies eps.

triggerSymbols :: [TriggerItem] -> [ContentSymbol ItemKind] Source #

>>> let trigger1 = HumanCmd.TriggerItem{tiverb="verb", tiobject="object", tisymbols=[toContentSymbol 'a', toContentSymbol 'b']}
>>> let trigger2 = HumanCmd.TriggerItem{tiverb="verb2", tiobject="object2", tisymbols=[toContentSymbol 'c']}
>>> triggerSymbols [trigger1, trigger2]
"abc"
>>> triggerSymbols []
""

pointmanCycleHuman :: MonadClientUI m => ActorId -> Direction -> m MError Source #

Switch current pointman to the previous in the whole dungeon, wrapping.

pointmanCycleLevelHuman :: MonadClientUI m => ActorId -> Direction -> m MError Source #

Switch current pointman to the next on the viewed level, if any, wrapping.

recordHuman :: MonadClientUI m => m () Source #

Starts and stops recording of macros.

allHistoryHuman :: forall m. MonadClientUI m => m () Source #

Commands specific to aiming

cancelHuman :: MonadClientUI m => m () Source #

End aiming mode, rejecting the current position, unless when on remote level, in which case, return to our level.

acceptHuman :: (MonadClient m, MonadClientUI m) => ActorId -> m () Source #

Accept the current crosshair position as target, ending aiming mode, if active.

detailCycleHuman :: MonadClientUI m => m () Source #

Cycle detail level of aiming mode descriptions, starting up.

moveXhairHuman :: MonadClientUI m => Vector -> Int -> m MError Source #

Move the xhair. Assumes aiming mode.

aimTgtHuman :: MonadClientUI m => m () Source #

Start aiming.

aimFloorHuman :: MonadClientUI m => m () Source #

Cycle aiming mode. Do not change position of the xhair, switch target to point at different things at that position.

aimAscendHuman :: MonadClientUI m => Int -> m MError Source #

Change the displayed level in aiming mode to (at most) k levels shallower. Enters aiming mode, if not already in one.

epsIncrHuman :: (MonadClient m, MonadClientUI m) => Direction -> m () Source #

Tweak the eps parameter of the aiming digital line.

Internal operations

endAiming :: (MonadClient m, MonadClientUI m) => ActorId -> m () Source #

End aiming mode, accepting the current position.

Operations both internal and used in unit tests

xhairLegalEps :: MonadClientUI m => ActorId -> m (Either Text Int) Source #

Check whether one is permitted to aim (for projecting) at a target. The check is stricter for actor targets, assuming the player simply wants to hit a single actor. In order to fine tune trick-shots, e.g., piercing many actors, other aiming modes should be used. Returns a different seps if needed to reach the target.

Note: Simple Perception check is not enough for the check, e.g., because the target actor can be obscured by a glass wall.