- Timestamp:
- Nov 29, 2015, 9:05:26 PM (9 years ago)
- Location:
- code/branches/particleEffectsHS15/src/modules/weapons/weaponmodes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/particleEffectsHS15/src/modules/weapons/weaponmodes/MineGun.cc
r10836 r10889 51 51 RegisterObject(MineGun); 52 52 53 this->speed_ = 0.0f; 53 54 this->reloadTime_ = 1.0f; 54 55 this->damage_ = 0.0f; 55 this->speed_ = 0.0f; 56 this->lifeTime_ = 7500.0f; 56 this->maxTimeUntilExplosion_ = 0.0f; 57 57 58 58 this->setMunitionName("MineMunition"); … … 66 66 /** 67 67 @brief 68 XMLPort for the MineGun. You can define how often the projectiles Mine, how many childs should be created per Mine, the spread and the time between two Mines.68 XMLPort for the MineGun. 69 69 */ 70 70 void MineGun::XMLPort(Element& xmlelement, XMLPort::Mode mode) 71 71 { 72 72 SUPER(MineGun, XMLPort, xmlelement, mode); 73 XMLPortParam(MineGun, "Lifetime", setLifeTime, getLifeTime, xmlelement, mode); 73 74 XMLPortParam(MineGun, "maxtimeuntilexplosion", setMaxTimeUntilExplosion, getMaxTimeUntilExplosion, xmlelement, mode).defaultValues(10.0f); 75 XMLPortParam(MineGun, "timeuntilactivation", setTimeUntilActivation, getTimeUntilActivation, xmlelement, mode).defaultValues(3.0f); 74 76 } 75 77 … … 81 83 { 82 84 MineProjectile* projectile = new MineProjectile(this->getContext()); 83 //projectile->setMaterial("Flares/energyflare");84 85 85 86 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); … … 88 89 projectile->setVelocity(this->getMuzzleDirection() * this->speed_); 89 90 90 // Pass important information to the projectile: Number of Mines, Number of childs, Mine time, spread and the damage reduction 91 /*projectile->setNumberOfMines(getNumberOfMines()); 92 projectile->setNumberOfChilds(getNumberOfChilds());*/ 93 projectile->setLifeTime(getLifeTime()); 94 /*projectile->setSpread(getSpread()); 95 projectile->setDamageReduction(getDamageReduction());*/ 91 projectile->setMaxTimeUntilExplosion(getMaxTimeUntilExplosion()); 92 projectile->setTimeUntilActivation(getTimeUntilActivation()); 96 93 97 94 projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); -
code/branches/particleEffectsHS15/src/modules/weapons/weaponmodes/MineGun.h
r10836 r10889 44 44 @brief 45 45 A Mine that explodes when a ship is too close 46 @author47 Fabien Vultier48 46 @ingroup WeaponsWeaponModes 49 47 */ … … 56 54 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 57 55 virtual void fire(); 58 inline void setLifeTime(float lifeTime)59 { this->lifeTime_ = lifeTime; }60 inline float getLifeTime() const61 { return this->lifeTime_; }62 56 63 private: 57 inline float getMaxTimeUntilExplosion() const 58 { return this->maxTimeUntilExplosion_; } 59 inline float getTimeUntilActivation() const 60 { return this->timeUntilActivation_; } 61 protected: 62 inline void setMaxTimeUntilExplosion(float maxTimeUntilExplosion) 63 { this->maxTimeUntilExplosion_ = maxTimeUntilExplosion; } 64 inline void setTimeUntilActivation(float timeUntilActivation) 65 { this->timeUntilActivation_ = timeUntilActivation; } 66 private: 64 67 float speed_; //The speed of the fired projectile. 65 float lifeTime_;66 68 float maxTimeUntilExplosion_; 69 float timeUntilActivation_; 67 70 }; 68 71 }
Note: See TracChangeset
for help on using the changeset viewer.