restrict where the engraving symbol shows up

rooms and corridor locations that have been seen
don't hide stairs
This commit is contained in:
nhmall
2023-03-26 17:32:54 -04:00
parent a3d8557ea6
commit be3659d731
3 changed files with 26 additions and 8 deletions

View File

@@ -39,4 +39,10 @@ struct engr {
#define engraving_to_defsym(ep) \
(levl[(ep)->engr_x][(ep)->engr_y].typ == CORR ? S_engrcorr : S_engroom)
#define spot_shows_engravings(x,y) \
(levl[(x)][(y)].typ == CORR \
|| levl[(x)][(y)].typ == SCORR \
|| levl[(x)][(y)].typ == ICE \
|| levl[(x)][(y)].typ == ROOM )
#endif /* ENGRAVE_H */

View File

@@ -416,12 +416,14 @@ unmap_object(register coordxy x, register coordxy y)
if ((trap = t_at(x, y)) != 0 && trap->tseen && !covers_traps(x, y)) {
map_trap(trap, 0);
} else if ((ep = engr_at(x, y)) != 0 && !covers_traps(x, y)) {
map_engraving(ep, 0);
} else if (levl[x][y].seenv) {
struct rm *lev = &levl[x][y];
map_background(x, y, 0);
if (spot_shows_engravings(x, y)
&& (ep = engr_at(x, y)) != 0 && !covers_traps(x, y))
map_engraving(ep, 0);
else
map_background(x, y, 0);
/* turn remembered dark room squares dark */
if (!lev->waslit && lev->glyph == cmap_to_glyph(S_room)
@@ -450,7 +452,9 @@ unmap_object(register coordxy x, register coordxy y)
map_object(obj, show); \
else if ((trap = t_at(x, y)) && trap->tseen && !covers_traps(x, y)) \
map_trap(trap, show); \
else if ((ep = engr_at(x, y)) && !covers_traps(x, y)) \
else if (spot_shows_engravings(x, y) \
&& (ep = engr_at(x, y)) != 0 \
&& !covers_traps(x, y)) \
map_engraving(ep, show); \
else \
map_background(x, y, show); \

View File

@@ -317,8 +317,13 @@ void
read_engr_at(coordxy x, coordxy y)
{
struct engr *ep = engr_at(x, y);
const char *eloc = surface(x, y);
int sensed = 0;
if (!spot_shows_engravings(x, y)) {
if (On_stairs(x, y))
eloc = "stairs";
}
/* Sensing an engraving does not require sight,
* nor does it necessarily imply comprehension (literacy).
*/
@@ -335,21 +340,20 @@ read_engr_at(coordxy x, coordxy y)
case HEADSTONE:
if (!Blind || can_reach_floor(TRUE)) {
sensed = 1;
pline("%s is engraved here on the %s.", Something,
surface(x, y));
pline("%s is engraved here on the %s.", Something, eloc);
}
break;
case BURN:
if (!Blind || can_reach_floor(TRUE)) {
sensed = 1;
pline("Some text has been %s into the %s here.",
is_ice(x, y) ? "melted" : "burned", surface(x, y));
is_ice(x, y) ? "melted" : "burned", eloc);
}
break;
case MARK:
if (!Blind) {
sensed = 1;
pline("There's some graffiti on the %s here.", surface(x, y));
pline("There's some graffiti on the %s here.", eloc);
}
break;
case ENGR_BLOOD:
@@ -1052,6 +1056,10 @@ doengrave(void)
}
eloc = surface(u.ux, u.uy);
if (!spot_shows_engravings(u.ux, u.uy)) {
if (On_stairs(u.ux, u.uy))
eloc = "stairs";
}
adding = (oep && !eow);
switch (type) {
default: