fix #H4407 - avoiding floor-food while blind

Accept the 'm' prefix for eat, offer, and apply.

Allows 'me' to eat from inventory without checking for floor food.
Primarily for use after blind character used 'm<dir>' to move
somewhere without touching a suspected cockatrice corpse there.

'm#offer' and 'ma<let>' accomplish similar floor-object-skipping
when offering a sacrifice or applying a tinning-kit.  (All three
commands share floorfood() to pick the item to use.)

Report suggested replacing pick-from-floor followed by pick-from-
invent with use of slash'em-style pick-from-invent with explicit
pick-from-floor choice in list of inventory letters "[abc or ,]"
(slash'em used period for 'here'; I've always liked comma better
since the action is to pick an item rather than a location).  I
implemented that for nethack a long time ago, but it was mixed in
with other stuff that wasn't ready for prime time and vanished
when I lost access to the VMS system I used to use).

Using 'm' prefix to skip part of a multi-part operation is a lot
simpler to implement but doesn't include an in-game reminder that
it is available.

Revised Guidebook.mn is tested, Guidebook.tex is not.
This commit is contained in:
PatR
2016-06-24 16:21:53 -07:00
parent 02db340cd6
commit eb1add8500
4 changed files with 48 additions and 6 deletions

View File

@@ -3445,11 +3445,17 @@ boolean initial;
Cmd.move_SW = Cmd.dirchars[7];
}
/* non-movement commands which accept 'm' prefix to request menu operation */
STATIC_OVL boolean
accept_menu_prefix(cmd_func)
int NDECL((*cmd_func));
{
if (cmd_func == dopickup || cmd_func == dotip
/* eat, #offer, and apply tinning-kit all use floorfood() to pick
an item on floor or in invent; 'm' skips picking from floor
(ie, inventory only) rather than request use of menu operation */
|| cmd_func == doeat || cmd_func == dosacrifice || cmd_func == doapply
/* 'm' prefix allowed for some extended commands */
|| cmd_func == doextcmd || cmd_func == doextlist)
return TRUE;
return FALSE;