GitHub issue reported by ars3niy: https://github.com/NetHack/NetHack/issues/1303 @ars3niy commented on Oct 27: Stepping on a square with a dust or "graffiti" engraving while blind produces no message because presumably you can't read them by swiping the floor with your hands, however the engraving glyph still shows up on the map afterwards. While this helps zen players, it looks like a bug. @ville-v commented 3 days ago: Searching while blind also reveals the engravings. Here is a save file demonstrating the issue. [...] This adds an erevealed bit to engravings, to accompany the the eread bit that is already there. eread: refers to the text of the engraving erevealed: refers to the engraving map symbol Hopefully, this resolves issue 1303 without creating additional bugs. This invalidates existing save files and bones. Fixes #1303
55 lines
1.9 KiB
C
55 lines
1.9 KiB
C
/* NetHack 3.7 engrave.h $NHDT-Date: 1596498535 2020/08/03 23:48:55 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.10 $ */
|
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
|
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
|
|
/* NetHack may be freely redistributed. See license for details. */
|
|
|
|
#ifndef ENGRAVE_H
|
|
#define ENGRAVE_H
|
|
|
|
enum engraving_texts {
|
|
actual_text,
|
|
remembered_text,
|
|
pristine_text,
|
|
text_states
|
|
};
|
|
|
|
struct engr {
|
|
struct engr *nxt_engr;
|
|
char *engr_txt[text_states];
|
|
coordxy engr_x, engr_y;
|
|
unsigned engr_szeach; /* length of text including trailing NUL */
|
|
unsigned engr_alloc; /* for save & restore; not length of text */
|
|
long engr_time; /* moment engraving was (will be) finished */
|
|
xint8 engr_type;
|
|
#define DUST 1
|
|
#define ENGRAVE 2
|
|
#define BURN 3
|
|
#define MARK 4
|
|
#define ENGR_BLOOD 5
|
|
#define HEADSTONE 6
|
|
#define N_ENGRAVE 6
|
|
Bitfield(guardobjects, 1); /* if engr_txt is "Elbereth", it is effective
|
|
* against monsters when an object is present
|
|
* even when hero isn't (so behaves similarly
|
|
* to how Elbereth did in 3.4.3) */
|
|
Bitfield(nowipeout, 1); /* this engraving will not degrade */
|
|
Bitfield(eread, 1); /* refers to the engaving text: read or felt */
|
|
Bitfield(erevealed, 1); /* refers to engraving map symbol: revealed */
|
|
/* 4 free bits */
|
|
};
|
|
|
|
#define newengr(lth) \
|
|
(struct engr *) alloc((unsigned) (lth) + (unsigned) sizeof (struct engr))
|
|
#define dealloc_engr(engr) free((genericptr_t) (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 */
|