overview disclosure (trunk only)

Add 'o' to "i a v g c" disclosure set, to display final dungeon
overview at end of game.  It lists all levels visited rather than just
those that #overview considers to be interesting, but it doesn't reveal
any undiscovered aspects of those levels except for the presence of bones.
(I think revealing shops and altars and such would be worthwhile, but the
data for that isn't handy at the time.)  If the game ends due to death,
the bones section of the current level will have "you, <reason you died>"
(before any real bones entries for that level).  That occurs before bones
file creation so it doesn't give away whether bones are being saved.

     end.c includes some unrelated lint cleanup.

     Guidebook.{mn,tex} updates the section for autopickup_exceptions as
well as for disclose.  It had some odd looking indentation due to various
explicit paragraph breaks.  I took "experimental" out of its description
since it was moved out of the experimental section of config.h long ago.
The revised Guidebook.tex is untested.
This commit is contained in:
nethack.rankin
2012-04-09 02:56:37 +00:00
parent 921c056efc
commit 6218a0eee2
10 changed files with 345 additions and 284 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ Compound options which can be set during the game are:
boulder override the default boulder symbol with another default: [`] boulder override the default boulder symbol with another default: [`]
disclose the types of information you want offered at the end of the disclose the types of information you want offered at the end of the
game [ni na nv ng nc] game [ni na nv ng nc no]
fruit the name of a fruit you enjoy eating [slime mold] fruit the name of a fruit you enjoy eating [slime mold]
(basically a whimsy which NetHack uses from time to time). (basically a whimsy which NetHack uses from time to time).
menustyle user interface for selection of multiple objects: menustyle user interface for selection of multiple objects:
+54 -43
View File
@@ -5,7 +5,7 @@
.ds vr "NetHack 3.5 .ds vr "NetHack 3.5
.ds f0 "\*(vr .ds f0 "\*(vr
.ds f1 .ds f1
.ds f2 "September 14, 2011 .ds f2 "April 7, 2012
.\" labeled paragraph start (should be part of tmac.n, but I don't want to .\" labeled paragraph start (should be part of tmac.n, but I don't want to
.\" make changes to that file) .\" make changes to that file)
.\" .PS word .\" .PS word
@@ -1935,42 +1935,49 @@ new players if it detects some anticipated mistakes (default on).
Have user confirm attacks on pets, shopkeepers, and other Have user confirm attacks on pets, shopkeepers, and other
peaceable creatures (default on). peaceable creatures (default on).
.lp disclose .lp disclose
Controls options for disclosing various information when the game ends (defaults Controls what information the program reveals when the game ends.
to all possibilities being disclosed). Value is a space separated list of prompting/category pairs
(default is `\fBni na nv ng nc no\fP',
prompt with default response of `\fBn\fP' for each candidate).
The possibilities are: The possibilities are:
.sd .sd
.si .si
i - disclose your inventory. \fBi\fP - disclose your inventory;
a - disclose your attributes. \fBa\fP - disclose your attributes;
v - summarize monsters that have been vanquished. \fBv\fP - summarize monsters that have been vanquished;
g - list monster species that have been genocided. \fBg\fP - list monster species that have been genocided;
c - display your conduct. \fBc\fP - display your conduct;
\fBo\fP - display dungeon overview.
.ei .ei
.ed .ed
Each disclosure possibility can optionally be preceded by a prefix which Each disclosure possibility can optionally be preceded by a prefix which
let you refine how it behaves. Here are the valid prefixes: lets you refine how it behaves. Here are the valid prefixes:
.sd .sd
.si .si
y - prompt you and default to yes on the prompt. \fBy\fP - prompt you and default to yes on the prompt;
n - prompt you and default to no on the prompt. \fBn\fP - prompt you and default to no on the prompt;
+ - disclose it without prompting. \fB+\fP - disclose it without prompting;
- - do not disclose it and do not prompt. \fB-\fP - do not disclose it and do not prompt.
.ei .ei
.ed .ed
(ex. ``disclose:yi na +v -g -c'') Omitted categories are implicitly added with `n' prefix.
Specified categories with omitted prefix implicitly use `+' prefix.
Order of the disclosure categories does not matter, program display for
end-of-game disclosure follows a set sequence.
.lp ""
(ex. ``disclose:yi na +v -g o'')
The example sets The example sets
.op inventory \fBinventory\fP to \fIprompt\fP and default to \fIyes\fP,
to prompt and default to yes, \fBattributes\fP to \fIprompt\fP and default to \fIno\fP,
.op attributes \fBvanquished\fP to \fIdisclose without prompting\fP,
to prompt and default to no, \fBgenocided\fP to \fInot disclose\fP and \fInot prompt\fP,
.op vanquished \fBconduct\fP to implicitly \fIprompt\fP and default to \fIno\fP, and
to disclose without prompting, \fBoverview\fP to \fIdisclose without prompting\fP.
.op genocided .lp ""
to not disclose and not to prompt,
.op conduct
to not disclose and not to prompt.
Note that the vanquished monsters list includes all monsters killed by Note that the vanquished monsters list includes all monsters killed by
traps and each other as well as by you. traps and each other as well as by you.
And the dungeon overview shows all levels you had visited but does not
reveal things about them that you hadn't discovered.
.lp dogname .lp dogname
Name your starting dog (ex. ``dogname:Fang''). Name your starting dog (ex. ``dogname:Fang'').
Cannot be set with the `O' command. Cannot be set with the `O' command.
@@ -2094,10 +2101,10 @@ Allows you to change the way recalled messages are displayed.
The possible values are: The possible values are:
.sd .sd
.si .si
s - single message (default; only choice prior to 3.4.0) \fBs\fP - single message (default; only choice prior to 3.4.0)
c - combination, two messages as `single', then as `full' \fBc\fP - combination, two messages as `single', then as `full'
f - full window, oldest message first \fBf\fP - full window, oldest message first
r - full window reversed, newest message first \fBr\fP - full window reversed, newest message first
.ei .ei
.ed .ed
For backward compatibility, no value needs to be specified (which For backward compatibility, no value needs to be specified (which
@@ -2511,7 +2518,7 @@ Cannot be set with the `O' command.
.hn 2 .hn 2
Configuring autopickup exceptions Configuring autopickup exceptions
.pg .pg
There is an experimental compile time option called AUTOPICKUP_EXCEPTIONS. There is a compile time option called AUTOPICKUP_EXCEPTIONS.
If your copy of the game was built with that option defined, you can If your copy of the game was built with that option defined, you can
further refine the behavior of the further refine the behavior of the
.op autopickup .op autopickup
@@ -2533,28 +2540,30 @@ The
option should be followed by a string of 1-80 characters to be used as a option should be followed by a string of 1-80 characters to be used as a
pattern to match against the singular form of the description of an pattern to match against the singular form of the description of an
object at your location. object at your location.
.pg .lp ""
You may use the following special characters in a pattern: You may use the following special characters in a pattern:
.sd .sd
.si .si
*--- matches 0 or more characters. \fB*\fP - matches zero or more characters;
?--- matches any single character. \fB?\fP - matches any single character.
.ei .ei
.ed .ed
.pg
In addition, some characters are treated specially if they occur as the first In addition, some characters are treated specially if they occur as the first
character in the string pattern, specifically: character in the pattern, specifically:
.sd .sd
.si .si
< - always pickup an object that matches the pattern that follows. \fB<\fP - always pickup an object that matches rest of pattern;
> - never pickup an object that matches the pattern that follows. \fB>\fP - never pickup an object that matches rest of pattern.
.ei .ei
.ed .ed
.pg A `never pickup' rule takes precedence over an `always pickup' rule if
Can be set with the `O' command, but the setting is not preserved both match.
across saves and restores. .lp ""
.pg Exceptions can be set with the `\fBO\fP' command, but ones set that way will
Here's a couple of examples of autopickup_exceptions: not be preserved across saves and restores.
.\" end of ``.lp autopickup_exception'' entry; continue enclosing page...
.\" use .lp "text" to make an unindented paragraph ("text" should be short)
.lp "Here are some examples:"
.sd .sd
.si .si
autopickup_exception="<*arrow" autopickup_exception="<*arrow"
@@ -2562,10 +2571,12 @@ autopickup_exception=">*corpse"
autopickup_exception=">* cursed*" autopickup_exception=">* cursed*"
.ei .ei
.ed .ed
.\" (this paragraph would look better unindented but can't use .lp hack...)
.pg
The first example above will result in autopickup of any type of arrow. The first example above will result in autopickup of any type of arrow.
The second example results in the exclusion of any corpse from autopickup. The second example results in the exclusion of any corpse from autopickup.
The last example results in the exclusion of items known to be cursed from autopickup. The last example results in the exclusion of items known to be cursed from
A `never pickup' rule takes precedence over an `always pickup' rule if both match. autopickup.
.hn 2 .hn 2
Configuring User Sounds Configuring User Sounds
.pg .pg
+49 -34
View File
@@ -33,7 +33,7 @@
\begin{document} \begin{document}
% %
% input file: guidebook.mn % input file: guidebook.mn
% $Revision: 1.119 $ $Date: 2011/12/05 09:35:59 $ % $Revision: 1.120 $ $Date: 2011/12/05 09:38:58 $
% %
%.ds h0 " %.ds h0 "
%.ds h1 %.ds h2 \% %.ds h1 %.ds h2 \%
@@ -46,7 +46,7 @@
%.au %.au
\author{Eric S. Raymond\\ \author{Eric S. Raymond\\
(Extensively edited and expanded for 3.5)} (Extensively edited and expanded for 3.5)}
\date{September 14, 2011} \date{April 7, 2012}
\maketitle \maketitle
@@ -2363,40 +2363,50 @@ Have user confirm attacks on pets, shopkeepers, and other
peaceable creatures (default on). peaceable creatures (default on).
%.lp %.lp
\item[\ib{disclose}] \item[\ib{disclose}]
Controls options for disclosing various information when the game ends (defaults Controls what information the program reveals when the game ends.
to all possibilities being disclosed). Value is a space separated list of prompting/category pairs
(default is `{\tt ni na nv ng nc no}',
prompt with default response of `{\tt n}' for each candidate).
The possibilities are: The possibilities are:
%.sd %.sd
%.si %.si
{\tt i} --- disclose your inventory.\\ {\tt i} --- disclose your inventory;\\
{\tt a} --- disclose your attributes.\\ {\tt a} --- disclose your attributes;\\
{\tt v} --- summarize monsters that have been vanquished.\\ {\tt v} --- summarize monsters that have been vanquished;\\
{\tt g} --- list monster species that have been genocided.\\ {\tt g} --- list monster species that have been genocided;\\
{\tt c} --- display your conduct. {\tt c} --- display your conduct;\\
{\tt o} --- display dungeon overview.
%.ei %.ei
%.ed %.ed
Each disclosure possibility can optionally be preceded by a prefix which Each disclosure possibility can optionally be preceded by a prefix which
let you refine how it behaves. Here are the valid prefixes: lets you refine how it behaves. Here are the valid prefixes:
%.sd %.sd
%.si %.si
{\tt y} --- prompt you and default to yes on the prompt.\\ {\tt y} --- prompt you and default to yes on the prompt;\\
{\tt n} --- prompt you and default to no on the prompt.\\ {\tt n} --- prompt you and default to no on the prompt;\\
{\tt +} --- disclose it without prompting.\\ {\tt +} --- disclose it without prompting;\\
{\tt -} --- do not disclose it and do not prompt. {\tt -} --- do not disclose it and do not prompt.
%.ei %.ei
%.ed %.ed
(ex.\ ``{\tt disclose:yi na +v -g -c}'') %.lp ""
The example sets {\it inventory\/} to {\it prompt\/} and default to {\it yes\/}, (ex.\ ``{\tt disclose:yi na +v -g o}'')
{\it attributes\/} to {\it prompt\/} and default to {\it no\/}, The example sets
{\it vanquished\/} to {\it disclose without prompting\/}, {\tt inventory} to {\it prompt\/} and default to {\it yes\/},
{\it genocided\/} to {\it not disclose\/} and not to {\it prompt\/}, and {\tt attributes} to {\it prompt\/} and default to {\it no\/},
{\it conduct\/} to {\it not disclose\/} and not to {\it prompt\/}. {\tt vanquished} to {\it disclose without prompting\/},
{\tt genocided} to {\it not disclose\/} and {\it not prompt\/},
{\tt conduct} to implicitly {\it prompt\/} and default to {\it no\/},
{\tt overview} to {\it disclose without prompting\/}.
%.lp ""
Note that the vanquished monsters list includes all monsters killed by Note that the vanquished monsters list includes all monsters killed by
traps and each other as well as by you. traps and each other as well as by you.
And the dungeon overview shows all levels you had visited but does not
reveal things about them that you hadn't discovered.
%.lp %.lp
\item[\ib{dogname}] \item[\ib{dogname}]
Name your starting dog (ex.\ ``{\tt dogname:Fang}''). Name your starting dog (ex.\ ``{\tt dogname:Fang}'').
@@ -3064,7 +3074,7 @@ Cannot be set with the `{\tt O}' command.
\subsection*{Configuring autopickup exceptions} \subsection*{Configuring autopickup exceptions}
%.pg %.pg
There is an experimental compile time option called AUTOPICKUP_EXCEPTIONS. There is a compile time option called AUTOPICKUP_EXCEPTIONS.
If your copy of the game was built with that option defined, you can If your copy of the game was built with that option defined, you can
further refine the behavior of the ``{\tt autopickup}'' option beyond further refine the behavior of the ``{\tt autopickup}'' option beyond
what is available through the ``{\tt pickup\_types}'' option. what is available through the ``{\tt pickup\_types}'' option.
@@ -3082,40 +3092,45 @@ The {\it autopickup\_exception\/} option should be followed by a string of 1--80
characters to be used as a pattern to match against the singular form characters to be used as a pattern to match against the singular form
of the description of an object at your location. of the description of an object at your location.
%.pg %.lp ""
You may use the following special characters in a pattern: You may use the following special characters in a pattern:
\begin{verbatim} %.sd .si
*--- matches 0 or more characters. {\tt *} --- matches zero or more characters;\\
?--- matches any single character. {\tt ?} --- matches any single character.
\end{verbatim} %.ei .ed
In addition, some characters are treated specially if they occur as the first In addition, some characters are treated specially if they occur as the first
character in the specified string pattern, specifically: character in the pattern, specifically:
%.sd %.sd
%.si %.si
{\tt <} --- always pickup an object that matches the pattern that follows.\\ {\tt <} --- always pickup an object that matches rest of pattern;\\
{\tt >} --- never pickup an object that matches the pattern that follows. {\tt >} --- never pickup an object that matches rest of pattern.
%.ei %.ei
%.ed %.ed
Can be set with the `{\tt O}' command, but the setting is not preserved A `never pickup' rule takes precedence over an `always pickup' rule if
across saves and restores. both match.
%.lp ""
Exceptions can be set with the `{\tt O}' command, but ones set that way will
not be preserved across saves and restores.
\elist \elist
%.pg %.lp "Here are some examples:"
Here's a couple of examples of autopickup\_exceptions: Here are some examples:
\begin{verbatim} \begin{verbatim}
autopickup_exception="<*arrow" autopickup_exception="<*arrow"
autopickup_exception=">*corpse" autopickup_exception=">*corpse"
autopickup_exception=">* cursed*" autopickup_exception=">* cursed*"
\end{verbatim} \end{verbatim}
%.pg
The first example above will result in autopickup of any type of arrow. The first example above will result in autopickup of any type of arrow.
The second example results in the exclusion of any corpse from autopickup. The second example results in the exclusion of any corpse from autopickup.
The last example results in the exclusion of items known to be cursed from autopickup. The last example results in the exclusion of items known to be cursed from
A `never pickup' rule takes precedence over an `always pickup' rule if both match. autopickup.
%.lp %.lp
%.hn 2 %.hn 2
+1
View File
@@ -587,6 +587,7 @@ E schar FDECL(print_dungeon, (BOOLEAN_P,schar *,xchar *));
#ifdef DUNGEON_OVERVIEW #ifdef DUNGEON_OVERVIEW
E int NDECL(donamelevel); E int NDECL(donamelevel);
E int NDECL(dooverview); E int NDECL(dooverview);
E void FDECL(show_overview, (int,int));
E void FDECL(forget_mapseen, (int)); E void FDECL(forget_mapseen, (int));
E void FDECL(init_mapseen, (d_level *)); E void FDECL(init_mapseen, (d_level *));
E void NDECL(recalc_mapseen); E void NDECL(recalc_mapseen);
+3 -3
View File
@@ -68,13 +68,13 @@ struct flag {
int pile_limit; /* controls feedback when walking over objects */ int pile_limit; /* controls feedback when walking over objects */
char inv_order[MAXOCLASSES]; char inv_order[MAXOCLASSES];
char pickup_types[MAXOCLASSES]; char pickup_types[MAXOCLASSES];
#define NUM_DISCLOSURE_OPTIONS 5 #define NUM_DISCLOSURE_OPTIONS 6 /* i,a,v,g,c,o (decl.c) */
#define DISCLOSE_PROMPT_DEFAULT_YES 'y' #define DISCLOSE_PROMPT_DEFAULT_YES 'y'
#define DISCLOSE_PROMPT_DEFAULT_NO 'n' #define DISCLOSE_PROMPT_DEFAULT_NO 'n'
#define DISCLOSE_YES_WITHOUT_PROMPT '+' #define DISCLOSE_YES_WITHOUT_PROMPT '+'
#define DISCLOSE_NO_WITHOUT_PROMPT '-' #define DISCLOSE_NO_WITHOUT_PROMPT '-'
char end_disclose[NUM_DISCLOSURE_OPTIONS + 1]; /* disclose various info char end_disclose[NUM_DISCLOSURE_OPTIONS + 1]; /* disclose various
upon exit */ info upon exit */
char menu_style; /* User interface style setting */ char menu_style; /* User interface style setting */
boolean made_fruit; /* don't easily let the user overflow the number of fruits */ boolean made_fruit; /* don't easily let the user overflow the number of fruits */
+1 -1
View File
@@ -13,7 +13,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones * Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files. * and save files.
*/ */
#define EDITLEVEL 53 #define EDITLEVEL 54
#define COPYRIGHT_BANNER_A \ #define COPYRIGHT_BANNER_A \
"NetHack, Copyright 1985-2012" "NetHack, Copyright 1985-2012"
+1 -1
View File
@@ -71,7 +71,7 @@ const char ynaqchars[] = "ynaq";
const char ynNaqchars[] = "yn#aq"; const char ynNaqchars[] = "yn#aq";
NEARDATA long yn_number = 0L; NEARDATA long yn_number = 0L;
const char disclosure_options[] = "iavgc"; const char disclosure_options[] = "iavgco";
#if defined(MICRO) || defined(WIN32) #if defined(MICRO) || defined(WIN32)
char hackdir[PATHLEN]; /* where rumors, help, record are */ char hackdir[PATHLEN]; /* where rumors, help, record are */
+38 -15
View File
@@ -63,7 +63,7 @@ mapseen *mapseenchn = (struct mapseen *)0;
STATIC_DCL mapseen *FDECL(load_mapseen, (int)); STATIC_DCL mapseen *FDECL(load_mapseen, (int));
STATIC_DCL void FDECL(save_mapseen, (int, mapseen *)); STATIC_DCL void FDECL(save_mapseen, (int, mapseen *));
STATIC_DCL mapseen *FDECL(find_mapseen, (d_level *)); STATIC_DCL mapseen *FDECL(find_mapseen, (d_level *));
STATIC_DCL void FDECL(print_mapseen, (winid,mapseen *,BOOLEAN_P)); STATIC_DCL void FDECL(print_mapseen, (winid,mapseen *,int,int,BOOLEAN_P));
STATIC_DCL boolean FDECL(interest_mapseen, (mapseen *)); STATIC_DCL boolean FDECL(interest_mapseen, (mapseen *));
STATIC_DCL const char *FDECL(seen_string, (XCHAR_P,const char *)); STATIC_DCL const char *FDECL(seen_string, (XCHAR_P,const char *));
STATIC_DCL const char *FDECL(br_string2, (branch *)); STATIC_DCL const char *FDECL(br_string2, (branch *));
@@ -2325,6 +2325,16 @@ int roomno;
int int
dooverview() dooverview()
{
show_overview(0, 0);
return 0;
}
void
show_overview(why, reason)
int why; /* 0 => #overview command,
1 or 2 => end of game disclosure (1: alive, 2: dead) */
int reason; /* how hero died; used when disclosing end-of-game level */
{ {
winid win; winid win;
mapseen *mptr; mapseen *mptr;
@@ -2336,15 +2346,14 @@ dooverview()
win = create_nhwindow(NHW_MENU); win = create_nhwindow(NHW_MENU);
for (mptr = mapseenchn; mptr; mptr = mptr->next) { for (mptr = mapseenchn; mptr; mptr = mptr->next) {
/* only print out info for a level or a dungeon if interest */ /* only print out info for a level or a dungeon if interest */
if (interest_mapseen(mptr)) { if (why > 0 || interest_mapseen(mptr)) {
print_mapseen(win, mptr, (boolean)(mptr->lev.dnum != lastdun)); print_mapseen(win, mptr, why, reason,
(boolean)(mptr->lev.dnum != lastdun));
lastdun = mptr->lev.dnum; lastdun = mptr->lev.dnum;
} }
} }
display_nhwindow(win, TRUE); display_nhwindow(win, TRUE);
destroy_nhwindow(win); destroy_nhwindow(win);
return 0;
} }
STATIC_OVL const char * STATIC_OVL const char *
@@ -2452,13 +2461,16 @@ char *outbuf;
} while (0) } while (0)
STATIC_OVL void STATIC_OVL void
print_mapseen(win, mptr, printdun) print_mapseen(win, mptr, final, reason, printdun)
winid win; winid win;
mapseen *mptr; mapseen *mptr;
int final; /* 0: not final; 1: game over, alive; 2: game over, dead */
int reason; /* cause of death; only used if final==2 and mptr->lev==u.uz */
boolean printdun; boolean printdun;
{ {
char buf[BUFSZ]; char buf[BUFSZ], tmpbuf[BUFSZ];
int i, depthstart; int i, depthstart;
boolean died_here = (final == 2 && on_level(&u.uz, &mptr->lev));
/* Damnable special cases */ /* Damnable special cases */
/* The quest and knox should appear to be level 1 to match /* The quest and knox should appear to be level 1 to match
@@ -2518,8 +2530,8 @@ boolean printdun;
if (mptr->custom) if (mptr->custom)
Sprintf(eos(buf), " (%s)", mptr->custom); Sprintf(eos(buf), " (%s)", mptr->custom);
if (on_level(&u.uz, &mptr->lev)) if (on_level(&u.uz, &mptr->lev))
Strcat(buf, " <- You are here"); Sprintf(eos(buf), " <- You %s here", !final ? "are" : "were");
putstr(win, ATR_BOLD, buf); putstr(win, !final ? ATR_BOLD : 0, buf);
if (mptr->flags.forgot) return; if (mptr->flags.forgot) return;
@@ -2586,8 +2598,6 @@ boolean printdun;
indicates that the fort's entrance has been seen (or mapped) */ indicates that the fort's entrance has been seen (or mapped) */
Sprintf(buf, "%sFort Ludios.", PREFIX); Sprintf(buf, "%sFort Ludios.", PREFIX);
} else if (mptr->flags.castle) { } else if (mptr->flags.castle) {
char tmpbuf[BUFSZ];
Sprintf(buf, "%sThe castle%s.", PREFIX, tunesuffix(mptr, tmpbuf)); Sprintf(buf, "%sThe castle%s.", PREFIX, tunesuffix(mptr, tmpbuf));
} else if (mptr->flags.valley) { } else if (mptr->flags.valley) {
Sprintf(buf, "%sValley of the Dead.", PREFIX); Sprintf(buf, "%sValley of the Dead.", PREFIX);
@@ -2612,17 +2622,30 @@ boolean printdun;
} }
/* maybe print out bones details */ /* maybe print out bones details */
if (mptr->final_resting_place) { if (mptr->final_resting_place || final) {
struct cemetery *bp; struct cemetery *bp;
int kncnt = 0; int kncnt = !died_here ? 0 : 1;
for (bp = mptr->final_resting_place; bp; bp = bp->next) for (bp = mptr->final_resting_place; bp; bp = bp->next)
if (bp->bonesknown || wizard) ++kncnt; if (bp->bonesknown || wizard || final) ++kncnt;
if (kncnt) { if (kncnt) {
Sprintf(buf, "%s%s", PREFIX, "Final resting place for"); Sprintf(buf, "%s%s", PREFIX, "Final resting place for");
putstr(win, 0, buf); putstr(win, 0, buf);
if (died_here) {
/* disclosure occurs before bones creation, so listing dead
hero here doesn't give away whether bones are produced */
formatkiller(tmpbuf, sizeof tmpbuf, reason);
/* rephrase a few death reasons to work with "you" */
(void) strsubst(tmpbuf, " himself", " yourself");
(void) strsubst(tmpbuf, " herself", " yourself");
(void) strsubst(tmpbuf, " his ", " your ");
(void) strsubst(tmpbuf, " her ", " your ");
Sprintf(buf, "%s%syou, %s%c", PREFIX, TAB,
tmpbuf, --kncnt ? ',' : '.');
putstr(win, 0, buf);
}
for (bp = mptr->final_resting_place; bp; bp = bp->next) { for (bp = mptr->final_resting_place; bp; bp = bp->next) {
if (bp->bonesknown || wizard) { if (bp->bonesknown || wizard || final) {
Sprintf(buf, "%s%s%s, %s%c", PREFIX, TAB, Sprintf(buf, "%s%s%s, %s%c", PREFIX, TAB,
bp->who, bp->how, --kncnt ? ',' : '.'); bp->who, bp->how, --kncnt ? ',' : '.');
putstr(win, 0, buf); putstr(win, 0, buf);
+53 -40
View File
@@ -116,7 +116,7 @@ static boolean NDECL(NH_panictrace_gdb);
/*ARGSUSED*/ /*ARGSUSED*/
void void
panictrace_handler(sig_unused) /* called as signal() handler, so sent at least one arg */ panictrace_handler(sig_unused) /* called as signal() handler, so sent at least one arg */
int sig_unused; int sig_unused UNUSED;
{ {
# define SIG_MSG "\nSignal received.\n" # define SIG_MSG "\nSignal received.\n"
(void) write(2, SIG_MSG, sizeof(SIG_MSG)-1); (void) write(2, SIG_MSG, sizeof(SIG_MSG)-1);
@@ -198,15 +198,14 @@ NH_panictrace_libc()
{ {
# ifdef PANICTRACE_LIBC # ifdef PANICTRACE_LIBC
void *bt[20]; void *bt[20];
size_t count; size_t count, x;
char **info; char **info;
int x;
raw_print("Generating more information you may report:\n"); raw_print("Generating more information you may report:\n");
count = backtrace(bt, SIZE(bt)); count = backtrace(bt, SIZE(bt));
info = backtrace_symbols(bt, count); info = backtrace_symbols(bt, count);
for (x = 0; x < count; x++) { for (x = 0; x < count; x++) {
raw_printf("[%d] %s",x,info[x]); raw_printf("[%lu] %s", (unsigned long)x, info[x]);
} }
/* free(info); Don't risk it. */ /* free(info); Don't risk it. */
return TRUE; return TRUE;
@@ -286,7 +285,7 @@ static boolean Schroedingers_cat = FALSE;
/*ARGSUSED*/ /*ARGSUSED*/
void void
done1(sig_unused) /* called as signal() handler, so sent at least one arg */ done1(sig_unused) /* called as signal() handler, so sent at least one arg */
int sig_unused; int sig_unused UNUSED;
{ {
#ifndef NO_SIGNAL #ifndef NO_SIGNAL
(void) signal(SIGINT,SIG_IGN); (void) signal(SIGINT,SIG_IGN);
@@ -356,7 +355,7 @@ done2()
/*ARGSUSED*/ /*ARGSUSED*/
STATIC_PTR void STATIC_PTR void
done_intr(sig_unused) /* called as signal() handler, so sent at least one arg */ done_intr(sig_unused) /* called as signal() handler, so sent at least one arg */
int sig_unused; int sig_unused UNUSED;
{ {
done_stopprint++; done_stopprint++;
(void) signal(SIGINT, SIG_IGN); (void) signal(SIGINT, SIG_IGN);
@@ -594,7 +593,7 @@ char *defquery;
} else if (flags.end_disclose[idx] == DISCLOSE_PROMPT_DEFAULT_YES) { } else if (flags.end_disclose[idx] == DISCLOSE_PROMPT_DEFAULT_YES) {
*defquery = 'y'; *defquery = 'y';
return TRUE; return TRUE;
} else if (flags.end_disclose[idx] == DISCLOSE_PROMPT_DEFAULT_NO) { } else {
*defquery = 'n'; *defquery = 'n';
return TRUE; return TRUE;
} }
@@ -615,7 +614,7 @@ boolean taken;
char qbuf[QBUFSZ]; char qbuf[QBUFSZ];
boolean ask; boolean ask;
if (invent) { if (invent && !done_stopprint) {
if (taken) if (taken)
Sprintf(qbuf, "Do you want to see what you had when you %s?", Sprintf(qbuf, "Do you want to see what you had when you %s?",
(how == QUIT) ? "quit" : "died"); (how == QUIT) ? "quit" : "died");
@@ -623,7 +622,6 @@ boolean taken;
Strcpy(qbuf, "Do you want your possessions identified?"); Strcpy(qbuf, "Do you want your possessions identified?");
ask = should_query_disclose_option('i', &defquery); ask = should_query_disclose_option('i', &defquery);
if (!done_stopprint) {
c = ask ? yn_function(qbuf, ynqchars, defquery) : defquery; c = ask ? yn_function(qbuf, ynqchars, defquery) : defquery;
if (c == 'y') { if (c == 'y') {
struct obj *obj; struct obj *obj;
@@ -639,10 +637,9 @@ boolean taken;
} }
if (c == 'q') done_stopprint++; if (c == 'q') done_stopprint++;
} }
}
ask = should_query_disclose_option('a', &defquery);
if (!done_stopprint) { if (!done_stopprint) {
ask = should_query_disclose_option('a', &defquery);
c = ask ? yn_function("Do you want to see your attributes?", c = ask ? yn_function("Do you want to see your attributes?",
ynqchars, defquery) : defquery; ynqchars, defquery) : defquery;
if (c == 'y') if (c == 'y')
@@ -651,20 +648,31 @@ boolean taken;
if (c == 'q') done_stopprint++; if (c == 'q') done_stopprint++;
} }
ask = should_query_disclose_option('v', &defquery);
if (!done_stopprint)
list_vanquished(defquery, ask);
ask = should_query_disclose_option('g', &defquery);
if (!done_stopprint)
list_genocided(defquery, ask);
ask = should_query_disclose_option('c', &defquery);
if (!done_stopprint) { if (!done_stopprint) {
ask = should_query_disclose_option('v', &defquery);
list_vanquished(defquery, ask);
}
if (!done_stopprint) {
ask = should_query_disclose_option('g', &defquery);
list_genocided(defquery, ask);
}
if (!done_stopprint) {
ask = should_query_disclose_option('c', &defquery);
c = ask ? yn_function("Do you want to see your conduct?", c = ask ? yn_function("Do you want to see your conduct?",
ynqchars, defquery) : defquery; ynqchars, defquery) : defquery;
if (c == 'y') if (c == 'y')
show_conduct(how >= PANICKED ? 1 : 2); show_conduct((how >= PANICKED) ? 1 : 2);
if (c == 'q') done_stopprint++;
}
if (!done_stopprint) {
ask = should_query_disclose_option('o', &defquery);
c = ask ? yn_function("Do you want to see the dungeon overview?",
ynqchars, defquery) : defquery;
if (c == 'y')
show_overview((how >= PANICKED) ? 1 : 2, how);
if (c == 'q') done_stopprint++; if (c == 'q') done_stopprint++;
} }
} }
@@ -941,24 +949,6 @@ die:
else if (how == TURNED_SLIME) else if (how == TURNED_SLIME)
u.ugrave_arise = PM_GREEN_SLIME; u.ugrave_arise = PM_GREEN_SLIME;
if (bones_ok && u.ugrave_arise == NON_PM &&
!(mvitals[u.umonnum].mvflags & G_NOCORPSE)) {
int mnum = u.umonnum;
if (!Upolyd) {
/* Base corpse on race when not poly'd since original
* u.umonnum is based on role, and all role monsters
* are human.
*/
mnum = (flags.female && urace.femalenum != NON_PM) ?
urace.femalenum : urace.malenum;
}
corpse = mk_named_object(CORPSE, &mons[mnum],
u.ux, u.uy, plname);
Sprintf(pbuf, "%s, ", plname);
formatkiller(eos(pbuf), sizeof pbuf - strlen(pbuf), how);
make_grave(u.ux, u.uy, pbuf);
}
/* if pets will contribute to score, populate mydogs list now /* if pets will contribute to score, populate mydogs list now
(bones creation isn't a factor, but pline() messaging is) */ (bones creation isn't a factor, but pline() messaging is) */
if (how == ESCAPED || how == ASCENDED) keepdogs(TRUE); if (how == ESCAPED || how == ASCENDED) keepdogs(TRUE);
@@ -979,7 +969,8 @@ die:
taken = paybill((how == ESCAPED) ? -1 : (how != QUIT)); taken = paybill((how == ESCAPED) ? -1 : (how != QUIT));
paygd(); paygd();
clearpriests(); clearpriests();
} else taken = FALSE; /* lint; assert( !bones_ok ); */ } else
taken = FALSE; /* lint; assert( !bones_ok ); */
clearlocks(); clearlocks();
@@ -987,9 +978,31 @@ die:
if (strcmp(flags.end_disclose, "none") && how != PANICKED) if (strcmp(flags.end_disclose, "none") && how != PANICKED)
disclose(how, taken); disclose(how, taken);
/* finish_paybill should be called after disclosure but before bones */ /* finish_paybill should be called after disclosure but before bones */
if (bones_ok && taken) finish_paybill(); if (bones_ok && taken) finish_paybill();
/* grave creation should be after disclosure so it doesn't have
this grave in the current level's features for #overview */
if (bones_ok && u.ugrave_arise == NON_PM &&
!(mvitals[u.umonnum].mvflags & G_NOCORPSE)) {
int mnum = u.umonnum;
if (!Upolyd) {
/* Base corpse on race when not poly'd since original
* u.umonnum is based on role, and all role monsters
* are human.
*/
mnum = (flags.female && urace.femalenum != NON_PM) ?
urace.femalenum : urace.malenum;
}
corpse = mk_named_object(CORPSE, &mons[mnum],
u.ux, u.uy, plname);
Sprintf(pbuf, "%s, ", plname);
formatkiller(eos(pbuf), sizeof pbuf - strlen(pbuf), how);
make_grave(u.ux, u.uy, pbuf);
}
/* calculate score, before creating bones [container gold] */ /* calculate score, before creating bones [container gold] */
{ {
int deepest = deepest_lev_reached(FALSE); int deepest = deepest_lev_reached(FALSE);
+47 -49
View File
@@ -2083,7 +2083,8 @@ goodfruit:
if (match_optname(opts, "disclose", 7, TRUE)) { if (match_optname(opts, "disclose", 7, TRUE)) {
/* /*
* The order that the end_disclore options are stored: * The order that the end_disclore options are stored:
* inventory, attribs, vanquished, genocided, conduct * inventory, attribs, vanquished, genocided,
* conduct, overview.
* There is an array in flags: * There is an array in flags:
* end_disclose[NUM_DISCLOSURE_OPT]; * end_disclose[NUM_DISCLOSURE_OPT];
* with option settings for the each of the following: * with option settings for the each of the following:
@@ -2124,7 +2125,6 @@ goodfruit:
num = 0; num = 0;
prefix_val = -1; prefix_val = -1;
while (*op && num < sizeof flags.end_disclose - 1) { while (*op && num < sizeof flags.end_disclose - 1) {
register char c, *dop;
static char valid_settings[] = { static char valid_settings[] = {
DISCLOSE_PROMPT_DEFAULT_YES, DISCLOSE_PROMPT_DEFAULT_YES,
DISCLOSE_PROMPT_DEFAULT_NO, DISCLOSE_PROMPT_DEFAULT_NO,
@@ -2132,14 +2132,16 @@ goodfruit:
DISCLOSE_NO_WITHOUT_PROMPT, DISCLOSE_NO_WITHOUT_PROMPT,
'\0' '\0'
}; };
register char c, *dop;
c = lowc(*op); c = lowc(*op);
if (c == 'k') c = 'v'; /* killed -> vanquished */ if (c == 'k') c = 'v'; /* killed -> vanquished */
if (c == 'd') c = 'o'; /* dungeon -> overview */
dop = index(disclosure_options, c); dop = index(disclosure_options, c);
if (dop) { if (dop) {
idx = (int)(dop - disclosure_options); idx = (int)(dop - disclosure_options);
if (idx < 0 || idx > NUM_DISCLOSURE_OPTIONS - 1) { if (idx < 0 || idx > NUM_DISCLOSURE_OPTIONS - 1) {
impossible("bad disclosure index %d %c", impossible("bad disclosure index %d %c", idx, c);
idx, c);
continue; continue;
} }
if (prefix_val != -1) { if (prefix_val != -1) {
@@ -3132,66 +3134,66 @@ boolean setinitial,setfromfile;
/* parseoptions will prompt for the list of types */ /* parseoptions will prompt for the list of types */
parseoptions(strcpy(buf, "pickup_types"), setinitial, setfromfile); parseoptions(strcpy(buf, "pickup_types"), setinitial, setfromfile);
} else if (!strcmp("disclose", optname)) { } else if (!strcmp("disclose", optname)) {
int pick_cnt, pick_idx, opt_idx; /* order of disclose_names[] must correspond to
menu_item *disclosure_category_pick = (menu_item *)0; disclosure_options in decl.c */
/*
* The order of disclose_names[]
* must correspond to disclosure_options in decl.h
*/
static const char *disclosure_names[] = { static const char *disclosure_names[] = {
"inventory", "attributes", "vanquished", "genocides", "conduct" "inventory", "attributes", "vanquished", "genocides",
"conduct", "overview",
}; };
int disc_cat[NUM_DISCLOSURE_OPTIONS]; int disc_cat[NUM_DISCLOSURE_OPTIONS];
const char *disclosure_name; int pick_cnt, pick_idx, opt_idx;
menu_item *disclosure_pick = (menu_item *)0;
tmpwin = create_nhwindow(NHW_MENU); tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin); start_menu(tmpwin);
any = zeroany; any = zeroany;
for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) { for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) {
disclosure_name = disclosure_names[i]; Sprintf(buf, "%-12s[%c%c]", disclosure_names[i],
flags.end_disclose[i], disclosure_options[i]);
any.a_int = i + 1; any.a_int = i + 1;
add_menu(tmpwin, NO_GLYPH, &any, disclosure_options[i], 0, add_menu(tmpwin, NO_GLYPH, &any, disclosure_options[i], 0,
ATR_NONE, disclosure_name, MENU_UNSELECTED); ATR_NONE, buf, MENU_UNSELECTED);
disc_cat[i] = 0; disc_cat[i] = 0;
} }
end_menu(tmpwin, "Change which disclosure options categories:"); end_menu(tmpwin, "Change which disclosure options categories:");
if ((pick_cnt = select_menu(tmpwin, PICK_ANY, &disclosure_category_pick)) > 0) { pick_cnt = select_menu(tmpwin, PICK_ANY, &disclosure_pick);
if (pick_cnt > 0) {
for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) { for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) {
opt_idx = disclosure_category_pick[pick_idx].item.a_int - 1; opt_idx = disclosure_pick[pick_idx].item.a_int - 1;
disc_cat[opt_idx] = 1; disc_cat[opt_idx] = 1;
} }
free((genericptr_t)disclosure_category_pick); free((genericptr_t)disclosure_pick);
disclosure_category_pick = (menu_item *)0; disclosure_pick = (menu_item *)0;
} }
destroy_nhwindow(tmpwin); destroy_nhwindow(tmpwin);
for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) { for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) {
if (disc_cat[i]) { if (disc_cat[i]) {
char dbuf[BUFSZ]; Sprintf(buf, "Disclosure options for %s:",
menu_item *disclosure_option_pick = (menu_item *)0; disclosure_names[i]);
Sprintf(dbuf, "Disclosure options for %s:", disclosure_names[i]);
tmpwin = create_nhwindow(NHW_MENU); tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin); start_menu(tmpwin);
any = zeroany;
/* 'y','n',and '+' work as alternate selectors; '-' doesn't */
any.a_char = DISCLOSE_NO_WITHOUT_PROMPT; any.a_char = DISCLOSE_NO_WITHOUT_PROMPT;
add_menu(tmpwin, NO_GLYPH, &any, 'a', 0, add_menu(tmpwin, NO_GLYPH, &any, 'a', any.a_char, ATR_NONE,
ATR_NONE,"Never disclose and don't prompt", MENU_UNSELECTED); "Never disclose, without prompting", MENU_UNSELECTED);
any = zeroany;
any.a_char = DISCLOSE_YES_WITHOUT_PROMPT; any.a_char = DISCLOSE_YES_WITHOUT_PROMPT;
add_menu(tmpwin, NO_GLYPH, &any, 'b', 0, add_menu(tmpwin, NO_GLYPH, &any, 'b', any.a_char, ATR_NONE,
ATR_NONE,"Always disclose and don't prompt", MENU_UNSELECTED); "Always disclose, without prompting",
any = zeroany; MENU_UNSELECTED);
any.a_char = DISCLOSE_PROMPT_DEFAULT_NO; any.a_char = DISCLOSE_PROMPT_DEFAULT_NO;
add_menu(tmpwin, NO_GLYPH, &any, 'c', 0, add_menu(tmpwin, NO_GLYPH, &any, 'c', any.a_char, ATR_NONE,
ATR_NONE,"Prompt and default answer to \"No\"", MENU_UNSELECTED); "Prompt, with default answer of \"No\"",
any = zeroany; MENU_UNSELECTED);
any.a_char = DISCLOSE_PROMPT_DEFAULT_YES; any.a_char = DISCLOSE_PROMPT_DEFAULT_YES;
add_menu(tmpwin, NO_GLYPH, &any, 'd', 0, add_menu(tmpwin, NO_GLYPH, &any, 'd', any.a_char, ATR_NONE,
ATR_NONE,"Prompt and default answer to \"Yes\"", MENU_UNSELECTED); "Prompt, with default answer of \"Yes\"",
end_menu(tmpwin, dbuf); MENU_UNSELECTED);
if (select_menu(tmpwin, PICK_ONE, &disclosure_option_pick) > 0) { end_menu(tmpwin, buf);
flags.end_disclose[i] = disclosure_option_pick->item.a_char; if (select_menu(tmpwin, PICK_ONE, &disclosure_pick) > 0) {
free((genericptr_t)disclosure_option_pick); flags.end_disclose[i] = disclosure_pick->item.a_char;
free((genericptr_t)disclosure_pick);
} }
destroy_nhwindow(tmpwin); destroy_nhwindow(tmpwin);
} }
@@ -3659,26 +3661,22 @@ char *buf;
#endif #endif
#ifdef BACKWARD_COMPAT #ifdef BACKWARD_COMPAT
else if (!strcmp(optname, "boulder")) else if (!strcmp(optname, "boulder"))
Sprintf(buf,
# ifdef UNICODE_DRAWING # ifdef UNICODE_DRAWING
Sprintf(buf, "\\x%04X", iflags.bouldersym ? "\\x%04X",
# else # else
Sprintf(buf, "%c", iflags.bouldersym ? "%c",
# endif # endif
iflags.bouldersym : iflags.bouldersym ? iflags.bouldersym :
showsyms[(int)objects[BOULDER].oc_class + SYM_OFF_O]); showsyms[(int)objects[BOULDER].oc_class + SYM_OFF_O]);
#endif #endif
else if (!strcmp(optname, "catname")) else if (!strcmp(optname, "catname"))
Sprintf(buf, "%s", catname[0] ? catname : none); Sprintf(buf, "%s", catname[0] ? catname : none);
else if (!strcmp(optname, "disclose")) { else if (!strcmp(optname, "disclose"))
for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) { for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) {
char topt[2]; if (i) (void) strkitten(buf, ' ');
if (i) Strcat(buf," "); (void) strkitten(buf, flags.end_disclose[i]);
topt[1] = '\0'; (void) strkitten(buf, disclosure_options[i]);
topt[0] = flags.end_disclose[i];
Strcat(buf, topt);
topt[0] = disclosure_options[i];
Strcat(buf, topt);
}
} }
else if (!strcmp(optname, "dogname")) else if (!strcmp(optname, "dogname"))
Sprintf(buf, "%s", dogname[0] ? dogname : none); Sprintf(buf, "%s", dogname[0] ? dogname : none);