From 3f78a7e1647ba94129236bd2bf4fc855c109628a Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 3 Jan 2022 16:25:45 -0500 Subject: Added command to force a saving throw --- src/cmd.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/cmd.cc') 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 parseQualifiers(std::map flags) { + std::vector 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; + } } -- cgit v1.2.3