Changeset 8855 for code/trunk/src/modules/weapons/weaponmodes
- Timestamp:
- Aug 22, 2011, 3:05:26 PM (13 years ago)
- Location:
- code/trunk/src/modules/weapons/weaponmodes
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc
r8706 r8855 27 27 */ 28 28 29 /** 30 @file EnergyDrink.h 31 @brief Implementation of the EnergyDrink class. 32 */ 33 29 34 #include "EnergyDrink.h" 30 35 … … 32 37 #include "core/XMLPort.h" 33 38 #include "core/command/Executor.h" 39 34 40 #include "graphics/Model.h" 35 36 #include "weapons/projectiles/Projectile.h"37 #include "weapons/MuzzleFlash.h"38 41 #include "weaponsystem/Weapon.h" 39 42 #include "weaponsystem/WeaponPack.h" 40 43 #include "weaponsystem/WeaponSystem.h" 41 44 #include "worldentities/pawns/Pawn.h" 45 46 #include "weapons/projectiles/Projectile.h" 47 #include "weapons/MuzzleFlash.h" 42 48 43 49 namespace orxonox … … 49 55 RegisterObject(EnergyDrink); 50 56 51 this->reloadTime_ = 0.25 ;52 this->damage_ = 0 ; //default 1553 this->speed_ = 2500 ;54 this->delay_ = 0 ;57 this->reloadTime_ = 0.25f; 58 this->damage_ = 0.0f; 59 this->speed_ = 2500.0f; 60 this->delay_ = 0.0f; 55 61 this->setMunitionName("FusionMunition"); 56 62 … … 65 71 XMLPortParam(EnergyDrink, "delay", setDelay, getDelay, xmlelement, mode); 66 72 XMLPortParam(EnergyDrink, "material", setMaterial, getMaterial, xmlelement, mode); 67 68 73 } 69 74 70 void EnergyDrink::setMaterial(const std::string& material) 75 /** 76 @brief 77 Sets the delay with which is fired. 78 @param delay 79 The delay in seconds. 80 */ 81 void EnergyDrink::setDelay(float delay) 71 82 { 72 this->material_ = material; 73 } 74 75 void EnergyDrink::setDelay(float d) 76 { 77 this->delay_ = d; 83 this->delay_ = delay; 78 84 this->delayTimer_.setInterval(this->delay_); 79 85 } 80 86 81 float EnergyDrink::getDelay() const 82 { 83 return this->delay_; 84 } 85 87 /** 88 @brief 89 Fires the weapon. 90 */ 86 91 void EnergyDrink::fire() 87 92 { … … 89 94 } 90 95 91 void EnergyDrink::muendungsfeuer() 92 { 93 MuzzleFlash *muzzleFlash = new MuzzleFlash(this); 94 this->getWeapon()->attach(muzzleFlash); 95 muzzleFlash->setPosition(this->getMuzzleOffset()); 96 muzzleFlash->setMaterial(this->material_); 97 } 98 99 /* Creates the projectile object, sets its properties to the EnergyDrink properties, calls muendungsfeuer() 100 */ 96 /** 97 @brief 98 Executes the shot, be creating the projectile and sending it on its way. 99 */ 101 100 void EnergyDrink::shot() 102 101 { 102 // Create the projectile 103 103 Projectile* projectile = new Projectile(this); 104 104 Model* model = new Model(projectile); … … 112 112 projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_); 113 113 114 projectile->set Owner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());114 projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 115 115 projectile->setDamage(this->getDamage()); 116 116 projectile->setShieldDamage(this->getShieldDamage()); 117 117 projectile->setHealthDamage(this->getHealthDamage()); 118 118 119 EnergyDrink::muendungsfeuer(); 119 // Display a muzzle flash. 120 this->muzzleflash(); 121 } 122 123 /** 124 @brief 125 Displays a muzzle flash. 126 */ 127 void EnergyDrink::muzzleflash() 128 { 129 MuzzleFlash *muzzleFlash = new MuzzleFlash(this); 130 this->getWeapon()->attach(muzzleFlash); 131 muzzleFlash->setPosition(this->getMuzzleOffset()); 132 muzzleFlash->setMaterial(this->material_); 120 133 } 121 134 } -
code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.h
r5929 r8855 27 27 */ 28 28 29 /** 30 @file EnergyDrink.h 31 @brief Definition of the EnergyDrink class. 32 */ 33 29 34 #ifndef _EnergyDrink_H__ 30 35 #define _EnergyDrink_H__ … … 38 43 namespace orxonox 39 44 { 45 46 /** 47 @brief 48 Shoots a can. 49 @author 50 Hagen Seifert 51 @ingroup WeaponsWeaponModes 52 */ 40 53 class _WeaponsExport EnergyDrink : public WeaponMode 41 54 { … … 48 61 49 62 private: 50 void setMaterial(const std::string& material); 51 inline const std::string& getMaterial() 63 /** 64 @brief Set the material of the EnergyDrink. 65 @param material The name of the material. 66 */ 67 void setMaterial(const std::string& material) 68 { this->material_ = material; } 69 /** 70 @brief Get the material of the EnergyDrink. 71 @return Returns the material name. 72 */ 73 inline const std::string& getMaterial() const 52 74 { return this->material_; } 53 void setDelay(float d); 54 float getDelay() const; 75 76 void setDelay(float delay); 77 /** 78 @brief Get the firing delay. 79 @return Returns the delay in seconds. 80 */ 81 float getDelay() const 82 { return this->delay_; } 83 55 84 void shot(); 56 void mu endungsfeuer();85 void muzzleflash(); 57 86 58 std::string material_; 59 float speed_; 60 float delay_; 61 Timer delayTimer_; 87 std::string material_; //!< The material. 88 float speed_; //!< The speed of the EnergyDrink. 89 float delay_; //!< The firing delay. 90 Timer delayTimer_; //!< The timer to delay the firing. 62 91 }; 63 92 } -
code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc
r8706 r8855 27 27 */ 28 28 29 /** 30 @file FusionFire.h 31 @brief Implementation of the FusionFire class. 32 */ 33 29 34 #include "FusionFire.h" 30 35 36 #include "core/CoreIncludes.h" 31 37 #include "util/Math.h" 32 #include "core/CoreIncludes.h"33 #include "weapons/projectiles/BillboardProjectile.h"34 38 35 39 #include "weaponsystem/Weapon.h" … … 37 41 #include "weaponsystem/WeaponSystem.h" 38 42 #include "worldentities/pawns/Pawn.h" 43 44 #include "weapons/projectiles/BillboardProjectile.h" 39 45 40 46 namespace orxonox … … 46 52 RegisterObject(FusionFire); 47 53 48 this->reloadTime_ = 1.0 ;54 this->reloadTime_ = 1.0f; 49 55 this->bParallelReload_ = false; 50 this->damage_ = 0 ; //default 4051 this->speed_ = 1250 ;56 this->damage_ = 0.0f; 57 this->speed_ = 1250.0f; 52 58 53 59 this->setMunitionName("FusionMunition"); 54 60 } 55 61 56 /* Creates the projectile (BillboardProjectile) object, sets its properties to the FusionFire properties 57 */ 62 /** 63 @brief 64 Fires the weapon, by creating a projectile. 65 */ 58 66 void FusionFire::fire() 59 67 { … … 65 73 projectile->scale(5); 66 74 67 projectile->set Owner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());75 projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 68 76 projectile->setDamage(this->getDamage()); 69 77 projectile->setShieldDamage(this->getShieldDamage()); -
code/trunk/src/modules/weapons/weaponmodes/FusionFire.h
r5781 r8855 27 27 */ 28 28 29 /** 30 @file FusionFire.h 31 @brief Definition of the FusionFire class. 32 */ 33 29 34 #ifndef _FusionFire_H__ 30 35 #define _FusionFire_H__ … … 35 40 namespace orxonox 36 41 { 42 43 /** 44 @brief 45 FusionFire. 46 @author 47 Martin Polak 48 @ingroup WeaponsWeaponModes 49 */ 37 50 class _WeaponsExport FusionFire : public WeaponMode 38 51 { … … 44 57 45 58 private: 46 float speed_; 59 float speed_; //!< The speed of the fusion fire weapon. 47 60 }; 48 61 } -
code/trunk/src/modules/weapons/weaponmodes/HsW01.cc
r8706 r8855 27 27 */ 28 28 29 /** 30 @file HsW01.h 31 @brief Implementation of the HsW01 class. 32 */ 33 29 34 #include "HsW01.h" 30 35 … … 32 37 #include "core/XMLPort.h" 33 38 #include "core/command/Executor.h" 39 34 40 #include "graphics/Model.h" 35 36 #include "weapons/projectiles/Projectile.h"37 #include "weapons/MuzzleFlash.h"38 41 #include "weaponsystem/Weapon.h" 39 42 #include "weaponsystem/WeaponPack.h" … … 41 44 #include "worldentities/WorldEntity.h" 42 45 #include "worldentities/pawns/Pawn.h" 46 47 #include "weapons/projectiles/Projectile.h" 48 #include "weapons/MuzzleFlash.h" 43 49 44 50 namespace orxonox … … 50 56 RegisterObject(HsW01); 51 57 52 this->reloadTime_ = 0.25 ;53 this->damage_ = 0 ; //default 1554 this->speed_ = 2500 ;55 this->delay_ = 0 ;58 this->reloadTime_ = 0.25f; 59 this->damage_ = 0.0f; //default 15 60 this->speed_ = 2500.0f; 61 this->delay_ = 0.0f; 56 62 this->setMunitionName("LaserMunition"); 57 63 … … 72 78 XMLPortParam(HsW01, "delay", setDelay, getDelay, xmlelement, mode); 73 79 XMLPortParam(HsW01, "material", setMaterial, getMaterial, xmlelement, mode); 74 75 80 } 76 81 77 void HsW01::setMaterial(const std::string& material) 82 /** 83 @brief 84 Set the firing delay. 85 @param delay 86 The firing delay in seconds. 87 */ 88 void HsW01::setDelay(float delay) 78 89 { 79 this->material_ = material; 80 } 81 82 std::string& HsW01::getMaterial() 83 { 84 return this->material_; 85 } 86 87 void HsW01::setDelay(float d) 88 { 89 this->delay_ = d; 90 this->delay_ = delay; 90 91 this->delayTimer_.setInterval(this->delay_); 91 }92 93 float HsW01::getDelay() const94 {95 return this->delay_;96 92 } 97 93 … … 101 97 } 102 98 103 void HsW01::muendungsfeuer() 104 { 105 MuzzleFlash *muzzleFlash = new MuzzleFlash(this); 106 this->getWeapon()->attach(muzzleFlash); 107 muzzleFlash->setPosition(this->getMuzzleOffset()); 108 muzzleFlash->setMaterial(this->material_); 109 } 110 111 /* Creates the projectile object, sets its properties to the HsW01 properties, calls muendungsfeuer() 112 */ 99 /** 100 @brief 101 Fires the weapon. Creates a projectile and fires it. 102 */ 113 103 void HsW01::shot() 114 104 { 115 105 assert( this->getWeapon() && this->getWeapon()->getWeaponPack() && this->getWeapon()->getWeaponPack()->getWeaponSystem() && this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn() ); 106 107 // Create the projectile. 116 108 Projectile* projectile = new Projectile(this); 117 109 Model* model = new Model(projectile); … … 126 118 projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_); 127 119 128 projectile->set Owner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());120 projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 129 121 projectile->setDamage(this->getDamage()); 130 122 projectile->setShieldDamage(this->getShieldDamage()); 131 123 projectile->setHealthDamage(this->getHealthDamage()); 132 124 133 HsW01::muendungsfeuer(); 125 // Display the muzzle flash. 126 this->HsW01::muzzleflash(); 127 } 128 129 /** 130 @brief 131 Displays the muzzle flash. 132 */ 133 void HsW01::muzzleflash() 134 { 135 MuzzleFlash *muzzleFlash = new MuzzleFlash(this); 136 this->getWeapon()->attach(muzzleFlash); 137 muzzleFlash->setPosition(this->getMuzzleOffset()); 138 muzzleFlash->setMaterial(this->material_); 134 139 } 135 140 } -
code/trunk/src/modules/weapons/weaponmodes/HsW01.h
r6417 r8855 27 27 */ 28 28 29 /** 30 @file HsW01.h 31 @brief Definition of the HsW01 class. 32 */ 33 29 34 #ifndef _HsW01_H__ 30 35 #define _HsW01_H__ … … 37 42 namespace orxonox 38 43 { 44 45 /** 46 @brief 47 Shoots laser beams. 48 @author 49 Hagen Seifert 50 @ingroup WeaponsWeaponModes 51 */ 39 52 class _WeaponsExport HsW01 : public WeaponMode 40 53 { … … 47 60 48 61 private: 49 void setMaterial(const std::string& material); 50 std::string& getMaterial(); 51 void setDelay(float d); 52 float getDelay() const; 62 /** 63 @brief Set the material. 64 @param material The material name. 65 */ 66 void setMaterial(const std::string& material) 67 { this->material_ = material; } 68 /** 69 @brief Get the material. 70 @return Returns the material name. 71 */ 72 const std::string& getMaterial() const 73 { return this->material_; } 74 75 void setDelay(float delay); 76 /** 77 @brief Get the firing delay. 78 @return Returns the firing delay in seconds. 79 */ 80 float getDelay() const 81 { return this->delay_; } 82 53 83 void shot(); 54 void mu endungsfeuer();84 void muzzleflash(); 55 85 56 std::string material_; 57 float speed_; 58 float delay_; 59 Timer delayTimer_; 86 std::string material_; //!< The material. 87 float speed_; //!< The speed of the fired projectile. 88 float delay_; //!< The firing delay. 89 Timer delayTimer_; //!< A timer to delay the firing. 60 90 }; 61 91 } -
code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc
r8706 r8855 27 27 */ 28 28 29 /** 30 @file LaserFire.h 31 @brief Implementation of the LaserFire class. 32 */ 33 29 34 #include "LaserFire.h" 30 35 31 36 #include "core/CoreIncludes.h" 32 #include "weapons/projectiles/ParticleProjectile.h" 37 33 38 #include "weaponsystem/Weapon.h" 34 39 #include "weaponsystem/WeaponPack.h" 35 40 #include "weaponsystem/WeaponSystem.h" 36 41 #include "worldentities/pawns/Pawn.h" 42 43 #include "weapons/projectiles/ParticleProjectile.h" 37 44 38 45 namespace orxonox … … 44 51 RegisterObject(LaserFire); 45 52 46 this->reloadTime_ = 0.25 ;47 this->damage_ = 0 ; //default 1548 this->speed_ = 1250 ;53 this->reloadTime_ = 0.25f; 54 this->damage_ = 0.0f; 55 this->speed_ = 1250.0f; 49 56 50 57 this->setMunitionName("LaserMunition"); 51 58 } 52 59 53 /* Creates the projectile object, sets its properties to the LaserFire properties 54 */ 60 /** 61 @brief 62 Fires the weapon. Creates a projectile and fires it. 63 */ 55 64 void LaserFire::fire() 56 65 { … … 61 70 projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_); 62 71 63 projectile->set Owner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());72 projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 64 73 projectile->setDamage(this->getDamage()); 65 74 projectile->setShieldDamage(this->getShieldDamage()); -
code/trunk/src/modules/weapons/weaponmodes/LaserFire.h
r5781 r8855 27 27 */ 28 28 29 /** 30 @file LaserFire.h 31 @brief Definition of the LaserFire class. 32 */ 33 29 34 #ifndef _LaserFire_H__ 30 35 #define _LaserFire_H__ … … 35 40 namespace orxonox 36 41 { 42 43 /** 44 @brief 45 Shoots a particle laser. 46 @author 47 Martin Polak 48 @ingroup WeaponsWeaponModes 49 */ 37 50 class _WeaponsExport LaserFire : public WeaponMode 38 51 { … … 44 57 45 58 private: 46 float speed_; 59 float speed_; //!< The speed of the fired projectile. 47 60 }; 48 61 } -
code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc
r8706 r8855 27 27 */ 28 28 29 /** 30 @file LightningGun.h 31 @brief Implementation of the LightningGun class. 32 */ 33 29 34 #include "LightningGun.h" 30 35 31 36 #include "core/CoreIncludes.h" 32 #include "weapons/projectiles/LightningGunProjectile.h"33 37 #include "weaponsystem/Weapon.h" 34 38 #include "weaponsystem/WeaponPack.h" 35 39 #include "weaponsystem/WeaponSystem.h" 36 40 #include "worldentities/pawns/Pawn.h" 41 42 #include "weapons/projectiles/LightningGunProjectile.h" 37 43 38 44 namespace orxonox … … 44 50 RegisterObject(LightningGun); 45 51 46 this->reloadTime_ = 1 ;47 this->damage_ = 0 ; //default 10048 this->speed_ = 150;52 this->reloadTime_ = 1.0f; 53 this->damage_ = 0.0f; 54 this->speed_ = 250.0f; 49 55 50 56 this->setMunitionName("LaserMunition"); … … 56 62 } 57 63 58 /* Creates the projectile (LightningGunProjectile) object, sets its properties to the LightningGun properties 59 */ 64 /** 65 @brief 66 Fires the weapon. Creates a projectile and fires it. 67 */ 60 68 void LightningGun::fire() 61 69 { … … 67 75 projectile->setPosition(this->getMuzzlePosition()); 68 76 projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_); 69 projectile->setAcceleration(this->getMuzzleDirection() * 1000);70 77 71 projectile->set Owner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());78 projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 72 79 projectile->setDamage(this->getDamage()); 73 80 projectile->setShieldDamage(this->getShieldDamage()); -
code/trunk/src/modules/weapons/weaponmodes/LightningGun.h
r6417 r8855 27 27 */ 28 28 29 /** 30 @file LightningGun.h 31 @brief Definition of the LightningGun class. 32 */ 33 29 34 #ifndef _LightningGun_H__ 30 35 #define _LightningGun_H__ … … 35 40 namespace orxonox 36 41 { 42 43 /** 44 @brief 45 A slow ball of lightning. 46 @author 47 Joel Smely 48 @ingroup WeaponsWeaponModes 49 */ 37 50 class _WeaponsExport LightningGun : public WeaponMode 38 51 { … … 44 57 45 58 private: 46 float speed_; 59 float speed_; //!< The speed of the fired projectile. 47 60 }; 48 61 } -
code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc
r8706 r8855 27 27 */ 28 28 29 /** 30 @file RocketFire.h 31 @brief Implementation of the RocketFire class. 32 */ 33 29 34 #include "RocketFire.h" 30 35 36 #include "core/CoreIncludes.h" 31 37 #include "util/Math.h" 32 #include "core/CoreIncludes.h"33 #include "weapons/projectiles/Rocket.h"34 38 35 39 #include "weaponsystem/Weapon.h" … … 37 41 #include "weaponsystem/WeaponSystem.h" 38 42 #include "worldentities/pawns/Pawn.h" 43 44 #include "weapons/projectiles/Rocket.h" 39 45 40 46 namespace orxonox … … 48 54 this->reloadTime_ = 0.20f; 49 55 this->bParallelReload_ = false; 50 this->damage_ = 0 ;51 this->speed_ = 500 ;56 this->damage_ = 0.0f; 57 this->speed_ = 500.0f; 52 58 53 59 this->setMunitionName("RocketMunition"); … … 59 65 } 60 66 61 /* Creates the Rocket object, sets its properties to the RocketFire properties 62 */ 67 /** 68 @brief 69 Fires the weapon. Creates the Rocket and fires it. 70 */ 63 71 void RocketFire::fire() 64 72 { … … 71 79 rocket->scale(2); 72 80 73 rocket->set Owner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());81 rocket->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 74 82 rocket->setDamage(this->getDamage()); 75 83 rocket->setShieldDamage(this->getShieldDamage()); -
code/trunk/src/modules/weapons/weaponmodes/RocketFire.h
r6417 r8855 27 27 */ 28 28 29 /** 30 @file RocketFire.h 31 @brief Definition of the RocketFire class. 32 */ 33 29 34 #ifndef _RocketFire_H__ 30 35 #define _RocketFire_H__ … … 35 40 namespace orxonox 36 41 { 42 43 /** 44 @brief 45 Fires the (steerable) Rocket. 46 @author 47 Oliver Scheuss 48 @ingroup WeaponsWeaponModes 49 */ 37 50 class _WeaponsExport RocketFire : public WeaponMode 38 51 { … … 44 57 45 58 private: 46 float speed_; 59 float speed_; //!< The speed of the Rocket. 47 60 }; 48 61 } -
code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
r8706 r8855 21 21 * 22 22 * Author: 23 * Gabriel Nadler 24 * Co-authors: 23 25 * Oliver Scheuss 24 * Co-authors:25 26 * simonmie 26 27 * 27 28 */ 28 29 30 /** 31 @file BasicProjectile.h 32 @brief Implementation of the BasicProjectile class. 33 */ 34 29 35 #include "SimpleRocketFire.h" 30 36 37 #include "core/CoreIncludes.h" 31 38 #include "util/Math.h" 32 #include "core/CoreIncludes.h"33 #include "weapons/RocketController.h"34 39 35 40 #include "weaponsystem/Weapon.h" … … 38 43 #include "worldentities/pawns/Pawn.h" 39 44 #include "sound/WorldSound.h" 45 46 #include "weapons/RocketController.h" 47 #include "weapons/projectiles/SimpleRocket.h" 40 48 41 49 namespace orxonox … … 48 56 RegisterObject(SimpleRocketFire); 49 57 50 this->reloadTime_ = 1 ;58 this->reloadTime_ = 1.0f; 51 59 this->bParallelReload_ = false; 52 this->damage_ = 0 ;53 this->speed_ = 500 ;60 this->damage_ = 0.0f; 61 this->speed_ = 500.0f; 54 62 55 63 this->setMunitionName("RocketMunition"); … … 62 70 } 63 71 64 /* Creates the Rocket (RocketController) object, sets its properties to the SimpleRocketFire properties, sets target 65 */ 72 /** 73 @brief 74 Fires the weapon. Creates the SimpleRocket and a RocketController to steer it and fires it. 75 */ 66 76 void SimpleRocketFire::fire() 67 77 { 68 RocketController* con = new RocketController(this);69 SimpleRocket* rocket = con ->getRocket();78 RocketController* controller = new RocketController(this); 79 SimpleRocket* rocket = controller->getRocket(); 70 80 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); 71 81 rocket->setOrientation(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getWorldOrientation()); 72 82 rocket->setPosition(this->getMuzzlePosition()); 73 83 rocket->setVelocity(this->getMuzzleDirection()*this->speed_); 74 rocket->set Owner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());84 rocket->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 75 85 76 86 rocket->setDamage(this->damage_); … … 78 88 rocket->setHealthDamage(this->getHealthDamage()); 79 89 80 WorldEntity* pawn n=static_cast<ControllableEntity*>(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn())->getTarget();81 if (pawn n) con->setTarget(pawnn);90 WorldEntity* pawn = static_cast<ControllableEntity*>(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn())->getTarget(); 91 if (pawn) controller->setTarget(pawn); 82 92 } 83 93 } -
code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.h
r7163 r8855 21 21 * 22 22 * Author: 23 * Gabriel Nadler 24 * Co-authors: 23 25 * Oliver Scheuss 24 * Co-authors:25 * ...26 26 * 27 27 */ 28 29 /** 30 @file SimpleRocketFire.h 31 @brief Definition of the SimpleRocketFire class. 32 */ 28 33 29 34 #ifndef _SimpleRocketFire_H__ … … 39 44 FireMode for target-seeking Rocket 40 45 @author 41 Gabriel Nadler (Original file: Oli Scheuss) 46 Gabriel Nadler 47 @ingroup WeaponsWeaponModes 42 48 */ 43 49 class _WeaponsExport SimpleRocketFire : public WeaponMode … … 50 56 51 57 private: 52 float speed_; 58 float speed_; //!< The speed of the SimpleRocket. 53 59 54 60 };
Note: See TracChangeset
for help on using the changeset viewer.