diff options
author | Manoj Srivastava <srivasta@debian.org> | 2020-05-22 19:57:41 -0700 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2020-05-22 20:02:19 -0700 |
commit | c3d2579ad8d7eb33059aa8fdbaf5b564411a57f2 (patch) | |
tree | 1570cda0676fdcf4171a69a7fe313c1b89a52b0c /src/ability_type.hpp | |
parent | 986b7742bf244b4073ecca0723615f70be8a1ab6 (diff) | |
parent | 4e9b9c402ed95bf9a17fd6d795bc49bb4128a6fa (diff) |
Merge branch 'upstream' into debian-cmake-fixes
Diffstat (limited to 'src/ability_type.hpp')
-rw-r--r-- | src/ability_type.hpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/ability_type.hpp b/src/ability_type.hpp new file mode 100644 index 00000000..0ec596ba --- /dev/null +++ b/src/ability_type.hpp @@ -0,0 +1,47 @@ +#pragma once + +#include <string> +#include <vector> + +#include "h-basic.h" + +/** + * Abilities. + */ +struct ability_type +{ +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 */ + + std::vector<skill_requirement> need_skills; /* List of prereq skills */ + + s16b stat[6] { }; /* List of prereq stats */ + + std::vector<s16b> need_abilities; /* List of prereq abilities */ + + /** + * Default constructor + */ + ability_type() + { + for (auto &stat_ref: stat) + { + // Requirement is always met unless otherwise specified. + stat_ref = -1; + } + } + +}; |