diff options
author | 2020-07-03 08:27:25 -0500 | |
---|---|---|
committer | 2020-07-03 08:27:25 -0500 | |
commit | c042ec3652503346a375933214b80da4771795c9 (patch) | |
tree | 1b320da92d287a393b90c9758cbe031f4ea1225b | |
parent | need to do better than this (diff) |
more helpful dialog
-rw-r--r-- | core/bin.lisp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/core/bin.lisp b/core/bin.lisp index 78da4a7..e3cb66e 100644 --- a/core/bin.lisp +++ b/core/bin.lisp @@ -297,8 +297,7 @@ You can also specify multiple directions, for example @code{(move :south :south) (ally (or null unsigned-byte type-specifier) wear (or null unsigned-byte type-specifier) inventory (or null unsigned-byte type-specifier) - enemy (or null unsigned-byte type-specifier) - prop (or null keyword)) + enemy (or null unsigned-byte type-specifier)) "lists stats about various items in various places. @var{INVENTORY} is the index of an item in your inventory. @var{WEAR} is the index of what you or your ally is wearing. @var{PROP} is a keyword that refers to the prop you're selecting. @var{ITEM} is the index of an item that a prop has and is used to print information about that prop. @var{ATTACK} is a keyword referring to the move you or your ally has when showing that move. @var{ALLY} is the index of an ally on your team when selecting @var{INVENTORY} or @var{MOVE}, don't set @var{ALLY} if you want to select yourself." (when (and ally (list-length-> ally (allies-of *game*))) (write-line "That ally doesn't exist") @@ -339,10 +338,19 @@ You can also specify multiple directions, for example @code{(move :south :south) (description-of (get-move attack selected-user)) (energy-cost-of (get-move attack selected-user)))) (when prop - (let ((j (getf (get-props-from-zone (position-of (player-of *game*))) prop))) - (when item - (let ((i (nth item (items-of j)))) - (describe-item i))))))) + (handle-user-input () + (*query-io* ((or (check-type prop (and (not null) symbol)) (null (getf (get-props-from-zone (position-of (player-of *game*))) prop))) + (prop) + :prompt-text "Enter a different prop, or exit and use (lst :props t) to get the list of props and try again" + :error-text "That prop doesn't exist") + ((null (nth item (items-of (getf (get-props-from-zone (position-of (player-of *game*))) + (the (and (not null) symbol) prop))))) + (item) + :prompt-text "Enter a different item" + :error-text "That item doesn't exist")) + (describe-item (nth (the unsigned-byte item) + (items-of (getf (get-props-from-zone (position-of (player-of *game*))) + (the (and (not null) symbol) prop))))))))) (defunassert yadfa-world:interact (prop &rest keys &key list take action describe-action describe &allow-other-keys) (action (or keyword null) describe-action (or keyword null) |