Changeset 7699 for code/branches/lastmanstanding2
- Timestamp:
- Dec 2, 2010, 11:26:05 PM (14 years ago)
- Location:
- code/branches/lastmanstanding2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/lastmanstanding2/data/overlays/lastTeamStandingHUD.oxo
r7697 r7699 1 1 <Template name="LastteamstandingHUD"> 2 <OverlayGroup name=" DynamicmatcHUD" scale = "1, 1">2 <OverlayGroup name="LastteamstandingHUD" scale = "1, 1"> 3 3 4 4 <GametypeFadingMessage … … 30 30 31 31 showlives = true 32 show players = false32 showteams = false 33 33 /> 34 34 … … 40 40 colour = "1.0, 1.0, 1.0, 1.0" 41 41 align = "left" 42 caption = " Players: "42 caption = "Teams: " 43 43 /> 44 44 … … 52 52 53 53 showlives = false 54 show players = true54 showteams = true 55 55 /> 56 56 -
code/branches/lastmanstanding2/src/orxonox/gametypes/LastTeamStanding.cc
r7697 r7699 52 52 this->bHardPunishment=false; 53 53 this->punishDamageRate=0.4f; 54 this->setHUDTemplate("LastTeamStandingHUD"); 54 this->setHUDTemplate("LastTeamStandingHUD");//tolowercase:-) 55 55 this->eachTeamsPlayers = new int[teams_]; 56 this->bMinPlayersReached = false; 56 57 } 57 58 58 voidLastTeamStanding::~LastTeamStanding()59 LastTeamStanding::~LastTeamStanding() 59 60 { 60 61 delete[] this->eachTeamsPlayers; … … 138 139 } 139 140 140 void LastTeamStanding::end() 141 void LastTeamStanding::end()//TODO! 141 142 { 142 143 Gametype::end(); … … 171 172 if (!player)// only for safety 172 173 return; 173 Deathmatch::playerEntered(player);174 TeamDeathmatch::playerEntered(player); 174 175 if (teamsAlive<=1) 175 176 playerLives_[player]=lives; … … 180 181 this->teamsAlive++; 181 182 this->eachTeamsPlayers[getTeam(player)]++; 182 183 if (teamsAlive>1) // Now the game is allowed to end, since there are at least two teams. 184 bMinPlayersReached=true; 183 185 this->timeToAct_[player]=timeRemaining; 184 186 this->playerDelayTime_[player]=respawnDelay; … … 188 190 bool LastTeamStanding::playerLeft(PlayerInfo* player) 189 191 { 190 bool valid_player = Deathmatch::playerLeft(player);192 bool valid_player = TeamDeathmatch::playerLeft(player); 191 193 if (valid_player) 192 194 { … … 255 257 if(this->hasStarted()&&(!this->hasEnded())) 256 258 { 257 if ( (this->hasStarted()&&(teamsAlive<=1)))//last team remaining259 if (bMinPlayersReached &&(this->hasStarted()&&(teamsAlive<=1)))//last team remaining 258 260 { 259 261 this->end(); -
code/branches/lastmanstanding2/src/orxonox/gametypes/LastTeamStanding.h
r7697 r7699 35 35 36 36 #include "OrxonoxPrereqs.h" 37 #include " Deathmatch.h"37 #include "TeamDeathmatch.h" 38 38 #include <map> 39 39 #include <vector> 40 41 //TODO: Hud doesn load; problem with destructor; teams are not assigned properly; 40 42 41 43 namespace orxonox … … 63 65 virtual void spawnDeadPlayersIfRequested(); //!< Prevents dead players to respawn. 64 66 virtual int getMinLives(); //!< Returns minimum of each player's lives; players with 0 lives are skipped; 65 unsigned int * eachTeamsPlayers; //!<Each teams player's alive. 67 int * eachTeamsPlayers; //!<Each teams player's alive. 68 bool bMinPlayersReached; 66 69 67 70 public:
Note: See TracChangeset
for help on using the changeset viewer.