Changeset 10814 for code/branches/fabienHS15/src
- Timestamp:
- Nov 17, 2015, 10:30:24 PM (9 years ago)
- Location:
- code/branches/fabienHS15/src
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/fabienHS15/src/modules/overlays/CMakeLists.txt
r7163 r10814 16 16 LINK_LIBRARIES 17 17 orxonox 18 weapons 18 19 SOURCE_FILES ${OVERLAYS_SRC_FILES} 19 20 ) -
code/branches/fabienHS15/src/modules/overlays/OverlaysPrereqs.h
r9939 r10814 90 90 class HUDRadar; 91 91 class HUDSpeedBar; 92 class HUDShieldBar; 92 93 class HUDBoostBar; 94 class HUDRocketFuelBar; 93 95 class HUDTimer; 94 96 class HUDAimAssistant; -
code/branches/fabienHS15/src/modules/overlays/hud/CMakeLists.txt
r10746 r10814 7 7 HUDShieldBar.cc 8 8 HUDHealthBar.cc 9 HUDRocketFuelBar.cc 9 10 HUDTimer.cc 10 11 HUDEnemyHealthBar.cc -
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" -
code/branches/fabienHS15/src/orxonox/OrxonoxPrereqs.h
r10624 r10814 167 167 class DefaultWeaponmodeLink; 168 168 class Munition; 169 class ReplenishingMunition; 169 170 class Weapon; 170 171 class WeaponMode; -
code/branches/fabienHS15/src/orxonox/infos/PlayerInfo.cc
r10624 r10814 202 202 203 203 this->changedControllableEntity(); 204 205 // HACK-ish 206 if(this->isHumanPlayer()) 207 entity->createHud(); 204 208 } 205 209 … … 252 256 if( !entity || this->previousControllableEntity_.size() == 0 ) 253 257 return; 258 259 entity->destroyHud(); // HACK-ish 254 260 255 261 this->controllableEntity_->setController(0); -
code/branches/fabienHS15/src/orxonox/worldentities/pawns/Pawn.cc
r10791 r10814 143 143 XMLPortObject(Pawn, Munition, "munition", addMunitionXML, getMunitionXML, xmlelement, mode); 144 144 145 XMLPortParam(Pawn, " reloadrate", setShieldRechargeRate, getShieldRechargeRate, xmlelement, mode).defaultValues(0);146 XMLPortParam(Pawn, " reloadwaittime", setShieldRechargeWaitTime, getShieldRechargeWaitTime, xmlelement, mode).defaultValues(1.0f);145 XMLPortParam(Pawn, "shieldrechargerate", setShieldRechargeRate, getShieldRechargeRate, xmlelement, mode).defaultValues(0); 146 XMLPortParam(Pawn, "shieldrechargewaittime", setShieldRechargeWaitTime, getShieldRechargeWaitTime, xmlelement, mode).defaultValues(1.0f); 147 147 148 148 XMLPortParam(Pawn, "explosionSound", setExplosionSound, getExplosionSound, xmlelement, mode); -
code/branches/fabienHS15/src/orxonox/worldentities/pawns/Pawn.h
r10791 r10814 46 46 or below zero. If it is, the pawn gets killed. 47 47 48 Pawns can carry pickups and fire weapons. The can also have shields.48 Pawns can carry pickups and fire weapons. They can also have shields. 49 49 50 50 Notice that every Pawn is a ControllableEntity.
Note: See TracChangeset
for help on using the changeset viewer.