Add two new Ru sacrifices: resistance and eye
[crawl.git] / crawl-ref / source / enum.h
1 /**
2  * @file
3  * @brief Global (ick) enums.
4 **/
5
6 #ifndef ENUM_H
7 #define ENUM_H
8
9 #include <type_traits> // underlying_type<>
10
11 #include "tag-version.h"
12
13 template<class E>
14 class enum_bitfield
15 {
16 public:
17     typedef typename underlying_type<E>::type underlying_type;
18     underlying_type flags;
19
20     /// Get the flag corresponding to the given bit position (0 = LSB).
21     static E exponent(int pos) { return static_cast<E>(1 << pos); }
22
23     enum_bitfield() : flags(0) {}
24     enum_bitfield(E flag) : flags(flag) {}
25     template<class ... Es>
26     enum_bitfield(E flag, Es... rest) : enum_bitfield(rest...) { flags |= flag; }
27
28     explicit operator underlying_type () const { return flags; }
29     explicit operator bool () const { return flags; }
30     bool operator==(enum_bitfield<E> other) const
31     {
32         return flags == other.flags;
33     }
34     bool operator!=(enum_bitfield<E> other) const
35     {
36         return !(*this == other);
37     }
38
39     enum_bitfield<E> &operator|=(enum_bitfield<E> other)
40     {
41         flags |= other.flags;
42         return *this;
43     }
44
45     enum_bitfield<E> &operator&=(enum_bitfield<E> other)
46     {
47         flags &= other.flags;
48         return *this;
49     }
50
51     enum_bitfield<E> operator|(enum_bitfield<E> other) const
52     {
53         return enum_bitfield<E>(*this) |= other;
54     }
55
56     enum_bitfield<E> operator|(E other) const
57     {
58         return enum_bitfield<E>(*this) |= other;
59     }
60
61     enum_bitfield<E> operator&(enum_bitfield<E> other) const
62     {
63         return enum_bitfield<E>(*this) &= other;
64     }
65
66     enum_bitfield<E> operator&(E other) const
67     {
68         return enum_bitfield<E>(*this) &= other;
69     }
70
71     enum_bitfield<E> operator~() const
72     {
73         enum_bitfield<E> me(*this);
74         me.flags = ~me.flags;
75         return me;
76     }
77 };
78
79 template <class E, class ... Es>
80 enum_bitfield<E> bitfield(E e1, Es... args)
81 {
82     return bitfield<E>(e1, args...);
83 }
84
85 /**
86  * Define fieldT as a bitfield of the enum flagT, and make bitwise
87  * operators on flagT yield a fieldT.
88  *
89  * This macro produces a typedef and several inline function definitions;
90  * use it only at file/namespace scope. It requires a trailing semicolon.
91  *
92  * The operations ~, |, and (binary) & on flags or fields yields a field.
93  * Fields also support &= and |=. Fields can be explicitly converted to
94  * an integer of the enum's underlying type, or to bool. Note that in C++
95  * using a bitfield expression as the condition of a control structure,
96  * or as an operand of a logical operator, counts as explicit conversion
97  * to bool.
98  *
99  * @param fieldT An identifier naming the bitfield type to define.
100  * @param flagT  An identifier naming the enum type to use as a flag.
101  *               Could theoretically be a more complex type expression, but
102  *               I wouldn't try anything trickier than scope resolution.
103  */
104 #define DEF_BITFIELD(fieldT, flagT) typedef enum_bitfield<flagT> fieldT;  \
105     inline fieldT operator|(flagT a, flagT b)  { return fieldT(a) |= b; } \
106     inline fieldT operator|(flagT a, fieldT b) { return fieldT(a) |= b; } \
107     inline fieldT operator&(flagT a, flagT b)  { return fieldT(a) &= b; } \
108     inline fieldT operator&(flagT a, fieldT b) { return fieldT(a) &= b; } \
109     inline fieldT operator~(flagT a) { return ~fieldT(a); } \
110     COMPILE_CHECK(is_enum<flagT>::value)
111 // The last line above is really just to eat a semicolon; template
112 // substitution of enum_bitfield would have already failed.
113
114 enum lang_t
115 {
116     LANG_EN = 0,
117     LANG_CS,
118     LANG_DA,
119     LANG_DE,
120     LANG_EL,
121     LANG_ES,
122     LANG_FI,
123     LANG_FR,
124     LANG_HU,
125     LANG_IT,
126     LANG_JA,
127     LANG_KO,
128     LANG_LT,
129     LANG_LV,
130     LANG_NL,
131     LANG_PL,
132     LANG_PT,
133     LANG_RU,
134     LANG_SV,
135     LANG_ZH,
136 };
137
138 enum flang_t
139 {
140     FLANG_DWARVEN,
141     FLANG_JAGERKIN,
142     FLANG_KRAUT,
143     FLANG_FUTHARK,
144     FLANG_WIDE,
145     FLANG_GRUNT,
146     FLANG_BUTT,
147 };
148
149 enum ability_type
150 {
151     ABIL_NON_ABILITY = -1,
152     // Innate abilities and (Demonspawn) mutations.
153     ABIL_SPIT_POISON = 1,
154     ABIL_BREATHE_FIRE,
155     ABIL_BREATHE_FROST,
156     ABIL_BREATHE_POISON,
157     ABIL_BREATHE_LIGHTNING,
158     ABIL_BREATHE_POWER,
159     ABIL_BREATHE_STICKY_FLAME,
160     ABIL_BREATHE_STEAM,
161     ABIL_BREATHE_MEPHITIC,
162     ABIL_SPIT_ACID,
163     ABIL_BLINK,
164     // Others
165     ABIL_DELAYED_FIREBALL,
166     ABIL_END_TRANSFORMATION,
167     ABIL_STOP_SINGING, // From song of slaying
168
169     // Species-specific abilities.
170     // Demonspawn-only
171     ABIL_HELLFIRE,
172     // Tengu, Draconians
173     ABIL_FLY,
174 #if TAG_MAJOR_VERSION == 34
175     ABIL_WISP_BLINK,
176 #endif
177     ABIL_STOP_FLYING,
178     // Mummies
179     ABIL_MUMMY_RESTORATION,
180     // Vampires
181     ABIL_TRAN_BAT,
182 #if TAG_MAJOR_VERSION == 34
183     ABIL_BOTTLE_BLOOD,
184 #endif
185     // Deep Dwarves
186     ABIL_RECHARGING,
187     // Formicids
188     ABIL_DIG,
189     ABIL_SHAFT_SELF,
190     ABIL_MAX_INTRINSIC = ABIL_SHAFT_SELF,
191
192     // Evoking items.
193     ABIL_EVOKE_BERSERK = 40,
194     ABIL_MIN_EVOKE = ABIL_EVOKE_BERSERK,
195     ABIL_EVOKE_TELEPORTATION,
196     ABIL_EVOKE_BLINK,
197     ABIL_EVOKE_TURN_INVISIBLE,
198     ABIL_EVOKE_TURN_VISIBLE,
199     ABIL_EVOKE_FLIGHT,
200 #if TAG_MAJOR_VERSION == 34
201     ABIL_EVOKE_STOP_LEVITATING,
202 #endif
203     ABIL_EVOKE_FOG,
204     ABIL_EVOKE_TELEPORT_CONTROL,
205     ABIL_EVOKE_TWISTER,
206     ABIL_MAX_EVOKE = ABIL_EVOKE_TWISTER,
207
208     // Divine abilities
209     // Zin
210     ABIL_ZIN_SUSTENANCE = 1000,
211     ABIL_ZIN_RECITE,
212     ABIL_ZIN_VITALISATION,
213     ABIL_ZIN_IMPRISON,
214     ABIL_ZIN_SANCTUARY,
215     ABIL_ZIN_CURE_ALL_MUTATIONS,
216     // TSO
217     ABIL_TSO_DIVINE_SHIELD = 1010,
218     ABIL_TSO_CLEANSING_FLAME,
219     ABIL_TSO_SUMMON_DIVINE_WARRIOR,
220     // Kiku
221     ABIL_KIKU_RECEIVE_CORPSES = 1020,
222     ABIL_KIKU_TORMENT,
223     // Yredelemnul
224     ABIL_YRED_INJURY_MIRROR = 1030,
225     ABIL_YRED_ANIMATE_REMAINS,
226     ABIL_YRED_RECALL_UNDEAD_SLAVES,
227     ABIL_YRED_ANIMATE_DEAD,
228     ABIL_YRED_DRAIN_LIFE,
229     ABIL_YRED_ENSLAVE_SOUL,
230     ABIL_YRED_ANIMATE_REMAINS_OR_DEAD,
231     // Vehumet
232     // = 1040
233     // Okawaru
234     ABIL_OKAWARU_HEROISM = 1050,
235     ABIL_OKAWARU_FINESSE,
236     // Makhleb
237     ABIL_MAKHLEB_MINOR_DESTRUCTION = 1060,
238     ABIL_MAKHLEB_LESSER_SERVANT_OF_MAKHLEB,
239     ABIL_MAKHLEB_MAJOR_DESTRUCTION,
240     ABIL_MAKHLEB_GREATER_SERVANT_OF_MAKHLEB,
241     // Sif Muna
242     ABIL_SIF_MUNA_CHANNEL_ENERGY = 1070,
243     ABIL_SIF_MUNA_FORGET_SPELL,
244     // Trog
245     ABIL_TROG_BURN_SPELLBOOKS = 1080,
246     ABIL_TROG_BERSERK,
247     ABIL_TROG_REGEN_MR,
248     ABIL_TROG_BROTHERS_IN_ARMS,
249     // Elyvilon
250     ABIL_ELYVILON_LIFESAVING = 1090,
251     ABIL_ELYVILON_LESSER_HEALING,
252 #if TAG_MAJOR_VERSION == 34
253     ABIL_ELYVILON_LESSER_HEALING_OTHERS,
254 #endif
255     ABIL_ELYVILON_PURIFICATION,
256     ABIL_ELYVILON_GREATER_HEALING,
257     ABIL_ELYVILON_HEAL_OTHER,
258     ABIL_ELYVILON_DIVINE_VIGOUR,
259     // Lugonu
260     ABIL_LUGONU_ABYSS_EXIT = 1100,
261     ABIL_LUGONU_BEND_SPACE,
262     ABIL_LUGONU_BANISH,
263     ABIL_LUGONU_CORRUPT,
264     ABIL_LUGONU_ABYSS_ENTER,
265     // Nemelex
266 #if TAG_MAJOR_VERSION == 34
267     ABIL_NEMELEX_DRAW_ONE = 1110,
268     ABIL_NEMELEX_PEEK_TWO,
269 #endif
270     ABIL_NEMELEX_TRIPLE_DRAW = 1112,
271     ABIL_NEMELEX_DEAL_FOUR,
272     ABIL_NEMELEX_STACK_FIVE,
273     // Beogh
274     ABIL_BEOGH_SMITING = 1120,
275     ABIL_BEOGH_RECALL_ORCISH_FOLLOWERS,
276     ABIL_BEOGH_GIFT_ITEM,
277     // Jiyva
278     ABIL_JIYVA_CALL_JELLY = 1130,
279     ABIL_JIYVA_JELLY_PARALYSE,
280     ABIL_JIYVA_SLIMIFY,
281     ABIL_JIYVA_CURE_BAD_MUTATION,
282     // Fedhas
283     ABIL_FEDHAS_SUNLIGHT = 1140,
284     ABIL_FEDHAS_RAIN,
285     ABIL_FEDHAS_PLANT_RING,
286     ABIL_FEDHAS_SPAWN_SPORES,
287     ABIL_FEDHAS_EVOLUTION,
288     // Cheibriados
289     ABIL_CHEIBRIADOS_TIME_STEP = 1151,
290     ABIL_CHEIBRIADOS_TIME_BEND,
291     ABIL_CHEIBRIADOS_SLOUCH,
292     ABIL_CHEIBRIADOS_DISTORTION,
293     // Ashenzari
294     ABIL_ASHENZARI_SCRYING = 1160,
295     ABIL_ASHENZARI_TRANSFER_KNOWLEDGE,
296     ABIL_ASHENZARI_END_TRANSFER,
297     // Dithmenos
298     ABIL_DITHMENOS_SHADOW_STEP = 1170,
299     ABIL_DITHMENOS_SHADOW_FORM,
300     // Gozag
301     ABIL_GOZAG_POTION_PETITION = 1180,
302     ABIL_GOZAG_CALL_MERCHANT,
303     ABIL_GOZAG_BRIBE_BRANCH,
304     // Qazlal
305     ABIL_QAZLAL_UPHEAVAL = 1190,
306     ABIL_QAZLAL_ELEMENTAL_FORCE,
307     ABIL_QAZLAL_DISASTER_AREA,
308     // Ru
309     ABIL_RU_DRAW_OUT_POWER = 1200,
310     ABIL_RU_POWER_LEAP,
311     ABIL_RU_APOCALYPSE,
312
313     ABIL_RU_SACRIFICE_PURITY,
314         ABIL_FIRST_SACRIFICE = ABIL_RU_SACRIFICE_PURITY,
315     ABIL_RU_SACRIFICE_WORDS,
316     ABIL_RU_SACRIFICE_DRINK,
317     ABIL_RU_SACRIFICE_ESSENCE,
318     ABIL_RU_SACRIFICE_HEALTH,
319     ABIL_RU_SACRIFICE_STEALTH,
320     ABIL_RU_SACRIFICE_ARTIFICE,
321     ABIL_RU_SACRIFICE_LOVE,
322     ABIL_RU_SACRIFICE_COURAGE,
323     ABIL_RU_SACRIFICE_ARCANA,
324     ABIL_RU_SACRIFICE_NIMBLENESS,
325     ABIL_RU_SACRIFICE_DURABILITY,
326     ABIL_RU_SACRIFICE_HAND,
327     ABIL_RU_SACRIFICE_EXPERIENCE,
328     ABIL_RU_SACRIFICE_SKILL,
329     ABIL_RU_SACRIFICE_EYE,
330     ABIL_RU_SACRIFICE_RESISTANCE,
331         ABIL_FINAL_SACRIFICE = ABIL_RU_SACRIFICE_RESISTANCE,
332     ABIL_RU_REJECT_SACRIFICES,
333
334     // For both Yred and Beogh
335     ABIL_STOP_RECALL = 1500,
336
337     // General divine (pseudo) abilities.
338     ABIL_RENOUNCE_RELIGION,
339     ABIL_CONVERT_TO_BEOGH,
340
341     // Zot Defence abilities
342     ABIL_MAKE_FUNGUS = 2000,
343     ABIL_MIN_ZOTDEF = ABIL_MAKE_FUNGUS,
344     ABIL_MAKE_PLANT,
345     ABIL_MAKE_OKLOB_SAPLING,
346 #if TAG_MAJOR_VERSION == 34
347     ABIL_MAKE_DART_TRAP,
348 #endif
349     ABIL_MAKE_ICE_STATUE,
350     ABIL_MAKE_OCS,
351     ABIL_MAKE_OBSIDIAN_STATUE,
352     ABIL_MAKE_CURSE_SKULL,
353     ABIL_MAKE_TELEPORT,
354     ABIL_MAKE_ARROW_TRAP,
355     ABIL_MAKE_BOLT_TRAP,
356     ABIL_MAKE_SPEAR_TRAP,
357     ABIL_MAKE_NEEDLE_TRAP,
358     ABIL_MAKE_NET_TRAP,
359 #if TAG_MAJOR_VERSION == 34
360         ABIL_UNUSED_Z1,
361 #endif
362     ABIL_MAKE_ALARM_TRAP,
363     ABIL_MAKE_BLADE_TRAP,
364     ABIL_MAKE_OKLOB_CIRCLE,
365     ABIL_MAKE_ACQUIRE_GOLD,
366     ABIL_MAKE_ACQUIREMENT,
367     ABIL_MAKE_WATER,
368     ABIL_MAKE_LIGHTNING_SPIRE,
369     ABIL_MAKE_BAZAAR,
370     ABIL_MAKE_ALTAR,
371     ABIL_MAKE_GRENADES,
372 #if TAG_MAJOR_VERSION == 34
373     ABIL_MAKE_SAGE,
374 #endif
375     ABIL_MAKE_OKLOB_PLANT,
376     ABIL_MAKE_BURNING_BUSH,
377     ABIL_REMOVE_CURSE,
378     ABIL_MAX_ZOTDEF = ABIL_REMOVE_CURSE,
379     NUM_ABILITIES
380 };
381
382 // Be sure to change activity_interrupt_names in delay.cc to match!
383 enum activity_interrupt_type
384 {
385     AI_FORCE_INTERRUPT = 0,         // Forcibly kills any activity that can be
386                                     // interrupted.
387     AI_KEYPRESS,
388     AI_FULL_HP,                     // Player is fully healed
389     AI_FULL_MP,                     // Player has recovered all mp
390     AI_STATUE,                      // Bad statue has come into view
391     AI_HUNGRY,                      // Hunger increased
392     AI_MESSAGE,                     // Message was displayed
393     AI_HP_LOSS,
394     AI_STAT_CHANGE,
395     AI_SEE_MONSTER,
396     AI_MONSTER_ATTACKS,
397     AI_TELEPORT,
398     AI_HIT_MONSTER,                 // Player hit monster (invis or
399                                     // mimic) during travel/explore.
400     AI_SENSE_MONSTER,
401     AI_MIMIC,
402
403     // Always the last.
404     NUM_AINTERRUPTS
405 };
406
407 enum attribute_type
408 {
409     ATTR_DIVINE_LIGHTNING_PROTECTION,
410 #if TAG_MAJOR_VERSION == 34
411     ATTR_DIVINE_REGENERATION,
412 #endif
413     ATTR_DIVINE_DEATH_CHANNEL,
414     ATTR_CARD_COUNTDOWN,
415     ATTR_BANISHMENT_IMMUNITY,   // banishment immunity until
416     ATTR_DELAYED_FIREBALL,      // bwr: reserve fireballs
417     ATTR_HELD,                  // caught in a net or web
418     ATTR_ABYSS_ENTOURAGE,       // maximum number of hostile monsters in
419                                 // sight of the player while in the Abyss.
420     ATTR_DIVINE_VIGOUR,         // strength of Ely's Divine Vigour
421     ATTR_DIVINE_STAMINA,        // strength of Zin's Divine Stamina
422     ATTR_DIVINE_SHIELD,         // strength of TSO's Divine Shield
423 #if TAG_MAJOR_VERSION == 34
424     ATTR_WEAPON_SWAP_INTERRUPTED,
425 #endif
426     ATTR_GOLD_FOUND,
427     ATTR_PURCHASES,            // Gold amount spent at shops.
428     ATTR_DONATIONS,            // Gold amount donated to Zin.
429     ATTR_MISC_SPENDING,        // Spending for things like ziggurats.
430 #if TAG_MAJOR_VERSION == 34
431     ATTR_UNUSED1,              // was ATTR_RND_LVL_BOOKS
432     ATTR_NOISES,
433 #endif
434     ATTR_SHADOWS,              // Lantern of shadows effect.
435 #if TAG_MAJOR_VERSION == 34
436     ATTR_UNUSED2,              // was ATTR_FRUIT_FOUND
437 #endif
438     ATTR_FLIGHT_UNCANCELLABLE, // Potion of flight is in effect.
439     ATTR_INVIS_UNCANCELLABLE,  // Potion/spell/wand of invis is in effect.
440     ATTR_PERM_FLIGHT,          // Tengu flight or boots of flying are on.
441     ATTR_SEEN_INVIS_TURN,      // Last turn you saw something invisible.
442     ATTR_SEEN_INVIS_SEED,      // Random seed for invis monster positions.
443     ATTR_APPENDAGE,            // eq slot of Beastly Appendage
444     ATTR_TITHE_BASE,           // Remainder of untithed gold.
445     ATTR_EVOL_XP,              // XP gained since last evolved mutation
446     ATTR_LIFE_GAINED,          // XL when a felid gained a life.
447     ATTR_TEMP_MUTATIONS,       // Number of temporary mutations the player has.
448     ATTR_TEMP_MUT_XP,          // Amount of XP remaining before some temp muts
449                                // will be removed
450     ATTR_NEXT_RECALL_TIME,     // aut remaining until next ally will be recalled
451     ATTR_NEXT_RECALL_INDEX,    // index+1 into recall_list for next recall
452 #if TAG_MAJOR_VERSION == 34
453     ATTR_EVOKER_XP,            // How much xp remaining until next evoker charge
454 #endif
455     ATTR_SEEN_BEOGH,           // Did an orc priest already offer conversion?
456     ATTR_XP_DRAIN,             // Severity of current skill drain
457     ATTR_SEARING_RAY,          // Are we currently firing a searing ray?
458     ATTR_RECITE_TYPE,          // Recitation type.
459     ATTR_RECITE_SEED,          // Recite text seed.
460     ATTR_RECITE_HP,            // HP on start of recitation.
461     ATTR_SWIFTNESS,            // Duration of future antiswiftness.
462 #if TAG_MAJOR_VERSION == 34
463     ATTR_BARBS_MSG,            // Have we already printed a message on move?
464 #endif
465     ATTR_BARBS_POW,            // How badly we are currently skewered
466     ATTR_REPEL_MISSILES,       // Repel missiles active
467     ATTR_DEFLECT_MISSILES,     // Deflect missiles active
468     ATTR_PORTAL_PROJECTILE,    // Accuracy bonus during portal projectile
469     ATTR_GOD_WRATH_XP,         // How much XP before our next god wrath check?
470     ATTR_GOD_WRATH_COUNT,      // Number of stored retributions
471     ATTR_NEXT_DRAGON_TIME,     // aut remaining until Dragon's Call summons another
472     ATTR_GOLD_GENERATED,       // Count gold generated this game.
473 #if TAG_MAJOR_VERSION == 34
474     ATTR_GOZAG_POTIONS,        // Number of times you've bought potions from Gozag.
475 #endif
476     ATTR_GOZAG_SHOPS,          // Number of shops you've funded from Gozag.
477     ATTR_GOZAG_SHOPS_CURRENT,  // As above, but since most recent time worshipping.
478 #if TAG_MAJOR_VERSION == 34
479     ATTR_DIVINE_FIRE_RES,      // Divine fire resistance (Qazlal).
480     ATTR_DIVINE_COLD_RES,      // Divine cold resistance (Qazlal).
481     ATTR_DIVINE_ELEC_RES,      // Divine electricity resistance (Qazlal).
482     ATTR_DIVINE_AC,            // Divine AC bonus (Qazlal).
483 #endif
484     ATTR_GOZAG_GOLD_USED,      // Gold spent for Gozag abilities.
485     ATTR_BONE_ARMOUR,          // Current amount of boney armour (from the spell)
486     ATTR_LAST_FLIGHT_STATUS,   // Whether spawm_flight should be restored after form change
487     ATTR_GOZAG_FIRST_POTION,   // Gozag's free first usage of Potion Petition.
488     NUM_ATTRIBUTES
489 };
490
491 enum transformation_type
492 {
493     TRAN_NONE,
494     TRAN_SPIDER,
495     TRAN_BLADE_HANDS,
496     TRAN_STATUE,
497     TRAN_ICE_BEAST,
498     TRAN_DRAGON,
499     TRAN_LICH,
500     TRAN_BAT,
501     TRAN_PIG,
502     TRAN_APPENDAGE,
503     TRAN_TREE,
504     TRAN_PORCUPINE,
505     TRAN_WISP,
506 #if TAG_MAJOR_VERSION == 34
507     TRAN_JELLY,
508 #endif
509     TRAN_FUNGUS,
510     TRAN_SHADOW,
511     TRAN_HYDRA,
512     NUM_TRANSFORMS,
513 };
514
515 enum beam_type                  // bolt::flavour
516 {
517     BEAM_NONE,
518
519     BEAM_MISSILE,
520     BEAM_MMISSILE,                //    and similarly irresistible things
521     BEAM_FIRE,
522     BEAM_COLD,
523     BEAM_MAGIC,
524     BEAM_ELECTRICITY,
525     BEAM_POISON,
526     BEAM_NEG,
527     BEAM_ACID,
528     BEAM_MIASMA,
529     BEAM_WATER,
530
531     BEAM_SPORE,
532     BEAM_POISON_ARROW,
533     BEAM_HELLFIRE,
534     BEAM_STICKY_FLAME,
535     BEAM_STEAM,
536     BEAM_ENERGY,
537     BEAM_HOLY,
538     BEAM_FRAG,
539     BEAM_LAVA,
540     BEAM_ICE,
541     BEAM_DEVASTATION,
542     BEAM_RANDOM,                  // currently translates into FIRE..ACID
543     BEAM_CHAOS,
544     BEAM_GHOSTLY_FLAME,
545
546     // Enchantments
547     BEAM_SLOW,
548     BEAM_FIRST_ENCHANTMENT = BEAM_SLOW,
549     BEAM_HASTE,
550     BEAM_MIGHT,
551     BEAM_HEALING,
552     BEAM_PARALYSIS,
553     BEAM_CONFUSION,
554     BEAM_INVISIBILITY,
555     BEAM_DIGGING,
556     BEAM_TELEPORT,
557     BEAM_POLYMORPH,
558     BEAM_MALMUTATE,
559     BEAM_ENSLAVE,
560     BEAM_BANISH,
561     BEAM_ENSLAVE_SOUL,
562     BEAM_PAIN,
563     BEAM_DISPEL_UNDEAD,
564     BEAM_DISINTEGRATION,
565     BEAM_BLINK,
566     BEAM_BLINK_CLOSE,
567     BEAM_PETRIFY,
568     BEAM_CORONA,
569     BEAM_PORKALATOR,
570     BEAM_HIBERNATION,
571     BEAM_BERSERK,
572     BEAM_SLEEP,
573     BEAM_INNER_FLAME,
574     BEAM_SENTINEL_MARK,
575     BEAM_DIMENSION_ANCHOR,
576     BEAM_VULNERABILITY,
577     BEAM_MALIGN_OFFERING,
578     BEAM_VIRULENCE,
579     BEAM_IGNITE_POISON,
580     BEAM_AGILITY,
581     BEAM_SAP_MAGIC,
582     BEAM_CORRUPT_BODY,
583     BEAM_CHAOTIC_REFLECTION,
584     BEAM_DRAIN_MAGIC,
585     BEAM_TUKIMAS_DANCE,
586     BEAM_RESISTANCE,
587     BEAM_ATTRACT,
588     BEAM_LAST_ENCHANTMENT = BEAM_ATTRACT,
589
590     BEAM_MEPHITIC,
591     BEAM_INK,
592     BEAM_HOLY_FLAME,
593     BEAM_AIR,
594     BEAM_PETRIFYING_CLOUD,
595     BEAM_ENSNARE,
596     BEAM_CRYSTAL,
597     BEAM_DEATH_RATTLE,
598     BEAM_LAST_REAL = BEAM_DEATH_RATTLE,
599
600     // For getting the visual effect of a beam.
601     BEAM_VISUAL,
602     BEAM_BOUNCY_TRACER,           // Used for random bolt tracer (bounces as
603                                   // crystal bolt, but irresistable).
604
605     BEAM_TORMENT_DAMAGE,          // Pseudo-beam for damage flavour.
606     BEAM_FIRST_PSEUDO = BEAM_TORMENT_DAMAGE,
607
608     NUM_BEAMS
609 };
610
611 enum book_type
612 {
613     BOOK_MINOR_MAGIC,
614     BOOK_CONJURATIONS,
615     BOOK_FLAMES,
616     BOOK_FROST,
617     BOOK_SUMMONINGS,
618     BOOK_FIRE,
619     BOOK_ICE,
620     BOOK_SPATIAL_TRANSLOCATIONS,
621     BOOK_ENCHANTMENTS,
622     BOOK_YOUNG_POISONERS,
623     BOOK_TEMPESTS,
624     BOOK_DEATH,
625     BOOK_HINDERANCE,
626     BOOK_CHANGES,
627     BOOK_TRANSFIGURATIONS,
628     BOOK_FEN,
629 #if TAG_MAJOR_VERSION == 34
630     BOOK_WAR_CHANTS = BOOK_FEN,
631 #else
632     BOOK_BATTLE,
633 #endif
634     BOOK_CLOUDS,
635     BOOK_NECROMANCY,
636     BOOK_CALLINGS,
637     BOOK_MALEDICT,
638     BOOK_AIR,
639     BOOK_SKY,
640     BOOK_WARP,
641     BOOK_ENVENOMATIONS,
642     BOOK_UNLIFE,
643     BOOK_CONTROL,
644 #if TAG_MAJOR_VERSION == 34
645     BOOK_BATTLE, // was BOOK_MUTATIONS
646 #endif
647     BOOK_GEOMANCY,
648     BOOK_EARTH,
649 #if TAG_MAJOR_VERSION == 34
650     BOOK_WIZARDRY,
651 #endif
652     BOOK_POWER,
653     BOOK_CANTRIPS,
654     BOOK_PARTY_TRICKS,
655 #if TAG_MAJOR_VERSION == 34
656     BOOK_AKASHIC_RECORD,
657 #endif
658     BOOK_DEBILITATION,
659     BOOK_DRAGON,
660     BOOK_BURGLARY,
661     BOOK_DREAMS,
662     BOOK_ALCHEMY,
663     BOOK_BEASTS,
664
665     BOOK_ANNIHILATIONS,
666     BOOK_GRAND_GRIMOIRE,
667     BOOK_NECRONOMICON,
668 #if TAG_MAJOR_VERSION > 34
669     BOOK_AKASHIC_RECORD,
670 #endif
671
672 #if TAG_MAJOR_VERSION == 34
673     MAX_FIXED_BOOK = BOOK_NECRONOMICON,
674 #else
675     MAX_FIXED_BOOK = BOOK_AKASHIC_RECORD,
676 #endif
677
678     BOOK_RANDART_LEVEL,
679     BOOK_RANDART_THEME,
680
681     BOOK_MANUAL,
682 #if TAG_MAJOR_VERSION == 34
683     BOOK_BUGGY_DESTRUCTION,
684 #endif
685     NUM_BOOKS
686 };
687
688 #define NUM_NORMAL_BOOKS     (MAX_NORMAL_BOOK + 1)
689 #define NUM_FIXED_BOOKS      (MAX_FIXED_BOOK + 1)
690
691 enum branch_type                // you.where_are_you
692 {
693     BRANCH_DUNGEON,
694     BRANCH_TEMPLE,
695     BRANCH_FIRST_NON_DUNGEON = BRANCH_TEMPLE,
696     BRANCH_ORC,
697     BRANCH_ELF,
698 #if TAG_MAJOR_VERSION == 34
699     BRANCH_DWARF,
700 #endif
701     BRANCH_LAIR,
702     BRANCH_SWAMP,
703     BRANCH_SHOALS,
704     BRANCH_SNAKE,
705     BRANCH_SPIDER,
706     BRANCH_SLIME,
707     BRANCH_VAULTS,
708 #if TAG_MAJOR_VERSION == 34
709     BRANCH_BLADE,
710 #endif
711     BRANCH_CRYPT,
712     BRANCH_TOMB,
713 #if TAG_MAJOR_VERSION > 34
714     BRANCH_DEPTHS,
715 #endif
716     BRANCH_VESTIBULE,
717     BRANCH_DIS,
718     BRANCH_GEHENNA,
719     BRANCH_COCYTUS,
720     BRANCH_TARTARUS,
721       BRANCH_FIRST_HELL = BRANCH_DIS,
722       BRANCH_LAST_HELL = BRANCH_TARTARUS,
723     BRANCH_ZOT,
724 #if TAG_MAJOR_VERSION == 34
725     BRANCH_FOREST,
726 #endif
727     BRANCH_ABYSS,
728     BRANCH_PANDEMONIUM,
729     BRANCH_ZIGGURAT,
730     BRANCH_LABYRINTH,
731     BRANCH_BAZAAR,
732     BRANCH_TROVE,
733     BRANCH_SEWER,
734     BRANCH_OSSUARY,
735     BRANCH_BAILEY,
736     BRANCH_ICE_CAVE,
737     BRANCH_VOLCANO,
738     BRANCH_WIZLAB,
739 #if TAG_MAJOR_VERSION == 34
740     BRANCH_DEPTHS,
741 #endif
742     NUM_BRANCHES
743 };
744
745 enum caction_type    // Primary categorization of counted actions.
746 {                    // A subtype will also be given in each case:
747     CACT_MELEE,      // weapon subtype or unrand index
748     CACT_FIRE,       // weapon subtype or unrand index
749     CACT_THROW,      // item basetype << 16 | subtype
750     CACT_CAST,       // spell_type
751     CACT_INVOKE,     // ability_type
752     CACT_ABIL,       // ability_type
753     CACT_EVOKE,      // evoc_type
754                      //   or item.basetype << 16 | subtype
755                      //   or unrand index
756     CACT_USE,        // object_class_type
757     CACT_STAB,       // stab_type
758     CACT_EAT,        // food_type, or -1 for corpse
759     NUM_CACTIONS,
760 };
761
762 enum canned_message_type
763 {
764     MSG_SOMETHING_APPEARS,
765     MSG_NOTHING_HAPPENS,
766     MSG_YOU_UNAFFECTED,
767     MSG_YOU_RESIST,
768     MSG_YOU_PARTIALLY_RESIST,
769     MSG_TOO_BERSERK,
770     MSG_TOO_CONFUSED,
771     MSG_PRESENT_FORM,
772     MSG_NOTHING_CARRIED,
773     MSG_CANNOT_DO_YET,
774     MSG_OK,
775     MSG_UNTHINKING_ACT,
776     MSG_NOTHING_THERE,
777     MSG_NOTHING_CLOSE_ENOUGH,
778     MSG_NO_ENERGY,
779     MSG_SPELL_FIZZLES,
780     MSG_HUH,
781     MSG_EMPTY_HANDED_ALREADY,
782     MSG_EMPTY_HANDED_NOW,
783     MSG_YOU_BLINK,
784     MSG_STRANGE_STASIS,
785     MSG_NO_SPELLS,
786     MSG_MANA_INCREASE,
787     MSG_MANA_DECREASE,
788     MSG_DISORIENTED,
789     MSG_TOO_HUNGRY,
790     MSG_DETECT_NOTHING,
791     MSG_CALL_DEAD,
792     MSG_ANIMATE_REMAINS,
793     MSG_CANNOT_MOVE,
794     MSG_YOU_DIE,
795     MSG_GHOSTLY_OUTLINE,
796 };
797
798 enum char_set_type
799 {
800     CSET_DEFAULT,
801     CSET_ASCII,         // flat 7-bit ASCII
802     NUM_CSET
803 };
804
805 enum cleansing_flame_source_type
806 {
807     CLEANSING_FLAME_GENERIC    = -1,
808     CLEANSING_FLAME_SPELL      = -2, // SPELL_FLAME_OF_CLEANSING
809     CLEANSING_FLAME_INVOCATION = -3, // ABIL_TSO_CLEANSING_FLAME
810     CLEANSING_FLAME_TSO        = -4, // TSO effect
811 };
812
813 enum cloud_type
814 {
815     CLOUD_NONE,
816     CLOUD_FIRE,
817     CLOUD_MEPHITIC,
818     CLOUD_COLD,
819     CLOUD_POISON,
820     CLOUD_BLACK_SMOKE,
821     CLOUD_GREY_SMOKE,
822     CLOUD_BLUE_SMOKE,
823     CLOUD_PURPLE_SMOKE,
824     CLOUD_TLOC_ENERGY,
825     CLOUD_FOREST_FIRE,
826     CLOUD_STEAM,
827 #if TAG_MAJOR_VERSION == 34
828     CLOUD_GLOOM,
829 #endif
830     CLOUD_INK,
831     CLOUD_PETRIFY,
832     CLOUD_HOLY_FLAMES,
833     CLOUD_MIASMA,
834     CLOUD_MIST,
835     CLOUD_CHAOS,
836     CLOUD_RAIN,
837     CLOUD_MUTAGENIC,
838     CLOUD_MAGIC_TRAIL,
839     CLOUD_TORNADO,
840     CLOUD_DUST_TRAIL,
841     CLOUD_GHOSTLY_FLAME,
842     CLOUD_ACID,
843     CLOUD_STORM,
844     CLOUD_NEGATIVE_ENERGY,
845     NUM_CLOUD_TYPES,
846
847     CLOUD_OPAQUE_FIRST = CLOUD_BLACK_SMOKE,
848     CLOUD_OPAQUE_LAST  = CLOUD_HOLY_FLAMES,
849
850     // Random per-square.
851     CLOUD_RANDOM_SMOKE = 97,
852     CLOUD_RANDOM,
853     CLOUD_DEBUGGING,
854 };
855
856 enum command_type
857 {
858     CMD_NO_CMD = 2000,
859     CMD_NO_CMD_DEFAULT, // hack to allow assignment of keys to CMD_NO_CMD
860     CMD_MOVE_LEFT,
861     CMD_MOVE_DOWN,
862     CMD_MOVE_UP,
863     CMD_MOVE_RIGHT,
864     CMD_MOVE_UP_LEFT,
865     CMD_MOVE_DOWN_LEFT,
866     CMD_MOVE_UP_RIGHT,
867     CMD_MOVE_DOWN_RIGHT,
868     CMD_RUN_LEFT,
869     CMD_RUN_DOWN,
870     CMD_RUN_UP,
871     CMD_RUN_RIGHT,
872     CMD_RUN_UP_LEFT,
873     CMD_RUN_DOWN_LEFT,
874     CMD_RUN_UP_RIGHT,
875     CMD_RUN_DOWN_RIGHT,
876     CMD_SAFE_WAIT,
877     CMD_SAFE_MOVE_LEFT,
878     CMD_SAFE_MOVE_DOWN,
879     CMD_SAFE_MOVE_UP,
880     CMD_SAFE_MOVE_RIGHT,
881     CMD_SAFE_MOVE_UP_LEFT,
882     CMD_SAFE_MOVE_DOWN_LEFT,
883     CMD_SAFE_MOVE_UP_RIGHT,
884     CMD_SAFE_MOVE_DOWN_RIGHT,
885     CMD_ATTACK_LEFT,
886     CMD_ATTACK_DOWN,
887     CMD_ATTACK_UP,
888     CMD_ATTACK_RIGHT,
889     CMD_ATTACK_UP_LEFT,
890     CMD_ATTACK_DOWN_LEFT,
891     CMD_ATTACK_UP_RIGHT,
892     CMD_ATTACK_DOWN_RIGHT,
893     CMD_OPEN_DOOR,
894     CMD_CLOSE_DOOR,
895     CMD_REST,
896     CMD_GO_UPSTAIRS,
897     CMD_GO_DOWNSTAIRS,
898     CMD_TOGGLE_AUTOPICKUP,
899     CMD_TOGGLE_VIEWPORT_MONSTER_HP,
900     CMD_TOGGLE_VIEWPORT_WEAPONS,
901     CMD_TOGGLE_TRAVEL_SPEED,
902     CMD_PICKUP,
903     CMD_PICKUP_QUANTITY,
904     CMD_DROP,
905     CMD_DROP_LAST,
906     CMD_BUTCHER,
907     CMD_INSPECT_FLOOR,
908     CMD_SHOW_TERRAIN,
909     CMD_FULL_VIEW,
910     CMD_EVOKE,
911     CMD_EVOKE_WIELDED,
912     CMD_FORCE_EVOKE_WIELDED,
913     CMD_WIELD_WEAPON,
914     CMD_WEAPON_SWAP,
915     CMD_FIRE,
916     CMD_QUIVER_ITEM,
917     CMD_THROW_ITEM_NO_QUIVER,
918     CMD_WEAR_ARMOUR,
919     CMD_REMOVE_ARMOUR,
920     CMD_WEAR_JEWELLERY,
921     CMD_REMOVE_JEWELLERY,
922     CMD_CYCLE_QUIVER_FORWARD,
923     CMD_CYCLE_QUIVER_BACKWARD,
924     CMD_LIST_WEAPONS,
925     CMD_LIST_ARMOUR,
926     CMD_LIST_JEWELLERY,
927     CMD_LIST_EQUIPMENT,
928     CMD_LIST_GOLD,
929     CMD_ZAP_WAND,
930     CMD_CAST_SPELL,
931     CMD_FORCE_CAST_SPELL,
932     CMD_MEMORISE_SPELL,
933     CMD_USE_ABILITY,
934     CMD_PRAY,
935     CMD_EAT,
936     CMD_QUAFF,
937     CMD_READ,
938     CMD_LOOK_AROUND,
939     CMD_WAIT,
940     CMD_SHOUT,
941     CMD_CHARACTER_DUMP,
942     CMD_DISPLAY_COMMANDS,
943     CMD_DISPLAY_INVENTORY,
944     CMD_DISPLAY_KNOWN_OBJECTS,
945     CMD_DISPLAY_MUTATIONS,
946     CMD_DISPLAY_SKILLS,
947     CMD_DISPLAY_MAP,
948     CMD_DISPLAY_OVERMAP,
949     CMD_DISPLAY_RELIGION,
950     CMD_DISPLAY_RUNES,
951     CMD_DISPLAY_CHARACTER_STATUS,
952     CMD_DISPLAY_SPELLS,
953     CMD_LOOKUP_HELP,
954     CMD_EXPERIENCE_CHECK,
955     CMD_ADJUST_INVENTORY,
956     CMD_REPLAY_MESSAGES,
957     CMD_REDRAW_SCREEN,
958     CMD_MACRO_ADD,
959     CMD_SAVE_GAME,
960     CMD_SAVE_GAME_NOW,
961     CMD_SUSPEND_GAME,
962     CMD_QUIT,
963     CMD_WIZARD,
964     CMD_EXPLORE_MODE,
965
966     CMD_SEARCH_STASHES,
967     CMD_EXPLORE,
968     CMD_INTERLEVEL_TRAVEL,
969     CMD_FIX_WAYPOINT,
970
971     CMD_CLEAR_MAP,
972     CMD_INSCRIBE_ITEM,
973     CMD_MAKE_NOTE,
974     CMD_RESISTS_SCREEN,
975
976     CMD_READ_MESSAGES,
977
978     CMD_MOUSE_MOVE,
979     CMD_MOUSE_CLICK,
980
981     CMD_ANNOTATE_LEVEL,
982
983 #ifdef CLUA_BINDINGS
984     CMD_AUTOFIGHT,
985     CMD_AUTOFIGHT_NOMOVE,
986 #endif
987
988 #ifdef USE_TILE
989     CMD_EDIT_PLAYER_TILE,
990     CMD_MIN_TILE = CMD_EDIT_PLAYER_TILE,
991     CMD_MAX_TILE = CMD_EDIT_PLAYER_TILE,
992 #endif
993
994 #ifdef TOUCH_UI
995     // zoom on dungeon
996     CMD_ZOOM_IN,
997     CMD_ZOOM_OUT,
998
999     // bring up the on-screen keyboard if needed
1000     CMD_SHOW_KEYBOARD,
1001 #endif
1002
1003     // Repeat previous command
1004     CMD_PREV_CMD_AGAIN,
1005
1006     // Repeat next command a given number of times
1007     CMD_REPEAT_CMD,
1008
1009     CMD_LUA_CONSOLE,
1010
1011     CMD_MAX_NORMAL = CMD_LUA_CONSOLE,
1012
1013     // overmap commands
1014     CMD_MAP_CLEAR_MAP,
1015     CMD_MIN_OVERMAP = CMD_MAP_CLEAR_MAP,
1016     CMD_MAP_ADD_WAYPOINT,
1017     CMD_MAP_EXCLUDE_AREA,
1018     CMD_MAP_CLEAR_EXCLUDES,
1019     CMD_MAP_EXCLUDE_RADIUS,
1020
1021     CMD_MAP_MOVE_LEFT,
1022     CMD_MAP_MOVE_DOWN,
1023     CMD_MAP_MOVE_UP,
1024     CMD_MAP_MOVE_RIGHT,
1025     CMD_MAP_MOVE_UP_LEFT,
1026     CMD_MAP_MOVE_DOWN_LEFT,
1027     CMD_MAP_MOVE_UP_RIGHT,
1028     CMD_MAP_MOVE_DOWN_RIGHT,
1029
1030     CMD_MAP_JUMP_LEFT,
1031     CMD_MAP_JUMP_DOWN,
1032     CMD_MAP_JUMP_UP,
1033     CMD_MAP_JUMP_RIGHT,
1034     CMD_MAP_JUMP_UP_LEFT,
1035     CMD_MAP_JUMP_DOWN_LEFT,
1036     CMD_MAP_JUMP_UP_RIGHT,
1037     CMD_MAP_JUMP_DOWN_RIGHT,
1038
1039     CMD_MAP_NEXT_LEVEL,
1040     CMD_MAP_PREV_LEVEL,
1041     CMD_MAP_GOTO_LEVEL,
1042
1043     CMD_MAP_SCROLL_DOWN,
1044     CMD_MAP_SCROLL_UP,
1045
1046     CMD_MAP_FIND_UPSTAIR,
1047     CMD_MAP_FIND_DOWNSTAIR,
1048     CMD_MAP_FIND_YOU,
1049     CMD_MAP_FIND_PORTAL,
1050     CMD_MAP_FIND_TRAP,
1051     CMD_MAP_FIND_ALTAR,
1052     CMD_MAP_FIND_EXCLUDED,
1053     CMD_MAP_FIND_WAYPOINT,
1054     CMD_MAP_FIND_STASH,
1055     CMD_MAP_FIND_STASH_REVERSE,
1056
1057     CMD_MAP_GOTO_TARGET,
1058     CMD_MAP_ANNOTATE_LEVEL,
1059
1060     CMD_MAP_EXPLORE,
1061
1062     CMD_MAP_WIZARD_TELEPORT,
1063
1064     CMD_MAP_DESCRIBE,
1065
1066     CMD_MAP_HELP,
1067     CMD_MAP_FORGET,
1068     CMD_MAP_UNFORGET,
1069
1070     CMD_MAP_EXIT_MAP,
1071
1072     CMD_MAX_OVERMAP = CMD_MAP_EXIT_MAP,
1073
1074     // targeting commands
1075     CMD_TARGET_DOWN_LEFT,
1076     CMD_MIN_TARGET = CMD_TARGET_DOWN_LEFT,
1077     CMD_TARGET_DOWN,
1078     CMD_TARGET_DOWN_RIGHT,
1079     CMD_TARGET_LEFT,
1080     CMD_TARGET_RIGHT,
1081     CMD_TARGET_UP_LEFT,
1082     CMD_TARGET_UP,
1083     CMD_TARGET_UP_RIGHT,
1084
1085     CMD_TARGET_DIR_DOWN_LEFT,
1086     CMD_TARGET_DIR_DOWN,
1087     CMD_TARGET_DIR_DOWN_RIGHT,
1088     CMD_TARGET_DIR_LEFT,
1089     CMD_TARGET_DIR_RIGHT,
1090     CMD_TARGET_DIR_UP_LEFT,
1091     CMD_TARGET_DIR_UP,
1092     CMD_TARGET_DIR_UP_RIGHT,
1093
1094     CMD_TARGET_DESCRIBE,
1095     CMD_TARGET_PREV_TARGET,
1096     CMD_TARGET_MAYBE_PREV_TARGET,
1097     CMD_TARGET_SELECT,
1098     CMD_TARGET_SELECT_ENDPOINT,
1099     CMD_TARGET_SELECT_FORCE,
1100     CMD_TARGET_SELECT_FORCE_ENDPOINT,
1101     CMD_TARGET_GET,
1102     CMD_TARGET_OBJ_CYCLE_BACK,
1103     CMD_TARGET_OBJ_CYCLE_FORWARD,
1104     CMD_TARGET_CYCLE_FORWARD,
1105     CMD_TARGET_CYCLE_BACK,
1106     CMD_TARGET_CYCLE_BEAM,
1107     CMD_TARGET_CYCLE_MLIST = CMD_NO_CMD + 1000, // for indices a-z in the monster list
1108     CMD_TARGET_CYCLE_MLIST_END = CMD_NO_CMD + 1025,
1109     CMD_TARGET_TOGGLE_MLIST,
1110     CMD_TARGET_TOGGLE_BEAM,
1111     CMD_TARGET_CANCEL,
1112     CMD_TARGET_SHOW_PROMPT,
1113     CMD_TARGET_OLD_SPACE,
1114     CMD_TARGET_EXCLUDE,
1115     CMD_TARGET_FIND_TRAP,
1116     CMD_TARGET_FIND_PORTAL,
1117     CMD_TARGET_FIND_ALTAR,
1118     CMD_TARGET_FIND_UPSTAIR,
1119     CMD_TARGET_FIND_DOWNSTAIR,
1120     CMD_TARGET_FIND_YOU,
1121     CMD_TARGET_WIZARD_MAKE_FRIENDLY,
1122     CMD_TARGET_WIZARD_BLESS_MONSTER,
1123     CMD_TARGET_WIZARD_MAKE_SHOUT,
1124     CMD_TARGET_WIZARD_GIVE_ITEM,
1125     CMD_TARGET_WIZARD_MOVE,
1126     CMD_TARGET_WIZARD_PATHFIND,
1127     CMD_TARGET_WIZARD_GAIN_LEVEL,
1128     CMD_TARGET_WIZARD_MISCAST,
1129     CMD_TARGET_WIZARD_MAKE_SUMMONED,
1130     CMD_TARGET_WIZARD_POLYMORPH,
1131     CMD_TARGET_WIZARD_DEBUG_MONSTER,
1132     CMD_TARGET_WIZARD_HEAL_MONSTER,
1133     CMD_TARGET_WIZARD_HURT_MONSTER,
1134     CMD_TARGET_WIZARD_DEBUG_PORTAL,
1135     CMD_TARGET_WIZARD_KILL_MONSTER,
1136     CMD_TARGET_WIZARD_BANISH_MONSTER,
1137     CMD_TARGET_WIZARD_CREATE_MIMIC,
1138     CMD_TARGET_MOUSE_MOVE,
1139     CMD_TARGET_MOUSE_SELECT,
1140     CMD_TARGET_HELP,
1141     CMD_MAX_TARGET = CMD_TARGET_HELP,
1142
1143 #ifdef USE_TILE
1144     // Tile doll editing screen
1145     CMD_DOLL_RANDOMIZE,
1146     CMD_MIN_DOLL = CMD_DOLL_RANDOMIZE,
1147     CMD_DOLL_SELECT_NEXT_DOLL,
1148     CMD_DOLL_SELECT_PREV_DOLL,
1149     CMD_DOLL_SELECT_NEXT_PART,
1150     CMD_DOLL_SELECT_PREV_PART,
1151     CMD_DOLL_CHANGE_PART_NEXT,
1152     CMD_DOLL_CHANGE_PART_PREV,
1153     CMD_DOLL_CONFIRM_CHOICE,
1154     CMD_DOLL_COPY,
1155     CMD_DOLL_PASTE,
1156     CMD_DOLL_TAKE_OFF,
1157     CMD_DOLL_TAKE_OFF_ALL,
1158     CMD_DOLL_TOGGLE_EQUIP,
1159     CMD_DOLL_TOGGLE_EQUIP_ALL,
1160     CMD_DOLL_JOB_DEFAULT,
1161     CMD_DOLL_CHANGE_MODE,
1162     CMD_DOLL_SAVE,
1163     CMD_DOLL_QUIT,
1164     CMD_MAX_DOLL = CMD_DOLL_QUIT,
1165 #endif
1166
1167     // Disable/enable -more- prompts.
1168     CMD_DISABLE_MORE,
1169     CMD_MIN_SYNTHETIC = CMD_DISABLE_MORE,
1170     CMD_ENABLE_MORE,
1171     CMD_UNWIELD_WEAPON,
1172
1173     // [ds] Silently ignored, requests another round of input.
1174     CMD_NEXT_CMD,
1175
1176     // Must always be last
1177     CMD_MAX_CMD
1178 };
1179
1180 enum conduct_type
1181 {
1182     DID_NOTHING,
1183     DID_NECROMANCY,                       // vamp/drain/pain/reap, Zong/Curses
1184     DID_HOLY,                             // holy wrath, holy word scrolls
1185     DID_UNHOLY,                           // demon weapons, demon spells
1186     DID_ATTACK_HOLY,
1187     DID_ATTACK_NEUTRAL,
1188     DID_ATTACK_FRIEND,
1189     DID_FRIEND_DIED,
1190     DID_UNCHIVALRIC_ATTACK,
1191     DID_POISON,
1192     DID_KILL_LIVING,
1193     DID_KILL_UNDEAD,
1194     DID_KILL_DEMON,
1195     DID_KILL_NATURAL_UNHOLY,              // TSO
1196     DID_KILL_NATURAL_EVIL,                // TSO
1197     DID_KILL_UNCLEAN,                     // Zin
1198     DID_KILL_CHAOTIC,                     // Zin
1199     DID_KILL_WIZARD,                      // Trog
1200     DID_KILL_PRIEST,                      // Beogh
1201     DID_KILL_HOLY,
1202     DID_KILL_FAST,                        // Cheibriados
1203     DID_BANISH,
1204     DID_SPELL_MEMORISE,
1205     DID_SPELL_CASTING,
1206     DID_SPELL_PRACTISE,
1207     DID_DRINK_BLOOD,
1208     DID_CANNIBALISM,
1209     DID_DESECRATE_SOULED_BEING,           // Zin
1210     DID_DELIBERATE_MUTATING,              // Zin
1211     DID_CAUSE_GLOWING,                    // Zin
1212     DID_UNCLEAN,                          // Zin (used unclean weapon/magic)
1213     DID_CHAOS,                            // Zin (used chaotic weapon/magic)
1214     DID_DESECRATE_ORCISH_REMAINS,         // Beogh
1215     DID_DESTROY_ORCISH_IDOL,              // Beogh
1216     DID_KILL_SLIME,                       // Jiyva
1217     DID_KILL_PLANT,                       // Fedhas
1218     DID_HASTY,                            // Cheibriados
1219     DID_CORPSE_VIOLATION,                 // Fedhas (Necromancy involving
1220                                           // corpses/chunks).
1221     DID_SOULED_FRIEND_DIED,               // Zin
1222     DID_ATTACK_IN_SANCTUARY,              // Zin
1223     DID_KILL_ARTIFICIAL,                  // Yredelemnul
1224     DID_DESTROY_SPELLBOOK,                // Sif Muna
1225     DID_EXPLORATION,                      // Ashenzari, wrath timers
1226     DID_DESECRATE_HOLY_REMAINS,           // Zin/Ely/TSO/Yredelemnul
1227     DID_SEE_MONSTER,                      // TSO
1228     DID_FIRE,                             // Dithmenos
1229     DID_KILL_FIERY,                       // Dithmenos
1230     DID_SACRIFICE_LOVE,                   // Ru
1231
1232     NUM_CONDUCTS
1233 };
1234
1235 enum confirm_butcher_type
1236 {
1237     CONFIRM_NEVER,
1238     CONFIRM_ALWAYS,
1239     CONFIRM_AUTO,
1240 };
1241
1242 enum confirm_prompt_type
1243 {
1244     CONFIRM_CANCEL,             // automatically answer 'no', i.e. disallow
1245     CONFIRM_PROMPT,             // prompt
1246     CONFIRM_NONE,               // automatically answer 'yes'
1247 };
1248
1249 enum confirm_level_type
1250 {
1251     CONFIRM_NONE_EASY,
1252     CONFIRM_SAFE_EASY,
1253     CONFIRM_ALL_EASY,
1254 };
1255
1256 // When adding new delays, update their names in delay.cc
1257 enum delay_type
1258 {
1259     DELAY_NOT_DELAYED,
1260     DELAY_EAT,
1261     DELAY_FEED_VAMPIRE,
1262     DELAY_ARMOUR_ON,
1263     DELAY_ARMOUR_OFF,
1264     DELAY_JEWELLERY_ON,
1265     DELAY_MEMORISE,
1266     DELAY_BUTCHER,
1267     DELAY_BOTTLE_BLOOD,
1268 #if TAG_MAJOR_VERSION == 34
1269     DELAY_WEAPON_SWAP,
1270 #endif
1271     DELAY_PASSWALL,
1272     DELAY_DROP_ITEM,
1273     DELAY_MULTIDROP,
1274     DELAY_ASCENDING_STAIRS,
1275     DELAY_DESCENDING_STAIRS,
1276 #if TAG_MAJOR_VERSION == 34
1277     DELAY_UNUSED, // was DELAY_RECITE
1278 #endif
1279
1280     // [dshaligram] Shift-running, resting, travel and macros are now
1281     // also handled as delays.
1282     DELAY_RUN,
1283     DELAY_REST,
1284     DELAY_TRAVEL,
1285
1286     DELAY_MACRO,
1287
1288     // In a macro delay, a stacked delay to tell Crawl to read and act on
1289     // one input command.
1290     DELAY_MACRO_PROCESS_KEY,
1291
1292     DELAY_INTERRUPTIBLE,                // simple interruptible delay
1293     DELAY_UNINTERRUPTIBLE,              // simple uninterruptible delay
1294
1295     DELAY_SHAFT_SELF, // Formicid ability
1296     DELAY_BLURRY_SCROLL,
1297
1298     NUM_DELAYS
1299 };
1300
1301 enum description_level_type
1302 {
1303     DESC_THE,
1304     DESC_A,
1305     DESC_YOUR,
1306     DESC_PLAIN,
1307     DESC_ITS,
1308     DESC_INVENTORY_EQUIP,
1309     DESC_INVENTORY,
1310
1311     // Partial item names.
1312     DESC_BASENAME,                     // Base name of item subtype
1313     DESC_QUALNAME,                     // Name without articles, quantities,
1314                                        // enchantments.
1315     DESC_DBNAME,                       // Name with which to look up item
1316                                        // description in the db.
1317
1318     DESC_NONE
1319 };
1320
1321 enum evoc_type
1322 {
1323     EVOC_WAND,
1324     EVOC_ROD,
1325     EVOC_DECK,
1326 #if TAG_MAJOR_VERSION == 34
1327     EVOC_MISC,
1328     EVOC_BUGGY_TOME,
1329 #endif
1330 };
1331
1332 enum game_direction_type
1333 {
1334     GDT_GAME_START = 0,
1335     GDT_DESCENDING,
1336     GDT_ASCENDING,
1337 };
1338
1339 enum game_type
1340 {
1341     GAME_TYPE_UNSPECIFIED,
1342     GAME_TYPE_NORMAL,
1343     GAME_TYPE_TUTORIAL,
1344     GAME_TYPE_ARENA,
1345     GAME_TYPE_SPRINT,
1346     GAME_TYPE_HINTS,
1347     GAME_TYPE_ZOTDEF,
1348     GAME_TYPE_INSTRUCTIONS,
1349     GAME_TYPE_HIGH_SCORES,
1350     NUM_GAME_TYPE
1351 };
1352
1353 enum level_flag_type
1354 {
1355     LFLAG_NONE = 0,
1356
1357     LFLAG_NO_TELE_CONTROL = (1 << 0), // Teleport control not allowed.
1358     LFLAG_NO_MAP          = (1 << 2), // Level can't be persistently mapped.
1359 };
1360
1361 // Volatile state and cache.
1362 enum level_state_type
1363 {
1364     LSTATE_NONE = 0,
1365
1366     LSTATE_GOLUBRIA       = (1 << 0), // A Golubria trap exists.
1367     LSTATE_GLOW_MOLD      = (1 << 1), // Any glowing mold exists.
1368     LSTATE_DELETED        = (1 << 2), // The level won't be saved.
1369     LSTATE_BEOGH          = (1 << 3), // Possibly an orcish priest around.
1370     LSTATE_SLIMY_WALL     = (1 << 4), // Any slime walls exist.
1371 };
1372
1373 // NOTE: The order of these is very important to their usage!
1374 // [dshaligram] If adding/removing from this list, also update viewchar.cc!
1375 enum dungeon_char_type
1376 {
1377     DCHAR_WALL,
1378     DCHAR_PERMAWALL,
1379     DCHAR_WALL_MAGIC,
1380     DCHAR_FLOOR,
1381     DCHAR_FLOOR_MAGIC,
1382     DCHAR_DOOR_OPEN,
1383     DCHAR_DOOR_CLOSED,
1384     DCHAR_TRAP,
1385     DCHAR_STAIRS_DOWN,
1386     DCHAR_STAIRS_UP,
1387     DCHAR_GRATE,
1388     DCHAR_ALTAR,
1389     DCHAR_ARCH,
1390     DCHAR_FOUNTAIN,
1391     DCHAR_WAVY,
1392     DCHAR_STATUE,
1393     DCHAR_INVIS_EXPOSED,
1394     DCHAR_ITEM_DETECTED,
1395     DCHAR_ITEM_ORB,
1396     DCHAR_ITEM_RUNE,
1397     DCHAR_ITEM_WEAPON,
1398     DCHAR_ITEM_ARMOUR,
1399     DCHAR_ITEM_WAND,
1400     DCHAR_ITEM_FOOD,
1401     DCHAR_ITEM_SCROLL,
1402     DCHAR_ITEM_RING,
1403     DCHAR_ITEM_POTION,
1404     DCHAR_ITEM_MISSILE,
1405     DCHAR_ITEM_BOOK,
1406     DCHAR_ITEM_STAFF,
1407     DCHAR_ITEM_ROD,
1408     DCHAR_ITEM_MISCELLANY,
1409     DCHAR_ITEM_CORPSE,
1410     DCHAR_ITEM_SKELETON,
1411     DCHAR_ITEM_GOLD,
1412     DCHAR_ITEM_AMULET,
1413     DCHAR_CLOUD,
1414     DCHAR_TREE,
1415     DCHAR_TELEPORTER,
1416
1417     DCHAR_SPACE,
1418     DCHAR_FIRED_FLASK,
1419     DCHAR_FIRED_BOLT,
1420     DCHAR_FIRED_CHUNK,
1421     DCHAR_FIRED_BOOK,
1422     DCHAR_FIRED_WEAPON,
1423     DCHAR_FIRED_ZAP,
1424     DCHAR_FIRED_BURST,
1425     DCHAR_FIRED_STICK,
1426     DCHAR_FIRED_TRINKET,
1427     DCHAR_FIRED_SCROLL,
1428     DCHAR_FIRED_DEBUG,
1429     DCHAR_FIRED_ARMOUR,
1430     DCHAR_FIRED_MISSILE,
1431     DCHAR_EXPLOSION,
1432
1433     DCHAR_FRAME_HORIZ,
1434     DCHAR_FRAME_VERT,
1435     DCHAR_FRAME_TL,
1436     DCHAR_FRAME_TR,
1437     DCHAR_FRAME_BL,
1438     DCHAR_FRAME_BR,
1439
1440     NUM_DCHAR_TYPES
1441 };
1442
1443 // When adding:
1444
1445 // * Add an entry in feature-data.h for the feature.
1446
1447 // * edit dat/descript/features.txt and add a
1448 //      long description if appropriate.
1449
1450 // * check the feat_* functions in terrain.cc and make sure
1451 //      they return sane values for your new feature.
1452
1453 // * edit mapdef.cc and add a symbol to _glyph_to_feat() for the feature,
1454 //      if you want vault maps to be able to use it directly . If you do, also
1455 //      update docs/develop/levels/syntax.txt with the new symbol.
1456 enum dungeon_feature_type
1457 {
1458     DNGN_UNSEEN = 0,                   // must be zero
1459     DNGN_CLOSED_DOOR,
1460     DNGN_RUNED_DOOR,
1461     DNGN_SEALED_DOOR,
1462     DNGN_TREE,
1463
1464     // Walls
1465     DNGN_METAL_WALL,
1466     DNGN_CRYSTAL_WALL,
1467     DNGN_ROCK_WALL,
1468     DNGN_SLIMY_WALL,
1469     DNGN_STONE_WALL,
1470     DNGN_PERMAROCK_WALL,               // for undiggable walls
1471     DNGN_CLEAR_ROCK_WALL,              // transparent walls
1472     DNGN_CLEAR_STONE_WALL,
1473     DNGN_CLEAR_PERMAROCK_WALL,
1474
1475     DNGN_GRATE,
1476
1477     // Misc solid features
1478     DNGN_OPEN_SEA,                     // Shoals equivalent for permarock
1479     DNGN_LAVA_SEA,                     // Gehenna equivalent for permarock
1480     DNGN_ORCISH_IDOL,
1481     DNGN_GRANITE_STATUE,
1482     DNGN_MALIGN_GATEWAY,
1483
1484 #if TAG_MAJOR_VERSION == 34
1485     DNGN_LAVA            = 30,
1486 #else
1487     DNGN_LAVA,
1488 #endif
1489     DNGN_DEEP_WATER,
1490
1491     DNGN_SHALLOW_WATER,
1492
1493     DNGN_FLOOR,
1494     DNGN_OPEN_DOOR,
1495
1496     DNGN_TRAP_MECHANICAL,
1497     DNGN_TRAP_TELEPORT,
1498     DNGN_TRAP_SHAFT,
1499     DNGN_TRAP_WEB,
1500 #if TAG_MAJOR_VERSION > 34
1501     DNGN_TRAP_ALARM,
1502     DNGN_TRAP_ZOT,
1503     DNGN_PASSAGE_OF_GOLUBRIA,
1504     DNGN_TRAP_SHADOW,
1505     DNGN_TRAP_SHADOW_DORMANT,
1506 #endif
1507     DNGN_UNDISCOVERED_TRAP,
1508
1509     DNGN_ENTER_SHOP,
1510     DNGN_ABANDONED_SHOP,
1511
1512     DNGN_STONE_STAIRS_DOWN_I,
1513     DNGN_STONE_STAIRS_DOWN_II,
1514     DNGN_STONE_STAIRS_DOWN_III,
1515     DNGN_ESCAPE_HATCH_DOWN,
1516
1517     // corresponding up stairs (same order as above)
1518     DNGN_STONE_STAIRS_UP_I,
1519     DNGN_STONE_STAIRS_UP_II,
1520     DNGN_STONE_STAIRS_UP_III,
1521     DNGN_ESCAPE_HATCH_UP,
1522
1523     // Various gates
1524     DNGN_ENTER_DIS,
1525     DNGN_ENTER_GEHENNA,
1526     DNGN_ENTER_COCYTUS,
1527     DNGN_ENTER_TARTARUS,
1528     DNGN_ENTER_ABYSS,
1529     DNGN_EXIT_ABYSS,
1530     DNGN_STONE_ARCH,
1531     DNGN_ENTER_PANDEMONIUM,
1532     DNGN_EXIT_PANDEMONIUM,
1533     DNGN_TRANSIT_PANDEMONIUM,
1534     DNGN_EXIT_DUNGEON,
1535     DNGN_EXIT_THROUGH_ABYSS,
1536     DNGN_EXIT_HELL,
1537     DNGN_ENTER_HELL,
1538     DNGN_ENTER_LABYRINTH,
1539     DNGN_TELEPORTER,
1540 #if TAG_MAJOR_VERSION == 34
1541     DNGN_ENTER_PORTAL_VAULT,
1542     DNGN_EXIT_PORTAL_VAULT,
1543 #endif
1544     DNGN_EXPIRED_PORTAL,
1545
1546     // Entrances to various branches
1547 #if TAG_MAJOR_VERSION == 34
1548     DNGN_ENTER_DWARF,
1549 #endif
1550     DNGN_ENTER_ORC,
1551     DNGN_ENTER_LAIR,
1552     DNGN_ENTER_SLIME,
1553     DNGN_ENTER_VAULTS,
1554     DNGN_ENTER_CRYPT,
1555 #if TAG_MAJOR_VERSION == 34
1556     DNGN_ENTER_BLADE,
1557 #endif
1558     DNGN_ENTER_ZOT,
1559     DNGN_ENTER_TEMPLE,
1560     DNGN_ENTER_SNAKE,
1561     DNGN_ENTER_ELF,
1562     DNGN_ENTER_TOMB,
1563     DNGN_ENTER_SWAMP,
1564     DNGN_ENTER_SHOALS,
1565     DNGN_ENTER_SPIDER,
1566 #if TAG_MAJOR_VERSION == 34
1567     DNGN_ENTER_FOREST,
1568 #endif
1569     DNGN_ENTER_DEPTHS,
1570
1571     // Exits from various branches
1572     // Order must be the same as above
1573 #if TAG_MAJOR_VERSION == 34
1574     DNGN_EXIT_DWARF,
1575 #endif
1576     DNGN_EXIT_ORC,
1577     DNGN_EXIT_LAIR,
1578     DNGN_EXIT_SLIME,
1579     DNGN_EXIT_VAULTS,
1580     DNGN_EXIT_CRYPT,
1581 #if TAG_MAJOR_VERSION == 34
1582     DNGN_EXIT_BLADE,
1583 #endif
1584     DNGN_EXIT_ZOT,
1585     DNGN_EXIT_TEMPLE,
1586     DNGN_EXIT_SNAKE,
1587     DNGN_EXIT_ELF,
1588     DNGN_EXIT_TOMB,
1589     DNGN_EXIT_SWAMP,
1590     DNGN_EXIT_SHOALS,
1591     DNGN_EXIT_SPIDER,
1592 #if TAG_MAJOR_VERSION == 34
1593     DNGN_EXIT_FOREST,
1594 #endif
1595     DNGN_EXIT_DEPTHS,
1596
1597     DNGN_ALTAR_ZIN,
1598     DNGN_ALTAR_SHINING_ONE,
1599     DNGN_ALTAR_KIKUBAAQUDGHA,
1600     DNGN_ALTAR_YREDELEMNUL,
1601     DNGN_ALTAR_XOM,
1602     DNGN_ALTAR_VEHUMET,
1603     DNGN_ALTAR_OKAWARU,
1604     DNGN_ALTAR_MAKHLEB,
1605     DNGN_ALTAR_SIF_MUNA,
1606     DNGN_ALTAR_TROG,
1607     DNGN_ALTAR_NEMELEX_XOBEH,
1608     DNGN_ALTAR_ELYVILON,
1609     DNGN_ALTAR_LUGONU,
1610     DNGN_ALTAR_BEOGH,
1611     DNGN_ALTAR_JIYVA,
1612     DNGN_ALTAR_FEDHAS,
1613     DNGN_ALTAR_CHEIBRIADOS,
1614     DNGN_ALTAR_ASHENZARI,
1615     DNGN_ALTAR_DITHMENOS,
1616 #if TAG_MAJOR_VERSION > 34
1617     DNGN_ALTAR_GOZAG,
1618     DNGN_ALTAR_QAZLAL,
1619     DNGN_ALTAR_RU,
1620 #endif
1621
1622     DNGN_FOUNTAIN_BLUE,
1623     DNGN_FOUNTAIN_SPARKLING,           // aka 'Magic Fountain' {dlb}
1624     DNGN_FOUNTAIN_BLOOD,
1625 #if TAG_MAJOR_VERSION == 34
1626     DNGN_DRY_FOUNTAIN_BLUE,
1627     DNGN_DRY_FOUNTAIN_SPARKLING,
1628     DNGN_DRY_FOUNTAIN_BLOOD,
1629 #endif
1630     DNGN_DRY_FOUNTAIN,
1631
1632     // Not meant to ever appear in grd().
1633     DNGN_EXPLORE_HORIZON, // dummy for redefinition
1634
1635     DNGN_UNKNOWN_ALTAR,
1636     DNGN_UNKNOWN_PORTAL,
1637
1638     DNGN_ABYSSAL_STAIR,
1639 #if TAG_MAJOR_VERSION == 34
1640     DNGN_BADLY_SEALED_DOOR,
1641 #endif
1642
1643     DNGN_SEALED_STAIRS_UP,
1644     DNGN_SEALED_STAIRS_DOWN,
1645 #if TAG_MAJOR_VERSION == 34
1646     DNGN_TRAP_ALARM,
1647     DNGN_TRAP_ZOT,
1648     DNGN_PASSAGE_OF_GOLUBRIA,
1649 #endif
1650
1651     DNGN_ENTER_ZIGGURAT,
1652     DNGN_ENTER_BAZAAR,
1653     DNGN_ENTER_TROVE,
1654     DNGN_ENTER_SEWER,
1655     DNGN_ENTER_OSSUARY,
1656     DNGN_ENTER_BAILEY,
1657     DNGN_ENTER_ICE_CAVE,
1658     DNGN_ENTER_VOLCANO,
1659     DNGN_ENTER_WIZLAB,
1660 #if TAG_MAJOR_VERSION == 34
1661     DNGN_UNUSED_ENTER_PORTAL_1,
1662 #endif
1663
1664     DNGN_EXIT_ZIGGURAT,
1665     DNGN_EXIT_BAZAAR,
1666     DNGN_EXIT_TROVE,
1667     DNGN_EXIT_SEWER,
1668     DNGN_EXIT_OSSUARY,
1669     DNGN_EXIT_BAILEY,
1670     DNGN_EXIT_ICE_CAVE,
1671     DNGN_EXIT_VOLCANO,
1672     DNGN_EXIT_WIZLAB,
1673     DNGN_EXIT_LABYRINTH,
1674 #if TAG_MAJOR_VERSION == 34
1675     DNGN_UNUSED_EXIT_PORTAL_1,
1676
1677     DNGN_ALTAR_GOZAG,
1678     DNGN_ALTAR_QAZLAL,
1679     DNGN_ALTAR_RU,
1680
1681     DNGN_TRAP_SHADOW,
1682     DNGN_TRAP_SHADOW_DORMANT,
1683 #endif
1684
1685     NUM_FEATURES
1686 };
1687
1688 enum duration_type
1689 {
1690     DUR_INVIS,
1691     DUR_CONF,
1692     DUR_PARALYSIS,
1693     DUR_SLOW,
1694     DUR_MESMERISED,
1695     DUR_HASTE,
1696     DUR_MIGHT,
1697     DUR_BRILLIANCE,
1698     DUR_AGILITY,
1699     DUR_FLIGHT,
1700     DUR_BERSERK,
1701     DUR_POISONING,
1702
1703     DUR_CONFUSING_TOUCH,
1704 #if TAG_MAJOR_VERSION == 34
1705     DUR_SURE_BLADE,
1706 #endif
1707     DUR_CORONA,
1708     DUR_DEATHS_DOOR,
1709     DUR_FIRE_SHIELD,
1710
1711 #if TAG_MAJOR_VERSION == 34
1712     DUR_BUILDING_RAGE,
1713 #endif
1714     DUR_EXHAUSTED,              // fatigue counter for berserk
1715
1716     DUR_LIQUID_FLAMES,
1717     DUR_ICY_ARMOUR,
1718 #if TAG_MAJOR_VERSION == 34
1719     DUR_REPEL_MISSILES,
1720     DUR_JELLY_PRAYER,
1721 #endif
1722     DUR_PIETY_POOL,             // distribute piety over time
1723     DUR_DIVINE_VIGOUR,          // duration of Ely's Divine Vigour
1724     DUR_DIVINE_STAMINA,         // duration of Zin's Divine Stamina
1725     DUR_DIVINE_SHIELD,          // duration of TSO's Divine Shield
1726     DUR_REGENERATION,
1727     DUR_SWIFTNESS,
1728 #if TAG_MAJOR_VERSION == 34
1729     DUR_CONTROLLED_FLIGHT,
1730 #endif
1731     DUR_TELEPORT,
1732     DUR_CONTROL_TELEPORT,
1733     DUR_BREATH_WEAPON,
1734     DUR_TRANSFORMATION,
1735     DUR_DEATH_CHANNEL,
1736 #if TAG_MAJOR_VERSION == 34
1737     DUR_DEFLECT_MISSILES,
1738 #endif
1739     DUR_PHASE_SHIFT,
1740 #if TAG_MAJOR_VERSION == 34
1741     DUR_SEE_INVISIBLE,
1742 #endif
1743     DUR_WEAPON_BRAND,           // general "branding" spell counter
1744     DUR_DEMONIC_GUARDIAN,       // demonic guardian timeout
1745     DUR_POWERED_BY_DEATH,
1746     DUR_SILENCE,
1747     DUR_CONDENSATION_SHIELD,
1748     DUR_STONESKIN,
1749     DUR_GOURMAND,
1750 #if TAG_MAJOR_VERSION == 34
1751     DUR_BARGAIN,
1752     DUR_INSULATION,
1753 #endif
1754     DUR_RESISTANCE,
1755 #if TAG_MAJOR_VERSION == 34
1756     DUR_SLAYING,
1757 #endif
1758     DUR_STEALTH,
1759     DUR_MAGIC_SHIELD,
1760     DUR_SLEEP,
1761     DUR_TELEPATHY,
1762     DUR_PETRIFIED,
1763     DUR_LOWERED_MR,
1764     DUR_REPEL_STAIRS_MOVE,
1765     DUR_REPEL_STAIRS_CLIMB,
1766     DUR_COLOUR_SMOKE_TRAIL,
1767     DUR_SLIMIFY,
1768     DUR_TIME_STEP,
1769     DUR_ICEMAIL_DEPLETED,       // Wait this many turns for Icemail to return
1770 #if TAG_MAJOR_VERSION == 34
1771     DUR_MISLED,
1772 #endif
1773     DUR_QUAD_DAMAGE,
1774     DUR_AFRAID,
1775     DUR_MIRROR_DAMAGE,
1776     DUR_SCRYING,
1777     DUR_TORNADO,
1778     DUR_LIQUEFYING,
1779     DUR_HEROISM,
1780     DUR_FINESSE,
1781     DUR_LIFESAVING,
1782     DUR_PARALYSIS_IMMUNITY,
1783     DUR_DARKNESS,
1784     DUR_PETRIFYING,
1785     DUR_SHROUD_OF_GOLUBRIA,
1786     DUR_TORNADO_COOLDOWN,
1787 #if TAG_MAJOR_VERSION == 34
1788     DUR_NAUSEA,
1789 #endif
1790     DUR_AMBROSIA,
1791 #if TAG_MAJOR_VERSION == 34
1792     DUR_TEMP_MUTATIONS,
1793 #endif
1794     DUR_DISJUNCTION,
1795     DUR_VEHUMET_GIFT,
1796 #if TAG_MAJOR_VERSION == 34
1797     DUR_BATTLESPHERE,
1798 #endif
1799     DUR_SENTINEL_MARK,
1800     DUR_SICKENING,
1801     DUR_WATER_HOLD,
1802     DUR_WATER_HOLD_IMMUNITY,
1803     DUR_FLAYED,
1804 #if TAG_MAJOR_VERSION == 34
1805     DUR_RETCHING,
1806 #endif
1807     DUR_WEAK,
1808     DUR_DIMENSION_ANCHOR,
1809     DUR_ANTIMAGIC,
1810 #if TAG_MAJOR_VERSION == 34
1811     DUR_SPIRIT_HOWL,
1812 #endif
1813     DUR_INFUSION,
1814     DUR_SONG_OF_SLAYING,
1815 #if TAG_MAJOR_VERSION == 34
1816     DUR_SONG_OF_SHIELDING,
1817 #endif
1818     DUR_TOXIC_RADIANCE,
1819     DUR_RECITE,
1820     DUR_GRASPING_ROOTS,
1821     DUR_SLEEP_IMMUNITY,
1822     DUR_FIRE_VULN,
1823     DUR_ELIXIR_HEALTH,
1824     DUR_ELIXIR_MAGIC,
1825 #if TAG_MAJOR_VERSION == 34
1826     DUR_ANTENNAE_EXTEND,
1827 #endif
1828     DUR_TROGS_HAND,
1829     DUR_BARBS,
1830     DUR_POISON_VULN,
1831     DUR_FROZEN,
1832     DUR_SAP_MAGIC,
1833     DUR_MAGIC_SAPPED,
1834     DUR_PORTAL_PROJECTILE,
1835     DUR_FORESTED,
1836     DUR_DRAGON_CALL,
1837     DUR_DRAGON_CALL_COOLDOWN,
1838     DUR_ABJURATION_AURA,
1839     DUR_MESMERISE_IMMUNE,
1840     DUR_NO_POTIONS,
1841     DUR_QAZLAL_FIRE_RES,
1842     DUR_QAZLAL_COLD_RES,
1843     DUR_QAZLAL_ELEC_RES,
1844     DUR_QAZLAL_AC,
1845     DUR_CORROSION,
1846     DUR_FORTITUDE,
1847     DUR_HORROR,
1848     DUR_NO_SCROLLS,
1849 #if TAG_MAJOR_VERSION == 34
1850     DUR_NEGATIVE_VULN,
1851 #endif
1852     DUR_CLEAVE,
1853     DUR_GOZAG_GOLD_AURA,
1854     DUR_COLLAPSE,
1855     DUR_BRAINLESS,
1856     DUR_CLUMSY,
1857     NUM_DURATIONS
1858 };
1859
1860 // This list must match the enchant_names array in mon-ench.cc
1861 // Enchantments that imply other enchantments should come first
1862 // to avoid timeout message confusion. Currently:
1863 //     berserk -> haste, might; fatigue -> slow
1864 enum enchant_type
1865 {
1866     ENCH_NONE = 0,
1867     ENCH_BERSERK,
1868     ENCH_HASTE,
1869     ENCH_MIGHT,
1870     ENCH_FATIGUE,        // Post-berserk fatigue.
1871     ENCH_SLOW,
1872     ENCH_FEAR,
1873     ENCH_CONFUSION,
1874     ENCH_INVIS,
1875     ENCH_POISON,
1876 #if TAG_MAJOR_VERSION == 34
1877     ENCH_ROT,
1878 #endif
1879     ENCH_SUMMON,
1880     ENCH_ABJ,
1881     ENCH_CORONA,
1882     ENCH_CHARM,
1883     ENCH_STICKY_FLAME,
1884     ENCH_GLOWING_SHAPESHIFTER,
1885     ENCH_SHAPESHIFTER,
1886     ENCH_TP,
1887     ENCH_SLEEP_WARY,
1888     ENCH_SUBMERGED,
1889     ENCH_SHORT_LIVED,
1890     ENCH_PARALYSIS,
1891     ENCH_SICK,
1892 #if TAG_MAJOR_VERSION == 34
1893     ENCH_SLEEPY,         //   Monster can't wake until this wears off.
1894 #endif
1895     ENCH_HELD,           //   Caught in a net.
1896     ENCH_BATTLE_FRENZY,  //   Monster is in a battle frenzy.
1897 #if TAG_MAJOR_VERSION == 34
1898     ENCH_TEMP_PACIF,
1899 #endif
1900     ENCH_PETRIFYING,
1901     ENCH_PETRIFIED,
1902     ENCH_LOWERED_MR,
1903     ENCH_SOUL_RIPE,
1904     ENCH_SLOWLY_DYING,
1905     ENCH_EAT_ITEMS,
1906     ENCH_AQUATIC_LAND,   // Water monsters lose hp while on land.
1907     ENCH_SPORE_PRODUCTION,
1908 #if TAG_MAJOR_VERSION == 34
1909     ENCH_SLOUCH,
1910 #endif
1911     ENCH_SWIFT,
1912     ENCH_TIDE,
1913     ENCH_INSANE,         // Berserk + changed attitude.
1914     ENCH_SILENCE,
1915     ENCH_AWAKEN_FOREST,
1916     ENCH_EXPLODING,
1917     ENCH_BLEED,
1918     ENCH_PORTAL_TIMER,
1919     ENCH_SEVERED,
1920     ENCH_ANTIMAGIC,
1921 #if TAG_MAJOR_VERSION == 34
1922     ENCH_FADING_AWAY,
1923     ENCH_PREPARING_RESURRECT,
1924 #endif
1925     ENCH_REGENERATION,
1926     ENCH_RAISED_MR,
1927     ENCH_MIRROR_DAMAGE,
1928     ENCH_STONESKIN,
1929     ENCH_FEAR_INSPIRING,
1930     ENCH_PORTAL_PACIFIED,
1931     ENCH_WITHDRAWN,
1932 #if TAG_MAJOR_VERSION == 34
1933     ENCH_ATTACHED,
1934 #endif
1935     ENCH_LIFE_TIMER,     // Minimum time demonic guardian must exist.
1936     ENCH_FLIGHT,
1937     ENCH_LIQUEFYING,
1938     ENCH_TORNADO,
1939     ENCH_FAKE_ABJURATION,
1940     ENCH_DAZED,          // Dazed - less chance of acting each turn.
1941     ENCH_MUTE,           // Silenced.
1942     ENCH_BLIND,          // Blind (everything is invisible).
1943     ENCH_DUMB,           // Stupefied (paralysis by a different name).
1944     ENCH_MAD,            // Confusion by another name.
1945     ENCH_SILVER_CORONA,  // Zin's silver light.
1946     ENCH_RECITE_TIMER,   // Was recited against.
1947     ENCH_INNER_FLAME,
1948     ENCH_ROUSED,         // Monster has been roused to greatness
1949     ENCH_BREATH_WEAPON,  // just a simple timer for dragon breathweapon spam
1950     ENCH_DEATHS_DOOR,
1951     ENCH_ROLLING,        // Boulder Beetle in ball form
1952     ENCH_OZOCUBUS_ARMOUR,
1953     ENCH_WRETCHED,       // An abstract placeholder for monster mutations
1954     ENCH_SCREAMED,       // Starcursed scream timer
1955     ENCH_WORD_OF_RECALL, // Chanting word of recall
1956     ENCH_INJURY_BOND,
1957     ENCH_WATER_HOLD,     // Silence and asphyxiation damage
1958     ENCH_FLAYED,
1959     ENCH_HAUNTING,
1960 #if TAG_MAJOR_VERSION == 34
1961     ENCH_RETCHING,
1962 #endif
1963     ENCH_WEAK,
1964     ENCH_DIMENSION_ANCHOR,
1965     ENCH_AWAKEN_VINES,   // Is presently animating snaplasher vines
1966     ENCH_CONTROL_WINDS,
1967 #if TAG_MAJOR_VERSION == 34
1968     ENCH_WIND_AIDED,
1969 #endif
1970     ENCH_SUMMON_CAPPED,  // Abjuring quickly because a summon cap was hit
1971     ENCH_TOXIC_RADIANCE,
1972     ENCH_GRASPING_ROOTS_SOURCE, // Not actually entangled, but entangling others
1973     ENCH_GRASPING_ROOTS,
1974     ENCH_IOOD_CHARGED,
1975     ENCH_FIRE_VULN,
1976     ENCH_TORNADO_COOLDOWN,
1977     ENCH_MERFOLK_AVATAR_SONG,
1978     ENCH_BARBS,
1979 #if TAG_MAJOR_VERSION == 34
1980     ENCH_BUILDING_CHARGE,
1981 #endif
1982     ENCH_POISON_VULN,
1983     ENCH_ICEMAIL,
1984     ENCH_AGILE,
1985     ENCH_FROZEN,
1986     ENCH_EPHEMERAL_INFUSION,
1987     ENCH_BLACK_MARK,
1988     ENCH_GRAND_AVATAR,
1989     ENCH_SAP_MAGIC,
1990     ENCH_SHROUD,
1991     ENCH_PHANTOM_MIRROR,
1992     ENCH_NEUTRAL_BRIBED,
1993     ENCH_FRIENDLY_BRIBED,
1994     ENCH_CORROSION,
1995     ENCH_GOLD_LUST,
1996     ENCH_DRAINED,
1997     ENCH_REPEL_MISSILES,
1998     ENCH_DEFLECT_MISSILES,
1999 #if TAG_MAJOR_VERSION == 34
2000     ENCH_NEGATIVE_VULN,
2001 #endif
2002     ENCH_CONDENSATION_SHIELD,
2003     ENCH_RESISTANCE,
2004     ENCH_HEXED,
2005     ENCH_BONE_ARMOUR,
2006     ENCH_CHANT_FIRE_STORM, // chanting the fire storm spell
2007     ENCH_CHANT_WORD_OF_ENTROPY, // chanting word of entropy
2008     // Update enchantment names in mon-ench.cc when adding or removing
2009     // enchantments.
2010     NUM_ENCHANTMENTS
2011 };
2012
2013 enum energy_use_type
2014 {
2015     EUT_MOVE,
2016     EUT_SWIM,
2017     EUT_ATTACK,
2018     EUT_MISSILE,
2019     EUT_SPELL,
2020     EUT_SPECIAL,
2021     EUT_ITEM,
2022     EUT_PICKUP,
2023 };
2024
2025 enum equipment_type
2026 {
2027     EQ_NONE = -1,
2028
2029     EQ_WEAPON,
2030     EQ_CLOAK,
2031     EQ_HELMET,
2032     EQ_GLOVES,
2033     EQ_BOOTS,
2034     EQ_SHIELD,
2035     EQ_BODY_ARMOUR,
2036     //Everything beyond here is jewellery
2037     EQ_LEFT_RING,
2038     EQ_RIGHT_RING,
2039     EQ_AMULET,
2040     //Octopodes don't have left and right rings. They have eight rings, instead.
2041     EQ_RING_ONE,
2042     EQ_RING_TWO,
2043     EQ_RING_THREE,
2044     EQ_RING_FOUR,
2045     EQ_RING_FIVE,
2046     EQ_RING_SIX,
2047     EQ_RING_SEVEN,
2048     EQ_RING_EIGHT,
2049     // Finger amulet provides an extra ring slot
2050     EQ_RING_AMULET,
2051     NUM_EQUIP,
2052
2053     EQ_MIN_ARMOUR = EQ_CLOAK,
2054     EQ_MAX_ARMOUR = EQ_BODY_ARMOUR,
2055     EQ_MAX_WORN   = EQ_RING_AMULET,
2056     // these aren't actual equipment slots, they're categories for functions
2057     EQ_STAFF            = 100,         // weapon with base_type OBJ_STAVES
2058     EQ_RINGS,                          // check both rings
2059     EQ_RINGS_PLUS,                     // check both rings and sum plus
2060 #if TAG_MAJOR_VERSION == 34
2061     EQ_RINGS_PLUS2,                    // check both rings and sum plus2
2062 #endif
2063     EQ_ALL_ARMOUR,                     // check all armour types
2064 };
2065
2066 enum eq_type
2067 {
2068     ET_WEAPON,
2069     ET_SHIELD,
2070     ET_ARMOUR,
2071     ET_JEWELS,
2072     NUM_ET
2073 };
2074
2075 enum eq_type_flags
2076 {
2077     ETF_WEAPON = 0x1,
2078     ETF_SHIELD = 0x2,
2079     ETF_ARMOUR = 0x4,
2080     ETF_JEWELS = 0x8,
2081     ETF_ALL    = 0xF
2082 };
2083
2084 enum flush_reason_type
2085 {
2086     FLUSH_ON_FAILURE,                  // spell/ability failed to cast
2087     FLUSH_BEFORE_COMMAND,              // flush before getting a command
2088     FLUSH_ON_MESSAGE,                  // flush when printing a message
2089     FLUSH_ON_WARNING_MESSAGE,          // flush on MSGCH_WARN messages
2090     FLUSH_ON_DANGER_MESSAGE,           // flush on MSGCH_DANGER messages
2091     FLUSH_ON_PROMPT,                   // flush on MSGCH_PROMPT messages
2092     FLUSH_ON_UNSAFE_YES_OR_NO_PROMPT,  // flush when !safe set to yesno()
2093     FLUSH_LUA,                         // flush when Lua wants to flush
2094     FLUSH_KEY_REPLAY_CANCEL,           // flush when key replay is cancelled
2095     FLUSH_ABORT_MACRO,                 // something wrong with macro being
2096                                        // processed, so stop it
2097     FLUSH_REPLAY_SETUP_FAILURE,        // setup for key replay failed
2098     FLUSH_REPEAT_SETUP_DONE,           // command repeat done manipulating
2099                                        // the macro buffer
2100     NUM_FLUSH_REASONS
2101 };
2102
2103 enum god_type
2104 {
2105     GOD_NO_GOD,
2106     GOD_ZIN,
2107     GOD_SHINING_ONE,
2108     GOD_KIKUBAAQUDGHA,
2109     GOD_YREDELEMNUL,
2110     GOD_XOM,
2111     GOD_VEHUMET,
2112     GOD_OKAWARU,
2113     GOD_MAKHLEB,
2114     GOD_SIF_MUNA,
2115     GOD_TROG,
2116     GOD_NEMELEX_XOBEH,
2117     GOD_ELYVILON,
2118     GOD_LUGONU,
2119     GOD_BEOGH,
2120     GOD_JIYVA,
2121     GOD_FEDHAS,
2122     GOD_CHEIBRIADOS,
2123     GOD_ASHENZARI,
2124     GOD_DITHMENOS,
2125     GOD_GOZAG,
2126     GOD_QAZLAL,
2127     GOD_RU,
2128     NUM_GODS,                          // always after last god
2129
2130     GOD_RANDOM = 100,
2131     GOD_NAMELESS,                      // for monsters with non-player gods
2132     GOD_VIABLE,
2133 };
2134
2135 enum held_type
2136 {
2137     HELD_NONE = 0,
2138     HELD_NET,         // currently unused
2139     HELD_WEB,         // currently unused
2140     HELD_MONSTER,     // but no damage
2141     HELD_CONSTRICTED, // damaging
2142 };
2143
2144 enum holy_word_source_type
2145 {
2146     HOLY_WORD_SCROLL,
2147     HOLY_WORD_ZIN,     // sanctuary
2148     HOLY_WORD_TSO,     // weapon blessing
2149 };
2150
2151 enum hunger_state_t                    // you.hunger_state
2152 {
2153     HS_STARVING,
2154     HS_NEAR_STARVING,
2155     HS_VERY_HUNGRY,
2156     HS_HUNGRY,
2157     HS_SATIATED,                       // "not hungry" state
2158     HS_FULL,
2159     HS_VERY_FULL,
2160     HS_ENGORGED,
2161 };
2162
2163 enum item_status_flag_type  // per item flags: ie. ident status, cursed status
2164 {
2165     ISFLAG_KNOW_CURSE        = 0x00000001,  // curse status
2166     ISFLAG_KNOW_TYPE         = 0x00000002,  // artefact name, sub/special types
2167     ISFLAG_KNOW_PLUSES       = 0x00000004,  // to hit/to dam/to AC/charges
2168     ISFLAG_KNOW_PROPERTIES   = 0x00000008,  // know special artefact properties
2169     ISFLAG_IDENT_MASK        = 0x0000000F,  // mask of all id related flags
2170
2171     ISFLAG_CURSED            = 0x00000100,  // cursed
2172     ISFLAG_HANDLED           = 0x00000200,  // player has handled this item
2173                              //0x00000400,  // was: ISFLAG_SEEN_CURSED
2174     ISFLAG_TRIED             = 0x00000800,  // tried but not (usually) ided
2175
2176     ISFLAG_RANDART           = 0x00001000,  // special value is seed
2177     ISFLAG_UNRANDART         = 0x00002000,  // is an unrandart
2178     ISFLAG_ARTEFACT_MASK     = 0x00003000,  // randart or unrandart
2179     ISFLAG_DROPPED           = 0x00004000,  // dropped item (no autopickup)
2180     ISFLAG_THROWN            = 0x00008000,  // thrown missile weapon
2181
2182     // these don't have to remain as flags
2183     ISFLAG_NO_DESC           = 0x00000000,  // used for clearing these flags
2184     ISFLAG_GLOWING           = 0x00010000,  // weapons or armour
2185     ISFLAG_RUNED             = 0x00020000,  // weapons or armour
2186     ISFLAG_EMBROIDERED_SHINY = 0x00040000,  // armour: depends on sub-type
2187     ISFLAG_COSMETIC_MASK     = 0x00070000,  // mask of cosmetic descriptions
2188
2189     ISFLAG_UNOBTAINABLE      = 0x00080000,  // vault on display
2190
2191     ISFLAG_MIMIC             = 0x00100000,  // mimic
2192     ISFLAG_NO_MIMIC          = 0x00200000,  // Can't be turned into a mimic
2193
2194     ISFLAG_NO_PICKUP         = 0x00400000,  // Monsters won't pick this up
2195
2196 #if TAG_MAJOR_VERSION == 34
2197     ISFLAG_UNUSED1           = 0x01000000,  // was ISFLAG_ORCISH
2198     ISFLAG_UNUSED2           = 0x02000000,  // was ISFLAG_DWARVEN
2199     ISFLAG_UNUSED3           = 0x04000000,  // was ISFLAG_ELVEN
2200     ISFLAG_RACIAL_MASK       = 0x07000000,  // mask of racial equipment types
2201 #endif
2202     ISFLAG_NOTED_ID          = 0x08000000,
2203     ISFLAG_NOTED_GET         = 0x10000000,
2204
2205     ISFLAG_SEEN              = 0x20000000,  // has it been seen
2206     ISFLAG_SUMMONED          = 0x40000000,  // Item generated on a summon
2207 #if TAG_MAJOR_VERSION == 34
2208     ISFLAG_UNUSED4           = 0x80000000,  // was ISFLAG_DROPPED_BY_ALLY
2209 #endif
2210 };
2211
2212 enum item_type_id_state_type
2213 {
2214     ID_UNKNOWN_TYPE = 0,
2215     ID_MON_TRIED_TYPE,
2216     ID_TRIED_TYPE,
2217     ID_TRIED_ITEM_TYPE,
2218     ID_KNOWN_TYPE,
2219     NUM_ID_STATE_TYPES
2220 };
2221
2222 enum job_type
2223 {
2224     JOB_FIGHTER,
2225     JOB_WIZARD,
2226 #if TAG_MAJOR_VERSION == 34
2227     JOB_PRIEST,
2228 #endif
2229     JOB_GLADIATOR,
2230     JOB_NECROMANCER,
2231     JOB_ASSASSIN,
2232     JOB_BERSERKER,
2233     JOB_HUNTER,
2234     JOB_CONJURER,
2235     JOB_ENCHANTER,
2236     JOB_FIRE_ELEMENTALIST,
2237     JOB_ICE_ELEMENTALIST,
2238     JOB_SUMMONER,
2239     JOB_AIR_ELEMENTALIST,
2240     JOB_EARTH_ELEMENTALIST,
2241     JOB_SKALD,
2242     JOB_VENOM_MAGE,
2243     JOB_CHAOS_KNIGHT,
2244     JOB_TRANSMUTER,
2245 #if TAG_MAJOR_VERSION == 34
2246     JOB_HEALER,
2247     JOB_STALKER,
2248 #endif
2249     JOB_MONK,
2250     JOB_WARPER,
2251     JOB_WANDERER,
2252     JOB_ARTIFICER,                     //   Greenberg/Bane
2253     JOB_ARCANE_MARKSMAN,
2254 #if TAG_MAJOR_VERSION == 34
2255     JOB_DEATH_KNIGHT,
2256 #endif
2257     JOB_ABYSSAL_KNIGHT,
2258 #if TAG_MAJOR_VERSION == 34
2259     JOB_JESTER,
2260 #endif
2261     NUM_JOBS,                          // always after the last job
2262
2263     JOB_UNKNOWN = 100,
2264     JOB_RANDOM,
2265     JOB_VIABLE,
2266 };
2267
2268 enum KeymapContext
2269 {
2270     KMC_DEFAULT,         // For no-arg getchm(), must be zero.
2271     KMC_LEVELMAP,        // When in the 'X' level map
2272     KMC_TARGETING,       // Only during 'x' and other targeting modes
2273     KMC_CONFIRM,         // When being asked y/n/q questions
2274     KMC_MENU,            // For menus
2275 #ifdef USE_TILE
2276     KMC_DOLL,            // For the tiles doll menu editing screen
2277 #endif
2278
2279     KMC_CONTEXT_COUNT,   // Must always be the last real context
2280
2281     KMC_NONE
2282 };
2283
2284 // This order is *critical*. Don't mess with it (see mon_enchant)
2285 enum kill_category
2286 {
2287     KC_YOU,
2288     KC_FRIENDLY,
2289     KC_OTHER,
2290     KC_NCATEGORIES
2291 };
2292
2293 enum killer_type                       // monster_die(), thing_thrown
2294 {
2295     KILL_NONE,                         // no killer
2296     KILL_YOU,                          // you are the killer
2297     KILL_MON,                          // no, it was a monster!
2298     KILL_YOU_MISSILE,                  // in the library, with a dart
2299     KILL_MON_MISSILE,                  // in the dungeon, with a club
2300     KILL_YOU_CONF,                     // died while confused as caused by you
2301     KILL_MISCAST,                      // as a result of a spell miscast
2302     KILL_MISC,                         // any miscellaneous killing
2303     KILL_RESET,                        // excised from existence
2304     KILL_DISMISSED,                    // like KILL_RESET, but drops inventory
2305     KILL_BANISHED,                     // monsters what got banished
2306     KILL_UNSUMMONED,                   // summoned monsters whose timers ran out
2307     KILL_TIMEOUT,                      // non-summoned monsters whose times ran out
2308     KILL_PACIFIED,                     // only used by milestones and notes
2309     KILL_ENSLAVED,                     // only used by milestones and notes
2310     KILL_SLIMIFIED,                    // only used by milestones and notes
2311 };
2312
2313 // Can't change this order without breaking saves.
2314 enum map_marker_type
2315 {
2316     MAT_FEATURE,              // Stock marker.
2317     MAT_LUA_MARKER,
2318     MAT_CORRUPTION_NEXUS,
2319     MAT_WIZ_PROPS,
2320     MAT_TOMB,
2321     MAT_MALIGN,
2322 #if TAG_MAJOR_VERSION == 34
2323     MAT_PHOENIX,
2324 #endif
2325     MAT_POSITION,
2326 #if TAG_MAJOR_VERSION == 34
2327     MAT_DOOR_SEAL,
2328 #endif
2329     MAT_TERRAIN_CHANGE,
2330     MAT_CLOUD_SPREADER,
2331     NUM_MAP_MARKER_TYPES,
2332     MAT_ANY,
2333 };
2334
2335 enum terrain_change_type
2336 {
2337     TERRAIN_CHANGE_GENERIC,
2338     TERRAIN_CHANGE_FLOOD,
2339     TERRAIN_CHANGE_TOMB,
2340     TERRAIN_CHANGE_IMPRISON,
2341     TERRAIN_CHANGE_DOOR_SEAL,
2342     TERRAIN_CHANGE_FORESTED,
2343     NUM_TERRAIN_CHANGE_TYPES
2344 };
2345
2346 enum map_feature
2347 {
2348     MF_UNSEEN,
2349     MF_FLOOR,
2350     MF_WALL,
2351     MF_MAP_FLOOR,
2352     MF_MAP_WALL,
2353     MF_DOOR,
2354     MF_ITEM,
2355     MF_MONS_FRIENDLY,
2356     MF_MONS_PEACEFUL,
2357     MF_MONS_NEUTRAL,
2358     MF_MONS_HOSTILE,
2359     MF_MONS_NO_EXP,
2360     MF_STAIR_UP,
2361     MF_STAIR_DOWN,
2362     MF_STAIR_BRANCH,
2363     MF_FEATURE,
2364     MF_WATER,
2365     MF_LAVA,
2366     MF_TRAP,
2367     MF_EXCL_ROOT,
2368     MF_EXCL,
2369     MF_PLAYER,
2370     MF_DEEP_WATER,
2371     MF_PORTAL,
2372     MF_MAX,
2373
2374     MF_SKIP,
2375 };
2376
2377 enum menu_type
2378 {
2379     MT_ANY = -1,
2380
2381     MT_INVLIST,                        // List inventory
2382     MT_DROP,
2383     MT_PICKUP,
2384     MT_KNOW,
2385     MT_RUNES,
2386     MT_SELONE,                         // Select one
2387 };
2388
2389 enum mon_holy_type
2390 {
2391     MH_HOLY,
2392     MH_NATURAL,
2393     MH_UNDEAD,
2394     MH_DEMONIC,
2395     MH_NONLIVING, // golems and other constructs
2396     MH_PLANT,
2397 };
2398
2399 enum targ_mode_type
2400 {
2401     TARG_ANY,
2402     TARG_ENEMY,  // hostile + neutral
2403     TARG_FRIEND,
2404     TARG_INJURED_FRIEND, // for healing
2405     TARG_HOSTILE,
2406     TARG_HOSTILE_SUBMERGED, // Target hostiles including submerged ones
2407     TARG_EVOLVABLE_PLANTS,  // Targeting mode for Fedhas' evolution
2408     TARG_HOSTILE_UNDEAD,    // For dispel undead
2409     TARG_BEOGH_GIFTABLE,    // For Beogh followers who can be given gifts
2410     TARG_NUM_MODES
2411 };
2412
2413 // NOTE: Changing this order will break saves! Appending does not.
2414 enum monster_type                      // menv[].type
2415 {
2416     MONS_PROGRAM_BUG,
2417         MONS_0 = MONS_PROGRAM_BUG,
2418
2419 #if TAG_MAJOR_VERSION > 34
2420     MONS_GIANT_LIZARD,          // genus
2421 #endif
2422     MONS_GIANT_NEWT,
2423     MONS_GIANT_GECKO,
2424     MONS_IGUANA,
2425     MONS_KOMODO_DRAGON,
2426     MONS_BASILISK,
2427     MONS_BAT,
2428     MONS_FIRE_BAT,
2429 #if TAG_MAJOR_VERSION > 34
2430     MONS_SNAKE,                // genus
2431 #endif
2432     MONS_BALL_PYTHON,
2433     MONS_ADDER,
2434     MONS_WATER_MOCCASIN,
2435     MONS_BLACK_MAMBA,
2436     MONS_ANACONDA,
2437     MONS_SEA_SNAKE,
2438 #if TAG_MAJOR_VERSION > 34
2439     MONS_SHOCK_SERPENT,
2440     MONS_MANA_VIPER,
2441 #endif
2442     MONS_RAT,
2443 #if TAG_MAJOR_VERSION == 34
2444     MONS_GREY_RAT,
2445 #endif
2446     MONS_RIVER_RAT,
2447     MONS_HELL_RAT,
2448 #if TAG_MAJOR_VERSION == 34
2449     MONS_LABORATORY_RAT,
2450 #endif
2451     MONS_QUOKKA,         // Quokka are a type of wallaby, returned -- bwr 382
2452     MONS_PORCUPINE,
2453     MONS_JACKAL,
2454     MONS_HOUND,
2455 #if TAG_MAJOR_VERSION == 34
2456     MONS_WAR_DOG,
2457 #endif
2458     MONS_WOLF,
2459     MONS_WARG,
2460     MONS_HELL_HOUND,
2461 #if TAG_MAJOR_VERSION > 34
2462     MONS_RAIJU,
2463 #endif
2464     MONS_HOG,
2465     MONS_HELL_HOG,
2466     MONS_HOLY_SWINE,            // porkalator
2467 #if TAG_MAJOR_VERSION == 34
2468     MONS_GIANT_SLUG,
2469     MONS_AGATE_SNAIL,
2470 #else
2471     MONS_TORPOR_SNAIL,
2472 #endif
2473     MONS_ELEPHANT_SLUG,
2474     MONS_GIANT_LEECH,
2475     MONS_BABY_ALLIGATOR,
2476     MONS_ALLIGATOR,
2477     MONS_CROCODILE,
2478     MONS_HYDRA,
2479     MONS_SHEEP,
2480     MONS_YAK,
2481     MONS_DEATH_YAK,
2482     MONS_CATOBLEPAS,
2483     MONS_ELEPHANT,
2484     MONS_DIRE_ELEPHANT,
2485     MONS_HELLEPHANT,
2486     MONS_MANTICORE,
2487     MONS_HIPPOGRIFF,
2488     MONS_GRIFFON,
2489 #if TAG_MAJOR_VERSION > 34
2490     MONS_CHIMERA,
2491 #endif
2492     MONS_GIANT_FROG,
2493     MONS_SPINY_FROG,
2494     MONS_BLINK_FROG,
2495 #if TAG_MAJOR_VERSION > 34
2496     MONS_BEAR,                  // genus
2497 #endif
2498     MONS_GRIZZLY_BEAR,
2499     MONS_POLAR_BEAR,
2500     MONS_BLACK_BEAR,
2501     MONS_WORM,
2502     MONS_BRAIN_WORM,
2503 #if TAG_MAJOR_VERSION == 34
2504     MONS_ROCK_WORM,
2505     MONS_SPINY_WORM,
2506 #endif
2507     MONS_WYVERN,
2508 #if TAG_MAJOR_VERSION > 34
2509     MONS_DRAKE,                 // genus
2510 #endif
2511     MONS_LINDWURM,
2512     MONS_FIRE_DRAKE,
2513     MONS_SWAMP_DRAKE,
2514     MONS_DEATH_DRAKE,
2515 #if TAG_MAJOR_VERSION > 34
2516     MONS_WIND_DRAKE,
2517     MONS_DRAGON,                // genus
2518 #endif
2519     MONS_STEAM_DRAGON,
2520     MONS_MOTTLED_DRAGON,
2521     MONS_SWAMP_DRAGON,
2522     MONS_FIRE_DRAGON,
2523     MONS_ICE_DRAGON,
2524     MONS_SHADOW_DRAGON,
2525     MONS_STORM_DRAGON,
2526     MONS_BONE_DRAGON,
2527     MONS_QUICKSILVER_DRAGON,
2528     MONS_IRON_DRAGON,
2529     MONS_GOLDEN_DRAGON,
2530     MONS_PEARL_DRAGON,
2531
2532     MONS_OOZE,
2533     MONS_JELLY,
2534 #if TAG_MAJOR_VERSION == 34
2535     MONS_BROWN_OOZE,
2536     MONS_GIANT_AMOEBA,
2537 #endif
2538     MONS_AZURE_JELLY,
2539     MONS_DEATH_OOZE,
2540     MONS_ACID_BLOB,
2541     MONS_SLIME_CREATURE,
2542 #if TAG_MAJOR_VERSION == 34
2543     MONS_PULSATING_LUMP,
2544 #endif
2545     MONS_GIANT_EYEBALL,
2546     MONS_EYE_OF_DRAINING,
2547     MONS_SHINING_EYE,
2548     MONS_EYE_OF_DEVASTATION,
2549     MONS_GREAT_ORB_OF_EYES,
2550     MONS_GIANT_ORANGE_BRAIN,
2551
2552     MONS_DANCING_WEAPON,
2553 #if TAG_MAJOR_VERSION > 34
2554     MONS_SPECTRAL_WEAPON,
2555     MONS_GRAND_AVATAR,
2556 #endif
2557     MONS_HARPY,
2558     MONS_RAVEN,
2559 #if TAG_MAJOR_VERSION > 34
2560     MONS_BENNU,
2561     MONS_CAUSTIC_SHRIKE,
2562     MONS_SHARD_SHRIKE,
2563
2564     MONS_ANUBIS_GUARD,
2565 #endif
2566     MONS_FIRE_CRAB,
2567 #if TAG_MAJOR_VERSION == 34
2568     MONS_HOMUNCULUS,
2569     MONS_SOUPLING,
2570 #else
2571     MONS_GHOST_CRAB,
2572     MONS_CRAB,
2573 #endif
2574
2575     MONS_BUTTERFLY,
2576 #if TAG_MAJOR_VERSION == 34
2577     MONS_ANT_LARVA,
2578 #endif
2579     MONS_WORKER_ANT,
2580     MONS_SOLDIER_ANT,
2581     MONS_QUEEN_ANT,
2582 #if TAG_MAJOR_VERSION > 34
2583     MONS_FORMICID,
2584 #endif
2585     MONS_KILLER_BEE,
2586     MONS_QUEEN_BEE,
2587     MONS_VAMPIRE_MOSQUITO,
2588 #if TAG_MAJOR_VERSION == 34
2589     MONS_BUMBLEBEE,
2590 #endif
2591     MONS_WASP,
2592     MONS_HORNET,
2593     MONS_GOLIATH_BEETLE,
2594     MONS_BORING_BEETLE,
2595     MONS_BOULDER_BEETLE,
2596 #if TAG_MAJOR_VERSION > 34
2597     MONS_DEATH_SCARAB,
2598 #endif
2599     MONS_GIANT_COCKROACH,
2600 #if TAG_MAJOR_VERSION == 34
2601     MONS_GIANT_CENTIPEDE,
2602     MONS_GIANT_MITE,
2603 #endif
2604     MONS_SPIDER,
2605     MONS_WOLF_SPIDER,
2606     MONS_TRAPDOOR_SPIDER,
2607     MONS_JUMPING_SPIDER,
2608     MONS_ORB_SPIDER,
2609     MONS_TARANTELLA,
2610     MONS_REDBACK,
2611     MONS_SCORPION,
2612     MONS_EMPEROR_SCORPION,
2613     MONS_MOTH,                  // genus
2614 #if TAG_MAJOR_VERSION == 34
2615     MONS_MOTH_OF_SUPPRESSION,
2616 #endif
2617     MONS_GHOST_MOTH,
2618     MONS_MOTH_OF_WRATH,
2619     MONS_DEMONIC_CRAWLER,
2620     MONS_SNAPPING_TURTLE,
2621     MONS_ALLIGATOR_SNAPPING_TURTLE,
2622 #if TAG_MAJOR_VERSION == 34
2623     MONS_GNOME,
2624 #endif
2625     MONS_HALFLING,              // recolouring + single vault.
2626     MONS_FELID,                 // recolouring + single vault. Miaow!
2627     MONS_VAMPIRE_BAT,           // recolouring + vaults
2628     MONS_DEMIGOD,               // recolouring + single vault
2629     MONS_DEMONSPAWN,
2630 #if TAG_MAJOR_VERSION > 34
2631     MONS_FIRST_DEMONSPAWN = MONS_DEMONSPAWN,
2632     MONS_MONSTROUS_DEMONSPAWN,
2633     MONS_FIRST_BASE_DEMONSPAWN = MONS_MONSTROUS_DEMONSPAWN,
2634     MONS_GELID_DEMONSPAWN,
2635     MONS_INFERNAL_DEMONSPAWN,
2636     MONS_PUTRID_DEMONSPAWN,
2637     MONS_TORTUROUS_DEMONSPAWN,
2638     MONS_LAST_BASE_DEMONSPAWN = MONS_TORTUROUS_DEMONSPAWN,
2639     MONS_BLOOD_SAINT,
2640     MONS_FIRST_NONBASE_DEMONSPAWN = MONS_BLOOD_SAINT,
2641     MONS_CHAOS_CHAMPION,
2642     MONS_WARMONGER,
2643     MONS_CORRUPTER,
2644     MONS_BLACK_SUN,
2645     MONS_LAST_NONBASE_DEMONSPAWN = MONS_BLACK_SUN,
2646     MONS_LAST_DEMONSPAWN = MONS_BLACK_SUN,
2647 #endif
2648     MONS_GARGOYLE,
2649     MONS_WAR_GARGOYLE,
2650     MONS_MOLTEN_GARGOYLE,
2651     MONS_UGLY_THING,
2652     MONS_VERY_UGLY_THING,
2653     MONS_ICE_BEAST,
2654     MONS_SKY_BEAST,
2655     MONS_SPHINX,
2656     MONS_ORB_GUARDIAN,
2657
2658     MONS_GOLEM,                 // genus
2659 #if TAG_MAJOR_VERSION == 34
2660     MONS_CLAY_GOLEM,
2661     MONS_WOOD_GOLEM,
2662     MONS_STONE_GOLEM,
2663 #endif
2664     MONS_IRON_GOLEM,
2665     MONS_CRYSTAL_GUARDIAN,
2666     MONS_TOENAIL_GOLEM,
2667     MONS_ELECTRIC_GOLEM, // replacing the guardian robot -- bwr
2668 #if TAG_MAJOR_VERSION > 34
2669     MONS_GUARDIAN_GOLEM,
2670     MONS_SPELLFORGED_SERVITOR,
2671     MONS_USHABTI,
2672 #endif
2673     MONS_ORB_OF_FIRE,    // Swords renamed to fit -- bwr
2674 #if TAG_MAJOR_VERSION > 34
2675     MONS_ELEMENTAL,             // genus
2676 #endif
2677     MONS_EARTH_ELEMENTAL,
2678     MONS_FIRE_ELEMENTAL,
2679     MONS_AIR_ELEMENTAL,
2680 #if TAG_MAJOR_VERSION > 34
2681     MONS_IRON_ELEMENTAL,
2682     MONS_ELEMENTAL_WELLSPRING,
2683 #endif
2684     MONS_TWISTER,        // air miscasts
2685     MONS_GOLDEN_EYE,
2686     MONS_FIRE_VORTEX,
2687     MONS_SPATIAL_VORTEX,
2688     MONS_INSUBSTANTIAL_WISP,
2689 #if TAG_MAJOR_VERSION == 34
2690     MONS_VAPOUR,
2691
2692     // Mimics:
2693     MONS_INEPT_ITEM_MIMIC,
2694     MONS_ITEM_MIMIC,
2695     MONS_RAVENOUS_ITEM_MIMIC,
2696     MONS_MONSTROUS_ITEM_MIMIC,
2697     MONS_INEPT_FEATURE_MIMIC,
2698     MONS_FEATURE_MIMIC,
2699     MONS_RAVENOUS_FEATURE_MIMIC,
2700     MONS_MONSTROUS_FEATURE_MIMIC, // unused
2701 #endif
2702
2703     // Plants:
2704     MONS_TOADSTOOL,
2705     MONS_FUNGUS,
2706     MONS_WANDERING_MUSHROOM,
2707 #if TAG_MAJOR_VERSION > 34
2708     MONS_DEATHCAP,
2709 #endif
2710     MONS_PLANT,
2711     MONS_OKLOB_SAPLING,
2712     MONS_OKLOB_PLANT,
2713     MONS_BUSH,
2714     MONS_BURNING_BUSH,
2715 #if TAG_MAJOR_VERSION > 34
2716     MONS_THORN_HUNTER,
2717     MONS_BRIAR_PATCH,
2718     MONS_SHAMBLING_MANGROVE,
2719     MONS_VINE_STALKER,
2720     MONS_ANIMATED_TREE,
2721 #endif
2722     MONS_GIANT_SPORE,
2723     MONS_BALLISTOMYCETE,
2724     MONS_HYPERACTIVE_BALLISTOMYCETE,
2725
2726     MONS_GOBLIN,
2727     MONS_HOBGOBLIN,
2728     MONS_GNOLL,
2729     MONS_GNOLL_SHAMAN,
2730     MONS_GNOLL_SERGEANT,
2731     MONS_BOGGART,
2732     MONS_KOBOLD,
2733     MONS_BIG_KOBOLD,
2734     MONS_KOBOLD_DEMONOLOGIST,
2735     MONS_ORC,
2736     MONS_ORC_WARRIOR,
2737     MONS_ORC_PRIEST,
2738     MONS_ORC_HIGH_PRIEST,
2739     MONS_ORC_WIZARD,
2740     MONS_ORC_KNIGHT,
2741     MONS_ORC_SORCERER,
2742     MONS_ORC_WARLORD,
2743     MONS_DWARF,
2744     MONS_DEEP_DWARF,
2745 #if TAG_MAJOR_VERSION == 34
2746     MONS_DEEP_DWARF_SCION,
2747     MONS_DEEP_DWARF_ARTIFICER,
2748     MONS_DEEP_DWARF_NECROMANCER,
2749     MONS_DEEP_DWARF_BERSERKER,
2750     MONS_DEATH_KNIGHT,
2751     MONS_UNBORN,
2752 #endif
2753     MONS_ELF,
2754 #if TAG_MAJOR_VERSION == 34
2755     MONS_DEEP_ELF_SOLDIER,
2756 #endif
2757     MONS_DEEP_ELF_FIGHTER,
2758     MONS_DEEP_ELF_KNIGHT,
2759     MONS_DEEP_ELF_MAGE,
2760     MONS_DEEP_ELF_SUMMONER,
2761     MONS_DEEP_ELF_CONJURER,
2762     MONS_DEEP_ELF_PRIEST,
2763     MONS_DEEP_ELF_HIGH_PRIEST,
2764     MONS_DEEP_ELF_DEMONOLOGIST,
2765     MONS_DEEP_ELF_ANNIHILATOR,
2766     MONS_DEEP_ELF_SORCERER,
2767     MONS_DEEP_ELF_DEATH_MAGE,
2768     MONS_DEEP_ELF_BLADEMASTER,
2769     MONS_DEEP_ELF_MASTER_ARCHER,
2770     MONS_SPRIGGAN,
2771     MONS_SPRIGGAN_DRUID,
2772 #if TAG_MAJOR_VERSION == 34
2773     MONS_SPRIGGAN_ASSASSIN,
2774 #endif
2775     MONS_SPRIGGAN_RIDER,
2776     MONS_SPRIGGAN_BERSERKER,
2777     MONS_SPRIGGAN_DEFENDER,
2778     MONS_SPRIGGAN_AIR_MAGE,
2779 #if TAG_MAJOR_VERSION == 34
2780     MONS_FIREFLY,
2781 #endif
2782     MONS_TENGU,
2783 #if TAG_MAJOR_VERSION > 34
2784     MONS_TENGU_WARRIOR,
2785     MONS_TENGU_CONJURER,
2786     MONS_TENGU_REAVER,
2787 #endif
2788     MONS_MINOTAUR,
2789     MONS_NAGA,
2790     MONS_NAGA_WARRIOR,
2791     MONS_NAGA_MAGE,
2792 #if TAG_MAJOR_VERSION > 34
2793     MONS_NAGA_RITUALIST,
2794     MONS_NAGA_SHARPSHOOTER,
2795 #endif
2796     MONS_GREATER_NAGA,
2797     MONS_GUARDIAN_SERPENT,
2798     MONS_OCTOPODE,
2799 #if TAG_MAJOR_VERSION > 34
2800     MONS_OCTOPODE_CRUSHER,
2801 #endif
2802     MONS_MERFOLK,
2803     MONS_SIREN,
2804     MONS_MERFOLK_AVATAR,
2805 #if TAG_MAJOR_VERSION > 34
2806     MONS_DROWNED_SOUL,
2807 #endif
2808     MONS_MERFOLK_IMPALER,
2809     MONS_MERFOLK_AQUAMANCER,
2810     MONS_MERFOLK_JAVELINEER,
2811 #if TAG_MAJOR_VERSION > 34
2812     MONS_WATER_NYMPH,
2813 #endif
2814     MONS_CENTAUR,
2815     MONS_CENTAUR_WARRIOR,
2816     MONS_YAKTAUR,
2817     MONS_YAKTAUR_CAPTAIN,
2818 #if TAG_MAJOR_VERSION > 34
2819     MONS_FAUN,
2820     MONS_SATYR,
2821 #endif
2822     MONS_OGRE,
2823     MONS_TWO_HEADED_OGRE,
2824     MONS_OGRE_MAGE,
2825     MONS_TROLL,
2826 #if TAG_MAJOR_VERSION == 34
2827     MONS_ROCK_TROLL,
2828 #endif
2829     MONS_IRON_TROLL,
2830     MONS_DEEP_TROLL,
2831 #if TAG_MAJOR_VERSION > 34
2832     MONS_DEEP_TROLL_EARTH_MAGE,
2833     MONS_DEEP_TROLL_SHAMAN,
2834 #endif
2835     MONS_GIANT,                 // genus
2836     MONS_HILL_GIANT,
2837     MONS_CYCLOPS,
2838     MONS_ETTIN,
2839     MONS_STONE_GIANT,
2840     MONS_FIRE_GIANT,
2841     MONS_FROST_GIANT,
2842     MONS_TITAN,
2843     MONS_HUMAN,
2844     MONS_SLAVE,
2845     MONS_HELL_KNIGHT,
2846 #if TAG_MAJOR_VERSION > 34
2847     MONS_DEATH_KNIGHT,
2848 #endif
2849     MONS_NECROMANCER,
2850     MONS_WIZARD,
2851     MONS_VAULT_GUARD,
2852 #if TAG_MAJOR_VERSION > 34
2853     MONS_VAULT_SENTINEL,
2854     MONS_VAULT_WARDEN,
2855     MONS_IRONBRAND_CONVOKER,
2856     MONS_IRONHEART_PRESERVER,
2857 #endif
2858     MONS_KILLER_KLOWN,
2859     MONS_SHAPESHIFTER,
2860     MONS_GLOWING_SHAPESHIFTER,
2861
2862     // Draconians:
2863     MONS_DRACONIAN,
2864     MONS_FIRST_DRACONIAN = MONS_DRACONIAN,
2865
2866     // If adding more drac colours, sync up colour names in
2867     // mon-util.cc.
2868     MONS_BLACK_DRACONIAN,
2869     MONS_FIRST_BASE_DRACONIAN = MONS_BLACK_DRACONIAN,
2870     MONS_MOTTLED_DRACONIAN,
2871     MONS_YELLOW_DRACONIAN,
2872     MONS_GREEN_DRACONIAN,
2873     MONS_PURPLE_DRACONIAN,
2874     MONS_RED_DRACONIAN,
2875     MONS_WHITE_DRACONIAN,
2876     MONS_LAST_SPAWNED_DRACONIAN = MONS_WHITE_DRACONIAN,
2877     MONS_GREY_DRACONIAN,
2878     MONS_PALE_DRACONIAN,
2879     MONS_LAST_BASE_DRACONIAN = MONS_PALE_DRACONIAN,
2880
2881     // Sync up with mon-place.cc's draconian selection if adding more.
2882     MONS_DRACONIAN_CALLER,
2883     MONS_FIRST_NONBASE_DRACONIAN = MONS_DRACONIAN_CALLER,
2884     MONS_DRACONIAN_MONK,
2885     MONS_DRACONIAN_ZEALOT,
2886     MONS_DRACONIAN_SHIFTER,
2887     MONS_DRACONIAN_ANNIHILATOR,
2888     MONS_DRACONIAN_KNIGHT,
2889     MONS_DRACONIAN_SCORCHER,
2890
2891     MONS_LAST_DRACONIAN = MONS_DRACONIAN_SCORCHER,
2892     MONS_LAST_NONBASE_DRACONIAN = MONS_DRACONIAN_SCORCHER,
2893
2894     // Lava monsters:
2895 #if TAG_MAJOR_VERSION == 34
2896     MONS_LAVA_WORM,
2897     MONS_LAVA_FISH,
2898 #endif
2899     MONS_LAVA_SNAKE,
2900     MONS_SALAMANDER,
2901 #if TAG_MAJOR_VERSION > 34
2902     MONS_SALAMANDER_FIREBRAND,
2903     MONS_SALAMANDER_MYSTIC,
2904     MONS_SALAMANDER_STORMCALLER,
2905 #endif
2906
2907     // Water monsters:
2908 #if TAG_MAJOR_VERSION == 34
2909     MONS_BIG_FISH,
2910     MONS_GIANT_GOLDFISH,
2911 #endif
2912     MONS_ELECTRIC_EEL,
2913 #if TAG_MAJOR_VERSION == 34
2914     MONS_JELLYFISH,
2915 #endif
2916     MONS_WATER_ELEMENTAL,
2917     MONS_SWAMP_WORM,
2918 #if TAG_MAJOR_VERSION == 34
2919     MONS_SHARK,
2920 #endif
2921     MONS_KRAKEN,
2922     MONS_KRAKEN_TENTACLE,
2923     MONS_KRAKEN_TENTACLE_SEGMENT,
2924
2925     // Statuary
2926     MONS_ORANGE_STATUE,
2927     MONS_OBSIDIAN_STATUE,
2928     MONS_ICE_STATUE,
2929     MONS_STATUE,
2930     MONS_TRAINING_DUMMY,
2931     MONS_LIGHTNING_SPIRE,
2932 #if TAG_MAJOR_VERSION > 34
2933     MONS_DIAMOND_OBELISK,
2934 #endif
2935
2936     // Demons:
2937     MONS_CRIMSON_IMP,
2938     MONS_QUASIT,
2939     MONS_WHITE_IMP,
2940 #if TAG_MAJOR_VERSION == 34
2941     MONS_LEMURE,
2942 #endif
2943     MONS_UFETUBUS,
2944     MONS_IRON_IMP,
2945     MONS_SHADOW_IMP,
2946     MONS_RED_DEVIL,
2947 #if TAG_MAJOR_VERSION == 34
2948     MONS_ROTTING_DEVIL,
2949 #endif
2950     MONS_HELLWING,
2951     MONS_SIXFIRHY,
2952     MONS_NEQOXEC,
2953     MONS_ORANGE_DEMON,
2954     MONS_SMOKE_DEMON,
2955     MONS_YNOXINUL,
2956     MONS_CHAOS_SPAWN,
2957     MONS_HELLION,
2958     MONS_LOROCYPROCA,
2959     MONS_TORMENTOR,
2960     MONS_REAPER,
2961     MONS_SOUL_EATER,
2962     MONS_ICE_DEVIL,
2963     MONS_BLUE_DEVIL,
2964     MONS_HELL_BEAST,
2965     MONS_RUST_DEVIL,
2966     MONS_EXECUTIONER,
2967     MONS_GREEN_DEATH,
2968     MONS_BLIZZARD_DEMON,
2969     MONS_BALRUG,
2970     MONS_CACODEMON,
2971     MONS_SUN_DEMON,
2972     MONS_SHADOW_DEMON,
2973     MONS_HELL_SENTINEL,
2974     MONS_BRIMSTONE_FIEND,
2975     MONS_ICE_FIEND,
2976     MONS_SHADOW_FIEND,
2977     MONS_PANDEMONIUM_LORD,
2978
2979     // Spiritual beings ('R')
2980     MONS_EFREET,
2981     MONS_RAKSHASA,
2982 #if TAG_MAJOR_VERSION == 34
2983     MONS_RAKSHASA_FAKE,
2984 #endif
2985 #if TAG_MAJOR_VERSION > 34
2986     MONS_DRYAD,
2987     MONS_SNAPLASHER_VINE,
2988     MONS_SNAPLASHER_VINE_SEGMENT,
2989 #endif
2990
2991     // Abyssals
2992     MONS_UNSEEN_HORROR,
2993     MONS_TENTACLED_STARSPAWN,
2994     MONS_LURKING_HORROR,
2995     MONS_THRASHING_HORROR,
2996     MONS_STARCURSED_MASS,
2997     MONS_ANCIENT_ZYME,
2998     MONS_WRETCHED_STAR,
2999 #if TAG_MAJOR_VERSION > 34
3000     MONS_APOCALYPSE_CRAB,
3001     MONS_STARSPAWN_TENTACLE,
3002     MONS_STARSPAWN_TENTACLE_SEGMENT,
3003     MONS_SPATIAL_MAELSTROM,
3004     MONS_WORLDBINDER,
3005     MONS_ENTROPY_WEAVER, // not sure where else to put it
3006 #endif
3007     MONS_ELDRITCH_TENTACLE,
3008     MONS_ELDRITCH_TENTACLE_SEGMENT,
3009     MONS_TENTACLED_MONSTROSITY,
3010     MONS_ABOMINATION_SMALL,
3011     MONS_ABOMINATION_LARGE,
3012     MONS_CRAWLING_CORPSE,
3013     MONS_MACABRE_MASS,
3014
3015     // Undead:
3016 #if TAG_MAJOR_VERSION > 34
3017     MONS_ZOMBIE,
3018     MONS_SKELETON,
3019     MONS_SIMULACRUM,
3020 #endif
3021 #if TAG_MAJOR_VERSION == 34
3022     MONS_PLAGUE_SHAMBLER,
3023 #endif
3024     MONS_NECROPHAGE,
3025     MONS_GHOUL,
3026 #if TAG_MAJOR_VERSION == 34
3027     MONS_FLAMING_CORPSE,
3028 #endif
3029     MONS_MUMMY,
3030     MONS_BOG_BODY,
3031     MONS_GUARDIAN_MUMMY,
3032     MONS_GREATER_MUMMY,
3033     MONS_MUMMY_PRIEST,
3034     MONS_VAMPIRE,
3035     MONS_VAMPIRE_KNIGHT,
3036     MONS_VAMPIRE_MAGE,
3037     MONS_GHOST,                 // common genus for monster and player ghosts
3038     MONS_PHANTOM,
3039     MONS_SHADOW,
3040     MONS_HUNGRY_GHOST,
3041     MONS_FLAYED_GHOST,
3042     MONS_WIGHT,
3043     MONS_WRAITH,
3044     MONS_FREEZING_WRAITH,
3045     MONS_SHADOW_WRAITH,
3046     MONS_SILENT_SPECTRE,
3047     MONS_EIDOLON,
3048     MONS_FLYING_SKULL,
3049     MONS_SKELETAL_WARRIOR,
3050     MONS_PHANTASMAL_WARRIOR,
3051     MONS_LICH,
3052     MONS_ANCIENT_LICH,
3053     MONS_DEATH_COB,
3054     MONS_CURSE_TOE,
3055     MONS_CURSE_SKULL,
3056     MONS_PROFANE_SERVITOR,
3057 #if TAG_MAJOR_VERSION > 34
3058     MONS_ANCIENT_CHAMPION,
3059     MONS_REVENANT,
3060     MONS_LOST_SOUL,
3061     MONS_JIANGSHI,
3062 #endif
3063     MONS_SKELETON_SMALL,   // recolouring only
3064     MONS_SKELETON_LARGE,   // recolouring only
3065     MONS_ZOMBIE_SMALL,     // recolouring only
3066     MONS_ZOMBIE_LARGE,     // recolouring only
3067     MONS_SPECTRAL_THING,
3068     MONS_SIMULACRUM_SMALL, // recolouring only
3069     MONS_SIMULACRUM_LARGE, // recolouring only
3070
3071     // Holies:
3072     MONS_ANGEL,
3073     MONS_DAEVA,
3074     MONS_CHERUB,
3075     MONS_SERAPH,
3076 #if TAG_MAJOR_VERSION == 34
3077     MONS_PHOENIX,
3078     MONS_SILVER_STAR,
3079     MONS_BLESSED_TOE,
3080     MONS_SHEDU,
3081 #endif
3082     MONS_OPHAN,
3083 #if TAG_MAJOR_VERSION == 34
3084     MONS_SPIRIT,
3085     MONS_PALADIN,
3086 #endif
3087     MONS_APIS,
3088
3089     // Fixed uniques:
3090     MONS_GERYON,
3091     MONS_DISPATER,
3092     MONS_ASMODEUS,
3093     MONS_ANTAEUS,
3094     MONS_ERESHKIGAL,
3095     MONS_ROYAL_JELLY,
3096     MONS_THE_ENCHANTRESS,
3097     // the four Pan lords, order must match runes
3098     MONS_MNOLEG,
3099     MONS_LOM_LOBON,
3100     MONS_CEREBOV,
3101     MONS_GLOORX_VLOQ,
3102     MONS_SERPENT_OF_HELL,
3103 #if TAG_MAJOR_VERSION > 34
3104     MONS_SERPENT_OF_HELL_COCYTUS,
3105     MONS_SERPENT_OF_HELL_DIS,
3106     MONS_SERPENT_OF_HELL_TARTARUS,
3107 #endif
3108     // Random uniques:
3109     MONS_IJYB,
3110     MONS_JESSICA,
3111     MONS_SIGMUND,
3112     MONS_TERENCE,
3113     MONS_BLORK_THE_ORC,
3114     MONS_EDMUND,
3115     MONS_PSYCHE,
3116     MONS_EROLCHA,
3117     MONS_DONALD,
3118     MONS_URUG,
3119     MONS_JOSEPH,
3120     MONS_SNORG, // was Anita - 16jan2000 {dlb}
3121     MONS_ERICA,
3122     MONS_JOSEPHINE,
3123     MONS_HAROLD,
3124     MONS_AGNES,
3125     MONS_MAUD,
3126     MONS_LOUISE,
3127     MONS_FRANCES,
3128     MONS_RUPERT,
3129     MONS_WIGLAF,
3130     MONS_XTAHUA,
3131     MONS_NORRIS,
3132     MONS_FREDERICK,
3133     MONS_MARGERY,
3134     MONS_BORIS,
3135     MONS_POLYPHEMUS,
3136     MONS_MURRAY,
3137     MONS_TIAMAT,
3138     MONS_ROXANNE,
3139     MONS_SONJA,
3140     MONS_EUSTACHIO,
3141     MONS_AZRAEL,
3142     MONS_ILSUIW,
3143     MONS_PRINCE_RIBBIT,
3144     MONS_NERGALLE,
3145     MONS_SAINT_ROKA,
3146     MONS_NESSOS,
3147     MONS_LERNAEAN_HYDRA,
3148     MONS_DISSOLUTION,
3149     MONS_KIRKE,
3150     MONS_GRUM,
3151     MONS_PURGY,
3152     MONS_MENKAURE,
3153     MONS_DUVESSA,
3154     MONS_DOWAN,
3155     MONS_GASTRONOK,
3156     MONS_MAURICE,
3157     MONS_KHUFU,
3158     MONS_NIKOLA,
3159     MONS_AIZUL,
3160     MONS_PIKEL,
3161     MONS_CRAZY_YIUF,
3162     MONS_MENNAS,
3163     MONS_MARA,
3164 #if TAG_MAJOR_VERSION == 34
3165     MONS_MARA_FAKE,
3166 #endif
3167     MONS_GRINDER,
3168     MONS_JORY,
3169     MONS_IGNACIO,
3170     MONS_ARACHNE,
3171 #if TAG_MAJOR_VERSION > 34
3172     MONS_HELLBINDER,
3173     MONS_CLOUD_MAGE,
3174     MONS_FANNAR,
3175     MONS_JORGRUN,
3176     MONS_SOJOBO,
3177     MONS_ASTERION,
3178     MONS_NATASHA,
3179     MONS_VASHNIA,
3180     MONS_ROBIN,
3181     MONS_MOON_TROLL,
3182 #endif
3183     // Sprint uniques:
3184     MONS_CHUCK,
3185     MONS_IRON_GIANT,
3186     MONS_NELLIE,
3187 #if TAG_MAJOR_VERSION == 34
3188     MONS_IRON_ELEMENTAL,
3189 #endif
3190
3191     // Specials:
3192     MONS_PLAYER_ILLUSION,
3193     MONS_PLAYER_GHOST,
3194     MONS_BALL_LIGHTNING,
3195     MONS_ORB_OF_DESTRUCTION,    // a projectile, not a real mon
3196 #if TAG_MAJOR_VERSION > 34
3197     MONS_FULMINANT_PRISM,
3198     MONS_SINGULARITY,
3199     MONS_BATTLESPHERE,
3200 #endif
3201     MONS_PILLAR_OF_SALT,
3202 #if TAG_MAJOR_VERSION > 34
3203     MONS_BLOCK_OF_ICE,
3204 #endif
3205     MONS_HELL_LORD,             // genus
3206     MONS_MERGED_SLIME_CREATURE, // used only for recolouring
3207     MONS_SENSED,                // dummy monster for unspecified sensed mons
3208     MONS_SENSED_TRIVIAL,
3209     MONS_SENSED_EASY,
3210     MONS_SENSED_TOUGH,
3211     MONS_SENSED_NASTY,
3212     MONS_SENSED_FRIENDLY,
3213     MONS_PLAYER,                // a certain ugly creature
3214 #if TAG_MAJOR_VERSION > 34
3215     MONS_PLAYER_SHADOW,         // Dithmenos
3216 #endif
3217     MONS_TEST_SPAWNER,
3218
3219     // Add new monsters here:
3220 #if TAG_MAJOR_VERSION == 34
3221     MONS_SERPENT_OF_HELL_COCYTUS,
3222     MONS_SERPENT_OF_HELL_DIS,
3223     MONS_SERPENT_OF_HELL_TARTARUS,
3224
3225     MONS_HELLBINDER,
3226     MONS_CLOUD_MAGE,
3227     MONS_ANIMATED_TREE,
3228
3229     MONS_BEAR,                  // genus
3230     MONS_ELEMENTAL,             // genus
3231
3232     MONS_FANNAR,
3233     MONS_APOCALYPSE_CRAB,
3234     MONS_STARSPAWN_TENTACLE,
3235     MONS_STARSPAWN_TENTACLE_SEGMENT,
3236
3237     MONS_SPATIAL_MAELSTROM,
3238     MONS_CHAOS_BUTTERFLY,
3239
3240     MONS_JORGRUN,
3241     MONS_LAMIA,
3242
3243     MONS_FULMINANT_PRISM,
3244     MONS_BATTLESPHERE,
3245
3246     MONS_GIANT_LIZARD,          // genus
3247     MONS_DRAKE,                 // genus
3248     MONS_PLAYER_SHADOW,         // Dithmenos
3249
3250     MONS_DEEP_TROLL_EARTH_MAGE,
3251     MONS_DEEP_TROLL_SHAMAN,
3252     MONS_DIAMOND_OBELISK,
3253
3254     MONS_VAULT_SENTINEL,
3255     MONS_VAULT_WARDEN,
3256     MONS_IRONBRAND_CONVOKER,
3257     MONS_IRONHEART_PRESERVER,
3258
3259     MONS_ZOMBIE,
3260     MONS_SKELETON,
3261     MONS_SIMULACRUM,
3262
3263     MONS_ANCIENT_CHAMPION,
3264     MONS_REVENANT,
3265     MONS_LOST_SOUL,
3266     MONS_JIANGSHI,
3267
3268     MONS_DJINNI,
3269     MONS_LAVA_ORC,
3270
3271     MONS_DRYAD,
3272     MONS_WIND_DRAKE,
3273     MONS_FAUN,
3274     MONS_SATYR,
3275
3276     MONS_PAN,
3277
3278     MONS_TENGU_WARRIOR,
3279     MONS_TENGU_CONJURER,
3280     MONS_TENGU_REAVER,
3281
3282     MONS_SPRIGGAN_ENCHANTER,
3283
3284     MONS_SOJOBO,
3285
3286     MONS_CHIMERA,
3287
3288     MONS_SNAPLASHER_VINE,
3289     MONS_SNAPLASHER_VINE_SEGMENT,
3290     MONS_THORN_HUNTER,
3291     MONS_BRIAR_PATCH,
3292     MONS_SPIRIT_WOLF,
3293     MONS_ANCIENT_BEAR,
3294     MONS_WATER_NYMPH,
3295     MONS_SHAMBLING_MANGROVE,
3296     MONS_THORN_LOTUS,
3297     MONS_SPECTRAL_WEAPON,
3298     MONS_ELEMENTAL_WELLSPRING,
3299     MONS_POLYMOTH,
3300
3301     MONS_DEATHCAP,
3302     MONS_IGNIS,
3303
3304     MONS_FORMICID,
3305     MONS_FORMICID_DRONE,
3306     MONS_FORMICID_VENOM_MAGE,
3307
3308     MONS_RAIJU,
3309
3310     MONS_DRAGON,                // genus
3311     MONS_SNAKE,                 // genus
3312
3313     MONS_MONSTROUS_DEMONSPAWN,
3314     MONS_FIRST_DEMONSPAWN = MONS_MONSTROUS_DEMONSPAWN,
3315     MONS_FIRST_BASE_DEMONSPAWN = MONS_MONSTROUS_DEMONSPAWN,
3316     MONS_GELID_DEMONSPAWN,
3317     MONS_INFERNAL_DEMONSPAWN,
3318     MONS_PUTRID_DEMONSPAWN,
3319     MONS_TORTUROUS_DEMONSPAWN,
3320     MONS_LAST_BASE_DEMONSPAWN = MONS_TORTUROUS_DEMONSPAWN,
3321     MONS_BLOOD_SAINT,
3322     MONS_FIRST_NONBASE_DEMONSPAWN = MONS_BLOOD_SAINT,
3323     MONS_CHAOS_CHAMPION,
3324     MONS_WARMONGER,
3325     MONS_CORRUPTER,
3326     MONS_BLACK_SUN,
3327     MONS_LAST_NONBASE_DEMONSPAWN = MONS_BLACK_SUN,
3328     MONS_LAST_DEMONSPAWN = MONS_BLACK_SUN,
3329
3330     MONS_WORLDBINDER,
3331     MONS_GRAND_AVATAR,
3332     MONS_VINE_STALKER,
3333
3334     MONS_DROWNED_SOUL,
3335
3336     MONS_SHOCK_SERPENT,
3337     MONS_MANA_VIPER,
3338     MONS_NAGA_RITUALIST,
3339     MONS_NAGA_SHARPSHOOTER,
3340
3341     MONS_SALAMANDER_FIREBRAND,
3342     MONS_SALAMANDER_MYSTIC,
3343
3344     MONS_ASTERION,
3345     MONS_NATASHA,
3346     MONS_VASHNIA,
3347
3348     MONS_BLOCK_OF_ICE,
3349     MONS_GUARDIAN_GOLEM,
3350     MONS_SPELLFORGED_SERVITOR,
3351     MONS_OCTOPODE_CRUSHER,
3352     MONS_CRAB,
3353     MONS_GHOST_CRAB,
3354     MONS_TORPOR_SNAIL,
3355     MONS_MNOLEG_TENTACLE,
3356     MONS_MNOLEG_TENTACLE_SEGMENT,
3357     MONS_BENNU,
3358     MONS_USHABTI,
3359     MONS_DEATH_SCARAB,
3360     MONS_ANUBIS_GUARD,
3361     MONS_CAUSTIC_SHRIKE,
3362
3363     MONS_ROBIN,
3364
3365     MONS_SHARD_SHRIKE,
3366     MONS_SINGULARITY,
3367     MONS_SALAMANDER_STORMCALLER,
3368     MONS_ENTROPY_WEAVER,
3369     MONS_MOON_TROLL,
3370 #endif
3371
3372     NUM_MONSTERS,               // used for polymorph
3373
3374     // MONS_NO_MONSTER can get put in savefiles, so it shouldn't change
3375     // when NUM_MONSTERS increases.
3376     MONS_NO_MONSTER = 1000,
3377
3378     RANDOM_MONSTER = 2000, // used to distinguish between a random monster and using program bugs for error trapping {dlb}
3379     RANDOM_TOUGHER_MONSTER, // used for poly upgrading monsters.
3380     RANDOM_MOBILE_MONSTER, // used for monster generation (shadow creatures)
3381     RANDOM_COMPATIBLE_MONSTER, // used for player shadow creatures (prevents repulsing summons)
3382     RANDOM_BANDLESS_MONSTER,
3383
3384     // A random draconian, either base coloured drac or specialised.
3385     RANDOM_DRACONIAN,
3386     // Any random base draconian colour.
3387     RANDOM_BASE_DRACONIAN,
3388     // Any random specialised draconian, such as a draconian knight.
3389     RANDOM_NONBASE_DRACONIAN,
3390
3391     RANDOM_DEMON_LESSER,               //    0: Class V
3392     RANDOM_DEMON_COMMON,               //    1: Class II-IV
3393     RANDOM_DEMON_GREATER,              //    2: Class I
3394     RANDOM_DEMON,                      //    any of the above
3395
3396     RANDOM_MODERATE_OOD, // +5 depth, AKA '9' glyph on maps
3397     RANDOM_SUPER_OOD, // *2 + 4 depth, AKA '8'
3398
3399     RANDOM_DEMONSPAWN,
3400     RANDOM_BASE_DEMONSPAWN,
3401     RANDOM_NONBASE_DEMONSPAWN,
3402
3403     WANDERING_MONSTER = 3500, // only used in monster placement routines - forced limit checks {dlb}
3404 };
3405
3406 enum beh_type
3407 {
3408     BEH_SLEEP,
3409     BEH_WANDER,
3410     BEH_SEEK,
3411     BEH_FLEE,
3412     BEH_CORNERED,                      //  wanting to flee, but blocked by an
3413                                        //  obstacle or monster
3414 #if TAG_MAJOR_VERSION == 34
3415     BEH_PANIC,                         //  like flee but without running away
3416 #endif
3417     BEH_LURK,                          //  stay still until discovered or
3418                                        //  enemy close by
3419     BEH_RETREAT,                       //  like flee but when cannot attack
3420     BEH_WITHDRAW,                      //  an ally given a command to withdraw
3421                                        //  (will not respond to attacks)
3422     NUM_BEHAVIOURS,                    //  max # of legal states
3423     BEH_CHARMED,                       //  hostile-but-charmed; creation only
3424     BEH_FRIENDLY,                      //  used during creation only
3425     BEH_GOOD_NEUTRAL,                  //  creation only
3426     BEH_STRICT_NEUTRAL,
3427     BEH_NEUTRAL,                       //  creation only
3428     BEH_HOSTILE,                       //  creation only
3429     BEH_GUARD,                         //  creation only - monster is guard
3430     BEH_COPY,                          //  creation only - copy from summoner
3431 };
3432
3433 enum mon_attitude_type
3434 {
3435     ATT_HOSTILE,                       // 0, default in most cases
3436     ATT_NEUTRAL,                       // neutral
3437     ATT_STRICT_NEUTRAL,                // neutral, won't attack player. Used by Jiyva.
3438     ATT_GOOD_NEUTRAL,                  // neutral, but won't attack friendlies
3439     ATT_FRIENDLY,                      // created friendly (or tamed?)
3440 };
3441
3442 // Adding slots breaks saves. YHBW.
3443 enum mon_inv_type           // menv[].inv[]
3444 {
3445     MSLOT_WEAPON,           // Primary weapon (melee)
3446     MSLOT_ALT_WEAPON,       // Alternate weapon, ranged or second melee weapon
3447                             // for monsters that can use two weapons.
3448     MSLOT_MISSILE,
3449     MSLOT_ALT_MISSILE,
3450     MSLOT_ARMOUR,
3451     MSLOT_SHIELD,
3452     MSLOT_WAND,
3453     MSLOT_JEWELLERY,
3454     MSLOT_MISCELLANY,
3455
3456     // [ds] Last monster gear slot that the player can observe by examining
3457     // the monster; i.e. the last slot that goes into monster_info.
3458     MSLOT_LAST_VISIBLE_SLOT = MSLOT_MISCELLANY,
3459
3460     MSLOT_POTION,
3461     MSLOT_SCROLL,
3462     MSLOT_GOLD,
3463     NUM_MONSTER_SLOTS
3464 };
3465
3466 enum mutation_type
3467 {
3468     // body slot facets
3469     MUT_ANTENNAE,       // head
3470     MUT_BIG_WINGS,
3471     MUT_BEAK,           // head
3472     MUT_CLAWS,          // hands
3473     MUT_FANGS,
3474     MUT_HOOVES,         // feet
3475     MUT_HORNS,          // head
3476     MUT_STINGER,
3477     MUT_TALONS,         // feet
3478     MUT_TENTACLE_SPIKE, // Octopode only.
3479
3480     // scales
3481     MUT_DISTORTION_FIELD,
3482     MUT_ICY_BLUE_SCALES,
3483     MUT_IRIDESCENT_SCALES,
3484     MUT_LARGE_BONE_PLATES,
3485     MUT_MOLTEN_SCALES,
3486     MUT_ROUGH_BLACK_SCALES,
3487     MUT_RUGGED_BROWN_SCALES,
3488     MUT_SLIMY_GREEN_SCALES,
3489     MUT_THIN_METALLIC_SCALES,
3490     MUT_THIN_SKELETAL_STRUCTURE,
3491     MUT_YELLOW_SCALES,
3492     MUT_CAMOUFLAGE,
3493
3494     MUT_ACUTE_VISION,
3495     MUT_AGILE,
3496     MUT_BERSERK,
3497     MUT_BLINK,
3498     MUT_BLURRY_VISION,
3499     MUT_BREATHE_FLAMES,
3500 #if TAG_MAJOR_VERSION == 34
3501     MUT_BREATHE_POISON,
3502 #endif
3503     MUT_CARNIVOROUS,
3504     MUT_CLARITY,
3505     MUT_CLEVER,
3506     MUT_CLUMSY,
3507 #if TAG_MAJOR_VERSION > 34
3508     MUT_COLD_BLOODED,
3509 #endif
3510     MUT_COLD_RESISTANCE,
3511 #if TAG_MAJOR_VERSION > 34
3512     MUT_COLD_VULNERABILITY,
3513 #endif
3514 #if TAG_MAJOR_VERSION == 34
3515     MUT_CONSERVE_POTIONS,
3516     MUT_CONSERVE_SCROLLS,
3517 #endif
3518     MUT_DEFORMED,
3519     MUT_DEMONIC_GUARDIAN,
3520     MUT_DETERIORATION,
3521     MUT_DOPEY,
3522     MUT_HEAT_RESISTANCE,
3523 #if TAG_MAJOR_VERSION > 34
3524     MUT_HEAT_VULNERABILITY,
3525     MUT_FLAME_CLOUD_IMMUNITY,
3526 #endif
3527     MUT_HERBIVOROUS,
3528     MUT_HURL_HELLFIRE,
3529
3530     MUT_FAST,
3531     MUT_FAST_METABOLISM,
3532 #if TAG_MAJOR_VERSION == 34
3533     MUT_FLEXIBLE_WEAK,
3534 #endif
3535     MUT_FRAIL,
3536     MUT_FOUL_STENCH,
3537     MUT_GOURMAND,
3538     MUT_HIGH_MAGIC,
3539 #if TAG_MAJOR_VERSION > 34
3540     MUT_FREEZING_CLOUD_IMMUNITY,
3541 #endif
3542     MUT_ICEMAIL,
3543     MUT_IGNITE_BLOOD,
3544     MUT_LOW_MAGIC,
3545     MUT_MAGIC_RESISTANCE,
3546     MUT_MUTATION_RESISTANCE,
3547     MUT_NEGATIVE_ENERGY_RESISTANCE,
3548     MUT_NIGHTSTALKER,
3549     MUT_PASSIVE_FREEZE,
3550     MUT_PASSIVE_MAPPING,
3551     MUT_POISON_RESISTANCE,
3552     MUT_POWERED_BY_DEATH,
3553     MUT_POWERED_BY_PAIN,
3554     MUT_REGENERATION,
3555     MUT_ROBUST,
3556 #if TAG_MAJOR_VERSION == 34
3557     MUT_SAPROVOROUS,
3558 #endif
3559     MUT_SCREAM,
3560     MUT_SHAGGY_FUR,
3561     MUT_SHOCK_RESISTANCE,
3562 #if TAG_MAJOR_VERSION > 34
3563     MUT_SHOCK_VULNERABILITY,
3564 #endif
3565     MUT_SLOW,
3566     MUT_SLOW_HEALING,
3567     MUT_SLOW_METABOLISM,
3568     MUT_SPINY,
3569     MUT_SPIT_POISON,
3570     MUT_STOCHASTIC_TORMENT_RESISTANCE,
3571     MUT_STRONG,
3572 #if TAG_MAJOR_VERSION == 34
3573     MUT_STRONG_STIFF,
3574 #endif
3575     MUT_TELEPORT,
3576     MUT_TELEPORT_CONTROL,
3577     MUT_TORMENT_RESISTANCE,
3578     MUT_TOUGH_SKIN,
3579     MUT_WEAK,
3580     MUT_WILD_MAGIC,
3581     MUT_UNBREATHING,
3582     MUT_ACIDIC_BITE,
3583     MUT_EYEBALLS,
3584 #if TAG_MAJOR_VERSION == 34
3585     MUT_FOOD_JELLY,
3586 #endif
3587     MUT_GELATINOUS_BODY,
3588     MUT_PSEUDOPODS,
3589     MUT_TRANSLUCENT_SKIN,
3590     MUT_EVOLUTION,
3591     MUT_AUGMENTATION,
3592     MUT_TENDRILS,
3593     MUT_JELLY_GROWTH,
3594     MUT_JELLY_MISSILE,
3595     MUT_MANA_SHIELD,
3596     MUT_MANA_REGENERATION,
3597     MUT_MANA_LINK,
3598     MUT_PETRIFICATION_RESISTANCE,
3599     MUT_TRAMPLE_RESISTANCE,
3600 #if TAG_MAJOR_VERSION == 34
3601     MUT_CLING,
3602     MUT_FUMES,
3603     MUT_JUMP,
3604     MUT_EXOSKELETON,
3605 #endif
3606     MUT_ANTIMAGIC_BITE,
3607     MUT_NO_DEVICE_HEAL,
3608 #if TAG_MAJOR_VERSION == 34
3609     MUT_COLD_VULNERABILITY,
3610     MUT_HEAT_VULNERABILITY,
3611 #endif
3612     MUT_BLACK_MARK,
3613 #if TAG_MAJOR_VERSION == 34
3614     MUT_SHOCK_VULNERABILITY,
3615     MUT_COLD_BLOODED,
3616 #endif
3617     MUT_ROT_IMMUNITY,
3618 #if TAG_MAJOR_VERSION == 34
3619     MUT_FREEZING_CLOUD_IMMUNITY,
3620     MUT_FLAME_CLOUD_IMMUNITY,
3621 #else
3622     MUT_SUSTAIN_ABILITIES,
3623 #endif
3624 #if TAG_MAJOR_VERSION == 34
3625     MUT_FORLORN,
3626 #endif
3627     MUT_PLACID_MAGIC,
3628     MUT_NO_DRINK,
3629     MUT_NO_READ,
3630     MUT_MISSING_HAND,
3631     MUT_NO_STEALTH,
3632     MUT_NO_ARTIFICE,
3633     MUT_NO_LOVE,
3634     MUT_COWARDICE,
3635     MUT_NO_DODGING,
3636     MUT_NO_ARMOUR,
3637     MUT_NO_AIR_MAGIC,
3638     MUT_NO_CHARM_MAGIC,
3639     MUT_NO_CONJURATION_MAGIC,
3640     MUT_NO_EARTH_MAGIC,
3641     MUT_NO_FIRE_MAGIC,
3642     MUT_NO_HEXES_MAGIC,
3643     MUT_NO_ICE_MAGIC,
3644     MUT_NO_NECROMANCY_MAGIC,
3645     MUT_NO_POISON_MAGIC,
3646     MUT_NO_SUMMONING_MAGIC,
3647     MUT_NO_TRANSLOCATION_MAGIC,
3648     MUT_NO_TRANSMUTATION_MAGIC,
3649     MUT_PHYSICAL_VULNERABILITY,
3650     MUT_SLOW_REFLEXES,
3651     MUT_MAGICAL_VULNERABILITY,
3652     MUT_ANTI_WIZARDRY,
3653
3654 #if TAG_MAJOR_VERSION == 34
3655     MUT_SUSTAIN_ABILITIES,
3656 #endif
3657     MUT_MP_WANDS,
3658     MUT_UNSKILLED,
3659     MUT_INEXPERIENCED,
3660     MUT_PAWS,
3661     MUT_NECRO_ENHANCER,
3662     MUT_MUMMY_RESTORATION,
3663     MUT_CONSTRICTING_TAIL,
3664     MUT_TENGU_FLIGHT,
3665     MUT_MISSING_EYE,
3666     MUT_TEMPERATURE_SENSITIVITY,
3667     NUM_MUTATIONS,
3668
3669     RANDOM_MUTATION,
3670     RANDOM_XOM_MUTATION,
3671     RANDOM_GOOD_MUTATION,
3672     RANDOM_BAD_MUTATION,
3673     RANDOM_SLIME_MUTATION,
3674     RANDOM_NON_SLIME_MUTATION,
3675     RANDOM_CORRUPT_MUTATION,
3676     RANDOM_QAZLAL_MUTATION,
3677     MUT_NON_MUTATION,
3678 };
3679
3680 enum object_class_type                 // mitm[].base_type
3681 {
3682     OBJ_WEAPONS,
3683     OBJ_MISSILES,
3684     OBJ_ARMOUR,
3685     OBJ_WANDS,
3686     OBJ_FOOD,
3687     OBJ_SCROLLS,
3688     OBJ_JEWELLERY,
3689     OBJ_POTIONS,
3690     OBJ_BOOKS,
3691     OBJ_STAVES,
3692     OBJ_ORBS,
3693     OBJ_MISCELLANY,
3694     OBJ_CORPSES,
3695     OBJ_GOLD,
3696     OBJ_RODS,
3697     NUM_OBJECT_CLASSES,
3698     OBJ_UNASSIGNED = 100,
3699     OBJ_RANDOM,      // used for blanket random sub_type .. see dungeon::items()
3700     OBJ_DETECTED,    // unknown item; item_info only
3701 };
3702
3703 enum operation_types
3704 {
3705     OPER_WIELD    = 'w',
3706     OPER_QUAFF    = 'q',
3707     OPER_DROP     = 'd',
3708     OPER_EAT      = 'e',
3709     OPER_TAKEOFF  = 'T',
3710     OPER_WEAR     = 'W',
3711     OPER_PUTON    = 'P',
3712     OPER_REMOVE   = 'R',
3713     OPER_READ     = 'r',
3714     OPER_MEMORISE = 'M',
3715     OPER_ZAP      = 'Z',
3716     OPER_FIRE     = 'f',
3717     OPER_PRAY     = 'p',
3718     OPER_EVOKE    = 'v',
3719     OPER_DESTROY  = 'D',
3720     OPER_QUIVER   = 'Q',
3721     OPER_ATTACK   = 'a',
3722     OPER_ANY      = 0,
3723 };
3724
3725 enum orb_type
3726 {
3727     ORB_ZOT,
3728 };
3729
3730 enum recite_type
3731 {
3732     RECITE_HERETIC,
3733     RECITE_CHAOTIC,
3734     RECITE_IMPURE,
3735     RECITE_UNHOLY,
3736     NUM_RECITE_TYPES
3737 };
3738
3739 enum size_part_type
3740 {
3741     PSIZE_BODY,         // entire body size -- used for EV/size of target
3742     PSIZE_TORSO,        // torso only (hybrids -- size of parts that use equip)
3743 };
3744
3745 enum potion_type
3746 {
3747     POT_CURING,
3748     POT_HEAL_WOUNDS,
3749     POT_HASTE,
3750     POT_MIGHT,
3751     POT_BRILLIANCE,
3752     POT_AGILITY,
3753 #if TAG_MAJOR_VERSION == 34
3754     POT_GAIN_STRENGTH,
3755     POT_GAIN_DEXTERITY,
3756     POT_GAIN_INTELLIGENCE,
3757 #endif
3758     POT_FLIGHT,
3759     POT_POISON,
3760 #if TAG_MAJOR_VERSION == 34
3761     POT_SLOWING,
3762 #endif
3763     POT_CANCELLATION,
3764     POT_AMBROSIA,
3765     POT_INVISIBILITY,
3766 #if TAG_MAJOR_VERSION == 34
3767     POT_PORRIDGE,
3768 #endif
3769     POT_DEGENERATION,
3770 #if TAG_MAJOR_VERSION == 34
3771     POT_DECAY,
3772     POT_WATER,
3773 #endif
3774     POT_EXPERIENCE,
3775     POT_MAGIC,
3776     POT_RESTORE_ABILITIES,
3777 #if TAG_MAJOR_VERSION == 34
3778     POT_STRONG_POISON,
3779 #endif
3780     POT_BERSERK_RAGE,
3781     POT_CURE_MUTATION,
3782     POT_MUTATION,
3783     POT_RESISTANCE,
3784     POT_BLOOD,
3785 #if TAG_MAJOR_VERSION == 34
3786     POT_BLOOD_COAGULATED,
3787 #endif
3788     POT_LIGNIFY,
3789     POT_BENEFICIAL_MUTATION,
3790     NUM_POTIONS
3791 };
3792
3793 enum pronoun_type
3794 {
3795     PRONOUN_SUBJECTIVE,
3796     PRONOUN_POSSESSIVE,
3797     PRONOUN_REFLEXIVE,
3798     PRONOUN_OBJECTIVE,
3799     NUM_PRONOUN_CASES
3800 };
3801
3802 enum gender_type
3803 {
3804     GENDER_NEUTER,
3805     GENDER_MALE,
3806     GENDER_FEMALE,
3807     GENDER_YOU, // A person, not a gender, but close enough.
3808     NUM_GENDERS
3809 };
3810
3811 // Be sure to update artefact_prop_data[] in artefact.cc. Also,
3812 // _randart_propnames() in describe.cc, but order doesn't matter there.
3813 enum artefact_prop_type
3814 {
3815     ARTP_BRAND,
3816     ARTP_AC,
3817     ARTP_EVASION,
3818     ARTP_STRENGTH,
3819     ARTP_INTELLIGENCE,
3820     ARTP_DEXTERITY,
3821     ARTP_FIRE,
3822     ARTP_COLD,
3823     ARTP_ELECTRICITY,
3824     ARTP_POISON,
3825     ARTP_NEGATIVE_ENERGY,
3826     ARTP_MAGIC,
3827     ARTP_EYESIGHT,
3828     ARTP_INVISIBLE,
3829     ARTP_FLY,
3830 #if TAG_MAJOR_VERSION > 34
3831     ARTP_FOG,
3832 #endif
3833     ARTP_BLINK,
3834     ARTP_BERSERK,
3835     ARTP_NOISES,
3836     ARTP_PREVENT_SPELLCASTING,
3837     ARTP_CAUSE_TELEPORTATION,
3838     ARTP_PREVENT_TELEPORTATION,
3839     ARTP_ANGRY,
3840 #if TAG_MAJOR_VERSION == 34
3841     ARTP_METABOLISM,
3842 #endif
3843     ARTP_MUTAGENIC,
3844 #if TAG_MAJOR_VERSION == 34
3845     ARTP_ACCURACY,
3846 #endif
3847     ARTP_SLAYING,
3848     ARTP_CURSED,
3849     ARTP_STEALTH,
3850     ARTP_MAGICAL_POWER,
3851     ARTP_BASE_DELAY,
3852     ARTP_HP,
3853     ARTP_CLARITY,
3854     ARTP_BASE_ACC,
3855     ARTP_BASE_DAM,
3856     ARTP_RMSL,
3857 #if TAG_MAJOR_VERSION == 34
3858     ARTP_FOG,
3859 #endif
3860     ARTP_REGENERATION,
3861     ARTP_SUSTAB,
3862     ARTP_NO_UPGRADE,
3863     ARTP_RCORR,
3864     ARTP_RMUT,
3865     ARTP_TWISTER,
3866     ARTP_NUM_PROPERTIES
3867 };
3868
3869 enum score_format_type
3870 {
3871     SCORE_TERSE,                // one line
3872     SCORE_REGULAR,              // two lines (name, cause, blank)
3873     SCORE_VERBOSE,              // everything (dates, times, god, etc.)
3874 };
3875
3876 enum sense_type
3877 {
3878     SENSE_SMELL_BLOOD,
3879     SENSE_WEB_VIBRATION,
3880 };
3881
3882 enum shop_type
3883 {
3884     SHOP_WEAPON,
3885     SHOP_ARMOUR,
3886     SHOP_WEAPON_ANTIQUE,
3887     SHOP_ARMOUR_ANTIQUE,
3888     SHOP_GENERAL_ANTIQUE,
3889     SHOP_JEWELLERY,
3890     SHOP_EVOKABLES, // wands, rods, and misc items
3891     SHOP_BOOK,
3892     SHOP_FOOD,
3893     SHOP_DISTILLERY,
3894     SHOP_SCROLL,
3895     SHOP_GENERAL,
3896     NUM_SHOPS, // must remain last 'regular' member {dlb}
3897     SHOP_UNASSIGNED = 100,
3898     SHOP_RANDOM,
3899 };
3900
3901 // These are often addressed relative to each other (esp. delta SIZE_MEDIUM).
3902 enum size_type
3903 {
3904     SIZE_TINY,              // rats/bats
3905     SIZE_LITTLE,            // spriggans
3906     SIZE_SMALL,             // halflings/kobolds
3907     SIZE_MEDIUM,            // humans/elves/dwarves