about summary refs log tree commit diff
path: root/users/grfn/xanthous/src/Xanthous/Command.hs
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2021-06-18T17·04-0400
committergrfn <grfn@gws.fyi>2021-06-18T17·51+0000
commit4d2402a64ec3ca28e87ebc264f2064f310ca68f5 (patch)
tree90e5c9e48a0da815d0370c7881e6332d9dc74d2d /users/grfn/xanthous/src/Xanthous/Command.hs
parentfb5bec8d952b57fe4afa0d842ee606cf4e548563 (diff)
feat(xanthous): Add an auto-rest command r/2675
Add a command that automatically rests (essentially just stepping the
game forwards) until the character's hitpoints are back to full.

Currently due to the time it takes for the character to heal this takes
a bit too long - my thought there is to make the per-step delay for
autocommands different depending on the specific autocommand.

Change-Id: I40378c29d3d9d19e9787af1f015bde65fd08868c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3221
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/grfn/xanthous/src/Xanthous/Command.hs')
-rw-r--r--users/grfn/xanthous/src/Xanthous/Command.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/users/grfn/xanthous/src/Xanthous/Command.hs b/users/grfn/xanthous/src/Xanthous/Command.hs
index 37025dd37ad2..1d0014d78792 100644
--- a/users/grfn/xanthous/src/Xanthous/Command.hs
+++ b/users/grfn/xanthous/src/Xanthous/Command.hs
@@ -27,6 +27,7 @@ data Command
   | Wield
   | GoUp
   | GoDown
+  | Rest
 
     -- | TODO replace with `:` commands
   | ToggleRevealAll
@@ -52,6 +53,7 @@ commandFromKey (KChar 'i') [] = Just ShowInventory
 commandFromKey (KChar 'w') [] = Just Wield
 commandFromKey (KChar '<') [] = Just GoUp
 commandFromKey (KChar '>') [] = Just GoDown
+commandFromKey (KChar 'R') [] = Just Rest
 
 -- DEBUG COMMANDS --
 commandFromKey (KChar 'r') [MMeta] = Just ToggleRevealAll