Changeset 6692
- Timestamp:
- Apr 12, 2010, 4:00:30 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/dynamicmatch/src/orxonox/gametypes/Dynamicmatch.cc
r6686 r6692 36 36 #include "core/ConfigValueIncludes.h" 37 37 #include "interfaces/TeamColourable.h" 38 39 //t oDO: maybe the has entered the game function is not enough... look at TeamDeathmath38 //#include "Engine.h" 39 //timer mit new erstellen 40 40 namespace orxonox 41 41 { … … 58 58 { 59 59 std::map<PlayerInfo*, int>::const_iterator it_player = this->playerParty_.find(player); 60 //if (it_player != this->playerParty_.end() && it_player->second >= 0 && it_player->second < static_cast<int>(this->partyColours_.size()))61 // all players are the same colour at the beginning!!62 60 Pawn* pawn = dynamic_cast<Pawn*>(player->getControllableEntity()); 63 61 if (pawn) … … 100 98 } 101 99 102 bool Dynamicmatch::allowPawnDamage(Pawn* victim, Pawn* originator)// 100 bool Dynamicmatch::allowPawnDamage(Pawn* victim, Pawn* originator)//tested - works fine 103 101 { 104 102 105 103 if (victim && victim->getPlayer()) 106 { //TODO: evtl. ->getPlayer() zugriffe auslagern fuer mehr uebersicht107 //Case : 1. onlyChasers==false und victim istchaser108 if ((!onlyChasers)&&(playerParty_[originator->getPlayer()]==chaser) ) {104 { 105 //Case 1: a chaser hits piggy // BUG: playerParty_[originator->getPlayer()]==chaser) is true even if victim is a chaser 106 if ((!onlyChasers)&&(playerParty_[originator->getPlayer()]==chaser)&&playerParty_[victim->getPlayer()]==piggy) { 109 107 std::map<PlayerInfo*, Player>::iterator it = this->players_.find(originator->getPlayer()); 110 108 if (it != this->players_.end()) … … 113 111 } 114 112 } 115 //Case 2: onlyChasers==false und victim ist piggy113 //Case 2: piggy hits chaser 116 114 else if ((!onlyChasers)&&(playerParty_[originator->getPlayer()]==piggy)){ 117 115 //partyswitch: victim bcomes piggy and the orginator(piggy) becomes chaser … … 133 131 onlyChasers=false; 134 132 setPlayerColour(victim->getPlayer()); //victim colour 133 //victim - Boost ueber setBoostFactor(float factor) //vermutlich muss victim gecastet werden 134 // timer aufrufen - nach 5 Sekunden wieder auf normalgeschwindigkeit setzen 135 135 std::string message("First victim."); 136 136 COUT(0) << message << std::endl; … … 188 188 189 189 190 void Dynamicmatch::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn) 190 void Dynamicmatch::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn) //set party + colouring 191 191 { 192 192 if (!player) … … 195 195 // Set the playercolour 196 196 Dynamicmatch::setPlayerColour(player); 197 198 199 } 200 201 void Dynamicmatch::playerEntered(PlayerInfo* player) //standardfunction + party + colouring 197 } 198 199 void Dynamicmatch::playerEntered(PlayerInfo* player) //standardfunction 202 200 { 203 201 … … 206 204 207 205 Gametype::playerEntered(player); 208 209 //playerParty_[player]=chaser;//playerparty210 211 // Set the playercolour212 //Dynamicmatch::setPlayerColour(player);213 214 206 215 207 const std::string& message = player->getName() + " entered the game";
Note: See TracChangeset
for help on using the changeset viewer.