Safe Haskell | None |
---|---|
Language | Haskell2010 |
Game.LambdaHack.Client.CommonClient
Description
Common client monad operations.
- getPerFid :: MonadClient m => LevelId -> m Perception
- aidTgtToPos :: MonadClient m => ActorId -> LevelId -> Maybe Target -> m (Maybe Point)
- aidTgtAims :: MonadClient m => ActorId -> LevelId -> Maybe Target -> m (Either Msg Int)
- makeLine :: MonadClient m => Bool -> Actor -> Point -> Int -> m (Maybe Int)
- partAidLeader :: MonadClient m => ActorId -> m Part
- partActorLeader :: MonadClient m => ActorId -> Actor -> m Part
- partPronounLeader :: MonadClient m => ActorId -> Actor -> m Part
- actorSkillsClient :: MonadClient m => ActorId -> m Skills
- updateItemSlot :: MonadClient m => CStore -> Maybe ActorId -> ItemId -> m SlotChar
- fullAssocsClient :: MonadClient m => ActorId -> [CStore] -> m [(ItemId, ItemFull)]
- activeItemsClient :: MonadClient m => ActorId -> m [ItemFull]
- itemToFullClient :: MonadClient m => m (ItemId -> ItemQuant -> ItemFull)
- pickWeaponClient :: MonadClient m => ActorId -> ActorId -> m (Maybe (RequestTimed AbMelee))
- sumOrganEqpClient :: MonadClient m => EqpSlot -> ActorId -> m Int
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.
actorSkillsClient :: MonadClient m => ActorId -> m Skills Source
updateItemSlot :: MonadClient m => CStore -> Maybe ActorId -> ItemId -> m SlotChar Source
fullAssocsClient :: MonadClient m => ActorId -> [CStore] -> m [(ItemId, ItemFull)] Source
activeItemsClient :: MonadClient m => ActorId -> m [ItemFull] Source
itemToFullClient :: MonadClient m => m (ItemId -> ItemQuant -> ItemFull) Source
pickWeaponClient :: MonadClient m => ActorId -> ActorId -> m (Maybe (RequestTimed AbMelee)) Source
sumOrganEqpClient :: MonadClient m => EqpSlot -> ActorId -> m Int Source