Changeset 11166 for code/branches/sagerjFS16/src/orxonox
- Timestamp:
- Apr 14, 2016, 4:02:00 PM (9 years ago)
- Location:
- code/branches/sagerjFS16/src/orxonox
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sagerjFS16/src/orxonox/controllers/HumanController.cc
r11164 r11166 159 159 void HumanController::fire(unsigned int firemode) 160 160 { 161 orxout() << "fire hc " << firemode << endl; 161 162 if (HumanController::localController_s) 162 163 HumanController::localController_s->doFire(firemode); … … 165 166 void HumanController::doFire(unsigned int firemode) 166 167 { 168 orxout() << "do fire hc " << firemode << endl; 167 169 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 168 170 { … … 178 180 void HumanController::release(unsigned int firemode) 179 181 { 180 orxout() << " HumanController" << firemode << endl;182 orxout() << "release hc " << firemode << endl; 181 183 if (HumanController::localController_s) 182 184 HumanController::localController_s->doRelease(firemode); … … 185 187 void HumanController::doRelease(unsigned int firemode) 186 188 { 189 orxout() << "do release hc " << firemode << endl; 187 190 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 188 191 { -
code/branches/sagerjFS16/src/orxonox/controllers/NewHumanController.cc
r11164 r11166 54 54 SetConsoleCommand("NewHumanController", "accelerate", &NewHumanController::accelerate).keybindMode(KeybindMode::OnPress); 55 55 SetConsoleCommand("NewHumanController", "decelerate", &NewHumanController::decelerate).keybindMode(KeybindMode::OnPress); 56 //SetConsoleCommand("NewHumanController", "release", &NewHumanController::release ).keybindMode(KeybindMode::OnRelease).addShortcut();57 56 58 57 RegisterUnloadableClass(NewHumanController); … … 286 285 if (firemode == 1 && this->controlMode_ == 1) 287 286 { 287 orxout() << "do fire nhc if " << firemode << endl; 288 288 //unlocked steering, steer on right mouse click 289 289 HumanController::yaw(Vector2(this->currentYaw_, 0)); … … 291 291 } 292 292 else 293 { 294 orxout() << "do fire nhc else " << firemode << endl; 293 295 HumanController::doFire(firemode); //call for formationflight 294 } 295 296 /*void NewHumanController::release(unsigned int firemode) 297 { 298 if (NewHumanController::localController_s) 299 NewHumanController::localController_s->doRelease(firemode); 300 orxout() << "Trigger " << firemode << endl; 301 } 302 303 /void NewHumanController::doRelease(unsigned int firemode) 304 { 305 // this->firemode_ = -1; (outdated code from unfire) 306 // hideArrows(); 296 } 297 } 298 299 void NewHumanController::doRelease(unsigned int firemode) 300 { 301 orxout() << "do release nhc" << firemode << endl; 307 302 if (!this->controllableEntity_) 308 303 return; … … 311 306 312 307 HumanController::doRelease(firemode); //call for formationflight 313 } */308 } 314 309 315 310 void NewHumanController::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) -
code/branches/sagerjFS16/src/orxonox/controllers/NewHumanController.h
r11164 r11166 55 55 56 56 virtual void doFire(unsigned int firemode) override; 57 /*virtual void release(unsigned int firemode); 58 virtual void doRelease(unsigned int firemode);*/ 57 virtual void doRelease(unsigned int firemode) override; 59 58 60 59 virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) override; -
code/branches/sagerjFS16/src/orxonox/weaponsystem/Weapon.cc
r11164 r11166 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 if (this->bReloading_ && this->reloadingWeaponmode_ != mode) 117 118 return; … … 135 136 136 137 void Weapon::release(unsigned int mode) 137 {orxout() << "release weapon " << mode << endl;} 138 { 139 orxout() << "release weapon " << mode << endl; 140 if (this->bReloading_ && this->reloadingWeaponmode_ != mode) 141 return; 142 143 std::multimap<unsigned int, WeaponMode*>::iterator start = this->weaponmodes_.lower_bound(mode); 144 std::multimap<unsigned int, WeaponMode*>::iterator end = this->weaponmodes_.upper_bound(mode); 145 146 for (std::multimap<unsigned int, WeaponMode*>::iterator it = start; it != end; ++it) 147 { 148 float reloading_time = 0; 149 if (it->second->release(&reloading_time)) 150 { 151 this->bReloading_ = true; 152 this->reloadingWeaponmode_ = mode; 153 154 this->reloadTimer_.setInterval(reloading_time); 155 this->reloadTimer_.startTimer(); 156 } 157 } 158 } 138 159 139 160 /** -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.cc
r11164 r11166 121 121 { 122 122 (*reloadTime) = this->reloadTime_; 123 123 orxout() << "fire wm " << reloadTime << endl; 124 124 // Fireing is only possible if this weapon mode is not reloading and there is enough munition 125 125 if (!this->bReloading_ && this->munition_ && this->munition_->takeMunition(this->munitionPerShot_, this)) … … 169 169 } 170 170 171 void WeaponMode::release(float* reloadTime) 172 {orxout() << "release wmode " << reloadTime << endl;} 171 bool WeaponMode::release(float* reloadTime) 172 { 173 orxout() << "release wm " << reloadTime << endl; 174 return false; 175 } 173 176 174 177 bool WeaponMode::reload() -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.h
r11164 r11166 58 58 59 59 virtual bool fire(float* reloadTime); 60 virtual voidrelease(float* reloadTime);60 virtual bool release(float* reloadTime); 61 61 bool reload(); 62 62 -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponPack.cc
r11164 r11166 76 76 void WeaponPack::fire(unsigned int weaponmode) 77 77 { 78 orxout() << "fire wp " << weaponmode << endl; 78 79 for (Weapon* weapon : this->weapons_) 79 80 weapon->fire(weaponmode); … … 82 83 void WeaponPack::release(unsigned int weaponmode) 83 84 { 85 orxout() << "release wp " << weaponmode << endl; 84 86 for (Weapon* weapon : this->weapons_) 85 87 weapon->release(weaponmode); 86 orxout() << "release wpack " << weaponmode << endl;87 88 } 88 89 -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSet.cc
r11164 r11166 63 63 { 64 64 // Fire all WeaponPacks with their defined weaponmode 65 orxout() << "fire wset " << endl; 65 66 for (const auto& mapEntry : this->weaponpacks_) 66 67 if (mapEntry.second != WeaponSystem::WEAPON_MODE_UNASSIGNED) … … 70 71 void WeaponSet::release() 71 72 { 72 73 73 // Fire all WeaponPacks with their defined weaponmode 74 orxout() << "release wset " << endl; 74 75 for (const auto& mapEntry : this->weaponpacks_) 75 76 if (mapEntry.second != WeaponSystem::WEAPON_MODE_UNASSIGNED) 76 77 mapEntry.first->release(mapEntry.second); 77 orxout() << "release wset " << endl;78 79 78 } 80 79 -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSystem.cc
r11164 r11166 289 289 void WeaponSystem::fire(unsigned int firemode) 290 290 { 291 orxout() << "fire wsys " << firemode << endl; 291 292 std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.find(firemode); 292 293 if (it != this->weaponSets_.end() && it->second) … … 296 297 void WeaponSystem::release(unsigned int firemode) 297 298 { 299 orxout() << "release wsys " << firemode << endl; 298 300 std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.find(firemode); 299 301 if (it != this->weaponSets_.end() && it->second) 300 302 it->second->release(); 301 orxout() << "release wsys " << firemode << endl;302 303 } 303 304 -
code/branches/sagerjFS16/src/orxonox/worldentities/ControllableEntity.cc
r11164 r11166 303 303 if(GameMode::isMaster()) 304 304 { 305 orxout() << "f CE IF" << firemode << endl;305 orxout() << "fire ce if " << firemode << endl; 306 306 this->fired(firemode); 307 307 } 308 308 else 309 309 { 310 orxout() << "f CE EL" << firemode << endl;310 orxout() << "fire ce else " << firemode << endl; 311 311 callMemberNetworkFunction(&ControllableEntity::fire, this->getObjectID(), 0, firemode); 312 312 } … … 317 317 if(GameMode::isMaster()) 318 318 { 319 orxout() << "r CE IF" << firemode << endl;319 orxout() << "release ce if " << firemode << endl; 320 320 this->released(firemode); 321 321 } 322 322 else 323 323 { 324 orxout() << "r CE EL" << firemode << endl;324 orxout() << "release ce else " << firemode << endl; 325 325 callMemberNetworkFunction(&ControllableEntity::fire, this->getObjectID(), 0, firemode); 326 326 } -
code/branches/sagerjFS16/src/orxonox/worldentities/pawns/Pawn.cc
r11099 r11166 430 430 void Pawn::fired(unsigned int firemode) 431 431 { 432 orxout() << "fired pawn " << firemode << endl; 432 433 if (this->weaponSystem_) 433 434 this->weaponSystem_->fire(firemode); 435 } 436 437 void Pawn::released(unsigned int firemode) 438 { 439 orxout() << "released pawn " << firemode << endl; 440 if (this->weaponSystem_) 441 this->weaponSystem_->release(firemode); 434 442 } 435 443 -
code/branches/sagerjFS16/src/orxonox/worldentities/pawns/Pawn.h
r11071 r11166 158 158 159 159 virtual void fired(unsigned int firemode) override; 160 virtual void released(unsigned int firemode) override; 160 161 virtual void postSpawn(); 161 162
Note: See TracChangeset
for help on using the changeset viewer.