diff options
author | Your Name <you@example.com> | 2021-04-16 11:23:27 -0400 |
---|---|---|
committer | Your Name <you@example.com> | 2021-04-16 11:23:27 -0400 |
commit | 4618763c0e3a723bf4bb43c7b9edbce87240e0af (patch) | |
tree | a18aa4bf7da05ac02b4e37b199aeeb82da977aea /src/weapon.h | |
parent | dfce4d0398a8bafbb7ad7a31345af181c0269c09 (diff) | |
download | dmtool-4618763c0e3a723bf4bb43c7b9edbce87240e0af.tar.gz dmtool-4618763c0e3a723bf4bb43c7b9edbce87240e0af.tar.bz2 dmtool-4618763c0e3a723bf4bb43c7b9edbce87240e0af.zip |
Rebased feature/item on entry
Diffstat (limited to 'src/weapon.h')
-rw-r--r-- | src/weapon.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/weapon.h b/src/weapon.h index e4755df..9ee2e8a 100644 --- a/src/weapon.h +++ b/src/weapon.h @@ -7,8 +7,8 @@ namespace creature { class Creature; } -namespace item { - class Weapon : public Item { +namespace entry { + class Weapon : public Item, public Substantial { public: Weapon(const nlohmann::json& data, const nlohmann::json& base) : Item(base), 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"]), cost(data["cost"]), weight(data["weight"]) {} @@ -22,6 +22,8 @@ namespace item { int getCost(void) const {return cost;} double getWeight(void) const {return weight;} + virtual std::string getText(const creature::Creature& c) const; + /*virtual nlohmann::json toJson(void) const { auto data = Item::toJson(); data["damage"]["dmg_type"] = damageType; @@ -48,5 +50,5 @@ namespace item { const double weight; }; - std::string genActionText(const Weapon& w, const creature::Creature& c); + std::string genText(const Weapon& w, const creature::Creature& c); } |