From d1f01115fe9df36800191f1aa55d3ee45eb8cd02 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Sun, 27 Mar 2016 15:46:59 +0200 Subject: Move "drops artifact N at %chance" to edit r_info --- src/monster_race.hpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/monster_race.hpp') diff --git a/src/monster_race.hpp b/src/monster_race.hpp index 7e5d5082..f756d6ff 100644 --- a/src/monster_race.hpp +++ b/src/monster_race.hpp @@ -59,6 +59,9 @@ struct monster_race byte body_parts[BODY_MAX]; /* To help to decide what to use when body changing */ + byte artifact_idx; /* Artifact index of standard artifact dropped; 0 if none. */ + int artifact_chance; /* Percentage chance of dropping the artifact. */ + byte level; /* Level of creature */ byte rarity; /* Rarity of creature */ -- cgit v1.2.3 From 7137a17f77fd3b6c3bbcefa2d621b3a11f161679 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Mon, 20 Jun 2016 22:49:05 +0200 Subject: Remove monster memory Instead of having monster memory, the player automatically knows everything about all monsters from the start. --- src/monster_race.hpp | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'src/monster_race.hpp') diff --git a/src/monster_race.hpp b/src/monster_race.hpp index f756d6ff..ad44aef0 100644 --- a/src/monster_race.hpp +++ b/src/monster_race.hpp @@ -79,35 +79,7 @@ struct monster_race byte cur_num; /* Monster population on current level */ - s16b r_sights; /* Count sightings of this monster */ - s16b r_deaths; /* Count deaths from this monster */ - s16b r_pkills; /* Count monsters killed in this life */ - s16b r_tkills; /* Count monsters killed in all lives */ - - byte r_wake; /* Number of times woken up (?) */ - byte r_ignore; /* Number of times ignored (?) */ - - byte r_xtra1; /* Something (unused) */ - byte r_xtra2; /* Something (unused) */ - - 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 r_blows[4]; /* Number of times each blow type was seen */ - - 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 */ bool_ on_saved; /* Is the (unique) on a saved level ? */ -- cgit v1.2.3 From ca8819a0307ab785766b3b4a5e2031b6db33ed1c Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Mon, 20 Jun 2016 22:49:05 +0200 Subject: Change monster_race to non-POD struct --- src/monster_race.hpp | 82 +++++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 39 deletions(-) (limited to 'src/monster_race.hpp') diff --git a/src/monster_race.hpp b/src/monster_race.hpp index ad44aef0..1cb2742a 100644 --- a/src/monster_race.hpp +++ b/src/monster_race.hpp @@ -26,66 +26,70 @@ */ struct monster_race { - const char *name; /* Name */ - char *text; /* Text */ + const char *name = nullptr; /* Name */ + char *text = nullptr; /* Text */ - u16b hdice; /* Creatures hit dice count */ - u16b hside; /* Creatures hit dice sides */ + u16b hdice = 0; /* Creatures hit dice count */ + u16b hside = 0; /* Creatures hit dice sides */ - s16b ac; /* Armour Class */ + s16b ac = 0; /* Armour Class */ - s16b sleep; /* Inactive counter (base) */ - byte aaf; /* Area affect radius (1-100) */ - byte speed; /* Speed (normally 110) */ + s16b sleep = 0; /* Inactive counter (base) */ + byte aaf = 0; /* Area affect radius (1-100) */ + byte speed = 0; /* Speed (normally 110) */ - s32b mexp; /* Exp value for kill */ + s32b mexp = 0; /* Exp value for kill */ - s32b weight; /* Weight of the monster */ + s32b weight = 0; /* Weight of the monster */ - byte freq_inate; /* Inate spell frequency */ - byte freq_spell; /* Other spell frequency */ + byte freq_inate = 0; /* Inate spell frequency */ + byte freq_spell = 0; /* 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) */ + u32b flags1 = 0; /* Flags 1 (general) */ + u32b flags2 = 0; /* Flags 2 (abilities) */ + u32b flags3 = 0; /* Flags 3 (race/resist) */ + u32b flags4 = 0; /* Flags 4 (inate/breath) */ + u32b flags5 = 0; /* Flags 5 (normal spells) */ + u32b flags6 = 0; /* Flags 6 (special spells) */ + u32b flags7 = 0; /* Flags 7 (movement related abilities) */ + u32b flags8 = 0; /* Flags 8 (wilderness info) */ + u32b flags9 = 0; /* 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 */ + monster_blow blow[4] = { /* Up to four blows per round */ + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + }; - byte artifact_idx; /* Artifact index of standard artifact dropped; 0 if none. */ - int artifact_chance; /* Percentage chance of dropping the artifact. */ + byte body_parts[BODY_MAX] = { 0 }; /* To help to decide what to use when body changing */ - byte level; /* Level of creature */ - byte rarity; /* Rarity of creature */ + byte artifact_idx = 0; /* Artifact index of standard artifact dropped; 0 if none. */ + int artifact_chance = 0; /* Percentage chance of dropping the artifact. */ + byte level = 0; /* Level of creature */ + byte rarity = 0; /* Rarity of creature */ - byte d_attr; /* Default monster attribute */ - char d_char; /* Default monster character */ + byte d_attr = 0; /* Default monster attribute */ + char d_char = 0; /* Default monster character */ - byte x_attr; /* Desired monster attribute */ - char x_char; /* Desired monster character */ + byte x_attr = 0; /* Desired monster attribute */ + char x_char = 0; /* Desired monster character */ + s16b max_num = 0; /* Maximum population allowed per level */ + byte cur_num = 0; /* Monster population on current level */ - s16b max_num; /* Maximum population allowed per level */ + s16b r_pkills = 0; /* Count monsters killed in this life */ - byte cur_num; /* Monster population on current level */ + bool_ on_saved = 0; /* Is the (unique) on a saved level ? */ + byte total_visible = 0; /* Amount of this race that are visible */ - s16b r_pkills; /* Count monsters killed in this life */ + obj_theme drops = obj_theme /* The drops type */ + { 0, 0, 0, 0 }; - bool_ on_saved; /* Is the (unique) on a saved level ? */ - - byte total_visible; /* Amount of this race that are visible */ - - obj_theme drops; /* The drops type */ }; -- cgit v1.2.3 From f693888666c64c75a636be3504e6decb55f2865b Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Mon, 20 Jun 2016 22:49:05 +0200 Subject: Give monster_blow default values --- src/monster_race.hpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/monster_race.hpp') diff --git a/src/monster_race.hpp b/src/monster_race.hpp index 1cb2742a..9fa9f590 100644 --- a/src/monster_race.hpp +++ b/src/monster_race.hpp @@ -5,6 +5,8 @@ #include "monster_blow.hpp" #include "obj_theme.hpp" +#include + /** * Monster race descriptors and runtime data, including racial memories. * @@ -55,13 +57,7 @@ struct monster_race u32b flags8 = 0; /* Flags 8 (wilderness info) */ u32b flags9 = 0; /* Flags 9 (drops info) */ - - monster_blow blow[4] = { /* Up to four blows per round */ - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - }; + std::array blow { }; /* Up to four blows per round */ byte body_parts[BODY_MAX] = { 0 }; /* To help to decide what to use when body changing */ -- cgit v1.2.3 From e17e742edb3809d45ce1edc716d71b3bb93056d6 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Mon, 20 Jun 2016 22:49:05 +0200 Subject: Make obj_theme a non-POD struct --- src/monster_race.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/monster_race.hpp') diff --git a/src/monster_race.hpp b/src/monster_race.hpp index 9fa9f590..94896c64 100644 --- a/src/monster_race.hpp +++ b/src/monster_race.hpp @@ -83,8 +83,7 @@ struct monster_race byte total_visible = 0; /* Amount of this race that are visible */ - obj_theme drops = obj_theme /* The drops type */ - { 0, 0, 0, 0 }; + obj_theme drops; /* The drops type */ }; -- cgit v1.2.3 From 59b5314b6b7880cfda73f34aed03a700fd523017 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Mon, 20 Jun 2016 22:49:05 +0200 Subject: Rework RF{4,5,6}_* monster spell flags to flag_set<> --- src/monster_race.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/monster_race.hpp') diff --git a/src/monster_race.hpp b/src/monster_race.hpp index 94896c64..3a13e4b4 100644 --- a/src/monster_race.hpp +++ b/src/monster_race.hpp @@ -3,6 +3,7 @@ #include "body.hpp" #include "h-basic.h" #include "monster_blow.hpp" +#include "monster_spell_flag_set.hpp" #include "obj_theme.hpp" #include @@ -50,13 +51,12 @@ struct monster_race u32b flags1 = 0; /* Flags 1 (general) */ u32b flags2 = 0; /* Flags 2 (abilities) */ u32b flags3 = 0; /* Flags 3 (race/resist) */ - u32b flags4 = 0; /* Flags 4 (inate/breath) */ - u32b flags5 = 0; /* Flags 5 (normal spells) */ - u32b flags6 = 0; /* Flags 6 (special spells) */ u32b flags7 = 0; /* Flags 7 (movement related abilities) */ u32b flags8 = 0; /* Flags 8 (wilderness info) */ u32b flags9 = 0; /* Flags 9 (drops info) */ + monster_spell_flag_set spells; /* Spells */ + std::array blow { }; /* Up to four blows per round */ byte body_parts[BODY_MAX] = { 0 }; /* To help to decide what to use when body changing */ -- cgit v1.2.3 From 68e2a10b2d76cb3a2f5aa6818b4b184b6a02ef14 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Mon, 20 Jun 2016 22:49:05 +0200 Subject: Rework RF{1,2,3,7,8,9}_* monster flags to use flag_set<> --- src/monster_race.hpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/monster_race.hpp') diff --git a/src/monster_race.hpp b/src/monster_race.hpp index 3a13e4b4..58c49e1f 100644 --- a/src/monster_race.hpp +++ b/src/monster_race.hpp @@ -3,6 +3,7 @@ #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" @@ -48,12 +49,7 @@ struct monster_race byte freq_inate = 0; /* Inate spell frequency */ byte freq_spell = 0; /* Other spell frequency */ - u32b flags1 = 0; /* Flags 1 (general) */ - u32b flags2 = 0; /* Flags 2 (abilities) */ - u32b flags3 = 0; /* Flags 3 (race/resist) */ - u32b flags7 = 0; /* Flags 7 (movement related abilities) */ - u32b flags8 = 0; /* Flags 8 (wilderness info) */ - u32b flags9 = 0; /* Flags 9 (drops info) */ + monster_race_flag_set flags; /* Flags */ monster_spell_flag_set spells; /* Spells */ -- cgit v1.2.3 From 46f69654774b0eb51bd4706cf7fd9d11fbc8eec8 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Sat, 17 Sep 2016 09:58:14 +0200 Subject: Remove monster_race::total_visible temporary state --- src/monster_race.hpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/monster_race.hpp') diff --git a/src/monster_race.hpp b/src/monster_race.hpp index 58c49e1f..eb398a3d 100644 --- a/src/monster_race.hpp +++ b/src/monster_race.hpp @@ -77,8 +77,6 @@ struct monster_race bool_ on_saved = 0; /* Is the (unique) on a saved level ? */ - byte total_visible = 0; /* Amount of this race that are visible */ - obj_theme drops; /* The drops type */ }; -- cgit v1.2.3