aboutsummaryrefslogtreecommitdiff
path: root/src/cmd.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd.cc')
-rw-r--r--src/cmd.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cmd.cc b/src/cmd.cc
index 7029f0c..d84c55b 100644
--- a/src/cmd.cc
+++ b/src/cmd.cc
@@ -36,4 +36,19 @@ namespace cmd {
text << name << " " << type << ": " << rolled << " (d20) + " << bonus << " (" << name << " " << type << " bonus) = " << rolled + bonus << std::endl;
return text.str();
}
+
+ std::vector<rules::Qualifier> parseQualifiers(std::map<std::string, std::string> flags) {
+ std::vector<rules::Qualifier> qualifiers;
+ for(auto flagPair : flags) {
+ auto flag = flagPair.first;
+ if(flag == "m" || flag == "magical") {
+ qualifiers.push_back(rules::Qualifier::Magical());
+ } else if(flag == "s" || flag == "silvered") {
+ qualifiers.push_back(rules::Qualifier::Silvered());
+ } else if(flag == "a" || flag == "adamantine") {
+ qualifiers.push_back(rules::Qualifier::Adamantine());
+ }
+ }
+ return qualifiers;
+ }
}