aboutsummaryrefslogtreecommitdiff
path: root/src/weapon.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/weapon.h')
-rw-r--r--src/weapon.h8
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);
}