From de8052cef8a9f749cdb2312a4f5ae5f5a44cf1b8 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sun, 6 Oct 2019 12:50:29 -0400 Subject: Allow eating edible items Add menu support to the prompt system, and an "Eat" command that prompts for an item to eat and eats the item the character specifies, restoring an amount of hitpoints configurable via the item raw type. --- src/Xanthous/Command.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Xanthous/Command.hs') diff --git a/src/Xanthous/Command.hs b/src/Xanthous/Command.hs index 4bf0e2893908..f2f21160df75 100644 --- a/src/Xanthous/Command.hs +++ b/src/Xanthous/Command.hs @@ -16,6 +16,7 @@ data Command | PickUp | Open | Wait + | Eat -- | TODO replace with `:` commands | ToggleRevealAll @@ -27,6 +28,7 @@ commandFromKey (KChar (directionFromChar -> Just dir)) [] = Just $ Move dir commandFromKey (KChar 'p') [MCtrl] = Just PreviousMessage commandFromKey (KChar ',') [] = Just PickUp commandFromKey (KChar 'o') [] = Just Open +commandFromKey (KChar 'e') [] = Just Eat commandFromKey (KChar 'r') [MMeta] = Just ToggleRevealAll commandFromKey _ _ = Nothing -- cgit 1.4.1