Safe Haskell | None |
---|
Item UI code with the Action
type and everything it depends on
that is not already in Action.hs and EffectAction.hs.
This file should not depend on Actions.hs.
TODO: Add an export list and document after it's rewritten according to #17.
- inventory :: ActionFrame ()
- getGroupItem :: [Item] -> Object -> [Char] -> String -> String -> Action Item
- applyGroupItem :: ActorId -> Verb -> Item -> Action ()
- playerApplyGroupItem :: Verb -> Object -> [Char] -> Action ()
- projectGroupItem :: ActorId -> Point -> Verb -> Item -> Action ()
- playerProjectGroupItem :: Verb -> Object -> [Char] -> ActionFrame ()
- playerProjectGI :: Verb -> Object -> [Char] -> ActionFrame ()
- targetMonster :: TgtMode -> ActionFrame ()
- targetFloor :: TgtMode -> ActionFrame ()
- setCursor :: TgtMode -> ActionFrame ()
- epsIncr :: Bool -> Action ()
- endTargeting :: Bool -> Action ()
- endTargetingMsg :: Action ()
- cancelCurrent :: ActionFrame () -> ActionFrame ()
- acceptCurrent :: ActionFrame () -> ActionFrame ()
- clearCurrent :: Action ()
- dropItem :: Action ()
- removeOnlyFromInventory :: ActorId -> Item -> Point -> Action ()
- removeFromInventory :: ActorId -> Item -> Point -> Action ()
- removeFromLoc :: Item -> Point -> Action Bool
- actorPickupItem :: ActorId -> Action ()
- pickupItem :: Action ()
- allObjectsName :: String
- getAnyItem :: String -> [Item] -> String -> Action Item
- data ItemDialogState
- getItem :: String -> (Item -> Bool) -> String -> [Item] -> String -> Action Item
Documentation
inventory :: ActionFrame ()Source
Display inventory
:: [Item] | all objects in question |
-> Object | name of the group |
-> [Char] | accepted item symbols |
-> String | prompt |
-> String | how to refer to the collection of objects |
-> Action Item |
Let the player choose any item with a given group name. Note that this does not guarantee the chosen item belongs to the group, as the player can override the choice.
playerProjectGroupItem :: Verb -> Object -> [Char] -> ActionFrame ()Source
playerProjectGI :: Verb -> Object -> [Char] -> ActionFrame ()Source
targetMonster :: TgtMode -> ActionFrame ()Source
Start the monster targeting mode. Cycle between monster targets.
targetFloor :: TgtMode -> ActionFrame ()Source
Start the floor targeting mode or reset the cursor location to the player.
setCursor :: TgtMode -> ActionFrame ()Source
Set, activate and display cursor information.
endTargeting :: Bool -> Action ()Source
End targeting mode, accepting the current location or not.
endTargetingMsg :: Action ()Source
cancelCurrent :: ActionFrame () -> ActionFrame ()Source
Cancel something, e.g., targeting mode, resetting the cursor to the position of the player. Chosen target is not invalidated.
acceptCurrent :: ActionFrame () -> ActionFrame ()Source
Accept something, e.g., targeting mode, keeping cursor where it was. Or perform the default action, if nothing needs accepting.
clearCurrent :: Action ()Source
Clear current messages, show the next screen if any.
removeFromInventory :: ActorId -> Item -> Point -> Action ()Source
Remove given item from an actor's inventory or floor. TODO: this is subtly wrong: if identical items are on the floor and in inventory, the floor one will be chosen, regardless of player intention. TODO: right now it ugly hacks (with the ploc) around removing items of dead heros/monsters. The subtle incorrectness helps here a lot, because items of dead heroes land on the floor, so we use them up in inventory, but remove them after use from the floor.
removeFromLoc :: Item -> Point -> Action BoolSource
Remove given item from the given location. Tell if successful.
actorPickupItem :: ActorId -> Action ()Source
pickupItem :: Action ()Source
:: String | prompt |
-> [Item] | all items in question |
-> String | how to refer to the collection of items |
-> Action Item |
Let the player choose any item from a list of items.