def.monst.h revision 1.6 1 /* $NetBSD: def.monst.h,v 1.6 2001/03/25 20:43:58 jsm Exp $ */
2
3 /*
4 * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
5 */
6 #ifndef _DEF_MONST_H_
7 #define _DEF_MONST_H_
8 struct monst {
9 struct monst *nmon;
10 const struct permonst *data;
11 unsigned m_id;
12 xchar mx,my;
13 xchar mdx,mdy; /* if mdispl then pos where last displayed */
14 #define MTSZ 4
15 coord mtrack[MTSZ]; /* monster track */
16 schar mhp,mhpmax;
17 char mappearance; /* nonzero for undetected 'M's and for '1's */
18 Bitfield(mimic,1); /* undetected mimic */
19 Bitfield(mdispl,1); /* mdx,mdy valid */
20 Bitfield(minvis,1); /* invisible */
21 Bitfield(cham,1); /* shape-changer */
22 Bitfield(mhide,1); /* hides beneath objects */
23 Bitfield(mundetected,1); /* not seen in present hiding place */
24 Bitfield(mspeed,2);
25 Bitfield(msleep,1);
26 Bitfield(mfroz,1);
27 Bitfield(mconf,1);
28 Bitfield(mflee,1); /* fleeing */
29 Bitfield(mfleetim,7); /* timeout for mflee */
30 Bitfield(mcan,1); /* has been cancelled */
31 Bitfield(mtame,1); /* implies peaceful */
32 Bitfield(mpeaceful,1); /* does not attack unprovoked */
33 Bitfield(isshk,1); /* is shopkeeper */
34 Bitfield(isgd,1); /* is guard */
35 Bitfield(mcansee,1); /* cansee 1, temp.blinded 0, blind 0 */
36 Bitfield(mblinded,7); /* cansee 0, temp.blinded n, blind 0 */
37 Bitfield(mtrapped,1); /* trapped in a pit or bear trap */
38 Bitfield(mnamelth,6); /* length of name (following mxlth) */
39 #ifndef NOWORM
40 Bitfield(wormno,5); /* at most 31 worms on any level */
41 #endif /* NOWORM */
42 unsigned mtrapseen; /* bitmap of traps we've been trapped in */
43 long mlstmv; /* prevent two moves at once */
44 struct obj *minvent;
45 long mgold;
46 unsigned mxlth; /* length of following data */
47 /* in order to prevent alignment problems mextra should
48 be (or follow) a long int */
49 long mextra[1]; /* monster dependent info */
50 };
51
52 #define newmonst(xl) (struct monst *) alloc((unsigned)(xl) + sizeof(struct monst))
53
54 extern struct monst *fmon;
55 extern struct monst *fallen_down;
56
57 /* these are in mspeed */
58 #define MSLOW 1 /* slow monster */
59 #define MFAST 2 /* speeded monster */
60
61 #define NAME(mtmp) (((char *) mtmp->mextra) + mtmp->mxlth)
62 #define MREGEN "TVi1"
63 #define UNDEAD "ZVW "
64 #endif /* _DEF_MONST_H_ */
65