Changeset 11170 for code/branches/sagerjFS16
- Timestamp:
- Apr 21, 2016, 3:33:48 PM (9 years ago)
- Location:
- code/branches/sagerjFS16
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sagerjFS16/data/levels/includes/weaponSettingsEscort.oxi
r11166 r11170 1 1 <weaponslots> 2 <WeaponSlot position="-9.2,2,-13" /> 2 <WeaponSlot 3 position="-9.2,2,-13" 4 /> 5 </weaponslots> 3 6 4 </weaponslots>5 7 <weaponsets> 6 <WeaponSet firemode=0 /> 7 8 <WeaponSet 9 firemode=0 10 /> 8 11 </weaponsets> 12 9 13 <weaponpacks> 10 14 <WeaponPack> 11 15 <links> 12 <DefaultWeaponmodeLink firemode=0 weaponmode=0 /> 13 16 <DefaultWeaponmodeLink 17 firemode=0 18 weaponmode=0 19 /> 14 20 </links> 15 21 <Weapon> 16 <Discharger mode=0 munitionpershot=1 delay=0 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="LaserBeam2.mesh" /> 22 <Discharger 23 mode=0 24 munitionpershot=1 25 delay=0 26 damage=9.3 27 material="Flares/point_lensflare" 28 muzzleoffset=" 1.6, 1.3, -2.0" 29 projectileMesh="LaserBeam2.mesh" 30 /> 17 31 </Weapon> 18 32 … … 21 35 </weaponpacks> 22 36 <munition> 23 <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=1 replenishinterval=7.5/> 37 <LaserMunition 38 initialmagazines=8 39 maxmagazines=8 40 munitionpermagazine=10 41 replenishamount=1 42 replenishinterval=7.5 43 /> 24 44 </munition> -
code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.cc
r11166 r11170 51 51 RegisterObject(Discharger); 52 52 53 this->reloadTime_ = 0.23f; 54 this->damage_ = 90.01f; 55 this->speed_ = 90.01f; 56 this->charges_ = 0; 57 53 58 this->setMunitionName("LaserMunition"); 59 this->setFireSound("sounds/Weapon_LaserFire.ogg"); 60 this->setReloadSound("sounds/Reload_LaserFire.ogg", 0.8); 54 61 55 62 hudImageString_ = "Orxonox/WSHUD_WM_LaserFire"; … … 58 65 void Discharger::fire() 59 66 { 60 orxout() << "fire dis " << endl; 67 charges_ += 1; 68 orxout() << "c = " << charges_ << endl; 61 69 } 62 70 63 bool Discharger::fire(float* reloadTime)71 void Discharger::release() 64 72 { 65 orxout() << "fire Discharger " << endl; 66 return false; 67 } 68 bool Discharger::release(float* reloadTime) 69 { 70 orxout() << "release Discharger " << endl; 71 return false; 73 orxout() << "release c = " << charges_ << endl; 74 BillboardProjectile* projectile = new BillboardProjectile(this->getContext()); 75 76 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); 77 projectile->setOrientation(this->getMuzzleOrientation()); 78 projectile->setPosition(this->getMuzzlePosition()); 79 projectile->setVelocity(this->getMuzzleDirection() * this->speed_ * charges_); 80 81 projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 82 projectile->setDamage(this->getDamage() * charges_); 83 projectile->setShieldDamage(this->getShieldDamage() * charges_); 84 projectile->setHealthDamage(this->getHealthDamage() * charges_); 85 this->charges_ = 0; 72 86 } 73 87 } -
code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.h
r11166 r11170 55 55 56 56 virtual void fire() override; 57 virtual bool fire(float* reloadTime) override; 58 virtual bool release(float* reloadTime) override; 57 virtual void release() override; 59 58 60 59 private: 60 float speed_; // The speed of the fired projectile. 61 unsigned int charges_; // An indicator of how much you charged up. 61 62 }; 62 63 } -
code/branches/sagerjFS16/src/orxonox/controllers/HumanController.cc
r11166 r11170 159 159 void HumanController::fire(unsigned int firemode) 160 160 { 161 orxout() << "fire hc " << firemode << endl;162 161 if (HumanController::localController_s) 163 162 HumanController::localController_s->doFire(firemode); … … 166 165 void HumanController::doFire(unsigned int firemode) 167 166 { 168 orxout() << "do fire hc " << firemode << endl;169 167 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 170 168 { … … 180 178 void HumanController::release(unsigned int firemode) 181 179 { 182 orxout() << "release hc " << firemode << endl;183 180 if (HumanController::localController_s) 184 181 HumanController::localController_s->doRelease(firemode); … … 187 184 void HumanController::doRelease(unsigned int firemode) 188 185 { 189 orxout() << "do release hc " << firemode << endl;190 186 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 191 187 { -
code/branches/sagerjFS16/src/orxonox/controllers/NewHumanController.cc
r11166 r11170 285 285 if (firemode == 1 && this->controlMode_ == 1) 286 286 { 287 orxout() << "do fire nhc if " << firemode << endl;288 287 //unlocked steering, steer on right mouse click 289 288 HumanController::yaw(Vector2(this->currentYaw_, 0)); … … 292 291 else 293 292 { 294 orxout() << "do fire nhc else " << firemode << endl;295 293 HumanController::doFire(firemode); //call for formationflight 296 294 } … … 299 297 void NewHumanController::doRelease(unsigned int firemode) 300 298 { 301 orxout() << "do release nhc" << firemode << endl;302 299 if (!this->controllableEntity_) 303 300 return; -
code/branches/sagerjFS16/src/orxonox/weaponsystem/Weapon.cc
r11166 r11170 114 114 // Note: The reloading of each WeaponMode is internally handled by each A, B and C. 115 115 // The reloading of the weapon is only performed to avoid firing with different modes at the same time. 116 orxout() << "fire weapon " << mode << endl; 116 117 117 118 if (this->bReloading_ && this->reloadingWeaponmode_ != mode) 118 119 return; … … 137 138 void Weapon::release(unsigned int mode) 138 139 { 139 orxout() << "release weapon " << mode << endl;140 140 if (this->bReloading_ && this->reloadingWeaponmode_ != mode) 141 141 return; -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.cc
r11166 r11170 121 121 { 122 122 (*reloadTime) = this->reloadTime_; 123 orxout() << "fire wm " << reloadTime << endl;124 123 // Fireing is only possible if this weapon mode is not reloading and there is enough munition 125 124 if (!this->bReloading_ && this->munition_ && this->munition_->takeMunition(this->munitionPerShot_, this)) … … 171 170 bool WeaponMode::release(float* reloadTime) 172 171 { 173 orxout() << "release wm " << reloadTime << endl;172 this->release(); 174 173 return false; 175 174 } -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.h
r11166 r11170 165 165 166 166 virtual void fire() = 0; 167 virtual void release() {}; 167 168 168 169 unsigned int initialMunition_; -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponPack.cc
r11166 r11170 76 76 void WeaponPack::fire(unsigned int weaponmode) 77 77 { 78 orxout() << "fire wp " << weaponmode << endl;79 78 for (Weapon* weapon : this->weapons_) 80 79 weapon->fire(weaponmode); … … 83 82 void WeaponPack::release(unsigned int weaponmode) 84 83 { 85 orxout() << "release wp " << weaponmode << endl;86 84 for (Weapon* weapon : this->weapons_) 87 85 weapon->release(weaponmode); -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSet.cc
r11166 r11170 63 63 { 64 64 // Fire all WeaponPacks with their defined weaponmode 65 orxout() << "fire wset " << endl;66 65 for (const auto& mapEntry : this->weaponpacks_) 67 66 if (mapEntry.second != WeaponSystem::WEAPON_MODE_UNASSIGNED) … … 72 71 { 73 72 // Fire all WeaponPacks with their defined weaponmode 74 orxout() << "release wset " << endl;75 73 for (const auto& mapEntry : this->weaponpacks_) 76 74 if (mapEntry.second != WeaponSystem::WEAPON_MODE_UNASSIGNED) -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSystem.cc
r11166 r11170 289 289 void WeaponSystem::fire(unsigned int firemode) 290 290 { 291 orxout() << "fire wsys " << firemode << endl;292 291 std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.find(firemode); 293 292 if (it != this->weaponSets_.end() && it->second) … … 297 296 void WeaponSystem::release(unsigned int firemode) 298 297 { 299 orxout() << "release wsys " << firemode << endl;300 298 std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.find(firemode); 301 299 if (it != this->weaponSets_.end() && it->second) -
code/branches/sagerjFS16/src/orxonox/worldentities/ControllableEntity.cc
r11166 r11170 303 303 if(GameMode::isMaster()) 304 304 { 305 orxout() << "fire ce if " << firemode << endl;306 305 this->fired(firemode); 307 306 } 308 307 else 309 308 { 310 orxout() << "fire ce else " << firemode << endl;311 309 callMemberNetworkFunction(&ControllableEntity::fire, this->getObjectID(), 0, firemode); 312 310 } … … 317 315 if(GameMode::isMaster()) 318 316 { 319 orxout() << "release ce if " << firemode << endl;320 317 this->released(firemode); 321 318 } 322 319 else 323 320 { 324 orxout() << "release ce else " << firemode << endl;325 321 callMemberNetworkFunction(&ControllableEntity::fire, this->getObjectID(), 0, firemode); 326 322 } -
code/branches/sagerjFS16/src/orxonox/worldentities/pawns/Pawn.cc
r11166 r11170 430 430 void Pawn::fired(unsigned int firemode) 431 431 { 432 orxout() << "fired pawn " << firemode << endl;433 432 if (this->weaponSystem_) 434 433 this->weaponSystem_->fire(firemode); … … 437 436 void Pawn::released(unsigned int firemode) 438 437 { 439 orxout() << "released pawn " << firemode << endl;440 438 if (this->weaponSystem_) 441 439 this->weaponSystem_->release(firemode);
Note: See TracChangeset
for help on using the changeset viewer.