OSDN Git Service

patch decl.h
[jnethack/source.git] / include / permonst.h
1 /* NetHack 3.6  permonst.h      $NHDT-Date: 1432512778 2015/05/25 00:12:58 $  $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed.  See license for details. */
4
5 #ifndef PERMONST_H
6 #define PERMONST_H
7
8 /*      This structure covers all attack forms.
9  *      aatyp is the gross attack type (eg. claw, bite, breath, ...)
10  *      adtyp is the damage type (eg. physical, fire, cold, spell, ...)
11  *      damn is the number of hit dice of damage from the attack.
12  *      damd is the number of sides on each die.
13  *
14  *      Some attacks can do no points of damage.  Additionally, some can
15  *      have special effects *and* do damage as well.  If damn and damd
16  *      are set, they may have a special meaning.  For example, if set
17  *      for a blinding attack, they determine the amount of time blinded.
18  */
19
20 struct attack {
21     uchar aatyp;
22     uchar adtyp, damn, damd;
23 };
24
25 /*      Max # of attacks for any given monster.
26  */
27
28 #define NATTK 6
29
30 /*      Weight of a human body
31  */
32
33 #define WT_HUMAN 1450
34
35 #ifndef ALIGN_H
36 #include "align.h"
37 #endif
38 #include "monattk.h"
39 #include "monflag.h"
40
41 struct permonst {
42     const char *mname;          /* full name */
43     char mlet;                  /* symbol */
44     schar mlevel,               /* base monster level */
45         mmove,                  /* move speed */
46         ac,                     /* (base) armor class */
47         mr;                     /* (base) magic resistance */
48     aligntyp maligntyp;         /* basic monster alignment */
49     unsigned short geno;        /* creation/geno mask value */
50     struct attack mattk[NATTK]; /* attacks matrix */
51     unsigned short cwt,         /* weight of corpse */
52         cnutrit;                /* its nutritional value */
53     uchar msound;               /* noise it makes (6 bits) */
54     uchar msize;                /* physical size (3 bits) */
55     uchar mresists;             /* resistances */
56     uchar mconveys;             /* conveyed by eating */
57     unsigned long mflags1,      /* boolean bitflags */
58         mflags2;                /* more boolean bitflags */
59     unsigned short mflags3;     /* yet more boolean bitflags */
60 #ifdef TEXTCOLOR
61     uchar mcolor; /* color to use */
62 #endif
63 };
64
65 extern NEARDATA struct permonst mons[]; /* the master list of monster types */
66
67 #define VERY_SLOW 3
68 #define SLOW_SPEED 9
69 #define NORMAL_SPEED 12 /* movement rates */
70 #define FAST_SPEED 15
71 #define VERY_FAST 24
72
73 #define NON_PM PM_PLAYERMON          /* "not a monster" */
74 #define LOW_PM (NON_PM + 1)          /* first monster in mons[] */
75 #define SPECIAL_PM PM_LONG_WORM_TAIL /* [normal] < ~ < [special] */
76 /* mons[SPECIAL_PM] through mons[NUMMONS-1], inclusive, are
77    never generated randomly and cannot be polymorphed into */
78
79 #endif /* PERMONST_H */