Changeset 6356 for code/branches/presentation2
- Timestamp:
- Dec 15, 2009, 11:04:39 PM (15 years ago)
- Location:
- code/branches/presentation2/src/orxonox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/controllers/Controller.cc
r6108 r6356 41 41 this->player_ = 0; 42 42 this->controllableEntity_ = 0; 43 this->bGodMode_ = false; 43 44 } 44 45 -
code/branches/presentation2/src/orxonox/controllers/Controller.h
r6295 r6356 51 51 52 52 virtual inline void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) {}; 53 54 void setGodMode( bool mode ){ this->bGodMode_ = mode; } 55 bool getGodMode(){ return this->bGodMode_; } 53 56 54 57 inline ControllableEntity* getControllableEntity() const … … 70 73 PlayerInfo* player_; 71 74 ControllableEntity* controllableEntity_; 75 private: 76 bool bGodMode_; 72 77 }; 73 78 } -
code/branches/presentation2/src/orxonox/controllers/HumanController.cc
r6195 r6356 54 54 SetConsoleCommand(HumanController, mouseLook, true); 55 55 SetConsoleCommand(HumanController, suicide, true); 56 SetConsoleCommand(HumanController, toggleGodMode, true); 56 57 SetConsoleCommand(HumanController, addBots, true).defaultValues(1); 57 58 SetConsoleCommand(HumanController, killBots, true).defaultValues(0); … … 209 210 } 210 211 212 void HumanController::toggleGodMode() 213 { 214 HumanController::getLocalControllerSingleton()->setGodMode( !HumanController::getLocalControllerSingleton()->getGodMode() ); 215 } 216 211 217 void HumanController::useItem() 212 218 { -
code/branches/presentation2/src/orxonox/controllers/HumanController.h
r6199 r6356 74 74 75 75 static void suicide(); 76 static void toggleGodMode(); 76 77 77 78 static void addBots(unsigned int amount); -
code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.cc
r6295 r6356 168 168 void Pawn::hit(Pawn* originator, const Vector3& force, float damage) 169 169 { 170 if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) )170 if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) ) 171 171 { 172 172 this->damage(damage, originator); … … 179 179 void Pawn::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) 180 180 { 181 if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) )181 if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) ) 182 182 { 183 183 this->damage(damage, originator);
Note: See TracChangeset
for help on using the changeset viewer.