Changeset 7640 for code/branches/lastmanstanding/src
- Timestamp:
- Nov 11, 2010, 5:06:23 PM (14 years ago)
- Location:
- code/branches/lastmanstanding/src/orxonox/gametypes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.cc
r7636 r7640 64 64 this->spawnPlayer(it->first); 65 65 } 66 else if (0>=playerLives_[it->first])67 {68 if (it->first->getClientID()== CLIENTID_UNKNOWN)69 continue;70 const std::string& message2 = "You have lost all " +multi_cast<std::string>(lives)+ " lives." ;71 this->gtinfo_->sendFadingMessage(message2,it->first->getClientID());72 }73 66 } 74 67 } … … 115 108 Host::Broadcast(message); 116 109 } 110 117 111 return true; 118 112 } … … 173 167 this->playerDelayTime_[player]=respawnDelay; 174 168 this->inGame_[player]=true; 175 //Update: EachPlayer's "Players in Game"-HUD176 for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)177 {178 if (it->first->getClientID() == CLIENTID_UNKNOWN)179 continue;180 const std::string& message1 = "Remaining Players: "+ multi_cast<std::string>(playersAlive);181 this->gtinfo_->sendStaticMessage(message1,it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));182 }183 169 } 184 170 … … 192 178 this->playerDelayTime_.erase (player); 193 179 this->inGame_.erase (player); 194 //Update: EachPlayer's "Players in Game"-HUD195 for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)196 {197 if (it->first->getClientID() == CLIENTID_UNKNOWN)198 continue;199 const std::string& message1 = "Remaining Players: "+ multi_cast<std::string>(playersAlive);200 this->gtinfo_->sendStaticMessage(message1,it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));201 }202 180 } 203 181 … … 211 189 this->timeToAct_[player]=timeRemaining+3.0f+respawnDelay;//reset timer 212 190 this->playerDelayTime_[player]=respawnDelay; 213 //Update: Individual Players "lifes"-HUD214 std::map<PlayerInfo*, Player>::iterator it 2= this->players_.find(player);215 if (it 2!= this->players_.end())216 { 217 if (it 2->first->getClientID()== CLIENTID_UNKNOWN)191 192 std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player); 193 if (it != this->players_.end()) 194 { 195 if (it->first->getClientID()== CLIENTID_UNKNOWN) 218 196 return; 219 const std::string& message = "Your Lives: " +multi_cast<std::string>(playerLives_[player]); 220 this->gtinfo_->sendFadingMessage(message,it2->first->getClientID()); 221 const std::string& message1 = "Remaining Players: "+ multi_cast<std::string>(playersAlive); 222 this->gtinfo_->sendStaticMessage(message1,it2->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f)); 223 } 224 } 225 226 void LastManStanding::playerStopsControllingPawn(PlayerInfo* player, Pawn* pawn) 227 { 228 //Update: EachPlayer's "Players in Game"-HUD 229 for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it) 230 { 231 if (it->first->getClientID() == CLIENTID_UNKNOWN) 232 continue; 233 const std::string& message1 = "Remaining Players: "+ multi_cast<std::string>(playersAlive); 234 this->gtinfo_->sendStaticMessage(message1,it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f)); 235 } 197 const std::string& message = ""; // resets Camper-Warning-message 198 this->gtinfo_->sendFadingMessage(message,it->first->getClientID()); 199 } 236 200 } 237 201 -
code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.h
r7636 r7640 75 75 int playerGetLives(PlayerInfo* player); //!< getFunction for the map "playerLives_". 76 76 int getNumPlayersAlive() const; //!< Returns the number of players that are still alive. 77 virtual void playerEntered(PlayerInfo* player); //!< Initializes values. Manages the gametype's HUD. #Players alive via StaticMessage. 78 virtual bool playerLeft(PlayerInfo* player); //!< Manages the gametype's HUD. #Players alive via StaticMessage. 79 virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn); //!< Manages the gametype's HUD. player's lives via FadingMessage. 80 virtual void playerStopsControllingPawn(PlayerInfo* player, Pawn* pawn); //!< Manages the gametype's HUD. #Players alive via StaticMessage. 77 virtual void playerEntered(PlayerInfo* player); //!< Initializes values. 78 virtual bool playerLeft(PlayerInfo* player); //!< Manages all local variables. 79 virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn); //!< Resets punishment time and respawn delay. 81 80 82 81 void punishPlayer(PlayerInfo* player); //!< Function in order to kill a player. Punishment for hiding longer than "timeRemaining".
Note: See TracChangeset
for help on using the changeset viewer.