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:
@@ -71,7 +71,7 @@ const char ynaqchars[] = "ynaq";
|
||||
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 */
|
||||
|
||||
@@ -63,7 +63,7 @@ mapseen *mapseenchn = (struct mapseen *)0;
|
||||
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 *));
|
||||
@@ -2325,6 +2325,16 @@ int roomno;
|
||||
|
||||
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;
|
||||
@@ -2336,15 +2346,14 @@ dooverview()
|
||||
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 *
|
||||
@@ -2452,13 +2461,16 @@ char *outbuf;
|
||||
} 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
|
||||
@@ -2518,8 +2530,8 @@ boolean printdun;
|
||||
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;
|
||||
|
||||
@@ -2586,8 +2598,6 @@ boolean printdun;
|
||||
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);
|
||||
@@ -2612,17 +2622,30 @@ boolean printdun;
|
||||
}
|
||||
|
||||
/* 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);
|
||||
|
||||
129
src/end.c
129
src/end.c
@@ -116,7 +116,7 @@ static boolean NDECL(NH_panictrace_gdb);
|
||||
/*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);
|
||||
@@ -198,15 +198,14 @@ NH_panictrace_libc()
|
||||
{
|
||||
# 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;
|
||||
@@ -286,7 +285,7 @@ static boolean Schroedingers_cat = FALSE;
|
||||
/*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);
|
||||
@@ -356,7 +355,7 @@ done2()
|
||||
/*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);
|
||||
@@ -594,7 +593,7 @@ char *defquery;
|
||||
} 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;
|
||||
}
|
||||
@@ -615,34 +614,32 @@ boolean taken;
|
||||
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')
|
||||
@@ -651,20 +648,31 @@ boolean taken;
|
||||
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) {
|
||||
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?",
|
||||
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++;
|
||||
}
|
||||
}
|
||||
@@ -941,24 +949,6 @@ die:
|
||||
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);
|
||||
@@ -972,24 +962,47 @@ die:
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
||||
250
src/options.c
250
src/options.c
@@ -2081,82 +2081,84 @@ goodfruit:
|
||||
|
||||
/* 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] */
|
||||
@@ -3132,66 +3134,66 @@ boolean setinitial,setfromfile;
|
||||
/* 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 = zeroany;
|
||||
/* 'y','n',and '+' work as alternate selectors; '-' doesn't */
|
||||
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;
|
||||
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);
|
||||
}
|
||||
@@ -3659,29 +3661,25 @@ char *buf;
|
||||
#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"))
|
||||
|
||||
Reference in New Issue
Block a user