provide dungeon location in ^X feedback

Dungeon level wasn't included in ^X output, so it wasn't actually
giving all status fields and attempting to rely on it when turning
off 'status_updates' was leaving a gap in feedback for the player.
Add an extra line to the first section where character's name and
patron deity are reported, giving current location.
|You are in the Dungeons of Doom, on level 5.
or
|You are in the endgame, on the Elemental Plane of Fire.

The information is more explicit than the basic status field, but
you can already get similar information via #overview so it isn't
giving away extra info.
This commit is contained in:
PatR
2018-10-27 03:45:18 -07:00
parent bb62ab6fc1
commit 1273d6817e
5 changed files with 41 additions and 4 deletions

View File

@@ -174,6 +174,8 @@ in Guidebook.mn and Guidebook.txt, the 'I' command mis-described `IX' as
poison gas (stinking cloud) wasn't shown at drawbridge-up spot
prayer result which enhanced strength (fix weakness from hunger) didn't give
a message if a change in encumbrance occurred; it came on next move
add current location within the dungeon to the Background section of ^X and
final disclosure (it's not background but doesn't fit anywhere else)
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository

View File

@@ -628,6 +628,7 @@ E void FDECL(room_discovered, (int));
E void FDECL(recbranch_mapseen, (d_level *, d_level *));
E void FDECL(overview_stats, (winid, const char *, long *, long *));
E void FDECL(remdun_mapseen, (int));
E const char *FDECL(endgamelevelname, (char *, int));
/* ### eat.c ### */
@@ -2417,6 +2418,7 @@ E void NDECL(timer_sanity_check);
/* ### topten.c ### */
E void FDECL(formatkiller, (char *, unsigned, int, BOOLEAN_P));
E int FDECL(observable_depth, (d_level *));
E void FDECL(topten, (int, time_t));
E void FDECL(prscore, (int, char **));
E struct toptenentry *NDECL(get_rnd_toptenentry);

View File

@@ -1833,6 +1833,41 @@ int final;
difalgn ? align_str(u.ualignbase[A_ORIGINAL]) : "");
putstr(en_win, 0, buf);
}
/* 3.6.2: dungeon level, so that ^X really has all status info as
claimed by the comment below; this reveals more information than
the basic status display, but that's one of the purposes of ^X;
similar information is revealed by #overview; the "You died in
<location>" given by really_done() is more rudimentary than this */
*buf = *tmpbuf = '\0';
if (In_endgame(&u.uz)) {
int egdepth = observable_depth(&u.uz);
(void) endgamelevelname(tmpbuf, egdepth);
Sprintf(buf, "in the endgame, on the %s%s",
!strncmp(tmpbuf, "Plane", 5) ? "Elemental " : "", tmpbuf);
} else if (Is_knox(&u.uz)) {
/* this gives away the fact that the knox branch is only 1 level */
Sprintf(buf, "on the %s level", dungeons[u.uz.dnum].dname);
/* TODO? maybe phrase it differently when actually inside the fort,
if we're able to determine that (not trivial) */
} else {
char dgnbuf[QBUFSZ];
Strcpy(dgnbuf, dungeons[u.uz.dnum].dname);
if (!strncmpi(dgnbuf, "The ", 4))
*dgnbuf = lowc(*dgnbuf);
Sprintf(tmpbuf, "level %d",
In_quest(&u.uz) ? dunlev(&u.uz) : depth(&u.uz));
/* TODO? maybe extend this bit to include various other automatic
annotations from the dungeon overview code */
if (Is_rogue_level(&u.uz))
Strcat(tmpbuf, ", a primitive area");
else if (Is_bigroom(&u.uz) && !Blind)
Strcat(tmpbuf, ", a very big room");
Sprintf(buf, "in %s, on %s", dgnbuf, tmpbuf);
}
you_are(buf, "");
}
/* characteristics: expanded version of bottom line strength, dexterity, &c;

View File

@@ -71,7 +71,6 @@ STATIC_DCL void FDECL(traverse_mapseenchn, (BOOLEAN_P, winid,
int, int, int *));
STATIC_DCL const char *FDECL(seen_string, (XCHAR_P, const char *));
STATIC_DCL const char *FDECL(br_string2, (branch *));
STATIC_DCL const char *FDECL(endgamelevelname, (char *, int));
STATIC_DCL const char *FDECL(shop_string, (int));
STATIC_DCL char *FDECL(tunesuffix, (mapseen *, char *));
@@ -2775,7 +2774,7 @@ branch *br;
}
/* get the name of an endgame level; topten.c does something similar */
STATIC_OVL const char *
const char *
endgamelevelname(outbuf, indx)
char *outbuf;
int indx;

View File

@@ -62,7 +62,6 @@ struct toptenentry {
STATIC_DCL void FDECL(topten_print, (const char *));
STATIC_DCL void FDECL(topten_print_bold, (const char *));
STATIC_DCL xchar FDECL(observable_depth, (d_level *));
STATIC_DCL void NDECL(outheader);
STATIC_DCL void FDECL(outentry, (int, struct toptenentry *, BOOLEAN_P));
STATIC_DCL void FDECL(discardexcess, (FILE *));
@@ -178,7 +177,7 @@ const char *x;
putstr(toptenwin, ATR_BOLD, x);
}
STATIC_OVL xchar
int
observable_depth(lev)
d_level *lev;
{