diff options
author | Your Name <you@example.com> | 2021-04-13 15:14:34 -0400 |
---|---|---|
committer | Your Name <you@example.com> | 2021-04-13 15:14:34 -0400 |
commit | 2ab51e507d620c4479e07ca0ec47d22c8c66bc90 (patch) | |
tree | 90906ecb043c01034280c767b83a88eb6df6956f /src/weapon.h | |
download | dmtool-2ab51e507d620c4479e07ca0ec47d22c8c66bc90.tar.gz dmtool-2ab51e507d620c4479e07ca0ec47d22c8c66bc90.tar.bz2 dmtool-2ab51e507d620c4479e07ca0ec47d22c8c66bc90.zip |
Initial commit
Diffstat (limited to 'src/weapon.h')
-rw-r--r-- | src/weapon.h | 35 |
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); +} |