summaryrefslogtreecommitdiff
path: root/src/monster_race.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/monster_race.hpp')
-rw-r--r--src/monster_race.hpp98
1 files changed, 33 insertions, 65 deletions
diff --git a/src/monster_race.hpp b/src/monster_race.hpp
index 7e5d5082..eb398a3d 100644
--- a/src/monster_race.hpp
+++ b/src/monster_race.hpp
@@ -3,8 +3,12 @@
#include "body.hpp"
#include "h-basic.h"
#include "monster_blow.hpp"
+#include "monster_race_flag_set.hpp"
+#include "monster_spell_flag_set.hpp"
#include "obj_theme.hpp"
+#include <array>
+
/**
* Monster race descriptors and runtime data, including racial memories.
*
@@ -26,91 +30,55 @@
*/
struct monster_race
{
- const char *name; /* Name */
- char *text; /* Text */
-
- u16b hdice; /* Creatures hit dice count */
- u16b hside; /* Creatures hit dice sides */
-
- s16b ac; /* Armour Class */
-
- s16b sleep; /* Inactive counter (base) */
- byte aaf; /* Area affect radius (1-100) */
- byte speed; /* Speed (normally 110) */
-
- s32b mexp; /* Exp value for kill */
-
- s32b weight; /* Weight of the monster */
-
- byte freq_inate; /* Inate spell frequency */
- byte freq_spell; /* Other spell frequency */
-
- u32b flags1; /* Flags 1 (general) */
- u32b flags2; /* Flags 2 (abilities) */
- u32b flags3; /* Flags 3 (race/resist) */
- u32b flags4; /* Flags 4 (inate/breath) */
- u32b flags5; /* Flags 5 (normal spells) */
- u32b flags6; /* Flags 6 (special spells) */
- u32b flags7; /* Flags 7 (movement related abilities) */
- u32b flags8; /* Flags 8 (wilderness info) */
- u32b flags9; /* Flags 9 (drops info) */
-
- monster_blow blow[4]; /* Up to four blows per round */
-
- byte body_parts[BODY_MAX]; /* To help to decide what to use when body changing */
+ const char *name = nullptr; /* Name */
+ char *text = nullptr; /* Text */
- byte level; /* Level of creature */
- byte rarity; /* Rarity of creature */
+ u16b hdice = 0; /* Creatures hit dice count */
+ u16b hside = 0; /* Creatures hit dice sides */
+ s16b ac = 0; /* Armour Class */
- byte d_attr; /* Default monster attribute */
- char d_char; /* Default monster character */
+ s16b sleep = 0; /* Inactive counter (base) */
+ byte aaf = 0; /* Area affect radius (1-100) */
+ byte speed = 0; /* Speed (normally 110) */
+ s32b mexp = 0; /* Exp value for kill */
- byte x_attr; /* Desired monster attribute */
- char x_char; /* Desired monster character */
+ s32b weight = 0; /* Weight of the monster */
+ byte freq_inate = 0; /* Inate spell frequency */
+ byte freq_spell = 0; /* Other spell frequency */
- s16b max_num; /* Maximum population allowed per level */
+ monster_race_flag_set flags; /* Flags */
- byte cur_num; /* Monster population on current level */
+ monster_spell_flag_set spells; /* Spells */
+ std::array<monster_blow, 4> blow { }; /* Up to four blows per round */
- s16b r_sights; /* Count sightings of this monster */
- s16b r_deaths; /* Count deaths from this monster */
+ byte body_parts[BODY_MAX] = { 0 }; /* To help to decide what to use when body changing */
- s16b r_pkills; /* Count monsters killed in this life */
- s16b r_tkills; /* Count monsters killed in all lives */
+ byte artifact_idx = 0; /* Artifact index of standard artifact dropped; 0 if none. */
+ int artifact_chance = 0; /* Percentage chance of dropping the artifact. */
- byte r_wake; /* Number of times woken up (?) */
- byte r_ignore; /* Number of times ignored (?) */
+ byte level = 0; /* Level of creature */
+ byte rarity = 0; /* Rarity of creature */
- byte r_xtra1; /* Something (unused) */
- byte r_xtra2; /* Something (unused) */
+ byte d_attr = 0; /* Default monster attribute */
+ char d_char = 0; /* Default monster character */
- byte r_drop_gold; /* Max number of gold dropped at once */
- byte r_drop_item; /* Max number of item dropped at once */
- byte r_cast_inate; /* Max number of inate spells seen */
- byte r_cast_spell; /* Max number of other spells seen */
+ byte x_attr = 0; /* Desired monster attribute */
+ char x_char = 0; /* Desired monster character */
- byte r_blows[4]; /* Number of times each blow type was seen */
+ s16b max_num = 0; /* Maximum population allowed per level */
+ byte cur_num = 0; /* Monster population on current level */
- u32b r_flags1; /* Observed racial flags */
- u32b r_flags2; /* Observed racial flags */
- u32b r_flags3; /* Observed racial flags */
- u32b r_flags4; /* Observed racial flags */
- u32b r_flags5; /* Observed racial flags */
- u32b r_flags6; /* Observed racial flags */
- u32b r_flags7; /* Observed racial flags */
- u32b r_flags8; /* Observed racial flags */
- u32b r_flags9; /* Observed racial flags */
+ s16b r_pkills = 0; /* Count monsters killed in this life */
- bool_ on_saved; /* Is the (unique) on a saved level ? */
+ bool_ on_saved = 0; /* Is the (unique) on a saved level ? */
- byte total_visible; /* Amount of this race that are visible */
+ obj_theme drops; /* The drops type */
- obj_theme drops; /* The drops type */
};