- Timestamp:
- Oct 24, 2015, 10:51:18 PM (9 years ago)
- Location:
- code/branches/fabienHS15
- Files:
-
- 10 added
- 2 deleted
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/fabienHS15/data/levels/includes/weaponSettingsAssff.oxi
r10677 r10688 24 24 <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 /> 25 25 </attached> 26 <HsW01 mode=0 munitionpershot= 0delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />27 <HsW01 mode=0 munitionpershot= 0delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />26 <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" /> 27 <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" /> 28 28 <LightningGun mode=1 munitionpershot=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 /> 29 29 </Weapon> … … 34 34 <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 /> 35 35 </attached> 36 <HsW01 mode=0 munitionpershot= 0delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />37 <HsW01 mode=0 munitionpershot= 0delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />36 <HsW01 mode=0 munitionpershot=1 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" /> 37 <HsW01 mode=0 munitionpershot=1 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" /> 38 38 <LightningGun mode=1 munitionpershot=1 muzzleoffset="0,0,0" damage=23 /> 39 39 </Weapon> -
code/branches/fabienHS15/data/levels/includes/weaponSettingsAssff2.oxi
r10677 r10688 23 23 <BlinkingBillboard position="-1.9, -.5, -5.5" material="PE/lensflare" colour="0.128, 0.28, 1" amplitude=0.25 frequency=16 quadratic=0 /> 24 24 </attached> 25 <HsW01 mode=0 munitionpershot= 0delay=0.125 healthamage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6,1.3,-2.0" />26 <HsW01 mode=0 munitionpershot= 0delay=0 healthdamage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6,1.3,-2.0" />25 <HsW01 mode=0 munitionpershot=1 delay=0.125 healthamage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6,1.3,-2.0" /> 26 <HsW01 mode=0 munitionpershot=1 delay=0 healthdamage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6,1.3,-2.0" /> 27 27 <LightningGun mode=1 munitionpershot=1 muzzleoffset="0,0,0" shielddamage=23 /> 28 28 </Weapon> … … 32 32 <BlinkingBillboard position="1.9, -.5, -5.5" material="PE/lensflare" colour="0.128, 0.28, 1" amplitude=0.25 frequency=16 quadratic=0 /> 33 33 </attached> 34 <HsW01 mode=0 munitionpershot= 0delay=0 healthdamage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6,1.3,-2.0" />35 <HsW01 mode=0 munitionpershot= 0delay=0.125 healthdamage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1,1.6,-2.0" />34 <HsW01 mode=0 munitionpershot=1 delay=0 healthdamage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6,1.3,-2.0" /> 35 <HsW01 mode=0 munitionpershot=1 delay=0.125 healthdamage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1,1.6,-2.0" /> 36 36 <LightningGun mode=1 munitionpershot=1 muzzleoffset="0,0,0" shielddamage=23 /> 37 37 </Weapon> -
code/branches/fabienHS15/data/levels/includes/weaponSettingsSwallow.oxi
r10629 r10688 2 2 <WeaponSlot position=" 8,1.66,-17.5" /> 3 3 <WeaponSlot position="-8,1.66,-17.5" /> 4 <WeaponSlot position="0,1.66,-17.5" /> 4 5 </weaponslots> 5 6 <weaponsets> … … 14 15 </links> 15 16 <Weapon> 16 <SplitGun mode=0 munitionpershot=0 damage=6.0 muzzleoffset="0.5,0.6,1.7" splittime=0.2 numberofsplits=2 numberofchilds=3 spread=0.1 damagereduction=2.0 /> 17 <SplitGun mode=0 munitionpershot=1 damage=6.0 muzzleoffset="0.5,0.6,1.7" splittime=0.2 numberofsplits=2 numberofchilds=3 spread=0.1 damagereduction=2.0 /> 18 <LaserFire mode=1 munitionpershot=0 damage=10.0 muzzleoffset="0.5,0.6,1.7" /> 17 19 </Weapon> 18 20 <Weapon> 19 <SplitGun mode=0 munitionpershot=0 damage=6.0 muzzleoffset="-0.5,0.6,1.7" splittime=0.2 numberofsplits=2 numberofchilds=3 spread=0.1 damagereduction=2.0 /> 20 </Weapon> 21 <SplitGun mode=0 munitionpershot=1 damage=6.0 muzzleoffset="-0.5,0.6,1.7" splittime=0.2 numberofsplits=2 numberofchilds=3 spread=0.1 damagereduction=2.0 /> 22 <LaserFire mode=1 munitionpershot=0 damage=10.0 muzzleoffset="-0.5,0.6,1.7" /> 23 </Weapon> 21 24 </WeaponPack> 22 25 </weapons> -
code/branches/fabienHS15/data/overlays/HUDTemplates3.oxo
r10292 r10688 127 127 mapAngle3D = 0.6435011 128 128 /> 129 130 <HUDWeaponSystem 131 name = "WeaponSystem" 132 correctaspect = false 133 size = "0.6, 0.1" 134 position = "0.0, 0.0" 135 pickpoint = "0, 0" 136 visible = "true" 137 /> 129 138 130 139 <HUDTimer -
code/branches/fabienHS15/src/modules/overlays/hud/CMakeLists.txt
r9939 r10688 8 8 HUDTimer.cc 9 9 HUDEnemyHealthBar.cc 10 HUDWeaponMode.cc 11 HUDWeapon.cc 12 HUDWeaponSystem.cc 10 13 ChatOverlay.cc 11 14 AnnounceMessage.cc -
code/branches/fabienHS15/src/modules/weapons/munitions/CMakeLists.txt
r10629 r10688 1 1 ADD_SOURCE_FILES(WEAPONS_SRC_FILES 2 ReplenishingMunition.cc3 2 LaserMunition.cc 3 LightningMunition.cc 4 4 FusionMunition.cc 5 5 RocketMunition.cc -
code/branches/fabienHS15/src/modules/weapons/munitions/FusionMunition.cc
r9667 r10688 28 28 29 29 /** 30 @file FusionMunition. h30 @file FusionMunition.cc 31 31 @brief Implementation of the FusionMunition class. 32 32 */ … … 47 47 this->magazines_ = 10; 48 48 49 this-> bUseSeparateMagazines_ = true;50 this->bStackMunition_ = false; 49 this->deployment_ = DEPLOYMENT_SEPARATE; 50 51 51 this->reloadTime_ = 1.0f; 52 52 53 53 this->bAllowMunitionRefilling_ = true; 54 54 this->bAllowMultiMunitionRemovementUnderflow_ = true; 55 56 this->reloadTime_ = 0.5f; 55 57 } 56 58 } -
code/branches/fabienHS15/src/modules/weapons/munitions/GravityBombMunition.cc
r10622 r10688 19 19 this->magazines_ = 15; 20 20 21 this->bUseSeparateMagazines_ = false; 22 this->bStackMunition_ = true; 21 this->deployment_ = DEPLOYMENT_STACK; 23 22 24 23 this->bAllowMunitionRefilling_ = true; 25 24 this->bAllowMultiMunitionRemovementUnderflow_ = false; 25 26 this->reloadTime_ = 0.0f; 26 27 } 27 28 -
code/branches/fabienHS15/src/modules/weapons/munitions/IceMunition.cc
r10629 r10688 28 28 29 29 /** 30 @file IceMunition. h30 @file IceMunition.cc 31 31 @brief Implementation of the IceMunition class. 32 32 */ … … 47 47 this->magazines_ = 25; 48 48 49 this->bUseSeparateMagazines_ = false; 50 this->bStackMunition_ = true; 49 this->deployment_ = DEPLOYMENT_STACK; 51 50 52 51 this->bAllowMunitionRefilling_ = false; 53 52 this->bAllowMultiMunitionRemovementUnderflow_ = false; 53 54 this->reloadTime_ = 0.5f; 54 55 } 55 56 } -
code/branches/fabienHS15/src/modules/weapons/munitions/LaserMunition.cc
r9667 r10688 28 28 29 29 /** 30 @file LaserMunition. h30 @file LaserMunition.cc 31 31 @brief Implementation of the LaserMunition class. 32 32 */ … … 43 43 RegisterObject(LaserMunition); 44 44 45 this->maxMunitionPerMagazine_ = 20;46 this->maxMagazines_ = 1 ;47 this->magazines_ = 1 ;45 this->maxMunitionPerMagazine_ = 10; 46 this->maxMagazines_ = 10; 47 this->magazines_ = 10; 48 48 49 this->bUseSeparateMagazines_ = false; 50 this->bStackMunition_ = true; 49 this->deployment_ = DEPLOYMENT_SEPARATE; 51 50 52 51 this->bAllowMunitionRefilling_ = true; … … 55 54 this->replenishInterval_ = 0.5f; 56 55 this->replenishMunitionAmount_ = 1; 56 57 this->reloadTime_ = 0.8f; 57 58 } 58 59 } -
code/branches/fabienHS15/src/modules/weapons/munitions/LaserMunition.h
r9667 r10688 36 36 37 37 #include "weapons/WeaponsPrereqs.h" 38 #include " ReplenishingMunition.h"38 #include "weaponsystem/ReplenishingMunition.h" 39 39 40 40 namespace orxonox -
code/branches/fabienHS15/src/modules/weapons/munitions/RocketMunition.cc
r9667 r10688 28 28 29 29 /** 30 @file RocketMunition. h30 @file RocketMunition.cc 31 31 @brief Implementation of the RocketMunition class. 32 32 */ … … 47 47 this->magazines_ = 10; 48 48 49 this->bUseSeparateMagazines_ = false; 50 this->bStackMunition_ = true; 49 this->deployment_ = DEPLOYMENT_STACK; 51 50 52 51 this->bAllowMunitionRefilling_ = false; 53 52 this->bAllowMultiMunitionRemovementUnderflow_ = false; 53 54 this->reloadTime_ = 0.5f; 54 55 } 55 56 } -
code/branches/fabienHS15/src/modules/weapons/munitions/SplitMunition.cc
r10629 r10688 28 28 29 29 /** 30 @file SplitMunition. h30 @file SplitMunition.cc 31 31 @brief Implementation of the SplitMunition class. 32 32 */ … … 47 47 this->magazines_ = 25; 48 48 49 this->bUseSeparateMagazines_ = false; 50 this->bStackMunition_ = true; 49 this->deployment_ = DEPLOYMENT_STACK; 51 50 52 51 this->bAllowMunitionRefilling_ = true; 53 52 this->bAllowMultiMunitionRemovementUnderflow_ = false; 53 54 this->reloadTime_ = 0.5f; 54 55 } 55 56 } -
code/branches/fabienHS15/src/modules/weapons/projectiles/GravityBombField.cc
r10622 r10688 164 164 if (lifetime_ <= -4) 165 165 { 166 orxout(debug_output) << "Timeout. Destroying field." << endl;167 166 this->destroy(); 168 167 } -
code/branches/fabienHS15/src/modules/weapons/weaponmodes/EnergyDrink.cc
r10622 r10688 63 63 this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&EnergyDrink::shot, this))); 64 64 this->delayTimer_.stopTimer(); 65 66 hudImageString_ = "Orxonox/WSHUD_WM_EnergyDrink"; 65 67 } 66 68 -
code/branches/fabienHS15/src/modules/weapons/weaponmodes/FusionFire.cc
r10622 r10688 58 58 59 59 this->setMunitionName("FusionMunition"); 60 61 hudImageString_ = "Orxonox/WSHUD_WM_FusionFire"; 60 62 } 61 63 -
code/branches/fabienHS15/src/modules/weapons/weaponmodes/GravityBombFire.cc
r10622 r10688 31 31 this->setMunitionName("GravityBombMunition"); 32 32 this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.8); ///< sets sound of the bomb as it is fired. 33 34 hudImageString_ = "Orxonox/WSHUD_WM_GravityBombFire"; 33 35 } 34 36 -
code/branches/fabienHS15/src/modules/weapons/weaponmodes/HsW01.cc
r10296 r10688 69 69 70 70 this->setDefaultSound(this->sound_); 71 72 hudImageString_ = "Orxonox/WSHUD_WM_HsW01"; 71 73 } 72 74 -
code/branches/fabienHS15/src/modules/weapons/weaponmodes/IceGun.cc
r10629 r10688 59 59 this->setFreezeFactor(0.5); 60 60 61 this->setMunitionName(" LaserMunition");61 this->setMunitionName("IceMunition"); 62 62 this->setDefaultSound("sounds/Weapon_LightningGun.ogg"); 63 64 hudImageString_ = "Orxonox/WSHUD_WM_IceGun"; 63 65 } 64 66 -
code/branches/fabienHS15/src/modules/weapons/weaponmodes/LaserFire.cc
r10622 r10688 56 56 57 57 this->setMunitionName("LaserMunition"); 58 59 hudImageString_ = "Orxonox/WSHUD_WM_LaserFire"; 58 60 } 59 61 -
code/branches/fabienHS15/src/modules/weapons/weaponmodes/LightningGun.cc
r10296 r10688 54 54 this->speed_ = 750.0f; 55 55 56 this->setMunitionName("L aserMunition");56 this->setMunitionName("LightningMunition"); 57 57 this->setDefaultSound("sounds/Weapon_LightningGun.ogg"); 58 59 hudImageString_ = "Orxonox/WSHUD_WM_LightningGun"; 58 60 } 59 61 -
code/branches/fabienHS15/src/modules/weapons/weaponmodes/RocketFire.cc
r10296 r10688 59 59 this->setMunitionName("RocketMunition"); 60 60 // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning) 61 62 hudImageString_ = "Orxonox/WSHUD_WM_RocketFire"; 61 63 } 62 64 -
code/branches/fabienHS15/src/modules/weapons/weaponmodes/RocketFireOld.cc
r10622 r10688 59 59 this->setMunitionName("RocketMunition"); 60 60 // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning) 61 62 hudImageString_ = "Orxonox/WSHUD_WM_SimpleRocketFire"; 61 63 } 62 64 -
code/branches/fabienHS15/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
r9667 r10688 64 64 this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.4f); 65 65 // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning) 66 67 hudImageString_ = "Orxonox/WSHUD_WM_SimpleRocketFire"; 66 68 } 67 69 … … 89 91 90 92 WorldEntity* pawn = static_cast<ControllableEntity*>(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn())->getTarget(); 91 if (pawn) controller->setTarget(pawn); 93 if (pawn) 94 controller->setTarget(pawn); 92 95 } 93 96 } -
code/branches/fabienHS15/src/modules/weapons/weaponmodes/SplitGun.cc
r10629 r10688 62 62 this->setMunitionName("SplitMunition"); 63 63 this->setDefaultSound("sounds/Weapon_LightningGun.ogg"); 64 65 hudImageString_ = "Orxonox/WSHUD_WM_SplitGun"; 64 66 } 65 67 -
code/branches/fabienHS15/src/orxonox/weaponsystem/CMakeLists.txt
r5781 r10688 1 1 ADD_SOURCE_FILES(ORXONOX_SRC_FILES 2 2 Munition.cc 3 ReplenishingMunition.cc 3 4 Weapon.cc 4 5 WeaponMode.cc -
code/branches/fabienHS15/src/orxonox/weaponsystem/Munition.cc
r9667 r10688 45 45 this->magazines_ = 10; 46 46 47 this->bUseSeparateMagazines_ = false; 48 this->bStackMunition_ = true; 47 this->deployment_ = DEPLOYMENT_STACK; 49 48 this->bAllowMunitionRefilling_ = true; 50 49 this->bAllowMultiMunitionRemovementUnderflow_ = true; 51 50 52 this->reloadTime_ = 0 ;51 this->reloadTime_ = 0.5f; 53 52 } 54 53 … … 61 60 Munition::Magazine* Munition::getMagazine(WeaponMode* user) const 62 61 { 63 if ( this->bUseSeparateMagazines_)62 if (deployment_ == DEPLOYMENT_SEPARATE) 64 63 { 65 64 // For separated magazines we definitively need a given user … … 87 86 if (magazine) 88 87 { 89 if ( this->bStackMunition_)88 if (deployment_ == DEPLOYMENT_STACK) 90 89 // With stacked munition every magazine contributes to the total amount 91 90 return this->maxMunitionPerMagazine_ * this->magazines_ + magazine->munition_; … … 109 108 unsigned int Munition::getNumMagazines() const 110 109 { 111 if ( this->bStackMunition_)110 if (deployment_ == DEPLOYMENT_STACK) 112 111 { 113 112 // If we stack munition and the current magazine is still full, it counts too … … 122 121 unsigned int Munition::getMaxMunition() const 123 122 { 124 if ( this->bStackMunition_)123 if (deployment_ == DEPLOYMENT_STACK) 125 124 return this->maxMunitionPerMagazine_ * this->maxMagazines_; 126 125 else … … 135 134 unsigned int munition = magazine->munition_; 136 135 137 // If we stack munition, we con't care about the current magazine - we just need enough munition in total138 if ( this->bStackMunition_)136 // If we stack munition, we don't care about the current magazine - we just need enough munition in total 137 if (deployment_ == DEPLOYMENT_STACK) 139 138 munition += this->maxMunitionPerMagazine_ * this->magazines_; 140 139 … … 169 168 { 170 169 // Not enough munition 171 if ( this->bStackMunition_)170 if (deployment_ == DEPLOYMENT_STACK) 172 171 { 173 172 // We stack munition, so just take what we can and then load the next magazine … … 199 198 { 200 199 // As long as we have enough magazines (and don't stack munition) we can reload 201 return (this->magazines_ > 0 && ! this->bStackMunition_);200 return (this->magazines_ > 0 && !deployment_ == DEPLOYMENT_STACK); 202 201 } 203 202 … … 207 206 if (magazine) 208 207 { 209 if ( this->bStackMunition_)208 if (deployment_ == DEPLOYMENT_STACK) 210 209 // With stacked munition, we never have to reload 211 210 return false; … … 231 230 232 231 // If we use separate magazines for each user, we definitively need a user given 233 if ( this->bUseSeparateMagazines_&& !user)232 if (deployment_ == DEPLOYMENT_SEPARATE && !user) 234 233 return false; 235 234 236 235 // If we don't use separate magazines, set user to 0 237 if (! this->bUseSeparateMagazines_)236 if (!deployment_ == DEPLOYMENT_SEPARATE) 238 237 user = 0; 239 238 … … 260 259 return false; 261 260 262 if ( this->bStackMunition_)261 if (deployment_ == DEPLOYMENT_STACK) 263 262 { 264 263 // If we stack munition, we can always add munition until we reach the limit … … 281 280 return false; 282 281 283 if ( this->bStackMunition_)282 if (deployment_ == DEPLOYMENT_STACK) 284 283 { 285 284 // Stacking munition means, if a magazine gets full, the munition adds to a new magazine … … 340 339 // TODO: 'amount' is not used 341 340 342 if ( this->bStackMunition_)341 if (deployment_ == DEPLOYMENT_STACK) 343 342 // If we stack munition, we can always add new magazines because they contribute directly to the munition 344 343 return (this->getNumMunition(0) < this->getMaxMunition()); … … 357 356 358 357 // If zero or less magazines are needed, we definitively don't need more magazines (unless we stack munition - then a magazine contributes directly to the munition) 359 if (needed_magazines <= 0 && ! this->bStackMunition_)358 if (needed_magazines <= 0 && !deployment_ == DEPLOYMENT_STACK) 360 359 return false; 361 360 … … 369 368 // We get more magazines than we need, so just add the needed amount 370 369 this->magazines_ += needed_magazines; 371 if ( this->bStackMunition_)370 if (deployment_ == DEPLOYMENT_STACK) 372 371 { 373 372 // We stack munition, so the additional amount contributes directly to the munition of the current magazine … … 383 382 bool Munition::canRemoveMagazines(unsigned int amount) const 384 383 { 385 if ( this->bStackMunition_)384 if (deployment_ == DEPLOYMENT_STACK) 386 385 { 387 386 if (this->magazines_ >= amount) … … 422 421 this->magazines_ -= amount; 423 422 } 424 else if ( this->bStackMunition_)423 else if (deployment_ == DEPLOYMENT_STACK) 425 424 { 426 425 // We don't have enough magazines, but we're stacking munition, so additionally remove the bullets from the current magazine … … 437 436 { 438 437 // If we use separate magazines, we need a user 439 if ( this->bUseSeparateMagazines_&& !user)438 if (deployment_ == DEPLOYMENT_SEPARATE && !user) 440 439 return false; 441 440 442 441 // If we don't use separate magazines, set user to 0 443 if (! this->bUseSeparateMagazines_)442 if (!deployment_ == DEPLOYMENT_SEPARATE) 444 443 user = 0; 445 444 … … 465 464 this->bLoaded_ = false; 466 465 467 if (bUseReloadTime && munition->reloadTime_ > 0 && !munition-> bStackMunition_)466 if (bUseReloadTime && munition->reloadTime_ > 0 && !munition->deployment_ == DEPLOYMENT_STACK) 468 467 { 469 468 const ExecutorPtr& executor = createExecutor(createFunctor(&Magazine::loaded, this)); -
code/branches/fabienHS15/src/orxonox/weaponsystem/Munition.h
r9667 r10688 39 39 namespace orxonox 40 40 { 41 enum Deployment 42 { 43 DEPLOYMENT_SHARE, 44 DEPLOYMENT_STACK, 45 DEPLOYMENT_SEPARATE 46 }; 47 48 41 49 class _OrxonoxExport Munition : public BaseObject 42 { 50 { 43 51 struct Magazine 44 52 { … … 68 76 inline unsigned int getMaxMunitionPerMagazine() const 69 77 { return this->maxMunitionPerMagazine_; } 78 inline bool getUseSeparateMagazines() const 79 { return deployment_ == DEPLOYMENT_SEPARATE; } 80 inline bool getStackMunition() const 81 { return deployment_ == DEPLOYMENT_STACK; } 70 82 71 83 bool canTakeMunition(unsigned int amount, WeaponMode* user) const; … … 95 107 std::map<WeaponMode*, Magazine*> currentMagazines_; 96 108 97 bool bUseSeparateMagazines_;98 bool bStackMunition_; 109 Deployment deployment_; 110 99 111 bool bAllowMunitionRefilling_; 100 112 bool bAllowMultiMunitionRemovementUnderflow_; -
code/branches/fabienHS15/src/orxonox/weaponsystem/Weapon.cc
r10650 r10688 134 134 } 135 135 136 /** 137 @brief 138 Reload all @ref orxonox::WeaponMode weapon modes of this weapon. 139 */ 136 140 void Weapon::reload() 137 141 { -
code/branches/fabienHS15/src/orxonox/weaponsystem/Weapon.h
r10650 r10688 57 57 void addWeaponmode(WeaponMode* weaponmode); 58 58 WeaponMode* getWeaponmode(unsigned int index) const; 59 inline std::multimap<unsigned int, WeaponMode*>* getAllWeaponmodes() 60 { return &weaponmodes_; } 61 inline int getNumWeaponModes() const 62 { return weaponmodes_.size(); } 59 63 60 64 /** -
code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponMode.cc
r10650 r10688 75 75 this->muzzleOrientation_ = Quaternion::IDENTITY; 76 76 77 hudImageString_ = "WSHUD_WM_Unknown"; 78 77 79 if( GameMode::isMaster() ) 78 80 { … … 125 127 this->bSoundAttached_ = true; 126 128 } 127 129 130 // Fireing is only possible if this weapon mode is not reloading and there is enough munition 128 131 if (!this->bReloading_ && this->munition_ && this->munition_->takeMunition(this->munitionPerShot_, this)) 129 132 { … … 134 137 if (this->munition_->reload(this)) 135 138 { 139 // If true, the weapon reloads in parallel to the magazine reloading 136 140 if (this->bParallelReload_) 141 { 142 // The time needed to reload is the maximum of the reload time of the weapon mode and the magazine. 137 143 tempReloadtime = std::max(this->reloadTime_, this->munition_->getReloadTime()); 144 } 138 145 else 146 { 147 // The time needed to reload is the sum of the reload time of the weapon mode and the magazine. 139 148 tempReloadtime = this->reloadTime_ + this->munition_->getReloadTime(); 149 } 140 150 } 141 151 } 142 152 153 // Mark this weapon mode as reloading and start the reload timer 143 154 this->bReloading_ = true; 144 155 this->reloadTimer_.setInterval(tempReloadtime); … … 283 294 } 284 295 285 void WeaponMode::setDefaultSoundWithVolume(const std::string& soundPath, const float soundVolume){ 286 if (this->defSndWpnFire_) { 296 void WeaponMode::setDefaultSoundWithVolume(const std::string& soundPath, const float soundVolume) 297 { 298 if (this->defSndWpnFire_) 299 { 287 300 this->defSndWpnFire_->setSource(soundPath); 288 301 this->defSndWpnFire_->setVolume(soundVolume); -
code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponMode.h
r10650 r10688 38 38 #include "core/class/SubclassIdentifier.h" 39 39 #include "tools/Timer.h" 40 #include "Munition.h" 40 41 41 42 namespace orxonox … … 104 105 inline bool getParallelReload() const 105 106 { return this->bParallelReload_; } 107 inline bool getReloading() const 108 { return this->bReloading_; } 106 109 107 110 … … 147 150 Vector3 getTarget(); 148 151 152 inline const std::string& getHUDImageString() const 153 { return this->hudImageString_; } 154 149 155 protected: 150 156 virtual void fire() = 0; … … 155 161 156 162 float reloadTime_; 157 bool bAutoReload_; 158 bool bParallelReload_; 163 bool bAutoReload_; // If true, the weapon reloads the magazine automatically. 164 bool bParallelReload_; // If true, the weapon reloads in parallel to the magazine reloading. 159 165 160 166 float damage_; … … 162 168 float shielddamage_; 163 169 Vector3 muzzleOffset_; 170 171 std::string hudImageString_; 164 172 165 173 private: … … 175 183 176 184 Timer reloadTimer_; 177 bool bReloading_; 185 bool bReloading_; // If true, this weapon mode is marked as reloading. 178 186 179 187 Vector3 muzzlePosition_; -
code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponPack.cc
r10650 r10688 124 124 } 125 125 126 std::vector<Weapon*>* WeaponPack::getAllWeapons() 127 { 128 return &weapons_; 129 } 130 126 131 void WeaponPack::addDefaultWeaponmodeLink(DefaultWeaponmodeLink* link) 127 132 { -
code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponPack.h
r9667 r10688 52 52 void removeWeapon(Weapon * weapon); 53 53 Weapon * getWeapon(unsigned int index) const; 54 std::vector<Weapon*>* getAllWeapons(); 54 55 55 56 inline size_t getNumWeapons() const -
code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponSystem.cc
r10650 r10688 240 240 } 241 241 242 std::vector<WeaponPack *> * WeaponSystem::getAllWeaponPacks() 243 { 244 return &weaponPacks_; 245 } 246 242 247 bool WeaponSystem::swapWeaponSlots(WeaponSlot * wSlot1, WeaponSlot * wSlot2) 243 248 { -
code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponSystem.h
r10650 r10688 67 67 void removeWeaponPack(WeaponPack * wPack); 68 68 WeaponPack * getWeaponPack(unsigned int index) const; 69 std::vector<WeaponPack *> * getAllWeaponPacks(); 69 70 70 71 // configure slots and firemodes -
code/branches/fabienHS15/src/orxonox/worldentities/pawns/Pawn.cc
r10650 r10688 554 554 } 555 555 556 std::vector<WeaponPack *> * Pawn::getAllWeaponPacks() 557 { 558 if (this->weaponSystem_) 559 return this->weaponSystem_->getAllWeaponPacks(); 560 else 561 return 0; 562 } 563 556 564 //Tell the Map (RadarViewable), if this is a playership 557 565 void Pawn::startLocalHumanControl() -
code/branches/fabienHS15/src/orxonox/worldentities/pawns/Pawn.h
r10437 r10688 154 154 void addWeaponPackXML(WeaponPack * wPack); 155 155 WeaponPack * getWeaponPack(unsigned int index) const; 156 std::vector<WeaponPack *> * getAllWeaponPacks(); 156 157 157 158 virtual void addedWeaponPack(WeaponPack* wPack) {}
Note: See TracChangeset
for help on using the changeset viewer.