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-21 20:49:58 +0000
committerStijn Buys <ingar@osirion.org>2012-11-21 20:49:58 +0000
commit5e4ef80dc29a69e1f5f185d1efab323af4a77292 (patch)
tree3f741a160a9f62d392ef0116df9f9925d55da557 /src/game/base/weapon.h
parent3dc60689b9327190eeecd42f6920299ef3e7b52c (diff)
Added get/set methods for the weapon-slot API.
Diffstat (limited to 'src/game/base/weapon.h')
-rw-r--r--src/game/base/weapon.h80
1 files changed, 74 insertions, 6 deletions
diff --git a/src/game/base/weapon.h b/src/game/base/weapon.h
index ba28810..94fdce6 100644
--- a/src/game/base/weapon.h
+++ b/src/game/base/weapon.h
@@ -24,10 +24,14 @@ public:
inline SubType subtype() const {
return weapon_subtype;
}
+
inline bool stackable() const {
return weapon_stackable;
}
+ /**
+ * @brief player level required to buy this weapon
+ * */
inline int level() const {
return weapon_level;
}
@@ -39,23 +43,79 @@ public:
{
return weapon_damage;
}
-
- /* --- mutators -------------------------------------------- */
-
+
/**
- * @brief set the amount of damage this weapon inflicts
+ * @brief speed of projectiles generated by this weapon
* */
- inline void set_damage(const float damage)
+ inline const float projectile_speed() const
{
- weapon_damage = damage;
+ return weapon_projectile_speed;
}
+ /**
+ * @brief interval between consequtive projectils fired by this weapon, in milliseconds
+ * */
+ inline const unsigned long projectile_interval() const
+ {
+ return weapon_projectile_interval;
+ }
+
+ /**
+ * @brief name of the model used for projectiles generated by this weapon
+ * */
+ inline const std::string & projectile_modelname() const
+ {
+ return weapon_projectile_modelname;
+ }
+
+ /* --- mutators -------------------------------------------- */
+
void set_stackable(bool stackable);
void set_level(const int level);
void set_subtype(const SubType subtype);
+ /**
+ * @brief set the projectile lifespan, in milliseconds
+ * */
+ inline void set_projectile_lifespan(const unsigned long projectile_lifespan)
+ {
+ weapon_projectile_lifespan = projectile_lifespan;
+ }
+
+ /**
+ * @brief set the interval between two consecutive shots by this weapon
+ * */
+ inline void set_projectile_interval(const unsigned long projectile_interval)
+ {
+ weapon_projectile_interval = projectile_interval;
+ }
+
+ /**
+ * @brief set_projectile speed, in game units per second
+ * */
+ inline void set_projectile_speed(const float projectile_speed)
+ {
+ weapon_projectile_speed = projectile_speed;
+ }
+
+ /**
+ * @brief set the amount of damage this weapon inflicts
+ * */
+ inline void set_damage(const float damage)
+ {
+ weapon_damage = damage;
+ }
+
+ /**
+ * @brief set_projectile model name
+ * */
+ inline void set_projectile_modelname(const std::string & projectile_modelname)
+ {
+ weapon_projectile_modelname.assign(projectile_modelname);
+ }
+
/* --- static registry functions ---------------------------------- */
static Weapon *find(const std::string & label);
@@ -79,7 +139,15 @@ private:
bool weapon_stackable;
+ unsigned long weapon_projectile_interval;
+
+ unsigned long weapon_projectile_lifespan;
+
+ float weapon_projectile_speed;
+
float weapon_damage;
+
+ std::string weapon_projectile_modelname;
};
} // namespace game