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/projectile.h | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'src/game/base/projectile.h') diff --git a/src/game/base/projectile.h b/src/game/base/projectile.h index bbaea99..238de6a 100644 --- a/src/game/base/projectile.h +++ b/src/game/base/projectile.h @@ -17,17 +17,52 @@ class Projectile : public core::EntityDynamic public: Projectile(unsigned long lifespan); virtual ~Projectile(); - + virtual void upkeep(const unsigned long timestamp); - + virtual void collision(Entity *other); virtual void frame(const unsigned long elapsed); + /* --- inspectors ------------------------------------------ */ + + inline const unsigned long timestamp() const + { + return projectile_timestamp; + } + + /** + * @brief the lifespan of this projectile, in milliseconds + * */ + inline const unsigned long lifespan() const + { + return projectile_lifespan; + } + + /** + * @brief the amount of damage this projectile inflicts + * */ + inline const float damage() const + { + return projectile_damage; + } + + /* --- mutators -------------------------------------------- */ + + /** + * @brief set the amount of damage this projectile inflicts + * */ + inline void set_damage(const float damage) + { + projectile_damage = damage; + } + private: unsigned long projectile_timestamp; unsigned long projectile_lifespan; + + float projectile_damage; }; } // namespace game -- cgit v1.2.3