Still more enums

This commit is contained in:
Pasi Kallinen
2018-03-31 11:43:38 +03:00
parent 9b7e146807
commit ebde14a6f9
7 changed files with 73 additions and 60 deletions
+6 -4
View File
@@ -25,10 +25,12 @@ struct container {
genericptr_t list; genericptr_t list;
}; };
#define CONS_OBJ 0 enum bubble_contains_types {
#define CONS_MON 1 CONS_OBJ = 0,
#define CONS_HERO 2 CONS_MON,
#define CONS_TRAP 3 CONS_HERO,
CONS_TRAP
};
struct bubble { struct bubble {
xchar x, y; /* coordinates of the upper left corner */ xchar x, y; /* coordinates of the upper left corner */
+8 -6
View File
@@ -16,12 +16,14 @@ STATIC_DCL int FDECL(adj_pit_checks, (coord *, char *));
STATIC_DCL void FDECL(pit_flow, (struct trap *, SCHAR_P)); STATIC_DCL void FDECL(pit_flow, (struct trap *, SCHAR_P));
/* Indices returned by dig_typ() */ /* Indices returned by dig_typ() */
#define DIGTYP_UNDIGGABLE 0 enum dig_types {
#define DIGTYP_ROCK 1 DIGTYP_UNDIGGABLE = 0,
#define DIGTYP_STATUE 2 DIGTYP_ROCK,
#define DIGTYP_BOULDER 3 DIGTYP_STATUE,
#define DIGTYP_DOOR 4 DIGTYP_BOULDER,
#define DIGTYP_TREE 5 DIGTYP_DOOR,
DIGTYP_TREE
};
STATIC_OVL boolean STATIC_OVL boolean
rm_waslit() rm_waslit()
+14 -9
View File
@@ -1572,23 +1572,28 @@ int status;
extern const int monstr[]; 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", "traditional: by monster level, by internal monster index",
#define VANQ_MLVL_MNDX 0
"by monster toughness, by internal monster index", "by monster toughness, by internal monster index",
#define VANQ_MSTR_MNDX 1
"alphabetically, first unique monsters, then others", "alphabetically, first unique monsters, then others",
#define VANQ_ALPHA_SEP 2
"alphabetically, unique monsters and others intermixed", "alphabetically, unique monsters and others intermixed",
#define VANQ_ALPHA_MIX 3
"by monster class, high to low level within class", "by monster class, high to low level within class",
#define VANQ_MCLS_HTOL 4
"by monster class, low to high level within class", "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", "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", "by count, low to high, by internal index within tied count",
#define VANQ_COUNT_L_H 7
}; };
static int vanq_sortmode = VANQ_MLVL_MNDX; static int vanq_sortmode = VANQ_MLVL_MNDX;
+26 -22
View File
@@ -5,30 +5,34 @@
#include "hack.h" #include "hack.h"
/* monster mage spells */ /* monster mage spells */
#define MGC_PSI_BOLT 0 enum mcast_mage_spells {
#define MGC_CURE_SELF 1 MGC_PSI_BOLT = 0,
#define MGC_HASTE_SELF 2 MGC_CURE_SELF,
#define MGC_STUN_YOU 3 MGC_HASTE_SELF,
#define MGC_DISAPPEAR 4 MGC_STUN_YOU,
#define MGC_WEAKEN_YOU 5 MGC_DISAPPEAR,
#define MGC_DESTRY_ARMR 6 MGC_WEAKEN_YOU,
#define MGC_CURSE_ITEMS 7 MGC_DESTRY_ARMR,
#define MGC_AGGRAVATION 8 MGC_CURSE_ITEMS,
#define MGC_SUMMON_MONS 9 MGC_AGGRAVATION,
#define MGC_CLONE_WIZ 10 MGC_SUMMON_MONS,
#define MGC_DEATH_TOUCH 11 MGC_CLONE_WIZ,
MGC_DEATH_TOUCH
};
/* monster cleric spells */ /* monster cleric spells */
#define CLC_OPEN_WOUNDS 0 enum mcast_cleric_spells {
#define CLC_CURE_SELF 1 CLC_OPEN_WOUNDS = 0,
#define CLC_CONFUSE_YOU 2 CLC_CURE_SELF,
#define CLC_PARALYZE 3 CLC_CONFUSE_YOU,
#define CLC_BLIND_YOU 4 CLC_PARALYZE,
#define CLC_INSECTS 5 CLC_BLIND_YOU,
#define CLC_CURSE_ITEMS 6 CLC_INSECTS,
#define CLC_LIGHTNING 7 CLC_CURSE_ITEMS,
#define CLC_FIRE_PILLAR 8 CLC_LIGHTNING,
#define CLC_GEYSER 9 CLC_FIRE_PILLAR,
CLC_GEYSER
};
STATIC_DCL void FDECL(cursetxt, (struct monst *, BOOLEAN_P)); STATIC_DCL void FDECL(cursetxt, (struct monst *, BOOLEAN_P));
STATIC_DCL int FDECL(choose_magic_spell, (int)); STATIC_DCL int FDECL(choose_magic_spell, (int));
-5
View File
@@ -1184,11 +1184,6 @@ fumaroles()
* other source files, but they are all so nicely encapsulated here. * 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 bubble *bbubbles, *ebubbles;
static struct trap *wportal; static struct trap *wportal;
+4 -4
View File
@@ -478,10 +478,10 @@ struct obj *instr;
pc_speaker(&itmp, "C"); pc_speaker(&itmp, "C");
#endif #endif
#define PLAY_NORMAL 0 #define PLAY_NORMAL 0x00
#define PLAY_STUNNED 1 #define PLAY_STUNNED 0x01
#define PLAY_CONFUSED 2 #define PLAY_CONFUSED 0x02
#define PLAY_HALLU 4 #define PLAY_HALLU 0x04
mode = PLAY_NORMAL; mode = PLAY_NORMAL;
if (Stunned) if (Stunned)
mode |= PLAY_STUNNED; mode |= PLAY_STUNNED;
+15 -10
View File
@@ -1343,26 +1343,31 @@ losespells()
* are learned, they get inserted into sorted order rather than be * are learned, they get inserted into sorted order rather than be
* appended to the end of the list? * 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", "by casting letter",
#define SORTBY_LETTER 0
"alphabetically", "alphabetically",
#define SORTBY_ALPHA 1
"by level, low to high", "by level, low to high",
#define SORTBY_LVL_LO 2
"by level, high to low", "by level, high to low",
#define SORTBY_LVL_HI 3
"by skill group, alphabetized within each group", "by skill group, alphabetized within each group",
#define SORTBY_SKL_AL 4
"by skill group, low to high level within group", "by skill group, low to high level within group",
#define SORTBY_SKL_LO 5
"by skill group, high to low level within group", "by skill group, high to low level within group",
#define SORTBY_SKL_HI 6
"maintain current ordering", "maintain current ordering",
#define SORTBY_CURRENT 7
/* a menu choice rather than a sort choice */ /* a menu choice rather than a sort choice */
"reassign casting letters to retain current order", "reassign casting letters to retain current order",
#define SORTRETAINORDER 8
}; };
static int spl_sortmode = 0; /* index into spl_sortchoices[] */ static int spl_sortmode = 0; /* index into spl_sortchoices[] */
static int *spl_orderindx = 0; /* array of spl_book[] indices */ static int *spl_orderindx = 0; /* array of spl_book[] indices */