1 /**
2  * @file
3  * @brief Monster-related enums.
4  *
5  * Extracted from mon-util.h to cut down on mon-util.h
6  * dependencies.
7 **/
8 
9 #pragma once
10 
11 #include "tag-version.h"
12 
13 #define HERD_COMFORT_RANGE 6
14 
15 // TODO: Unify this and a player_equivalent (if applicable)
16 // and move into attack.h
17 enum attack_type
18 {
19     AT_NONE,
20     AT_HIT,         // Including weapon attacks.
21     AT_FIRST_ATTACK = AT_HIT,
22     AT_BITE,
23     AT_STING,
24     AT_SPORE,
25     AT_TOUCH,
26     AT_ENGULF,
27     AT_CLAW,
28     AT_PECK,
29     AT_HEADBUTT,
30     AT_PUNCH,
31     AT_KICK,
32     AT_TENTACLE_SLAP,
33     AT_TAIL_SLAP,
34     AT_GORE,
35     AT_CONSTRICT,
36     AT_TRAMPLE,
37     AT_TRUNK_SLAP,
38 #if TAG_MAJOR_VERSION == 34
39     AT_SNAP,
40     AT_SPLASH,
41 #endif
42     AT_POUNCE,
43 #if TAG_MAJOR_VERSION == 34
44     AT_REACH_STING,
45     AT_LAST_REAL_ATTACK = AT_REACH_STING,
46 #else
47     AT_LAST_REAL_ATTACK = AT_POUNCE,
48 #endif
49 
50     AT_CHERUB,
51 #if TAG_MAJOR_VERSION == 34
52     AT_SHOOT,
53 #endif
54     AT_WEAP_ONLY,   // AT_HIT if wielding a melee weapon, AT_NONE otherwise
55     AT_RANDOM,      // Anything but AT_SHOOT and AT_WEAP_ONLY.
56     NUM_ATTACK_TYPES,
57 };
58 
59 // When adding an attack flavour, give it a short description in
60 // _describe_attack_flavour() in describe.cc.
61 enum attack_flavour
62 {
63     AF_PLAIN,
64     AF_ACID,
65     AF_BLINK,
66     AF_COLD,
67     AF_CONFUSE,
68 #if TAG_MAJOR_VERSION == 34
69     AF_DISEASE,
70 #endif
71     AF_DRAIN_STR,
72     AF_DRAIN_INT,
73     AF_DRAIN_DEX,
74     AF_DRAIN_STAT,
75     AF_DRAIN,
76     AF_ELEC,
77     AF_FIRE,
78 #if TAG_MAJOR_VERSION == 34
79     AF_HUNGER,
80 #endif
81     AF_MUTATE,
82     AF_POISON_PARALYSE,
83     AF_POISON,
84 #if TAG_MAJOR_VERSION == 34
85     AF_POISON_NASTY,
86     AF_POISON_MEDIUM,
87 #endif
88     AF_POISON_STRONG,
89 #if TAG_MAJOR_VERSION == 34
90     AF_POISON_STR,
91     AF_POISON_INT,
92     AF_POISON_DEX,
93     AF_POISON_STAT,
94     AF_ROT,
95 #endif
96     AF_VAMPIRIC,
97 #if TAG_MAJOR_VERSION == 34
98     AF_KLOWN,
99 #endif
100     AF_DISTORT,
101     AF_RAGE,
102     AF_STICKY_FLAME,
103     AF_CHAOTIC,
104     AF_STEAL,
105 #if TAG_MAJOR_VERSION == 34
106     AF_STEAL_FOOD,
107 #endif
108     AF_CRUSH,
109     AF_REACH,
110     AF_HOLY,
111     AF_ANTIMAGIC,
112     AF_PAIN,
113     AF_ENSNARE,
114     AF_ENGULF,
115     AF_PURE_FIRE,
116     AF_DRAIN_SPEED,
117     AF_VULN,
118 #if TAG_MAJOR_VERSION == 34
119     AF_PLAGUE,
120 #endif
121     AF_REACH_STING,
122     AF_SHADOWSTAB,
123     AF_DROWN,
124 #if TAG_MAJOR_VERSION == 34
125     AF_FIREBRAND,
126 #endif
127     AF_CORRODE,
128     AF_SCARAB,
129     AF_KITE,  // Hops backwards if attacking with a polearm.
130     AF_SWOOP, // Swoops in to perform a melee attack if far away.
131     AF_TRAMPLE, // Trampling effect.
132     AF_WEAKNESS,
133 #if TAG_MAJOR_VERSION == 34
134     AF_MIASMATA,
135 #endif
136     AF_REACH_TONGUE,
137     AF_BLINK_WITH,
138 };
139 
140 // Non-spell "summoning" types to give to monster::mark_summoned(), or
141 // as the fourth parameter of mgen_data's constructor.
142 //
143 // Negative values since spells are non-negative.
144 enum mon_summon_type
145 {
146     MON_SUMM_CLONE = -10000, // Cloned from another monster
147     MON_SUMM_ANIMATE, // Item/feature/substance which was animated
148     MON_SUMM_CHAOS,   // Was made from pure chaos
149     MON_SUMM_MISCAST, // Spell miscast
150     MON_SUMM_ZOT,     // Zot trap
151     MON_SUMM_WRATH,   // Divine wrath
152     MON_SUMM_AID,     // Divine aid
153     MON_SUMM_SCROLL,  // Scroll of summoning
154 #if TAG_MAJOR_VERSION == 34
155     MON_SUMM_SHADOW,  // Shadow trap
156     MON_SUMM_LANTERN, // Lantern of shadows
157 #endif
158 };
159 
160 #include "mon-flags.h"
161 
162 enum mon_intel_type             // Must be in increasing intelligence order
163 {
164     I_BRAINLESS = 0,
165     I_ANIMAL,
166     I_HUMAN,
167 };
168 
169 enum habitat_type
170 {
171     // Flying monsters will appear in all categories except rock walls
172     HT_LAND = 0,         // Land critters
173     HT_AMPHIBIOUS,       // Amphibious creatures
174     HT_WATER,            // Water critters
175     HT_LAVA,             // Lava critters
176     HT_AMPHIBIOUS_LAVA,  // Amphibious w/ lava (salamanders)
177 
178     NUM_HABITATS
179 };
180 
181 // order of these is important:
182 enum mon_itemuse_type
183 {
184     MONUSE_NOTHING,
185     MONUSE_OPEN_DOORS,
186     MONUSE_STARTING_EQUIPMENT,
187     MONUSE_WEAPONS_ARMOUR,
188 
189     NUM_MONUSE
190 };
191 
192 typedef uint32_t resists_t;
193 #define mrd(res, lev) (resists_t)((res) * ((lev) & 7))
194 
195 enum mon_resist_flags
196 {
197     MR_NO_FLAGS          = 0,
198 
199     // resistances
200     // Notes:
201     // - negative energy is mostly handled via monster::res_negative_energy()
202     MR_RES_ELEC          = 1 << 0,
203     MR_RES_POISON        = 1 << 3,
204     MR_RES_FIRE          = 1 << 6,
205     MR_RES_COLD          = 1 << 9,
206     MR_RES_NEG           = 1 << 12,
207     MR_RES_MIASMA        = 1 << 15,
208     MR_RES_ACID          = 1 << 18,
209 
210     MR_LAST_MULTI, // must be >= any multi, < any boolean, exact value doesn't matter
211 
212     MR_RES_TORMENT       = 1 << 22,
213     MR_RES_PETRIFY       = 1 << 23,
214     MR_RES_DAMNATION     = 1 << 24,
215 #if TAG_MAJOR_VERSION == 34
216     MR_OLD_RES_ACID      = 1 << 25,
217 #else
218     // unused 1 << 25,
219 #endif
220     MR_RES_STICKY_FLAME  = 1 << 26,
221     MR_RES_VORTEX       = 1 << 27,
222     MR_RES_STEAM         = 1 << 28,
223 
224     // vulnerabilities
225     MR_VUL_WATER         = 1 << 29,
226     MR_VUL_ELEC          = mrd(MR_RES_ELEC, -1),
227     MR_VUL_POISON        = mrd(MR_RES_POISON, -1),
228     MR_VUL_FIRE          = mrd(MR_RES_FIRE, -1),
229     MR_VUL_COLD          = mrd(MR_RES_COLD, -1),
230 };
231 
232 enum shout_type
233 {
234     S_SILENT,               // silent
235     S_SHOUT,                // shout
236     S_BARK,                 // bark
237     S_HOWL,                 // howl
238     S_SHOUT2,               // shout twice (e.g. two-headed ogres)
239     S_ROAR,                 // roar
240     S_SCREAM,               // scream
241     S_BELLOW,               // bellow (yaks)
242     S_BLEAT,                // bleat (sheep)
243     S_TRUMPET,              // trumpets (elephants)
244     S_SCREECH,              // screech
245     S_BUZZ,                 // buzz
246     S_MOAN,                 // moan
247     S_GURGLE,               // gurgle
248     S_CROAK,                // frog croak
249     S_GROWL,                // for bears
250     S_HISS,                 // for reptiles & arachnids. quiet!
251     S_DEMON_TAUNT,          // for pandemonium lords
252     S_CHERUB,               // for cherubs
253     S_SQUEAL,               // pigs
254     S_LOUD_ROAR,            // dragons, &c. loud!
255     NUM_SHOUTS,
256 
257     // Loudness setting for shouts that are only defined in dat/shout.txt
258     // Only used for the verb/volume of random demon taunts
259     S_VERY_SOFT,
260     S_SOFT,
261     S_NORMAL,
262     S_LOUD,
263     S_VERY_LOUD,
264 
265     NUM_LOUDNESS,
266     S_RANDOM
267 };
268 
269 enum zombie_size_type
270 {
271     Z_NOZOMBIE = 0,
272     Z_SMALL,
273     Z_BIG,
274 };
275 
276 /**
277  * Monster body shapes. Set for each monster in the monster definitions of
278  * mon-data.h, the monster's shape affects various casting and melee attack
279  * messages.
280  */
281 enum mon_body_shape
282 {
283     MON_SHAPE_BUGGY,
284     MON_SHAPE_HUMANOID,
285     MON_SHAPE_FIRST_HUMANOID = MON_SHAPE_HUMANOID,
286     MON_SHAPE_HUMANOID_WINGED,
287     MON_SHAPE_HUMANOID_TAILED,
288     MON_SHAPE_HUMANOID_WINGED_TAILED,
289     MON_SHAPE_CENTAUR,
290     MON_SHAPE_NAGA,
291     MON_SHAPE_LAST_HUMANOID = MON_SHAPE_NAGA,
292     // Everything before this should have at least a humanoid upper body
293     MON_SHAPE_QUADRUPED,
294     MON_SHAPE_QUADRUPED_TAILLESS,
295     MON_SHAPE_QUADRUPED_WINGED,
296     MON_SHAPE_BAT,
297     MON_SHAPE_BIRD,
298     MON_SHAPE_SNAKE, // Including eels and worms
299     MON_SHAPE_FISH,
300     MON_SHAPE_INSECT,
301     MON_SHAPE_INSECT_WINGED,
302     MON_SHAPE_ARACHNID,
303     MON_SHAPE_CENTIPEDE,
304     MON_SHAPE_SNAIL,
305     MON_SHAPE_PLANT,
306     MON_SHAPE_FUNGUS,
307     MON_SHAPE_ORB,
308     MON_SHAPE_BLOB,
309     MON_SHAPE_MISC,
310 };
311