genericptr_t list;
};
-#define CONS_OBJ 0
-#define CONS_MON 1
-#define CONS_HERO 2
-#define CONS_TRAP 3
+enum bubble_contains_types {
+ CONS_OBJ = 0,
+ CONS_MON,
+ CONS_HERO,
+ CONS_TRAP
+};
struct bubble {
xchar x, y; /* coordinates of the upper left corner */
STATIC_DCL void FDECL(pit_flow, (struct trap *, SCHAR_P));
/* Indices returned by dig_typ() */
-#define DIGTYP_UNDIGGABLE 0
-#define DIGTYP_ROCK 1
-#define DIGTYP_STATUE 2
-#define DIGTYP_BOULDER 3
-#define DIGTYP_DOOR 4
-#define DIGTYP_TREE 5
+enum dig_types {
+ DIGTYP_UNDIGGABLE = 0,
+ DIGTYP_ROCK,
+ DIGTYP_STATUE,
+ DIGTYP_BOULDER,
+ DIGTYP_DOOR,
+ DIGTYP_TREE
+};
STATIC_OVL boolean
rm_waslit()
extern const int monstr[];
-static const char *vanqorders[] = {
+enum vanq_order_modes {
+ VANQ_MLVL_MNDX = 0,
+ VANQ_MSTR_MNDX,
+ VANQ_ALPHA_SEP,
+ VANQ_ALPHA_MIX,
+ VANQ_MCLS_HTOL,
+ VANQ_MCLS_LTOH,
+ VANQ_COUNT_H_L,
+ VANQ_COUNT_L_H,
+
+ NUM_VANQ_ORDER_MODES
+};
+
+static const char *vanqorders[NUM_VANQ_ORDER_MODES] = {
"traditional: by monster level, by internal monster index",
-#define VANQ_MLVL_MNDX 0
"by monster toughness, by internal monster index",
-#define VANQ_MSTR_MNDX 1
"alphabetically, first unique monsters, then others",
-#define VANQ_ALPHA_SEP 2
"alphabetically, unique monsters and others intermixed",
-#define VANQ_ALPHA_MIX 3
"by monster class, high to low level within class",
-#define VANQ_MCLS_HTOL 4
"by monster class, low to high level within class",
-#define VANQ_MCLS_LTOH 5
"by count, high to low, by internal index within tied count",
-#define VANQ_COUNT_H_L 6
"by count, low to high, by internal index within tied count",
-#define VANQ_COUNT_L_H 7
};
static int vanq_sortmode = VANQ_MLVL_MNDX;
#include "hack.h"
/* monster mage spells */
-#define MGC_PSI_BOLT 0
-#define MGC_CURE_SELF 1
-#define MGC_HASTE_SELF 2
-#define MGC_STUN_YOU 3
-#define MGC_DISAPPEAR 4
-#define MGC_WEAKEN_YOU 5
-#define MGC_DESTRY_ARMR 6
-#define MGC_CURSE_ITEMS 7
-#define MGC_AGGRAVATION 8
-#define MGC_SUMMON_MONS 9
-#define MGC_CLONE_WIZ 10
-#define MGC_DEATH_TOUCH 11
+enum mcast_mage_spells {
+ MGC_PSI_BOLT = 0,
+ MGC_CURE_SELF,
+ MGC_HASTE_SELF,
+ MGC_STUN_YOU,
+ MGC_DISAPPEAR,
+ MGC_WEAKEN_YOU,
+ MGC_DESTRY_ARMR,
+ MGC_CURSE_ITEMS,
+ MGC_AGGRAVATION,
+ MGC_SUMMON_MONS,
+ MGC_CLONE_WIZ,
+ MGC_DEATH_TOUCH
+};
/* monster cleric spells */
-#define CLC_OPEN_WOUNDS 0
-#define CLC_CURE_SELF 1
-#define CLC_CONFUSE_YOU 2
-#define CLC_PARALYZE 3
-#define CLC_BLIND_YOU 4
-#define CLC_INSECTS 5
-#define CLC_CURSE_ITEMS 6
-#define CLC_LIGHTNING 7
-#define CLC_FIRE_PILLAR 8
-#define CLC_GEYSER 9
+enum mcast_cleric_spells {
+ CLC_OPEN_WOUNDS = 0,
+ CLC_CURE_SELF,
+ CLC_CONFUSE_YOU,
+ CLC_PARALYZE,
+ CLC_BLIND_YOU,
+ CLC_INSECTS,
+ CLC_CURSE_ITEMS,
+ CLC_LIGHTNING,
+ CLC_FIRE_PILLAR,
+ CLC_GEYSER
+};
STATIC_DCL void FDECL(cursetxt, (struct monst *, BOOLEAN_P));
STATIC_DCL int FDECL(choose_magic_spell, (int));
* other source files, but they are all so nicely encapsulated here.
*/
-#define CONS_OBJ 0
-#define CONS_MON 1
-#define CONS_HERO 2
-#define CONS_TRAP 3
-
static struct bubble *bbubbles, *ebubbles;
static struct trap *wportal;
pc_speaker(&itmp, "C");
#endif
-#define PLAY_NORMAL 0
-#define PLAY_STUNNED 1
-#define PLAY_CONFUSED 2
-#define PLAY_HALLU 4
+#define PLAY_NORMAL 0x00
+#define PLAY_STUNNED 0x01
+#define PLAY_CONFUSED 0x02
+#define PLAY_HALLU 0x04
mode = PLAY_NORMAL;
if (Stunned)
mode |= PLAY_STUNNED;
* are learned, they get inserted into sorted order rather than be
* appended to the end of the list?
*/
-static const char *spl_sortchoices[] = {
+enum spl_sort_types {
+ SORTBY_LETTER = 0,
+ SORTBY_ALPHA,
+ SORTBY_LVL_LO,
+ SORTBY_LVL_HI,
+ SORTBY_SKL_AL,
+ SORTBY_SKL_LO,
+ SORTBY_SKL_HI,
+ SORTBY_CURRENT,
+ SORTRETAINORDER,
+
+ NUM_SPELL_SORTBY
+};
+
+static const char *spl_sortchoices[NUM_SPELL_SORTBY] = {
"by casting letter",
-#define SORTBY_LETTER 0
"alphabetically",
-#define SORTBY_ALPHA 1
"by level, low to high",
-#define SORTBY_LVL_LO 2
"by level, high to low",
-#define SORTBY_LVL_HI 3
"by skill group, alphabetized within each group",
-#define SORTBY_SKL_AL 4
"by skill group, low to high level within group",
-#define SORTBY_SKL_LO 5
"by skill group, high to low level within group",
-#define SORTBY_SKL_HI 6
"maintain current ordering",
-#define SORTBY_CURRENT 7
/* a menu choice rather than a sort choice */
"reassign casting letters to retain current order",
-#define SORTRETAINORDER 8
};
static int spl_sortmode = 0; /* index into spl_sortchoices[] */
static int *spl_orderindx = 0; /* array of spl_book[] indices */