Changeset 7617
- Timestamp:
- Nov 5, 2010, 5:58:01 PM (14 years ago)
- Location:
- code/branches/lastmanstanding
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/lastmanstanding/data/levels/gametype_lastmanstanding.oxw
r7605 r7617 66 66 <!-- ---------------asteroid dome----------------- --> 67 67 <?lua 68 max = 1 769 for i = 1, max, 168 max = 16 69 for i = 0, max, 1 70 70 do 71 71 y = math.sin(i/max*6)*750 72 72 z = math.cos(i/max*6)*750 73 j = 1 73 74 ?> 74 <?lua75 for k = 1, 17, 176 do77 j = math.random()78 ?>79 75 80 76 <SpawnPoint team=0 position="<?lua print(y*1.4+z*0.2) ?>,0,<?lua print(z*1.4-y*0.2) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /> … … 142 138 143 139 144 <?lua145 end146 ?>147 140 <?lua end ?> 148 141 -
code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.cc
r7605 r7617 48 48 this->timeRemaining=15.0f; 49 49 this->respawnDelay=4.0f; 50 this-> noPunishment=false;51 this-> hardPunishment=false;50 this->bNoPunishment=false; 51 this->bHardPunishment=false; 52 52 this->punishDamageRate=0.4f; 53 53 this->setHUDTemplate("LastmanstandingHUD"); … … 63 63 { 64 64 this->spawnPlayer(it->first); 65 }66 else if ((!inGame_[it->first])&&(0<playerLives_[it->first]))67 {68 if (it->first->getClientID()== CLIENTID_UNKNOWN)69 continue;70 const std::string& message = "Respawn in " +multi_cast<std::string>(respawnDelay)+ " seconds." ;71 this->gtinfo_->sendFadingMessage(message,it->first->getClientID());72 65 } 73 66 else if (0>=playerLives_[it->first]) … … 87 80 SetConfigValue(timeRemaining, 15.0f); 88 81 SetConfigValue(respawnDelay, 4.0f); 89 SetConfigValue( noPunishment, false);90 SetConfigValue( hardPunishment, false);82 SetConfigValue(bNoPunishment, false); 83 SetConfigValue(bHardPunishment, false); 91 84 } 92 85 … … 102 95 if (it->first->getClientID()== CLIENTID_UNKNOWN) 103 96 return true; 104 const std::string& message = ""; // set blank - erases Camper-Warning-message97 const std::string& message = ""; // resets Camper-Warning-message 105 98 this->gtinfo_->sendFadingMessage(message,it->first->getClientID()); 106 99 } … … 243 236 if(!player) 244 237 return; 245 if( noPunishment)238 if(bNoPunishment) 246 239 return; 247 240 std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player); … … 253 246 if(!pawn) 254 247 return; 255 if( hardPunishment)248 if(bHardPunishment) 256 249 { 257 250 pawn->kill(); 258 251 this->timeToAct_[player]=timeRemaining+3.0f+respawnDelay;//reset timer 259 252 } 260 /*else261 { 262 float damage=pawn->getMaxHealth()*punishDamageRate*0.5; 253 else 254 { 255 float damage=pawn->getMaxHealth()*punishDamageRate*0.5;//TODO: Factor 0.5 is hard coded. Where is the ratio between MaxHealth actually defined? 263 256 pawn->removeHealth(damage); 264 257 this->timeToAct_[player]=timeRemaining;//reset timer 265 } */258 } 266 259 } 267 260 } … … 297 290 it->second=timeRemaining+3.0f;//reset punishment-timer 298 291 if (playerGetLives(it->first)>0) 292 { 299 293 this->punishPlayer(it->first); 294 if (it->first->getClientID()== CLIENTID_UNKNOWN) 295 return; 296 const std::string& message = ""; // resets Camper-Warning-message 297 this->gtinfo_->sendFadingMessage(message,it->first->getClientID()); 298 } 300 299 } 301 300 else if (it->second<timeRemaining/5)//Warning message -
code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.h
r7605 r7617 55 55 float timeRemaining; //!< Each player has a certain time where he or she has to hit an opponent or will be punished. 56 56 std::map<PlayerInfo*, float> timeToAct_; //!< Each player's time till she/he will be punished is stored here. 57 float respawnDelay; 57 float respawnDelay; //!<Time in seconds when a player will respawn after death. 58 58 std::map<PlayerInfo*, float> playerDelayTime_; //!< Stores each Player's delay time. 59 59 std::map<PlayerInfo*, bool> inGame_; //!< Indicates each Player's state. 60 bool noPunishment;61 bool hardPunishment;62 float punishDamageRate; 60 bool bNoPunishment; //!< Config value to switch off Punishment function if it is set to true. 61 bool bHardPunishment; //!< Switches between damage and death as punishment. 62 float punishDamageRate; //!< Makes Damage adjustable. 63 63 virtual void spawnDeadPlayersIfRequested(); //!< Prevents dead players to respawn. 64 64 virtual int getMinLives(); //!< Returns minimum of each player's lives; players with 0 lives are skipped;
Note: See TracChangeset
for help on using the changeset viewer.