mextra changes

Note: The CVS repository was tagged with NETHACK_PRE_MEXTRA
prior to application of this patch to allow easy withdrawal if necessary.

Adds a new mextra structure type that has a set
of pointers to various types of monster structures
including:
   mname, egd, epri, eshk, emin, edog

Replaces the mextra bits in the monst structure
with a single pointer called mtmp->mextra of type
(struct mextra *).
The pointer can be null if there are no additional
structures attached. The mextra structure is not
adjacent to the monst structure.

Reduces the in-memory footprint of the monst that
has no other structures attached, at the cost
of adding 6 extra long ints per monster to
the save file

The new mextra structure has the mextra fields
independent of each other, not overlapping as was
the case with previous NetHack versions.
This patch doesn't do anything to capitalize on
that difference however.

Consolidates vault.h, epri.h, eshk.h, emin.h and edog.h
into mextra.h

Adds a macro for checking for whether a monster has
a name:
	has_name(monst)

This fixes the magic trap panic
   expels() -> spoteffects() -> dotrap() ->
	domagictrap() -> tamedog()
because the monst no longer varies in size so no
replacement is required.
This commit is contained in:
nethack.allison
2006-01-06 05:46:03 +00:00
parent cfbc5194ae
commit 0dc071bee8
39 changed files with 1015 additions and 625 deletions

View File

@@ -163,16 +163,19 @@ NEARDATA extern coord bhitpos; /* place where throw or zap hits or stops */
#define NO_SPELL 0
/* flags to control makemon() */
#define NO_MM_FLAGS 0x00 /* use this rather than plain 0 */
#define NO_MINVENT 0x01 /* suppress minvent when creating mon */
#define MM_NOWAIT 0x02 /* don't set STRAT_WAITMASK flags */
#define MM_EDOG 0x04 /* add edog structure */
#define MM_EMIN 0x08 /* add emin structure */
#define MM_ANGRY 0x10 /* monster is created angry */
#define MM_NONAME 0x20 /* monster is not christened */
#define MM_NOCOUNTBIRTH 0x40 /* don't increment born counter (for revival) */
#define MM_IGNOREWATER 0x80 /* ignore water when positioning */
#define MM_ADJACENTOK 0x100 /* it is acceptable to use adjacent coordinates */
#define NO_MM_FLAGS 0x00000 /* use this rather than plain 0 */
#define NO_MINVENT 0x00001 /* suppress minvent when creating mon */
#define MM_NOWAIT 0x00002 /* don't set STRAT_WAITMASK flags */
#define MM_NOCOUNTBIRTH 0x00004 /* don't increment born counter (for revival) */
#define MM_IGNOREWATER 0x00008 /* ignore water when positioning */
#define MM_ADJACENTOK 0x00010 /* it is acceptable to use adjacent coordinates */
#define MM_ANGRY 0x00020 /* monster is created angry */
#define MM_NONAME 0x00040 /* monster is not christened */
#define MM_EGD 0x00100 /* add egd structure */
#define MM_EPRI 0x00200 /* add epri structure */
#define MM_ESHK 0x00400 /* add eshk structure */
#define MM_EMIN 0x00800 /* add emin structure */
#define MM_EDOG 0x01000 /* add edog structure */
/* flags for make_corpse() and mkcorpstat() */
#define CORPSTAT_NONE 0x00