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