From ab61530779c73e7e145193efcb1e23a47c16e7f3 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 18 Nov 2012 15:10:37 +0000 Subject: Implements server-side ship damage, adds a damage key to the weapons.ini file, configurable spacemine damage. --- src/game/base/weapon.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/game/base/weapon.h') diff --git a/src/game/base/weapon.h b/src/game/base/weapon.h index 01a135b..ba28810 100644 --- a/src/game/base/weapon.h +++ b/src/game/base/weapon.h @@ -19,6 +19,8 @@ public: Weapon(); ~Weapon(); + /* --- inspectors ------------------------------------------ */ + inline SubType subtype() const { return weapon_subtype; } @@ -29,6 +31,24 @@ public: inline int level() const { return weapon_level; } + + /** + * @brief the amount of damage this weapon inflicts + * */ + inline const float damage() const + { + return weapon_damage; + } + + /* --- mutators -------------------------------------------- */ + + /** + * @brief set the amount of damage this weapon inflicts + * */ + inline void set_damage(const float damage) + { + weapon_damage = damage; + } void set_stackable(bool stackable); @@ -53,11 +73,13 @@ public: private: static core::InfoType *weapon_infotype; + SubType weapon_subtype; + int weapon_level; bool weapon_stackable; - SubType weapon_subtype; + float weapon_damage; }; } // namespace game -- cgit v1.2.3