boulder override the default boulder symbol with another default: [`]
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]
(basically a whimsy which NetHack uses from time to time).
menustyle user interface for selection of multiple objects:
.ds vr "NetHack 3.5
.ds f0 "\*(vr
.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
.\" make changes to that file)
.\" .PS word
Have user confirm attacks on pets, shopkeepers, and other
peaceable creatures (default on).
.lp disclose
-Controls options for disclosing various information when the game ends (defaults
-to all possibilities being disclosed).
+Controls what information the program reveals when the game ends.
+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:
.sd
.si
-i - disclose your inventory.
-a - disclose your attributes.
-v - summarize monsters that have been vanquished.
-g - list monster species that have been genocided.
-c - display your conduct.
+\fBi\fP - disclose your inventory;
+\fBa\fP - disclose your attributes;
+\fBv\fP - summarize monsters that have been vanquished;
+\fBg\fP - list monster species that have been genocided;
+\fBc\fP - display your conduct;
+\fBo\fP - display dungeon overview.
.ei
.ed
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
.si
-y - prompt you and default to yes on the prompt.
-n - prompt you and default to no on the prompt.
-+ - disclose it without prompting.
-- - do not disclose it and do not prompt.
+\fBy\fP - prompt you and default to yes on the prompt;
+\fBn\fP - prompt you and default to no on the prompt;
+\fB+\fP - disclose it without prompting;
+\fB-\fP - do not disclose it and do not prompt.
.ei
.ed
-(ex. ``disclose:yi na +v -g -c'')
-The example sets
-.op inventory
-to prompt and default to yes,
-.op attributes
-to prompt and default to no,
-.op vanquished
-to disclose without prompting,
-.op genocided
-to not disclose and not to prompt,
-.op conduct
-to not disclose and not to prompt.
+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
+\fBinventory\fP to \fIprompt\fP and default to \fIyes\fP,
+\fBattributes\fP to \fIprompt\fP and default to \fIno\fP,
+\fBvanquished\fP to \fIdisclose without prompting\fP,
+\fBgenocided\fP to \fInot disclose\fP and \fInot prompt\fP,
+\fBconduct\fP to implicitly \fIprompt\fP and default to \fIno\fP, and
+\fBoverview\fP to \fIdisclose without prompting\fP.
+.lp ""
Note that the vanquished monsters list includes all monsters killed by
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
Name your starting dog (ex. ``dogname:Fang'').
Cannot be set with the `O' command.
.lp extmenu
-Changes the extended commands interface to pop-up a menu of available commands.
+Changes the extended commands interface to pop-up a menu of available commands.
It is keystroke compatible with the traditional interface except that it does
not require that you hit Enter. It is implemented only by the tty port
(default off), when the game has been compiled to support tty graphics.
The possible values are:
.sd
.si
-s - single message (default; only choice prior to 3.4.0)
-c - combination, two messages as `single', then as `full'
-f - full window, oldest message first
-r - full window reversed, newest message first
+\fBs\fP - single message (default; only choice prior to 3.4.0)
+\fBc\fP - combination, two messages as `single', then as `full'
+\fBf\fP - full window, oldest message first
+\fBr\fP - full window reversed, newest message first
.ei
.ed
For backward compatibility, no value needs to be specified (which
.hn 2
Configuring autopickup exceptions
.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
further refine the behavior of the
.op autopickup
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
object at your location.
-.pg
+.lp ""
You may use the following special characters in a pattern:
.sd
.si
- *--- matches 0 or more characters.
- ?--- matches any single character.
+\fB*\fP - matches zero or more characters;
+\fB?\fP - matches any single character.
.ei
.ed
-.pg
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
.si
-< - always pickup an object that matches the pattern that follows.
-> - never pickup an object that matches the pattern that follows.
+\fB<\fP - always pickup an object that matches rest of pattern;
+\fB>\fP - never pickup an object that matches rest of pattern.
.ei
.ed
-.pg
-Can be set with the `O' command, but the setting is not preserved
-across saves and restores.
-.pg
-Here's a couple of examples of autopickup_exceptions:
+A `never pickup' rule takes precedence over an `always pickup' rule if
+both match.
+.lp ""
+Exceptions can be set with the `\fBO\fP' command, but ones set that way will
+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
.si
autopickup_exception="<*arrow"
autopickup_exception=">* cursed*"
.ei
.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 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.
-A `never pickup' rule takes precedence over an `always pickup' rule if both match.
+The last example results in the exclusion of items known to be cursed from
+autopickup.
.hn 2
Configuring User Sounds
.pg
\begin{document}
%
% 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 h1 %.ds h2 \%
%.au
\author{Eric S. Raymond\\
(Extensively edited and expanded for 3.5)}
-\date{September 14, 2011}
+\date{April 7, 2012}
\maketitle
peaceable creatures (default on).
%.lp
\item[\ib{disclose}]
-Controls options for disclosing various information when the game ends (defaults
-to all possibilities being disclosed).
+Controls what information the program reveals when the game ends.
+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:
%.sd
%.si
-{\tt i} --- disclose your inventory.\\
-{\tt a} --- disclose your attributes.\\
-{\tt v} --- summarize monsters that have been vanquished.\\
-{\tt g} --- list monster species that have been genocided.\\
-{\tt c} --- display your conduct.
+{\tt i} --- disclose your inventory;\\
+{\tt a} --- disclose your attributes;\\
+{\tt v} --- summarize monsters that have been vanquished;\\
+{\tt g} --- list monster species that have been genocided;\\
+{\tt c} --- display your conduct;\\
+{\tt o} --- display dungeon overview.
%.ei
%.ed
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
%.si
-{\tt y} --- prompt you and default to yes on the prompt.\\
-{\tt n} --- prompt you and default to no on the prompt.\\
-{\tt +} --- disclose it without prompting.\\
+{\tt y} --- prompt you and default to yes on the prompt;\\
+{\tt n} --- prompt you and default to no on the prompt;\\
+{\tt +} --- disclose it without prompting;\\
{\tt -} --- do not disclose it and do not prompt.
%.ei
%.ed
-(ex.\ ``{\tt disclose:yi na +v -g -c}'')
-The example sets {\it inventory\/} to {\it prompt\/} and default to {\it yes\/},
-{\it attributes\/} to {\it prompt\/} and default to {\it no\/},
-{\it vanquished\/} to {\it disclose without prompting\/},
-{\it genocided\/} to {\it not disclose\/} and not to {\it prompt\/}, and
-{\it conduct\/} to {\it not disclose\/} and not to {\it prompt\/}.
+%.lp ""
+(ex.\ ``{\tt disclose:yi na +v -g o}'')
+The example sets
+{\tt inventory} to {\it prompt\/} and default to {\it yes\/},
+{\tt attributes} to {\it prompt\/} and default to {\it no\/},
+{\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
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
\item[\ib{dogname}]
Name your starting dog (ex.\ ``{\tt dogname:Fang}'').
\subsection*{Configuring autopickup exceptions}
%.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
further refine the behavior of the ``{\tt autopickup}'' option beyond
what is available through the ``{\tt pickup\_types}'' option.
characters to be used as a pattern to match against the singular form
of the description of an object at your location.
-%.pg
+%.lp ""
You may use the following special characters in a pattern:
-\begin{verbatim}
- *--- matches 0 or more characters.
- ?--- matches any single character.
-\end{verbatim}
+%.sd .si
+{\tt *} --- matches zero or more characters;\\
+{\tt ?} --- matches any single character.
+%.ei .ed
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
%.si
-{\tt <} --- always pickup an object that matches the pattern that follows.\\
-{\tt >} --- never 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 rest of pattern.
%.ei
%.ed
-Can be set with the `{\tt O}' command, but the setting is not preserved
-across saves and restores.
+A `never pickup' rule takes precedence over an `always pickup' rule if
+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
-%.pg
-Here's a couple of examples of autopickup\_exceptions:
+%.lp "Here are some examples:"
+Here are some examples:
\begin{verbatim}
autopickup_exception="<*arrow"
autopickup_exception=">*corpse"
autopickup_exception=">* cursed*"
\end{verbatim}
+%.pg
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 last example results in the exclusion of items known to be cursed from autopickup.
-A `never pickup' rule takes precedence over an `always pickup' rule if both match.
+The last example results in the exclusion of items known to be cursed from
+autopickup.
%.lp
%.hn 2
#ifdef DUNGEON_OVERVIEW
E int NDECL(donamelevel);
E int NDECL(dooverview);
+E void FDECL(show_overview, (int,int));
E void FDECL(forget_mapseen, (int));
E void FDECL(init_mapseen, (d_level *));
E void NDECL(recalc_mapseen);
int pile_limit; /* controls feedback when walking over objects */
char inv_order[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_NO 'n'
#define DISCLOSE_YES_WITHOUT_PROMPT '+'
#define DISCLOSE_NO_WITHOUT_PROMPT '-'
- char end_disclose[NUM_DISCLOSURE_OPTIONS + 1]; /* disclose various info
- upon exit */
+ char end_disclose[NUM_DISCLOSURE_OPTIONS + 1]; /* disclose various
+ info upon exit */
char menu_style; /* User interface style setting */
boolean made_fruit; /* don't easily let the user overflow the number of fruits */
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
-#define EDITLEVEL 53
+#define EDITLEVEL 54
#define COPYRIGHT_BANNER_A \
"NetHack, Copyright 1985-2012"
const char ynNaqchars[] = "yn#aq";
NEARDATA long yn_number = 0L;
-const char disclosure_options[] = "iavgc";
+const char disclosure_options[] = "iavgco";
#if defined(MICRO) || defined(WIN32)
char hackdir[PATHLEN]; /* where rumors, help, record are */
STATIC_DCL mapseen *FDECL(load_mapseen, (int));
STATIC_DCL void FDECL(save_mapseen, (int, mapseen *));
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 const char *FDECL(seen_string, (XCHAR_P,const char *));
STATIC_DCL const char *FDECL(br_string2, (branch *));
int
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;
mapseen *mptr;
win = create_nhwindow(NHW_MENU);
for (mptr = mapseenchn; mptr; mptr = mptr->next) {
/* only print out info for a level or a dungeon if interest */
- if (interest_mapseen(mptr)) {
- print_mapseen(win, mptr, (boolean)(mptr->lev.dnum != lastdun));
+ if (why > 0 || interest_mapseen(mptr)) {
+ print_mapseen(win, mptr, why, reason,
+ (boolean)(mptr->lev.dnum != lastdun));
lastdun = mptr->lev.dnum;
}
}
display_nhwindow(win, TRUE);
destroy_nhwindow(win);
-
- return 0;
}
STATIC_OVL const char *
} while (0)
STATIC_OVL void
-print_mapseen(win, mptr, printdun)
+print_mapseen(win, mptr, final, reason, printdun)
winid win;
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;
{
- char buf[BUFSZ];
+ char buf[BUFSZ], tmpbuf[BUFSZ];
int i, depthstart;
+ boolean died_here = (final == 2 && on_level(&u.uz, &mptr->lev));
/* Damnable special cases */
/* The quest and knox should appear to be level 1 to match
if (mptr->custom)
Sprintf(eos(buf), " (%s)", mptr->custom);
if (on_level(&u.uz, &mptr->lev))
- Strcat(buf, " <- You are here");
- putstr(win, ATR_BOLD, buf);
+ Sprintf(eos(buf), " <- You %s here", !final ? "are" : "were");
+ putstr(win, !final ? ATR_BOLD : 0, buf);
if (mptr->flags.forgot) return;
indicates that the fort's entrance has been seen (or mapped) */
Sprintf(buf, "%sFort Ludios.", PREFIX);
} else if (mptr->flags.castle) {
- char tmpbuf[BUFSZ];
-
Sprintf(buf, "%sThe castle%s.", PREFIX, tunesuffix(mptr, tmpbuf));
} else if (mptr->flags.valley) {
Sprintf(buf, "%sValley of the Dead.", PREFIX);
}
/* maybe print out bones details */
- if (mptr->final_resting_place) {
+ if (mptr->final_resting_place || final) {
struct cemetery *bp;
- int kncnt = 0;
+ int kncnt = !died_here ? 0 : 1;
for (bp = mptr->final_resting_place; bp; bp = bp->next)
- if (bp->bonesknown || wizard) ++kncnt;
+ if (bp->bonesknown || wizard || final) ++kncnt;
if (kncnt) {
Sprintf(buf, "%s%s", PREFIX, "Final resting place for");
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) {
- if (bp->bonesknown || wizard) {
+ if (bp->bonesknown || wizard || final) {
Sprintf(buf, "%s%s%s, %s%c", PREFIX, TAB,
bp->who, bp->how, --kncnt ? ',' : '.');
putstr(win, 0, buf);
/*ARGSUSED*/
void
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"
(void) write(2, SIG_MSG, sizeof(SIG_MSG)-1);
{
# ifdef PANICTRACE_LIBC
void *bt[20];
- size_t count;
+ size_t count, x;
char **info;
- int x;
raw_print("Generating more information you may report:\n");
count = backtrace(bt, SIZE(bt));
info = backtrace_symbols(bt, count);
- for(x=0; x<count; x++){
- raw_printf("[%d] %s",x,info[x]);
+ for (x = 0; x < count; x++) {
+ raw_printf("[%lu] %s", (unsigned long)x, info[x]);
}
/* free(info); Don't risk it. */
return TRUE;
/*ARGSUSED*/
void
done1(sig_unused) /* called as signal() handler, so sent at least one arg */
-int sig_unused;
+int sig_unused UNUSED;
{
#ifndef NO_SIGNAL
(void) signal(SIGINT,SIG_IGN);
/*ARGSUSED*/
STATIC_PTR void
done_intr(sig_unused) /* called as signal() handler, so sent at least one arg */
-int sig_unused;
+int sig_unused UNUSED;
{
done_stopprint++;
(void) signal(SIGINT, SIG_IGN);
} else if (flags.end_disclose[idx] == DISCLOSE_PROMPT_DEFAULT_YES) {
*defquery = 'y';
return TRUE;
- } else if (flags.end_disclose[idx] == DISCLOSE_PROMPT_DEFAULT_NO) {
+ } else {
*defquery = 'n';
return TRUE;
}
char qbuf[QBUFSZ];
boolean ask;
- if (invent) {
- if(taken)
- Sprintf(qbuf,"Do you want to see what you had when you %s?",
+ if (invent && !done_stopprint) {
+ if (taken)
+ Sprintf(qbuf, "Do you want to see what you had when you %s?",
(how == QUIT) ? "quit" : "died");
else
- Strcpy(qbuf,"Do you want your possessions identified?");
+ Strcpy(qbuf, "Do you want your possessions identified?");
ask = should_query_disclose_option('i', &defquery);
- if (!done_stopprint) {
- c = ask ? yn_function(qbuf, ynqchars, defquery) : defquery;
- if (c == 'y') {
- struct obj *obj;
-
- for (obj = invent; obj; obj = obj->nobj) {
- makeknown(obj->otyp);
- obj->known = obj->bknown = obj->dknown = obj->rknown = 1;
- if (Is_container(obj) || obj->otyp == STATUE)
- obj->cknown = obj->lknown = 1;
- }
- (void) display_inventory((char *)0, TRUE);
- container_contents(invent, TRUE, TRUE, FALSE);
+ c = ask ? yn_function(qbuf, ynqchars, defquery) : defquery;
+ if (c == 'y') {
+ struct obj *obj;
+
+ for (obj = invent; obj; obj = obj->nobj) {
+ makeknown(obj->otyp);
+ obj->known = obj->bknown = obj->dknown = obj->rknown = 1;
+ if (Is_container(obj) || obj->otyp == STATUE)
+ obj->cknown = obj->lknown = 1;
}
- if (c == 'q') done_stopprint++;
+ (void) display_inventory((char *)0, TRUE);
+ container_contents(invent, TRUE, TRUE, FALSE);
}
+ if (c == 'q') done_stopprint++;
}
- ask = should_query_disclose_option('a', &defquery);
if (!done_stopprint) {
+ ask = should_query_disclose_option('a', &defquery);
c = ask ? yn_function("Do you want to see your attributes?",
ynqchars, defquery) : defquery;
if (c == 'y')
if (c == 'q') done_stopprint++;
}
- ask = should_query_disclose_option('v', &defquery);
- if (!done_stopprint)
+ if (!done_stopprint) {
+ ask = should_query_disclose_option('v', &defquery);
list_vanquished(defquery, ask);
+ }
- ask = should_query_disclose_option('g', &defquery);
- if (!done_stopprint)
+ if (!done_stopprint) {
+ ask = should_query_disclose_option('g', &defquery);
list_genocided(defquery, ask);
+ }
- ask = should_query_disclose_option('c', &defquery);
if (!done_stopprint) {
+ ask = should_query_disclose_option('c', &defquery);
c = ask ? yn_function("Do you want to see your conduct?",
ynqchars, defquery) : defquery;
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++;
}
}
else if (how == TURNED_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
(bones creation isn't a factor, but pline() messaging is) */
if (how == ESCAPED || how == ASCENDED) keepdogs(TRUE);
}
}
if (how == ESCAPED || how == PANICKED)
- killer.format = NO_KILLER_PREFIX;
+ killer.format = NO_KILLER_PREFIX;
if (how != PANICKED) {
/* these affect score and/or bones, but avoid them during panic */
taken = paybill((how == ESCAPED) ? -1 : (how != QUIT));
paygd();
clearpriests();
- } else taken = FALSE; /* lint; assert( !bones_ok ); */
+ } else
+ taken = FALSE; /* lint; assert( !bones_ok ); */
clearlocks();
if (have_windows) display_nhwindow(WIN_MESSAGE, FALSE);
if (strcmp(flags.end_disclose, "none") && how != PANICKED)
- disclose(how, taken);
+ disclose(how, taken);
+
/* finish_paybill should be called after disclosure but before bones */
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] */
{
int deepest = deepest_lev_reached(FALSE);
/* things to disclose at end of game */
if (match_optname(opts, "disclose", 7, TRUE)) {
- /*
- * The order that the end_disclore options are stored:
- * inventory, attribs, vanquished, genocided, conduct
- * There is an array in flags:
- * end_disclose[NUM_DISCLOSURE_OPT];
- * with option settings for the each of the following:
- * iagvc [see disclosure_options in decl.c]:
- * Legal setting values in that array are:
- * DISCLOSE_PROMPT_DEFAULT_YES ask with default answer yes
- * DISCLOSE_PROMPT_DEFAULT_NO ask with default answer no
- * DISCLOSE_YES_WITHOUT_PROMPT always disclose and don't ask
- * DISCLOSE_NO_WITHOUT_PROMPT never disclose and don't ask
- *
- * Those setting values can be used in the option
- * string as a prefix to get the desired behaviour.
- *
- * For backward compatibility, no prefix is required,
- * and the presence of a i,a,g,v, or c without a prefix
- * sets the corresponding value to DISCLOSE_YES_WITHOUT_PROMPT.
- */
- boolean badopt = FALSE;
- int idx, prefix_val;
-
- if (duplicate) complain_about_duplicate(opts,1);
- op = string_for_opt(opts, TRUE);
- if (op && negated) {
- bad_negation("disclose", TRUE);
- return;
- }
- /* "disclose" without a value means "all with prompting"
- and negated means "none without prompting" */
- if (!op || !strcmpi(op, "all") || !strcmpi(op, "none")) {
- if (op && !strcmpi(op, "none")) negated = TRUE;
- for (num = 0; num < NUM_DISCLOSURE_OPTIONS; num++)
- flags.end_disclose[num] = negated ?
- DISCLOSE_NO_WITHOUT_PROMPT :
- DISCLOSE_PROMPT_DEFAULT_YES;
- return;
- }
-
- num = 0;
- prefix_val = -1;
- while (*op && num < sizeof flags.end_disclose - 1) {
- register char c, *dop;
- static char valid_settings[] = {
- DISCLOSE_PROMPT_DEFAULT_YES,
- DISCLOSE_PROMPT_DEFAULT_NO,
- DISCLOSE_YES_WITHOUT_PROMPT,
- DISCLOSE_NO_WITHOUT_PROMPT,
- '\0'
- };
- c = lowc(*op);
- if (c == 'k') c = 'v'; /* killed -> vanquished */
- dop = index(disclosure_options, c);
- if (dop) {
- idx = (int)(dop - disclosure_options);
- if (idx < 0 || idx > NUM_DISCLOSURE_OPTIONS - 1) {
- impossible("bad disclosure index %d %c",
- idx, c);
- continue;
- }
- if (prefix_val != -1) {
- flags.end_disclose[idx] = prefix_val;
- prefix_val = -1;
- } else
- flags.end_disclose[idx] = DISCLOSE_YES_WITHOUT_PROMPT;
- } else if (index(valid_settings, c)) {
- prefix_val = c;
- } else if (c == ' ') {
- ; /* do nothing */
- } else
- badopt = TRUE;
- op++;
- }
- if (badopt) badoption(opts);
+ /*
+ * The order that the end_disclore options are stored:
+ * inventory, attribs, vanquished, genocided,
+ * conduct, overview.
+ * There is an array in flags:
+ * end_disclose[NUM_DISCLOSURE_OPT];
+ * with option settings for the each of the following:
+ * iagvc [see disclosure_options in decl.c]:
+ * Legal setting values in that array are:
+ * DISCLOSE_PROMPT_DEFAULT_YES ask with default answer yes
+ * DISCLOSE_PROMPT_DEFAULT_NO ask with default answer no
+ * DISCLOSE_YES_WITHOUT_PROMPT always disclose and don't ask
+ * DISCLOSE_NO_WITHOUT_PROMPT never disclose and don't ask
+ *
+ * Those setting values can be used in the option
+ * string as a prefix to get the desired behaviour.
+ *
+ * For backward compatibility, no prefix is required,
+ * and the presence of a i,a,g,v, or c without a prefix
+ * sets the corresponding value to DISCLOSE_YES_WITHOUT_PROMPT.
+ */
+ boolean badopt = FALSE;
+ int idx, prefix_val;
+
+ if (duplicate) complain_about_duplicate(opts,1);
+ op = string_for_opt(opts, TRUE);
+ if (op && negated) {
+ bad_negation("disclose", TRUE);
+ return;
+ }
+ /* "disclose" without a value means "all with prompting"
+ and negated means "none without prompting" */
+ if (!op || !strcmpi(op, "all") || !strcmpi(op, "none")) {
+ if (op && !strcmpi(op, "none")) negated = TRUE;
+ for (num = 0; num < NUM_DISCLOSURE_OPTIONS; num++)
+ flags.end_disclose[num] = negated ?
+ DISCLOSE_NO_WITHOUT_PROMPT :
+ DISCLOSE_PROMPT_DEFAULT_YES;
return;
+ }
+
+ num = 0;
+ prefix_val = -1;
+ while (*op && num < sizeof flags.end_disclose - 1) {
+ static char valid_settings[] = {
+ DISCLOSE_PROMPT_DEFAULT_YES,
+ DISCLOSE_PROMPT_DEFAULT_NO,
+ DISCLOSE_YES_WITHOUT_PROMPT,
+ DISCLOSE_NO_WITHOUT_PROMPT,
+ '\0'
+ };
+ register char c, *dop;
+
+ c = lowc(*op);
+ if (c == 'k') c = 'v'; /* killed -> vanquished */
+ if (c == 'd') c = 'o'; /* dungeon -> overview */
+ dop = index(disclosure_options, c);
+ if (dop) {
+ idx = (int)(dop - disclosure_options);
+ if (idx < 0 || idx > NUM_DISCLOSURE_OPTIONS - 1) {
+ impossible("bad disclosure index %d %c", idx, c);
+ continue;
+ }
+ if (prefix_val != -1) {
+ flags.end_disclose[idx] = prefix_val;
+ prefix_val = -1;
+ } else
+ flags.end_disclose[idx] = DISCLOSE_YES_WITHOUT_PROMPT;
+ } else if (index(valid_settings, c)) {
+ prefix_val = c;
+ } else if (c == ' ') {
+ ; /* do nothing */
+ } else
+ badopt = TRUE;
+ op++;
+ }
+ if (badopt) badoption(opts);
+ return;
}
/* scores:5t[op] 5a[round] o[wn] */
/* parseoptions will prompt for the list of types */
parseoptions(strcpy(buf, "pickup_types"), setinitial, setfromfile);
} else if (!strcmp("disclose", optname)) {
- int pick_cnt, pick_idx, opt_idx;
- menu_item *disclosure_category_pick = (menu_item *)0;
- /*
- * The order of disclose_names[]
- * must correspond to disclosure_options in decl.h
- */
+ /* order of disclose_names[] must correspond to
+ disclosure_options in decl.c */
static const char *disclosure_names[] = {
- "inventory", "attributes", "vanquished", "genocides", "conduct"
+ "inventory", "attributes", "vanquished", "genocides",
+ "conduct", "overview",
};
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);
start_menu(tmpwin);
any = zeroany;
for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) {
- disclosure_name = disclosure_names[i];
- any.a_int = i + 1;
- add_menu(tmpwin, NO_GLYPH, &any, disclosure_options[i], 0,
- ATR_NONE, disclosure_name, MENU_UNSELECTED);
- disc_cat[i] = 0;
+ Sprintf(buf, "%-12s[%c%c]", disclosure_names[i],
+ flags.end_disclose[i], disclosure_options[i]);
+ any.a_int = i + 1;
+ add_menu(tmpwin, NO_GLYPH, &any, disclosure_options[i], 0,
+ ATR_NONE, buf, MENU_UNSELECTED);
+ disc_cat[i] = 0;
}
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) {
- 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;
}
- free((genericptr_t)disclosure_category_pick);
- disclosure_category_pick = (menu_item *)0;
+ free((genericptr_t)disclosure_pick);
+ disclosure_pick = (menu_item *)0;
}
destroy_nhwindow(tmpwin);
for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) {
if (disc_cat[i]) {
- char dbuf[BUFSZ];
- menu_item *disclosure_option_pick = (menu_item *)0;
-
- Sprintf(dbuf, "Disclosure options for %s:", disclosure_names[i]);
+ Sprintf(buf, "Disclosure options for %s:",
+ disclosure_names[i]);
tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin);
- any.a_char = DISCLOSE_NO_WITHOUT_PROMPT;
- add_menu(tmpwin, NO_GLYPH, &any, 'a', 0,
- ATR_NONE,"Never disclose and don't prompt", MENU_UNSELECTED);
any = zeroany;
+ /* 'y','n',and '+' work as alternate selectors; '-' doesn't */
+ any.a_char = DISCLOSE_NO_WITHOUT_PROMPT;
+ add_menu(tmpwin, NO_GLYPH, &any, 'a', any.a_char, ATR_NONE,
+ "Never disclose, without prompting", MENU_UNSELECTED);
any.a_char = DISCLOSE_YES_WITHOUT_PROMPT;
- add_menu(tmpwin, NO_GLYPH, &any, 'b', 0,
- ATR_NONE,"Always disclose and don't prompt", MENU_UNSELECTED);
- any = zeroany;
+ add_menu(tmpwin, NO_GLYPH, &any, 'b', any.a_char, ATR_NONE,
+ "Always disclose, without prompting",
+ MENU_UNSELECTED);
any.a_char = DISCLOSE_PROMPT_DEFAULT_NO;
- add_menu(tmpwin, NO_GLYPH, &any, 'c', 0,
- ATR_NONE,"Prompt and default answer to \"No\"", MENU_UNSELECTED);
- any = zeroany;
+ add_menu(tmpwin, NO_GLYPH, &any, 'c', any.a_char, ATR_NONE,
+ "Prompt, with default answer of \"No\"",
+ MENU_UNSELECTED);
any.a_char = DISCLOSE_PROMPT_DEFAULT_YES;
- add_menu(tmpwin, NO_GLYPH, &any, 'd', 0,
- ATR_NONE,"Prompt and default answer to \"Yes\"", MENU_UNSELECTED);
- end_menu(tmpwin, dbuf);
- if (select_menu(tmpwin, PICK_ONE, &disclosure_option_pick) > 0) {
- flags.end_disclose[i] = disclosure_option_pick->item.a_char;
- free((genericptr_t)disclosure_option_pick);
+ add_menu(tmpwin, NO_GLYPH, &any, 'd', any.a_char, ATR_NONE,
+ "Prompt, with default answer of \"Yes\"",
+ MENU_UNSELECTED);
+ end_menu(tmpwin, buf);
+ if (select_menu(tmpwin, PICK_ONE, &disclosure_pick) > 0) {
+ flags.end_disclose[i] = disclosure_pick->item.a_char;
+ free((genericptr_t)disclosure_pick);
}
destroy_nhwindow(tmpwin);
}
#endif
#ifdef BACKWARD_COMPAT
else if (!strcmp(optname, "boulder"))
+ Sprintf(buf,
# ifdef UNICODE_DRAWING
- Sprintf(buf, "\\x%04X", iflags.bouldersym ?
+ "\\x%04X",
# else
- Sprintf(buf, "%c", iflags.bouldersym ?
+ "%c",
# endif
- iflags.bouldersym :
- showsyms[(int)objects[BOULDER].oc_class + SYM_OFF_O]);
+ iflags.bouldersym ? iflags.bouldersym :
+ showsyms[(int)objects[BOULDER].oc_class + SYM_OFF_O]);
#endif
else if (!strcmp(optname, "catname"))
- Sprintf(buf, "%s", catname[0] ? catname : none );
- else if (!strcmp(optname, "disclose")) {
+ Sprintf(buf, "%s", catname[0] ? catname : none);
+ else if (!strcmp(optname, "disclose"))
for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) {
- char topt[2];
- if (i) Strcat(buf," ");
- topt[1] = '\0';
- topt[0] = flags.end_disclose[i];
- Strcat(buf, topt);
- topt[0] = disclosure_options[i];
- Strcat(buf, topt);
+ if (i) (void) strkitten(buf, ' ');
+ (void) strkitten(buf, flags.end_disclose[i]);
+ (void) strkitten(buf, disclosure_options[i]);
}
- }
else if (!strcmp(optname, "dogname"))
- Sprintf(buf, "%s", dogname[0] ? dogname : none );
+ Sprintf(buf, "%s", dogname[0] ? dogname : none);
else if (!strcmp(optname, "dungeon"))
Sprintf(buf, "%s", to_be_done);
else if (!strcmp(optname, "effects"))