Issue reported by vultur-cadens: Elbereth used to be effective in inhibiting monster movement when an object was present on the same spot, but since 3.6.0 it isn't. It only functions that way when the hero--or hero's displaced image--is present these days. So special levels that have been using engraved Elbereth to try to protect objects from monsters haven't been providing any useful protection. This makes Elbereth that's engraved during level creation work like it used to in 3.4.3 and earlier: when there's at least one object on the engraving's spot, monsters who are affected by Elbereth will be affected. [I'm fairly sure that that behavior started out unintentionally, as a side-effect of an optimization to only check for scroll of scare monster when there was at least one item present which is a necessary condition for such a scroll.] Old-style Elbereth includes Elbereth chosen as a random engraving during level creation in addition to engravings specified in special level definitions. Engravings by the player don't have the required attribute and player-engraved Elbereth behaves in the 3.6 way. This ought to be replaced by something more general. Perhaps a new engraving type not usable by the player? Fixes #900
35 lines
1.2 KiB
C
35 lines
1.2 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
|
|
|
|
struct engr {
|
|
struct engr *nxt_engr;
|
|
char *engr_txt;
|
|
coordxy engr_x, engr_y;
|
|
unsigned engr_lth; /* 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) */
|
|
/* 7 free bits */
|
|
};
|
|
|
|
#define newengr(lth) \
|
|
(struct engr *) alloc((unsigned) (lth) + (unsigned) sizeof (struct engr))
|
|
#define dealloc_engr(engr) free((genericptr_t) (engr))
|
|
|
|
#endif /* ENGRAVE_H */
|