Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 30, 2010, 4:42:58 PM (14 years ago)
Author:
jo
Message:

adding 3rd party: killers, making the gametype playable for larger groups of players, bug removed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/dynamicmatch/src/orxonox/controllers/ArtificialController.cc

    r6686 r6812  
    249249        if (dynamic)
    250250        {
     251            if (dynamic->notEnoughPigs||dynamic->notEnoughKillers||dynamic->notEnoughChasers) {return false;}
     252       
    251253            if (entity1->getPlayer())
    252254                team1 = dynamic->getParty(entity1->getPlayer());
     
    254256            if (entity2->getPlayer())
    255257                team2 = dynamic->getParty(entity2->getPlayer());
    256         }
    257 
    258         return (team1 == team2 && team1 != -1)&&(!dynamic->onlyChasers); //returns false if players are in the same party and there is a victim
    259     }                                                           //-> if there is no victim or the AI-Player is not in the same team the AI attacks
     258                if (team1 ==-1 ||team2 ==-1 ) {return false;}
     259                else if (team1 == dynamic->chaser && team2 != dynamic->chaser) {return false;}
     260                else if (team1 == dynamic->piggy && team2 == dynamic->chaser) {return false;}
     261                else if (team1 == dynamic->killer && team2 == dynamic->chaser) {return false;}
     262                else return true;
     263               
     264        }
     265
     266        return (team1 == team2 && team1 != -1);
     267    }
    260268}
Note: See TracChangeset for help on using the changeset viewer.