diff options
Diffstat (limited to 'src/ability_type.hpp')
-rw-r--r-- | src/ability_type.hpp | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/src/ability_type.hpp b/src/ability_type.hpp index ea8a921d..0ec596ba 100644 --- a/src/ability_type.hpp +++ b/src/ability_type.hpp @@ -1,5 +1,8 @@ #pragma once +#include <string> +#include <vector> + #include "h-basic.h" /** @@ -7,21 +10,38 @@ */ struct ability_type { - const char *name; /* Name */ - char *desc; /* Description */ +public: + struct skill_requirement { + s16b skill_idx = 0; + s16b level = 0; + }; + +public: + std::string name; /* Name */ + std::string desc; /* Description */ + + std::string action_desc; /* Action Description */ + + s16b action_mkey = 0; /* Action do to */ + + s16b cost = 0; /* Skill points cost */ - const char *action_desc; /* Action Description */ + std::vector<skill_requirement> need_skills; /* List of prereq skills */ - s16b action_mkey; /* Action do to */ + s16b stat[6] { }; /* List of prereq stats */ - s16b cost; /* Skill points cost */ + std::vector<s16b> need_abilities; /* List of prereq abilities */ - bool_ acquired; /* Do the player actualylg ot it ? */ + /** + * Default constructor + */ + ability_type() + { + for (auto &stat_ref: stat) + { + // Requirement is always met unless otherwise specified. + stat_ref = -1; + } + } - /* Prereqs */ - s16b skills[10]; /* List of prereq skills(10 max) */ - s16b skill_levels[10]; /* List of prereq skills(10 max) */ - s16b stat[6]; /* List of prereq stats */ - s16b need_abilities[10]; /* List of prereq abilities(10 max) */ - s16b forbid_abilities[10]; /* List of forbidden abilities(10 max) */ }; |