diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-03-13 00:36:17 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-03-13 00:56:47 +0100 |
commit | 510ac65eb36cbb4f888df9dc1b54cacdf93a0db2 (patch) | |
tree | 39162f270df4877c22484b55b22943797f431135 | |
parent | fcc5b3c1ba9c3737b7df0fcfac614d92ba3cbd92 (diff) | |
download | manaserv-510ac65eb36cbb4f888df9dc1b54cacdf93a0db2.tar.gz manaserv-510ac65eb36cbb4f888df9dc1b54cacdf93a0db2.tar.bz2 manaserv-510ac65eb36cbb4f888df9dc1b54cacdf93a0db2.tar.xz manaserv-510ac65eb36cbb4f888df9dc1b54cacdf93a0db2.zip |
Use an enum rather than a bunch of #defines for the attributes
Nicer style.
-rw-r--r-- | src/defines.h | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/src/defines.h b/src/defines.h index fc99fb60..1fe9f1bc 100644 --- a/src/defines.h +++ b/src/defines.h @@ -130,45 +130,47 @@ enum Element * FIXME: Much of these serve only to indicate derivatives, and so would not be * needed once this is no longer a hardcoded system. */ +enum +{ + // Base Statistics + ATTR_STR = 1, + ATTR_AGI = 2, + ATTR_VIT = 3, + ATTR_INT = 4, + ATTR_DEX = 5, + ATTR_WIL = 6, -// Base Statistics -#define ATTR_STR 1 -#define ATTR_AGI 2 -#define ATTR_VIT 3 -#define ATTR_INT 4 -#define ATTR_DEX 5 -#define ATTR_WIL 6 - -// Derived attributes -#define ATTR_ACCURACY 7 -#define ATTR_DEFENSE 8 -#define ATTR_DODGE 9 + // Derived attributes + ATTR_ACCURACY = 7, + ATTR_DEFENSE = 8, + ATTR_DODGE = 9, -#define ATTR_MAGIC_DODGE 10 -#define ATTR_MAGIC_DEFENSE 11 + ATTR_MAGIC_DODGE = 10, + ATTR_MAGIC_DEFENSE = 11, -#define ATTR_BONUS_ASPD 12 + ATTR_BONUS_ASPD = 12, -#define ATTR_HP 13 -#define ATTR_MAX_HP 14 -#define ATTR_HP_REGEN 15 + ATTR_HP = 13, + ATTR_MAX_HP = 14, + ATTR_HP_REGEN = 15, -// Separate primary movespeed (tiles * second ^-1) and derived movespeed (raw) -#define ATTR_MOVE_SPEED_TPS 16 -#define ATTR_MOVE_SPEED_RAW 17 + // Separate primary movespeed (tiles * second ^-1) and derived movespeed (raw) + ATTR_MOVE_SPEED_TPS = 16, + ATTR_MOVE_SPEED_RAW = 17, -// Money and inventory size attributes. -#define ATTR_GP 18 -#define ATTR_INV_CAPACITY 19 + // Money and inventory size attributes. + ATTR_GP = 18, + ATTR_INV_CAPACITY = 19, -/** - * Temporary attributes. - * @todo Use AutoAttacks instead. - */ -#define MOB_ATTR_PHY_ATK_MIN 20 -#define MOB_ATTR_PHY_ATK_DELTA 21 -#define MOB_ATTR_MAG_ATK 22 + /** + * Temporary attributes. + * @todo Use AutoAttacks instead. + */ + MOB_ATTR_PHY_ATK_MIN = 20, + MOB_ATTR_PHY_ATK_DELTA = 21, + MOB_ATTR_MAG_ATK = 22 +}; /** * Attribute types. Can be one of stackable, non stackable, |