Changeset 10814 for code/branches/fabienHS15/src/modules/weapons
- Timestamp:
- Nov 17, 2015, 10:30:24 PM (9 years ago)
- Location:
- code/branches/fabienHS15/src/modules/weapons
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/fabienHS15/src/modules/weapons/WeaponsPrereqs.h
r10622 r10814 69 69 { 70 70 class MuzzleFlash; 71 class IceGunFreezer; 72 class RocketController; 71 73 72 74 // munitions 73 75 class FusionMunition; 74 76 class LaserMunition; 75 class ReplenishingMunition;76 77 class RocketMunition; 77 78 class GravityBombMuntion; 79 class IceMunition; 80 class LightningMunition; 81 class SplitMunition; 78 82 79 83 // projectiles … … 81 85 class LightningGunProjectile; 82 86 class ParticleProjectile; 87 class IceProjectile; 88 class SplitProjectile; 83 89 class Projectile; 90 class BasicProjectile; 84 91 class Rocket; 85 92 class RocketOld; … … 91 98 class FusionFire; 92 99 class HsW01; 100 class IceGun; 101 class SplitGun; 93 102 class LaserFire; 94 103 class LightningGun; -
code/branches/fabienHS15/src/modules/weapons/projectiles/Rocket.cc
r10795 r10814 66 66 67 67 this->localAngularVelocity_ = 0; 68 this->lifetime_ = 100.0f;68 this->lifetime_ = 20.0f; 69 69 70 70 if (GameMode::isMaster()) … … 100 100 this->attachCollisionShape(collisionShape); 101 101 102 this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&BasicProjectile::destroyObject, this)));103 104 102 // Add sound 105 103 this->defSndWpnEngine_ = new WorldSound(this->getContext()); … … 114 112 this->defSndWpnLaunch_->setVolume(1.0f); 115 113 this->attach(defSndWpnLaunch_); 114 115 this->setHudTemplate("rockethud"); 116 116 } 117 117 else … … 320 320 } 321 321 322 float Rocket::getFuel() const 323 { 324 return this->destroyTimer_.getRemainingTime(); 325 } 326 327 void Rocket::setMaxFuel(float fuel) 328 { 329 this->lifetime_ = fuel; 330 this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&BasicProjectile::destroyObject, this))); 331 } 322 332 } -
code/branches/fabienHS15/src/modules/weapons/projectiles/Rocket.h
r10216 r10814 118 118 virtual void fired(unsigned int firemode); 119 119 120 /** 121 @brief Set the maximum lifetime of the rocket. 122 */ 123 virtual void setMaxFuel(float fuel); 124 /** 125 @brief Get the maximum lifetime of the rocket. 126 */ 127 inline float getMaxFuel() const 128 { return lifetime_; } 129 virtual float getFuel() const; 130 120 131 private: 121 132 Vector3 localAngularVelocity_; //!< Variable to temporarily store accumulated steering command input. -
code/branches/fabienHS15/src/modules/weapons/weaponmodes/RocketFire.cc
r10794 r10814 41 41 #include "weaponsystem/WeaponSystem.h" 42 42 #include "worldentities/pawns/Pawn.h" 43 43 #include "core/XMLPort.h" 44 44 #include "weapons/projectiles/Rocket.h" 45 45 … … 56 56 this->damage_ = 0.0f; 57 57 this->speed_ = 500.0f; 58 this->fuel_ = 10.0f; 58 59 59 60 this->setMunitionName("RocketMunition"); … … 65 66 RocketFire::~RocketFire() 66 67 { 68 } 69 70 /** 71 @brief 72 XMLPort for the RocketFire. You can define the maximum lifetime of the rockets 73 */ 74 void RocketFire::XMLPort(Element& xmlelement, XMLPort::Mode mode) 75 { 76 SUPER(RocketFire, XMLPort, xmlelement, mode); 77 78 XMLPortParam(RocketFire, "fuel", setFuel, getFuel, xmlelement, mode); 67 79 } 68 80 … … 85 97 rocket->setShieldDamage(this->getShieldDamage()); 86 98 rocket->setHealthDamage(this->getHealthDamage()); 99 rocket->setMaxFuel(this->fuel_); 87 100 } 88 101 } -
code/branches/fabienHS15/src/modules/weapons/weaponmodes/RocketFire.h
r9667 r10814 54 54 virtual ~RocketFire(); 55 55 56 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 57 56 58 virtual void fire(); 59 inline void setFuel(float fuel) 60 { this->fuel_ = fuel; } 61 inline float getFuel() const 62 { return this->fuel_; } 57 63 58 64 private: 59 65 float speed_; //!< The speed of the Rocket. 66 float fuel_; //!< The maximum lifetime of the rocket 60 67 }; 61 68 } -
code/branches/fabienHS15/src/modules/weapons/weaponmodes/SplitGun.cc
r10688 r10814 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/XMLPort.h" 37 #include "core/XMLPort.h" 38 38 #include "weaponsystem/Weapon.h" 39 39 #include "weaponsystem/WeaponPack.h"
Note: See TracChangeset
for help on using the changeset viewer.