'm' prefix for drinking and dipping

Allow the player to precede q/#quaff or M-d/#dip with the 'm' prefix
to skip asking about fountains, sinks, or pools if one of those
happens to be present, similar to how using it for e/#eat skips food
on the floor and goes straight to inventory.

If you use it and don't have any potions, you'll get "you don't have
anything to drink" or "you don't have anything to dip into", same as
when there is no suitable dungeon feature present combined with no
potions.  However, if an applicable dungeon feature is present and
you don't use the prefix but answer 'no' to drink from fountain,&c
and you don't have any potions, "else" will be inserted into the
message: "you don't have anything else to drink".

A big part of the diff is just a change in indentation level for
code that is now inside 'if (!iflags.menu_requested) {' ... '}'.
This commit is contained in:
PatR
2022-04-13 03:14:39 -07:00
parent 60c504dd40
commit feac8c8f68
7 changed files with 168 additions and 73 deletions

View File

@@ -583,7 +583,11 @@ enum getobj_callback_returns {
/* generally invalid - can't be used for this purpose. will give a "silly
* thing" message if the player tries to pick it, unless a more specific
* failure message is in getobj itself - e.g. "You cannot foo gold". */
GETOBJ_EXCLUDE = -2,
GETOBJ_EXCLUDE = -3,
/* invalid because it is not in inventory; used when the hands/self
* possibility is queried and the player passed up something on the
* floor before getobj. */
GETOBJ_EXCLUDE_NONINVENT = -2,
/* invalid because it is an inaccessible or unwanted piece of gear, but
* psuedo-valid for the purposes of allowing the player to select it and
* getobj to return it if there is a prompt instead of getting "silly