- Timestamp:
- Jun 10, 2012, 5:13:00 PM (12 years ago)
- Location:
- code/branches/presentation2012merge
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012merge
- Property svn:mergeinfo changed
/code/branches/pCuts (added) merged: 9023-9024,9027,9081-9092
- Property svn:mergeinfo changed
-
code/branches/presentation2012merge/src/orxonox/gametypes/Dynamicmatch.cc
r9279 r9286 31 31 //Low; Codeoptimierung und Dokumentation 32 32 33 /* 34 short gaming manual: 35 There are three different parties a player can belong to: victim, chaser or killer 36 Every player starts as chaser. As long as there are not enough victims and killers, you can change your and other player's parties by shooting them. 37 In order to win you have to earn as much points as possible: 38 - as victim by escaping the chasers 39 - as chaser by shooting the victim 40 - as killer by killing the chasers 41 42 43 What you shouldn't do is shooting at players of your own party. By doing so your score will decrease. 44 P.S: If you don't want to be a victim: Get rid of your part by shooting a chaser. 33 /** 34 @brief 35 Short Gaming Manual: 36 There are three different parties a player can belong to: victim, chaser or killer 37 Every player starts as chaser. As long as there are not enough victims and killers, you can change your and other player's parties by shooting them. 38 In order to win you have to earn as much points as possible: 39 - as victim by escaping the chasers 40 - as chaser by shooting the victim 41 - as killer by killing the chasers 42 43 44 What you shouldn't do is shooting at players of your own party. By doing so your score will decrease. 45 P.S: If you don't want to be a victim: Get rid of your part by shooting a chaser. 45 46 */ 46 47 #include "Dynamicmatch.h" … … 95 96 ColourValue(0.3f, 0.3f, 1.0f), //piggycolour 96 97 ColourValue(0.3f, 1.0f, 0.3f) //killercolour what about black: 0.0f, 0.0f, 0.0f 97 98 98 }; 99 99 static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue)); … … 111 111 if (victim && victim->getPlayer()) //&& originator && originator->getPlayer() ?? 112 112 { 113 int target= playerParty_[victim->getPlayer()];114 int source= playerParty_[originator->getPlayer()];113 int target = playerParty_[victim->getPlayer()]; 114 int source = playerParty_[originator->getPlayer()]; 115 115 116 116 //Case: Not Enough Pigs: party change (= party management) … … 309 309 /** 310 310 @brief 311 Grant the piggya boost.311 Grant the victim a boost. 312 312 @param spaceship 313 313 The SpaceShip to give the boost. … … 315 315 void Dynamicmatch::grantPigBoost(SpaceShip* spaceship) 316 316 { 317 // Give pigboost317 // Give victim boost 318 318 if (spaceship) 319 319 { … … 374 374 375 375 if (this->hasStarted() && !gameEnded_) 376 { pointsPerTime =pointsPerTime + dt; 377 gameTime_ = gameTime_ - dt; 378 if (pointsPerTime > 2.0f)//hard coded!! should be changed 379 { 380 pointsPerTime=0.0f; 376 { 377 orxout() << " number of chasers: " << numberOf[chaser] << endl; 378 orxout() << " number of killers: " << numberOf[killer] << endl; 379 orxout() << " number of victims: " << numberOf[piggy] << endl; 380 pointsPerTime = pointsPerTime + dt; //increase points 381 gameTime_ = gameTime_ - dt; // decrease game time 382 if (pointsPerTime > 2.0f) //hard coded points for victim! should be changed 383 { 384 pointsPerTime = 0.0f; 381 385 rewardPig(); 382 386 } … … 408 412 } 409 413 414 /** 415 @brief The reward function is called every 2 seconds via the tick function and makes the victim score points. 416 */ 410 417 void Dynamicmatch::rewardPig() 411 418 { … … 415 422 { 416 423 //Spieler mit der Pig-party frags++ 417 std::map<PlayerInfo*, Player>::iterator it2 = this->players_.find(it->first); // still not sure if right syntax424 std::map<PlayerInfo*, Player>::iterator it2 = this->players_.find(it->first); 418 425 if (it2 != this->players_.end()) 419 426 {
Note: See TracChangeset
for help on using the changeset viewer.