<foo> suddenly appears next to you (trunk only)

Give demon lords and other monsters who teleport to your location a
oneshot arrival message.  Brought about by the report of the late "<demon>
appears" message delivered during its bribery demand, after the character
had already been able to see it for long enough to extract gold from a bag.
Now, if you can't see or sense a monster before it teleports to you, and
you can see or sense it after, you'll get "<monster> suddenly appears!".
The message will be given at most once for any given monster, and it won't
be shown at all if you already see/sense the monster before it teleports or
still don't see/sense it afterwards.  The fixes entry is deliberately a bit
vague (and I put it in the new feature section rather than the fix section).

     The change from long to unsigned long for monst.mstrategy may bring
some lint complaints along with it.  The various constants (STRAT_xxx) used
to populate it are still signed.  I didn't increment EDITLEVEL for this;
existing data should still work ok.
This commit is contained in:
nethack.rankin
2006-09-07 04:42:13 +00:00
parent 4c4304cc62
commit 467899e307
5 changed files with 53 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)monst.h 3.5 2006/01/02 */
/* SCCS Id: @(#)monst.h 3.5 2006/09/06 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -108,11 +108,16 @@ struct monst {
#define MAX_NUM_WORMS 32 /* should be 2^(wormno bitfield size) */
long mstrategy; /* for monsters with mflag3: current strategy */
unsigned long mstrategy; /* for monsters with mflag3: current strategy */
#ifdef NHSTDC
#define STRAT_APPEARMSG 0x80000000UL
#else
#define STRAT_APPEARMSG 0x80000000L
#endif
#define STRAT_ARRIVE 0x40000000L /* just arrived on current level */
#define STRAT_WAITFORU 0x20000000L
#define STRAT_CLOSE 0x10000000L
#define STRAT_WAITMASK 0x30000000L
#define STRAT_WAITMASK (STRAT_CLOSE | STRAT_WAITFORU)
#define STRAT_HEAL 0x08000000L
#define STRAT_GROUND 0x04000000L
#define STRAT_MONSTR 0x02000000L