concealing unknown branch stairs

First cut at displaying branch stairs/ladder up/down as ordinary
stairs/ladder up/down if the destination hasn't been visited yet.

Stepping on stairs with 'mention_decor' enabled, or using ':' when
already on them, will report regular stairs' destination level.
Probably not very useful since it's just N+1 for downstairs or N-1
for upstairs when currently on level N.

It's based on whether the destination level has been visited, not
on whether the stairs have been traversed, so reaching a level via
trap or level teleporation can make the level's stairs known when
their destination really shouldn't be discovered yet.
This commit is contained in:
PatR
2021-07-29 03:32:58 -07:00
parent 7bfbe0fba9
commit f2019e2ec6
4 changed files with 65 additions and 14 deletions

View File

@@ -3283,7 +3283,7 @@ dfeature_at(int x, int y, char *buf)
int ltyp = lev->typ, cmap = -1;
const char *dfeature = 0;
static char altbuf[BUFSZ];
stairway *stway = stairway_at(x,y);
stairway *stway = stairway_at(x, y);
if (IS_DOOR(ltyp)) {
switch (lev->doormask) {
@@ -3324,15 +3324,20 @@ dfeature_at(int x, int y, char *buf)
a_gname(),
align_str(Amask2align(lev->altarmask & ~AM_SHRINE)));
dfeature = altbuf;
} else if (stway && !stway->isladder && stway->up)
cmap = S_upstair; /* "staircase up" */
else if (stway && !stway->isladder && !stway->up)
cmap = S_dnstair; /* "staircase down" */
else if (stway && stway->isladder && stway->up)
cmap = S_upladder; /* "ladder up" */
else if (stway && stway->isladder && !stway->up)
cmap = S_dnladder; /* "ladder down" */
else if (ltyp == DRAWBRIDGE_DOWN)
} else if (stway) {
(void) known_branch_stairs(stway, altbuf, TRUE);
dfeature = altbuf;
#if 0
if (!stway->isladder && stway->up)
cmap = S_upstair; /* "staircase up" */
else if (!stway->isladder && !stway->up)
cmap = S_dnstair; /* "staircase down" */
else if (stway->isladder && stway->up)
cmap = S_upladder; /* "ladder up" */
else if (stway->isladder && !stway->up)
cmap = S_dnladder; /* "ladder down" */
#endif
} else if (ltyp == DRAWBRIDGE_DOWN)
cmap = S_vodbridge; /* "lowered drawbridge" */
else if (ltyp == DBWALL)
cmap = S_vcdbridge; /* "raised drawbridge" */