Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 12, 2010, 4:00:30 PM (15 years ago)
Author:
jo
Message:

some bugs removed, with friendlyfire option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/dynamicmatch/src/orxonox/gametypes/Dynamicmatch.cc

    r6686 r6692  
    3636#include "core/ConfigValueIncludes.h"
    3737#include "interfaces/TeamColourable.h"
    38 
    39 //toDO: maybe the has entered the game function is not enough... look at TeamDeathmath
     38//#include "Engine.h"
     39//timer mit new erstellen
    4040namespace orxonox
    4141{
     
    5858{
    5959        std::map<PlayerInfo*, int>::const_iterator it_player = this->playerParty_.find(player);
    60         //if (it_player != this->playerParty_.end() && it_player->second >= 0 && it_player->second < static_cast<int>(this->partyColours_.size()))
    61         // all players are the same colour at the beginning!!
    6260            Pawn* pawn = dynamic_cast<Pawn*>(player->getControllableEntity());
    6361            if (pawn)
     
    10098    }
    10199
    102 bool Dynamicmatch::allowPawnDamage(Pawn* victim, Pawn* originator)//
     100bool Dynamicmatch::allowPawnDamage(Pawn* victim, Pawn* originator)//tested - works fine
    103101    {   
    104102
    105103        if (victim && victim->getPlayer())
    106         {       //TODO: evtl. ->getPlayer() zugriffe auslagern fuer mehr uebersicht
    107                 //Case: 1. onlyChasers==false und victim ist chaser
    108                 if ((!onlyChasers)&&(playerParty_[originator->getPlayer()]==chaser)) {
     104        {
     105                //Case 1: a chaser hits piggy // BUG: playerParty_[originator->getPlayer()]==chaser) is true even if victim is a chaser
     106                if ((!onlyChasers)&&(playerParty_[originator->getPlayer()]==chaser)&&playerParty_[victim->getPlayer()]==piggy) {
    109107                        std::map<PlayerInfo*, Player>::iterator it = this->players_.find(originator->getPlayer());
    110108                    if (it != this->players_.end())
     
    113111                    }
    114112                }
    115                 //Case 2: onlyChasers==false und victim ist piggy
     113                //Case 2: piggy hits chaser
    116114                else if ((!onlyChasers)&&(playerParty_[originator->getPlayer()]==piggy)){
    117115                        //partyswitch: victim bcomes piggy and the orginator(piggy) becomes chaser
     
    133131                        onlyChasers=false;
    134132                        setPlayerColour(victim->getPlayer()); //victim colour
     133                //victim - Boost ueber setBoostFactor(float factor) //vermutlich muss victim gecastet werden
     134                // timer aufrufen - nach 5 Sekunden wieder auf normalgeschwindigkeit setzen
    135135                std::string message("First victim.");
    136136                COUT(0) << message << std::endl;
     
    188188
    189189   
    190 void Dynamicmatch::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)
     190void Dynamicmatch::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn) //set party + colouring
    191191    {
    192192        if (!player)
     
    195195        // Set the playercolour
    196196        Dynamicmatch::setPlayerColour(player);
    197 
    198        
    199     }
    200 
    201     void Dynamicmatch::playerEntered(PlayerInfo* player) //standardfunction + party + colouring
     197    }
     198
     199    void Dynamicmatch::playerEntered(PlayerInfo* player) //standardfunction
    202200    {
    203201
     
    206204
    207205        Gametype::playerEntered(player);
    208        
    209         //playerParty_[player]=chaser;//playerparty
    210        
    211         // Set the playercolour
    212         //Dynamicmatch::setPlayerColour(player);
    213        
    214206       
    215207        const std::string& message = player->getName() + " entered the game";
Note: See TracChangeset for help on using the changeset viewer.