diff options
Diffstat (limited to 'src/game/base')
-rw-r--r-- | src/game/base/ship.cc | 1 | ||||
-rw-r--r-- | src/game/base/star.cc | 2 | ||||
-rw-r--r-- | src/game/base/weapon.cc | 4 | ||||
-rw-r--r-- | src/game/base/weapon.h | 20 |
4 files changed, 25 insertions, 2 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index a7695dd..2368352 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -914,6 +914,7 @@ void Ship::frame(const unsigned long elapsed) projectile->set_damage(weapon->damage()); projectile->set_lifespan(weapon->projectile_lifespan()); projectile->set_projectile_modelname(weapon->projectile_modelname()); + projectile->set_projectile_soundname(weapon->projectile_soundname()); projectile->set_color(color()); projectile->set_color_second(color_second()); projectile->set_zone(zone()); diff --git a/src/game/base/star.cc b/src/game/base/star.cc index c54788a..c9dbb39 100644 --- a/src/game/base/star.cc +++ b/src/game/base/star.cc @@ -23,7 +23,7 @@ Star::Star() : core::EntityGlobe() entity_moduletypeid = star_enttype; // default star corona name - set_coronaname("default"); + set_coronaname("corona/default"); } Star::~Star() diff --git a/src/game/base/weapon.cc b/src/game/base/weapon.cc index 22527c2..1838733 100644 --- a/src/game/base/weapon.cc +++ b/src/game/base/weapon.cc @@ -187,6 +187,10 @@ bool Weapon::init() weapon->set_projectile_modelname(str); continue; + } else if (weaponsini.got_key_string("sound", str)) { + weapon->set_projectile_soundname(str); + continue; + } else { weaponsini.unknown_key(); diff --git a/src/game/base/weapon.h b/src/game/base/weapon.h index 746a9ad..31ce5de 100644 --- a/src/game/base/weapon.h +++ b/src/game/base/weapon.h @@ -75,6 +75,14 @@ public: { return weapon_projectile_modelname; } + + /** + * @brief name of the sound used when a projectile is fired by this weapon + * */ + inline const std::string & projectile_soundname() const + { + return weapon_projectile_soundname; + } /* --- mutators -------------------------------------------- */ @@ -117,12 +125,20 @@ public: } /** - * @brief set_projectile model name + * @brief set projectile model name * */ inline void set_projectile_modelname(const std::string & projectile_modelname) { weapon_projectile_modelname.assign(projectile_modelname); } + + /** + * @brief set the projectile sound name + * */ + inline void set_projectile_soundname(const std::string soundname) + { + weapon_projectile_soundname.assign(soundname); + } /** * @brief generate specifications info. @@ -161,6 +177,8 @@ private: float weapon_damage; std::string weapon_projectile_modelname; + + std::string weapon_projectile_soundname; }; } // namespace game |