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

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)permonst.h 3.5 1999/07/02 */
/* SCCS Id: @(#)permonst.h 3.5 2006/01/04 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -50,7 +50,6 @@ struct permonst {
struct attack mattk[NATTK]; /* attacks matrix */
unsigned short cwt, /* weight of corpse */
cnutrit; /* its nutritional value */
short pxlth; /* length of extension */
uchar msound; /* noise it makes (6 bits) */
uchar msize; /* physical size (3 bits) */
uchar mresists; /* resistances */