aboutsummaryrefslogtreecommitdiff
path: root/src/weapon.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/weapon.h')
-rw-r--r--src/weapon.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/weapon.h b/src/weapon.h
new file mode 100644
index 0000000..f09e8e5
--- /dev/null
+++ b/src/weapon.h
@@ -0,0 +1,35 @@
+#pragma once
+#include "item.h"
+#include "json.hpp"
+#include <set>
+
+namespace creature {
+ class Creature;
+}
+
+namespace item {
+ class Weapon : public Item {
+ public:
+ Weapon(const nlohmann::json& data);
+ std::string getDamageType(void) const;
+ int getDamageDieCount(void) const;
+ int getDamageDieSides(bool versatile=false) const;
+ std::set<std::string> getProperties(void) const;
+ std::string getWeaponType(void) const;
+ std::pair<int, int> getRange(void) const;
+ int getReach(void) const;
+
+ virtual nlohmann::json toJson(void) const;
+
+ private:
+ const std::string damageType;
+ const int damageDieCount;
+ const int damageDieSides;
+ const std::set<std::string> properties;
+ const std::string weaponType;
+ const std::pair<const int, const int> range;
+ const int reach;
+ };
+
+ std::string genActionText(const Weapon& w, const creature::Creature& c);
+}