aboutsummaryrefslogtreecommitdiff
path: root/src/weapon.cc
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-04-15 15:23:23 -0400
committerYour Name <you@example.com>2021-04-15 15:23:23 -0400
commitdfce4d0398a8bafbb7ad7a31345af181c0269c09 (patch)
tree695162ff8cc25e146f52d9e26fe19ffa9934b3d6 /src/weapon.cc
parent9034c3d2533177f7cb7a7ce939ec53f7fa63f60e (diff)
downloaddmtool-dfce4d0398a8bafbb7ad7a31345af181c0269c09.tar.gz
dmtool-dfce4d0398a8bafbb7ad7a31345af181c0269c09.tar.bz2
dmtool-dfce4d0398a8bafbb7ad7a31345af181c0269c09.zip
Added spells
Diffstat (limited to 'src/weapon.cc')
-rw-r--r--src/weapon.cc39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/weapon.cc b/src/weapon.cc
index b12c2cb..314b1be 100644
--- a/src/weapon.cc
+++ b/src/weapon.cc
@@ -8,17 +8,6 @@
using namespace std;
namespace item {
- Weapon::Weapon(const nlohmann::json& data)
- : Item(data), damageType(data["damage"]["dmg_type"]), damageDieCount(data["damage"]["dmg_die_count"]), damageDieSides(data["damage"]["dmg_die_sides"]), properties(data["properties"]), weaponType(data["type"]), range(data["range"][0], data["range"][1]), reach(data["reach"]) {}
-
- string Weapon::getDamageType() const {
- return damageType;
- }
-
- int Weapon::getDamageDieCount() const {
- return damageDieCount;
- }
-
int Weapon::getDamageDieSides(bool versatile) const {
if(versatile && getProperties().count("versatile")) {
return damageDieSides + 2;
@@ -26,34 +15,6 @@ namespace item {
return damageDieSides;
}
- set<string> Weapon::getProperties() const {
- return properties;
- }
-
- string Weapon::getWeaponType() const {
- return weaponType;
- }
-
- pair<int, int> Weapon::getRange() const {
- return range;
- }
-
- int Weapon::getReach() const {
- return reach;
- }
-
- nlohmann::json Weapon::toJson() const {
- auto data = Item::toJson();
- data["damage"]["dmg_type"] = damageType;
- data["damage"]["dmg_die_count"] = damageDieCount;
- data["damage"]["dmg_die_sides"] = damageDieSides;
- data["properties"] = properties;
- data["type"] = weaponType;
- data["range"] = range;
- data["reach"] = reach;
- return data;
- }
-
std::string genActionText(const Weapon& w, const creature::Creature& c) {
stringstream text;
// Determine best ability bonus