Changeset 7897 for code/branches/lastmanstanding2/src/orxonox
- Timestamp:
- Feb 15, 2011, 12:15:43 AM (14 years ago)
- Location:
- code/branches/lastmanstanding2/src/orxonox/gametypes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/lastmanstanding2/src/orxonox/gametypes/LastTeamStanding.cc
r7893 r7897 46 46 this->bForceSpawn_ = true; 47 47 this->lives = 1;//4 48 //this->eachTeamsPlayers.reserve(teams_);48 this->eachTeamsPlayers.resize(teams_,0); 49 49 this->teamsAlive = 0; 50 50 this->bMinTeamsReached = false; … … 59 59 { 60 60 this->playerLives_.clear(); 61 //this->eachTeamsPlayers.clear();61 this->eachTeamsPlayers.clear(); 62 62 this->timeToAct_.clear(); 63 this->inGame_.clear(); 63 64 this->playerDelayTime_.clear(); 64 this->inGame_.clear();65 65 } 66 66 … … 75 75 playerLives_[player]=getMinLives();//new players only get minimum of lives */ 76 76 77 //if(this->eachTeamsPlayers[getTeam(player)]==0) //if a player is the first in his group, a new team is alive78 //this->teamsAlive++;79 //this->eachTeamsPlayers[getTeam(player)]++; //the number of player in this team is increased77 if(this->eachTeamsPlayers[getTeam(player)]==0) //if a player is the first in his group, a new team is alive 78 this->teamsAlive++; 79 this->eachTeamsPlayers[getTeam(player)]++; //the number of player in this team is increased 80 80 81 81 if (teamsAlive>1) // Now the game is allowed to end, since there are at least two teams. … … 91 91 if (valid_player) 92 92 { 93 //this->eachTeamsPlayers[getTeam(player)]--; // a player left the team94 //if(this->eachTeamsPlayers[getTeam(player)] == 0) // if it was the last player a team died95 //this->teamsAlive--;93 this->eachTeamsPlayers[getTeam(player)]--; // a player left the team 94 if(this->eachTeamsPlayers[getTeam(player)] == 0) // if it was the last player a team died 95 this->teamsAlive--; 96 96 this->playerLives_.erase(player); 97 //this->eachTeamsPlayers.clear();98 97 this->timeToAct_.erase(player); 99 98 this->playerDelayTime_.erase(player); … … 115 114 if (playerLives_[victim->getPlayer()]<=0) //if player lost all lives 116 115 { 117 //this->eachTeamsPlayers[getTeam(victim->getPlayer())]--;118 //if(eachTeamsPlayers[getTeam(victim->getPlayer())] == 0) //last team member died116 this->eachTeamsPlayers[getTeam(victim->getPlayer())]--; 117 if(eachTeamsPlayers[getTeam(victim->getPlayer())] == 0) //last team member died 119 118 this->teamsAlive--; 120 119 const std::string& message = victim->getPlayer()->getName() + " has lost all lives"; … … 166 165 167 166 this->timeToAct_[player] = timeRemaining + 3.0f + respawnDelay;//reset timer 168 //this->playerDelayTime_[player] = respawnDelay;167 this->playerDelayTime_[player] = respawnDelay; 169 168 170 169 std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player); -
code/branches/lastmanstanding2/src/orxonox/gametypes/LastTeamStanding.h
r7893 r7897 54 54 int lives; //!< Standard amount of lives. Each player starts a game with so many lives. 55 55 std::map< PlayerInfo*, int > playerLives_; //!< Each player's lives are stored here. 56 //std::vector<int> eachTeamsPlayers; //!<Number of players in each team. !!!!!!!!!!!!!!56 std::vector<int> eachTeamsPlayers; //!<Number of players in each team. 57 57 int teamsAlive; //!< Counter counting teams with more than one player remaining. 58 58 //Data for CamperPunishment
Note: See TracChangeset
for help on using the changeset viewer.