Safe Haskell | None |
---|---|
Language | Haskell2010 |
Helper functions for both inventory management and human commands.
Synopsis
- data FailError
- showFailError :: FailError -> Text
- type MError = Maybe FailError
- mergeMError :: MError -> MError -> MError
- type FailOrCmd a = Either FailError a
- failWith :: MonadClientUI m => Text -> m (FailOrCmd a)
- failSer :: MonadClientUI m => ReqFailure -> m (FailOrCmd a)
- failMsg :: MonadClientUI m => Text -> m MError
- weaveJust :: FailOrCmd a -> Either MError a
- memberCycle :: (MonadClient m, MonadClientUI m) => Bool -> Direction -> m MError
- memberCycleLevel :: (MonadClient m, MonadClientUI m) => Bool -> Direction -> m MError
- partyAfterLeader :: MonadClientUI m => ActorId -> m [(ActorId, Actor, ActorUI)]
- pickLeader :: (MonadClient m, MonadClientUI m) => Bool -> ActorId -> m Bool
- pickLeaderWithPointer :: (MonadClient m, MonadClientUI m) => m MError
- itemOverlay :: MonadClientUI m => SingleItemSlots -> LevelId -> ItemBag -> Bool -> m OKX
- skillsOverlay :: MonadClientUI m => ActorId -> m OKX
- placesFromState :: ContentData PlaceKind -> ClientOptions -> State -> EnumMap (ContentId PlaceKind) (EnumSet LevelId, Int, Int, Int)
- placesOverlay :: MonadClientUI m => m OKX
- describeMode :: MonadClientUI m => Bool -> ContentId ModeKind -> m (EnumMap DisplayFont Overlay)
- modesOverlay :: MonadClientUI m => m OKX
- pickNumber :: (MonadClient m, MonadClientUI m) => Bool -> Int -> m (Either MError Int)
- guardItemSize :: Actor -> State -> Int
- lookAtItems :: MonadClientUI m => Bool -> Point -> ActorId -> Maybe (Part, Bool) -> m (Text, Maybe Person)
- lookAtStash :: MonadClientUI m => LevelId -> Point -> m Text
- lookAtPosition :: MonadClientUI m => LevelId -> Point -> m [(MsgClassShow, Text)]
- displayItemLore :: (MonadClient m, MonadClientUI m) => ItemBag -> Int -> (ItemId -> ItemFull -> Int -> Text) -> Int -> SingleItemSlots -> m Bool
- displayItemLorePointedAt :: (MonadClient m, MonadClientUI m) => ItemBag -> Int -> (ItemId -> ItemFull -> Int -> Text) -> Int -> SingleItemSlots -> Bool -> m KM
- viewLoreItems :: (MonadClient m, MonadClientUI m) => String -> SingleItemSlots -> ItemBag -> Text -> (Int -> SingleItemSlots -> m Bool) -> Bool -> m KM
- cycleLore :: MonadClientUI m => [m KM] -> [m KM] -> m ()
- spoilsBlurb :: Text -> Int -> Int -> Text
- ppContainerWownW :: MonadClientUI m => (ActorId -> m Part) -> Bool -> Container -> m [Part]
- nxtGameMode :: COps -> Int -> (ContentId ModeKind, ModeKind)
- lookAtTile :: MonadClientUI m => Bool -> Point -> ActorId -> LevelId -> Maybe Person -> m (Text, Text, [(Int, Part)])
- lookAtActors :: MonadClientUI m => Point -> LevelId -> m (Text, Maybe (Part, Bool), Text)
- guardItemVerbs :: Actor -> State -> [Part]
Documentation
Message describing the cause of failure of human command.
showFailError :: FailError -> Text Source #
failSer :: MonadClientUI m => ReqFailure -> m (FailOrCmd a) Source #
memberCycle :: (MonadClient m, MonadClientUI m) => Bool -> Direction -> m MError Source #
Switches current member to the previous in the whole dungeon, wrapping.
memberCycleLevel :: (MonadClient m, MonadClientUI m) => Bool -> Direction -> m MError Source #
Switches current member to the next on the level, if any, wrapping.
partyAfterLeader :: MonadClientUI m => ActorId -> m [(ActorId, Actor, ActorUI)] Source #
pickLeader :: (MonadClient m, MonadClientUI m) => Bool -> ActorId -> m Bool Source #
Select a faction leader. False, if nothing to do.
pickLeaderWithPointer :: (MonadClient m, MonadClientUI m) => m MError Source #
itemOverlay :: MonadClientUI m => SingleItemSlots -> LevelId -> ItemBag -> Bool -> m OKX Source #
skillsOverlay :: MonadClientUI m => ActorId -> m OKX Source #
placesFromState :: ContentData PlaceKind -> ClientOptions -> State -> EnumMap (ContentId PlaceKind) (EnumSet LevelId, Int, Int, Int) Source #
placesOverlay :: MonadClientUI m => m OKX Source #
describeMode :: MonadClientUI m => Bool -> ContentId ModeKind -> m (EnumMap DisplayFont Overlay) Source #
modesOverlay :: MonadClientUI m => m OKX Source #
pickNumber :: (MonadClient m, MonadClientUI m) => Bool -> Int -> m (Either MError Int) Source #
:: MonadClientUI m | |
=> Bool | can be seen right now? |
-> Point | position to describe |
-> ActorId | the actor that looks |
-> Maybe (Part, Bool) | pronoun for the big actor at the position, if any, and whether the big actor is alive |
-> m (Text, Maybe Person) |
Produces a textual description of items at a position.
lookAtStash :: MonadClientUI m => LevelId -> Point -> m Text Source #
lookAtPosition :: MonadClientUI m => LevelId -> Point -> m [(MsgClassShow, Text)] Source #
Produces a textual description of everything at the requested level's position.
displayItemLore :: (MonadClient m, MonadClientUI m) => ItemBag -> Int -> (ItemId -> ItemFull -> Int -> Text) -> Int -> SingleItemSlots -> m Bool Source #
displayItemLorePointedAt :: (MonadClient m, MonadClientUI m) => ItemBag -> Int -> (ItemId -> ItemFull -> Int -> Text) -> Int -> SingleItemSlots -> Bool -> m KM Source #
viewLoreItems :: (MonadClient m, MonadClientUI m) => String -> SingleItemSlots -> ItemBag -> Text -> (Int -> SingleItemSlots -> m Bool) -> Bool -> m KM Source #
ppContainerWownW :: MonadClientUI m => (ActorId -> m Part) -> Bool -> Container -> m [Part] Source #
Internal operations
:: MonadClientUI m | |
=> Bool | can be seen right now? |
-> Point | position to describe |
-> ActorId | the actor that looks |
-> LevelId | level the position is at |
-> Maybe Person | grammatical person of the item(s), if any |
-> m (Text, Text, [(Int, Part)]) |
Produces a textual description of the tile at a position.