More and more enums

This commit is contained in:
Pasi Kallinen
2018-03-31 12:34:41 +03:00
parent ebde14a6f9
commit 98b0c8d4f0
3 changed files with 79 additions and 68 deletions

View File

@@ -6,6 +6,39 @@
#define OBJCLASS_H
/* [misnamed] definition of a type of object */
enum obj_material_types {
LIQUID = 1, /* currently only for venom */
WAX,
VEGGY, /* foodstuffs */
FLESH, /* ditto */
PAPER,
CLOTH,
LEATHER,
WOOD,
BONE,
DRAGON_HIDE, /* not leather! */
IRON, /* Fe - includes steel */
METAL, /* Sn, &c. */
COPPER, /* Cu - includes brass */
SILVER, /* Ag */
GOLD, /* Au */
PLATINUM, /* Pt */
MITHRIL,
PLASTIC,
GLASS,
GEMSTONE,
MINERAL
};
enum obj_armor_types {
ARM_SUIT = 0,
ARM_SHIELD, /* needed for special wear function */
ARM_HELM,
ARM_GLOVES,
ARM_BOOTS,
ARM_CLOAK,
ARM_SHIRT
};
struct objclass {
short oc_name_idx; /* index of actual name */
@@ -40,28 +73,7 @@ struct objclass {
/*Bitfield(oc_subtyp,3);*/ /* Now too big for a bitfield... see below */
Bitfield(oc_material, 5);
#define LIQUID 1 /* currently only for venom */
#define WAX 2
#define VEGGY 3 /* foodstuffs */
#define FLESH 4 /* ditto */
#define PAPER 5
#define CLOTH 6
#define LEATHER 7
#define WOOD 8
#define BONE 9
#define DRAGON_HIDE 10 /* not leather! */
#define IRON 11 /* Fe - includes steel */
#define METAL 12 /* Sn, &c. */
#define COPPER 13 /* Cu - includes brass */
#define SILVER 14 /* Ag */
#define GOLD 15 /* Au */
#define PLATINUM 16 /* Pt */
#define MITHRIL 17
#define PLASTIC 18
#define GLASS 19
#define GEMSTONE 20
#define MINERAL 21
Bitfield(oc_material, 5); /* one of obj_material_types */
#define is_organic(otmp) (objects[otmp->otyp].oc_material <= WOOD)
#define is_metallic(otmp) \
@@ -84,13 +96,6 @@ struct objclass {
schar oc_subtyp;
#define oc_skill oc_subtyp /* Skills of weapons, spellbooks, tools, gems */
#define oc_armcat oc_subtyp /* for armor */
#define ARM_SHIELD 1 /* needed for special wear function */
#define ARM_HELM 2
#define ARM_GLOVES 3
#define ARM_BOOTS 4
#define ARM_CLOAK 5
#define ARM_SHIRT 6
#define ARM_SUIT 0
uchar oc_oprop; /* property (invis, &c.) conveyed */
char oc_class; /* object class */

View File

@@ -145,43 +145,47 @@ enum opcode_defs {
* mean.
*/
/* MONSTER */
#define SP_M_V_PEACEFUL 0
#define SP_M_V_ALIGN 1
#define SP_M_V_ASLEEP 2
#define SP_M_V_APPEAR 3
#define SP_M_V_NAME 4
enum sp_mon_var_flags {
SP_M_V_PEACEFUL = 0,
SP_M_V_ALIGN,
SP_M_V_ASLEEP,
SP_M_V_APPEAR,
SP_M_V_NAME,
SP_M_V_FEMALE,
SP_M_V_INVIS,
SP_M_V_CANCELLED,
SP_M_V_REVIVED,
SP_M_V_AVENGE,
SP_M_V_FLEEING,
SP_M_V_BLINDED,
SP_M_V_PARALYZED,
SP_M_V_STUNNED,
SP_M_V_CONFUSED,
SP_M_V_SEENTRAPS,
#define SP_M_V_FEMALE 5
#define SP_M_V_INVIS 6
#define SP_M_V_CANCELLED 7
#define SP_M_V_REVIVED 8
#define SP_M_V_AVENGE 9
#define SP_M_V_FLEEING 10
#define SP_M_V_BLINDED 11
#define SP_M_V_PARALYZED 12
#define SP_M_V_STUNNED 13
#define SP_M_V_CONFUSED 14
#define SP_M_V_SEENTRAPS 15
#define SP_M_V_END 16 /* end of variable parameters */
SP_M_V_END
};
/* OBJECT */
#define SP_O_V_SPE 0
#define SP_O_V_CURSE 1
#define SP_O_V_CORPSENM 2
#define SP_O_V_NAME 3
#define SP_O_V_QUAN 4
#define SP_O_V_BURIED 5
#define SP_O_V_LIT 6
#define SP_O_V_ERODED 7
#define SP_O_V_LOCKED 8
#define SP_O_V_TRAPPED 9
#define SP_O_V_RECHARGED 10
#define SP_O_V_INVIS 11
#define SP_O_V_GREASED 12
#define SP_O_V_BROKEN 13
#define SP_O_V_COORD 14
#define SP_O_V_END 15 /* end of variable parameters */
enum sp_obj_var_flags {
SP_O_V_SPE = 0,
SP_O_V_CURSE,
SP_O_V_CORPSENM,
SP_O_V_NAME,
SP_O_V_QUAN,
SP_O_V_BURIED,
SP_O_V_LIT,
SP_O_V_ERODED,
SP_O_V_LOCKED,
SP_O_V_TRAPPED,
SP_O_V_RECHARGED,
SP_O_V_INVIS,
SP_O_V_GREASED,
SP_O_V_BROKEN,
SP_O_V_COORD,
SP_O_V_END
};
/* When creating objects, we need to know whether
* it's a container and/or contents.

View File

@@ -27,11 +27,13 @@ NEARDATA struct instance_flags iflags; /* provide linkage */
#define PREFER_TILED FALSE
#endif
#define MESSAGE_OPTION 1
#define STATUS_OPTION 2
#define MAP_OPTION 3
#define MENU_OPTION 4
#define TEXT_OPTION 5
enum window_option_types {
MESSAGE_OPTION = 1,
STATUS_OPTION,
MAP_OPTION,
MENU_OPTION,
TEXT_OPTION
};
#define PILE_LIMIT_DFLT 5