Changeset 9733 for code/branches/levelKaan/src/orxonox/gametypes/Mission.cc
- Timestamp:
- Nov 1, 2013, 12:19:18 AM (11 years ago)
- Location:
- code/branches/levelKaan
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/levelKaan
- Property svn:mergeinfo changed
/code/trunk (added) merged: 9703,9716,9728-9730
- Property svn:mergeinfo changed
-
code/branches/levelKaan/src/orxonox/gametypes/Mission.cc
r9667 r9733 32 32 33 33 #include "core/CoreIncludes.h" 34 #include "core/command/ConsoleCommand.h" 35 #include "infos/PlayerInfo.h" 34 36 #include "network/Host.h" 35 37 #include "worldentities/pawns/Pawn.h" 36 38 39 37 40 namespace orxonox 38 41 { 42 SetConsoleCommand("Mission", "endMission", &Mission::endMission); 43 SetConsoleCommand("Mission", "setLives", &Mission::setLivesWrapper); 39 44 RegisterUnloadableClass(Mission); 40 45 … … 56 61 this->end(); 57 62 } 63 else if (this->lives_ == 0) 64 { 65 this->missionAccomplished_ = false; 66 this->end(); 67 } 58 68 } 59 69 60 70 void Mission::pawnKilled(Pawn* victim, Pawn* killer) 61 71 { 62 if (victim && victim->getPlayer() && this->lives_ == 1)72 if (victim && victim->getPlayer() && victim->getPlayer()->isHumanPlayer() ) 63 73 { 64 this->missionAccomplished_ = false; 65 this->end(); 74 this->lives_--; 66 75 } 67 76 } … … 78 87 { 79 88 Gametype::end(); 80 /*if (this->missionAccomplished_)89 if (this->missionAccomplished_) 81 90 this->gtinfo_->sendAnnounceMessage("Mission accomplished!"); 82 91 else 83 92 this->gtinfo_->sendAnnounceMessage("Mission failed!"); 84 */85 93 } 86 94 … … 94 102 } 95 103 } 96 104 void Mission::endMission(bool accomplished) 105 { 106 for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it) 107 {//TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions! 108 it->setMissionAccomplished(accomplished); 109 it->end(); 110 } 111 } 112 113 void Mission::setLivesWrapper(unsigned int amount) 114 { 115 for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it) 116 {//TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would affect ALL missions! 117 it->setLives(amount); 118 } 119 } 97 120 98 121
Note: See TracChangeset
for help on using the changeset viewer.