Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-11-18 15:10:37 +0000
committerStijn Buys <ingar@osirion.org>2012-11-18 15:10:37 +0000
commitab61530779c73e7e145193efcb1e23a47c16e7f3 (patch)
tree9aed75947be45585cf884effc3a59575a1b1bb8e /src/game/base/projectile.h
parent69b0cd536aee5cf948e5a97af4df3dd75a545bd0 (diff)
Implements server-side ship damage,
adds a damage key to the weapons.ini file, configurable spacemine damage.
Diffstat (limited to 'src/game/base/projectile.h')
-rw-r--r--src/game/base/projectile.h39
1 files changed, 37 insertions, 2 deletions
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