Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 10, 2012, 5:13:00 PM (12 years ago)
Author:
jo
Message:

Merged pCuts branch.

Location:
code/branches/presentation2012merge
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2012merge

  • code/branches/presentation2012merge/src/orxonox/gametypes/Dynamicmatch.cc

    r9279 r9286  
    3131//Low; Codeoptimierung und Dokumentation
    3232
    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.
    4546*/
    4647#include "Dynamicmatch.h"
     
    9596            ColourValue(0.3f, 0.3f, 1.0f),  //piggycolour
    9697            ColourValue(0.3f, 1.0f, 0.3f)   //killercolour  what about black: 0.0f, 0.0f, 0.0f
    97 
    9898        };
    9999        static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
     
    111111        if (victim && victim->getPlayer()) //&& originator && originator->getPlayer() ??
    112112        {
    113         int target= playerParty_[victim->getPlayer()];
    114         int source= playerParty_[originator->getPlayer()];
     113            int target = playerParty_[victim->getPlayer()];
     114            int source = playerParty_[originator->getPlayer()];
    115115
    116116            //Case: Not Enough Pigs: party change (= party management)
     
    309309    /**
    310310    @brief
    311         Grant the piggy a boost.
     311        Grant the victim a boost.
    312312    @param spaceship
    313313        The SpaceShip to give the boost.
     
    315315    void Dynamicmatch::grantPigBoost(SpaceShip* spaceship)
    316316    {
    317         // Give pig boost
     317        // Give victim boost
    318318        if (spaceship)
    319319        {
     
    374374
    375375        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        {
     377orxout() << " number of chasers:  " << numberOf[chaser] << endl;
     378orxout() << " number of killers:  " << numberOf[killer] << endl;
     379orxout() << " 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;
    381385                rewardPig();
    382386            }
     
    408412    }
    409413
     414/**
     415    @brief The reward function is called every 2 seconds via the tick function and makes the victim score points.
     416*/
    410417    void Dynamicmatch::rewardPig()
    411418    {
     
    415422            {
    416423                 //Spieler mit der Pig-party frags++
    417                  std::map<PlayerInfo*, Player>::iterator it2 = this->players_.find(it->first);// still not sure if right syntax
     424                 std::map<PlayerInfo*, Player>::iterator it2 = this->players_.find(it->first);
    418425                 if (it2 != this->players_.end())
    419426                 {
Note: See TracChangeset for help on using the changeset viewer.