#pragma once #include "item.h" #include "rules.h" #include #include namespace creature { class Creature; } namespace entry { class Weapon; class Damage; struct weaponImpl; std::vector getAbilityOptions(const Weapon& w); std::vector rollDmg(const Weapon& w, bool versatile=false); // Prints for both versatile options (if applicable) std::string formatDmg(const Weapon& w, const creature::Creature& c); // Prints for just the dmg provided std::string formatDmg(const Weapon& w, const creature::Creature& c, const std::vector& dmg); struct Damage { int dmg_die_count; int dmg_die_sides; std::string dmg_type; bool is_or; int rolled = 0; }; NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Damage, dmg_die_count, dmg_die_sides, dmg_type, is_or); class Weapon : public Item { public: Weapon(); std::vector getDamage(void) const; std::set getProperties(void) const; std::string getWeaponType(void) const; std::pair getRange(void) const; int getReach(void) const; int getToHitBonus(const creature::Creature& c) const; int getDamageBonus(const creature::Creature& c) const; virtual std::string getText() const override; virtual std::string getText(const creature::Creature& c) const override; NLOHMANN_FRIEND_DECLARES(Weapon); private: std::shared_ptr data; }; }