Changeset 7640 for code/branches/lastmanstanding
- Timestamp:
- Nov 11, 2010, 5:06:23 PM (14 years ago)
- Location:
- code/branches/lastmanstanding
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/lastmanstanding/data/levels/gametype_dynamicmatch.oxw
r7163 r7640 68 68 <?lua 69 69 max = 20 70 for i = 1, max, 170 for i = 0, max, 1 71 71 do 72 72 y = math.sin(i/max*6)*4000 73 73 z = math.cos(i/max*6)*5000 74 x = i*10074 x = 0 75 75 ?> 76 76 <?lua -
code/branches/lastmanstanding/data/overlays/lastmanstandinghud.oxo
r7637 r7640 2 2 <OverlayGroup name="DynamicmatcHUD" scale = "1, 1"> 3 3 4 < GametypeStaticMessage4 <!--GametypeStaticMessage 5 5 name = "staticmessage" 6 6 position = "0.5, 0.01" … … 10 10 colour = "1.0, 1.0, 0.5, 1.0" 11 11 align = "center" 12 / >12 /--> 13 13 14 14 <GametypeFadingMessage 15 15 name = "fadingmessage" 16 position = "0.5, 0.0 5"16 position = "0.5, 0.01" 17 17 font = "VeraMono" 18 18 textsize = 0.04 19 19 colour = "1.0, 1.0, 0.5, 1.0" 20 20 align = "center" 21 />22 <LastManStandingInfos23 position = "0.63, 0.05"24 pickpoint = "0.0, 0.0"25 font = "ShareTechMono"26 textsize = 0.0427 colour = "0.8, 0.8, 1.0, 1.0"28 align = "right"29 30 showlives = true31 showplayers = false32 21 /> 33 22 … … 42 31 /> 43 32 33 <LastManStandingInfos 34 position = "0.15, 0.02" 35 pickpoint = "0.0, 0.0" 36 font = "ShareTechMono" 37 textsize = 0.04 38 colour = "1.0, 1.0, 1.0, 1.0" 39 align = "left" 40 41 showlives = true 42 showplayers = false 43 /> 44 44 45 <OverlayText 45 46 position = "0.02, 0.055" … … 50 51 align = "left" 51 52 caption = "Players: " 53 /> 54 55 <LastManStandingInfos 56 position = "0.15, 0.055" 57 pickpoint = "0.0, 0.0" 58 font = "ShareTechMono" 59 textsize = 0.04 60 colour = "1.0, 1.0, 1.0, 1.0" 61 align = "left" 62 63 showlives = false 64 showplayers = true 52 65 /> 53 66 -
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.