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