- Timestamp:
- Dec 16, 2008, 6:01:13 PM (16 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
-
code/branches/presentation/src/orxonox/objects/controllers/HumanController.cc
r2087 r2485 33 33 #include "core/ConsoleCommand.h" 34 34 #include "objects/worldentities/ControllableEntity.h" 35 #include "objects/worldentities/pawns/Pawn.h" 36 #include "objects/gametypes/Gametype.h" 35 37 36 38 namespace orxonox … … 44 46 SetConsoleCommand(HumanController, fire, true).keybindMode(KeybindMode::OnHold); 45 47 SetConsoleCommand(HumanController, altFire, true).keybindMode(KeybindMode::OnHold); 48 SetConsoleCommand(HumanController, boost, true).keybindMode(KeybindMode::OnHold); 46 49 SetConsoleCommand(HumanController, greet, true); 47 50 SetConsoleCommand(HumanController, use, true); 48 51 SetConsoleCommand(HumanController, switchCamera, true); 52 SetConsoleCommand(HumanController, mouseLook, true); 53 SetConsoleCommand(HumanController, suicide, true); 54 SetConsoleCommand(HumanController, addBots, true).defaultValues(1); 55 SetConsoleCommand(HumanController, killBots, true).defaultValues(0); 49 56 50 57 CreateUnloadableFactory(HumanController); … … 112 119 } 113 120 121 void HumanController::boost() 122 { 123 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 124 HumanController::localController_s->controllableEntity_->boost(); 125 } 126 114 127 void HumanController::greet() 115 128 { … … 129 142 HumanController::localController_s->controllableEntity_->switchCamera(); 130 143 } 144 145 void HumanController::mouseLook() 146 { 147 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 148 HumanController::localController_s->controllableEntity_->mouseLook(); 149 } 150 151 void HumanController::suicide() 152 { 153 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 154 { 155 Pawn* pawn = dynamic_cast<Pawn*>(HumanController::localController_s->controllableEntity_); 156 if (pawn) 157 pawn->kill(); 158 } 159 } 160 161 void HumanController::addBots(unsigned int amount) 162 { 163 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && HumanController::localController_s->controllableEntity_->getGametype()) 164 HumanController::localController_s->controllableEntity_->getGametype()->addBots(amount); 165 } 166 167 void HumanController::killBots(unsigned int amount) 168 { 169 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && HumanController::localController_s->controllableEntity_->getGametype()) 170 HumanController::localController_s->controllableEntity_->getGametype()->killBots(amount); 171 } 131 172 }
Note: See TracChangeset
for help on using the changeset viewer.