paranoid_confirmation [expanded user patch] (trunk only; 1 of 2)
[Long writeup committed with flag.h and options.c only.]
This is a reworking of a user contributed patch available in Pasi
Kallinen's NetHack Patch Database at http://bilious.homelinux.org under
the name "Paranoid_Quit". It was created by David Damerell and extended
by several others, and I haven't attempted to preserve attribution.
Their patch added three new boolean run-time options (this one
doesn't; details below):
paranoid_quit: if true, change the "really quit?" prompt to require an
answer of yes rather than just y to quit, presumeably for players who
type faster than they read and think (been there, done that...). It
also applies to the "do you want to enter explore mode?" prompt. The
changed prompt shows yes and no rather than yn as possible answers.
After having used it a few times, I find it easily noticeable that
"yes"<return> is expected instead of just single keystroke 'y', and
if you mess up somehow you can just reissue the #quit or X command
with no harm done. (And the default setting is off; the game still
issues the original yn prompt.)
paranoid_hit: if true, make a similar change for the "really attack <the
peaceful monster>?" prompt. Definitely helpful if you bump into a
monster while in the midst of using 'y' to move diagonally upper left.
Note that this just changes the expected/required answer to an existing
prompt; it doesn't change interaction between the hero and monsters.
paranoid_remove: if true, the 'R' and 'T' commands will prompt the player
to select an appropriate item from inventory even when there's only one
applicable item (instead of simply removing or taking off that only
item). Helpful if you think you've got more than one thing on and
intend to take off something other than the last one (which might be a
ring of levitation keeping you from dropping into lava or a blindfold
and you're trying to play the whole game blinded).
Their patch also made two other changes which weren't controllable via
options: when dipping, after picking what to dip, mention it in the
second prompt for what to dip into; and require yes instead of y at the
wizard mode "save bones?" prompt. We've had the enhanced dipping prompt
for a while, and "unknown" installed a fix-up (which wasn't needed with
their version) for it recently. I've left our bones prompt alone, the
original yn query. Anyone who saves bones by accident can remove them,
if not externally they by using wizard mode to revisit the same dungeon
depth, load the bones, and unlink them.
#####
That's a summary of the contributed patch. Now for the implemented
one.... Instead of separate booleans, this adds a single compound option
called "paranoid_confirmation" that takes a string argument of space
separated words: "quit die attack pray Remove". And it puts the actual
yes vs y querying into a new routine instead of duplicating it at each
affected prompting location.
paranoid_confirm:quit - as above, if true then require yes instead of y
to answer the "really quit?" and "do you want to enter explore mode?"
prompts. Can also be supplied as paranoid_confirm:explore or even
"quit explore" but that's just redundant; it's a single flag which
controls prompting for both game-ending or game-altering commands.
paranoid_confirm:die - applicable only for explore and wizard modes but
visible/settable during option viewing/changing in normal play. If
true then require yes instead of y at the "die?" prompt. This wasn't
part of their original patch, but should have been since the effect
of accidental y is just as drastic as unintentionally quitting.
paranoid_confirm:attack - as above, yes vs y for "really attack <the
peaceful monster?". Can also be supplied as paranoid_confirm:hit.
paranoid_confirm:pray - supersedes the existing prayconfirm boolean.
That option is still accepted and honored duing config file processing,
but option viewing/changing with 'O' only handles the new variant.
This does not control "yes" vs 'y', but rather whether there's a prompt
first or prayer simply starts. When used, the prompt itself is the
same yn one already being asked with prayconfirm. Presumably config
file support for prayconfirm will go away in some future version.
Unlike the other paranoid settings, this one defaults to 'on' in order
to match the 3.3.0 through 3.4.3 behavior controlled by prayconfirm,
whose default was on (but maybe should have been off...).
paranoid_confirm:Remove - as above, causes the 'R' and 'T' commands to
use a "what do you want to remove?" or "what do you want to takeoff?"
inventory selection prompt even when only one accessory or piece of
armor is worn. Player can pick the inventory letter and remove/takeoff
the item, use ? or * to see what the candidate item is, or cancel with
ESC. Can be supplied as paranoid_confirm:takeoff or "remove takeoff",
but like with "quit explore", a single flag controls the behavior of
both 'R' and 'T'.
Option file processing accepts two other settings, paranoid_confirm:none
and paranoid_confirm:all, but those are not available (nor needed) when
using the 'O' command. "none" is useful because it's the value shown to
the player by 'O' when none of the paranoia flags are set, and it's a
way to turn off paranoid_confirm:pray without turning on any of the other
choices. "all" probably isn't very useful but was trivial to tack on.
This is an example of the menu that 'O' puts up after picking option
paranoid_confirmation from the main list. I've shifted everything left
to reduce whitespace here; it appears on the right side of the screen for
tty menuing.
Actions requiring extra confirmation:
q - yes vs y to quit or to enter explore mode
d - yes vs y to die (explore mode or debug mode)
a - yes vs y to attack a peaceful monster
p + y to pray (supersedes old "prayconfirm" option)
R - always pick from inventory for Remove and Takeoff
(end)
Currently set paranoia features are marked as preselected and can be
toggled off along with toggling any others on as desired. I've just
realized that this menu relies on showing entries marked via preselection
rather than explicitly annotating each one as [on] or [off]; that seemed
perfectly natural during testing so I think I'll leave it this way, at
least for the time being.