- Timestamp:
- Nov 30, 2011, 4:09:25 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/formation/src/orxonox/controllers/HumanController.cc
r8948 r8953 51 51 SetConsoleCommand("HumanController", "rotateRoll", &HumanController::rotateRoll ).addShortcut().setAsInputCommand(); 52 52 SetConsoleCommand("HumanController", "toggleFormationFlight", &HumanController::toggleFormationFlight).addShortcut().keybindMode(KeybindMode::OnPress); 53 SetConsoleCommand("HumanController", "FFChangeMode", &HumanController::FFChangeMode).addShortcut().keybindMode(KeybindMode::OnPress); 53 54 SetConsoleCommand("HumanController", __CC_fire_name, &HumanController::fire ).addShortcut().keybindMode(KeybindMode::OnHold); 54 55 SetConsoleCommand("HumanController", "reload", &HumanController::reload ).addShortcut(); … … 105 106 if (HumanController::localController_s && HumanController::localController_s->state_==MASTER) 106 107 { 107 HumanController::localController_s->commandSlaves(); 108 if (HumanController::localController_s->mode_!=ATTACK) 109 HumanController::localController_s->commandSlaves(); 108 110 } 109 111 } … … 274 276 } 275 277 278 /** 279 @brief 280 toggle the formation. Not usable, if formationflight is disabled generally (formationFlight_) 281 */ 276 282 void HumanController::toggleFormationFlight() 277 283 { 278 279 if (HumanController::localController_s) 280 { 284 if (HumanController::localController_s) 285 { 286 if (!HumanController::localController_s->formationFlight_) 287 { 288 return; //dont use when formationFlight is disabled 289 } 281 290 if (HumanController::localController_s->state_==MASTER) 282 291 { 283 HumanController::localController_s->freeSlaves(); 284 HumanController::localController_s->state_=FREE; 292 HumanController::localController_s->loseMasterState(); 285 293 orxout(message) <<"FormationFlight disabled "<< endl; 286 294 } else //SLAVE or FREE … … 294 302 } 295 303 304 /** 305 @brief 306 Switch through the different Modes of formationflight. You must be a master of a formation to use. 307 */ 308 void HumanController::FFChangeMode() 309 { 310 if (HumanController::localController_s && HumanController::localController_s->state_==MASTER) 311 { 312 switch (HumanController::localController_s->getMode()) { 313 case NORMAL: 314 HumanController::localController_s->setMode(DEFEND); 315 orxout(message) <<"Mode: DEFEND "<< endl; 316 break; 317 case DEFEND: 318 HumanController::localController_s->setMode(ATTACK); 319 orxout(message) <<"Mode: ATTACK "<< endl; 320 break; 321 case ATTACK: 322 HumanController::localController_s->setMode(NORMAL); 323 orxout(message) <<"Mode: NORMAL "<< endl; 324 break; 325 } 326 changedMode(); 327 } 328 } 329 330 void HumanController::changedMode() 331 { 332 333 } 334 296 335 void HumanController::addBots(unsigned int amount) 297 336 {
Note: See TracChangeset
for help on using the changeset viewer.