- Timestamp:
- May 23, 2015, 7:33:37 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/weaponFS15/src/modules/weapons/weaponmodes/GravityBombFire.cc
r10438 r10455 3 3 * 4 4 * Created on: Apr 16, 2015 5 * Author: meggiman5 * Author: Manuel Eggimann 6 6 */ 7 7 #include "GravityBombFire.h" … … 19 19 RegisterClass(GravityBombFire); 20 20 21 const float GravityBombFire::BOMB_VELOCITY = 400.0; 21 const float GravityBombFire::BOMB_VELOCITY = 400.0; ///< The velocity of the bomb after launch 22 22 23 23 GravityBombFire::GravityBombFire(Context* context) : WeaponMode(context) … … 25 25 RegisterObject(GravityBombFire); 26 26 27 this->reloadTime_ = 0.50f; 27 this->reloadTime_ = 0.50f; 28 28 this->bParallelReload_ = false; 29 this->damage_ = 0.0f; 30 this->speed_ = BOMB_VELOCITY; 29 this->damage_ = 20.0f; ///< The damage of the Bomb if it hits a pawn. 31 30 32 31 this->setMunitionName("GravityBombMunition"); 33 this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.8); 32 this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.8); ///< sets sound of the bomb as it is fired. 34 33 } 35 34 … … 39 38 { 40 39 GravityBomb* bomb = new GravityBomb(this->getContext()); 41 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); 40 //Create a new Bomb in 3D-Space and set the right direction speed and orientation. 41 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); 42 42 bomb->setOrientation(this->getMuzzleOrientation()); 43 43 bomb->setPosition(this->getMuzzlePosition()); 44 bomb->setVelocity(this->getMuzzleDirection() * (this-> speed_+this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity().length()));44 bomb->setVelocity(this->getMuzzleDirection() * (this->BOMB_VELOCITY+this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity().length())); 45 45 46 //Set the shooter of the bomb so it is possible to determine the pawn that killed another one and define damage to shield and healt the bomb does. 46 47 bomb->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 47 48 bomb->setDamage(this->getDamage());
Note: See TracChangeset
for help on using the changeset viewer.