Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 12, 2010, 2:52:45 PM (15 years ago)
Author:
jo
Message:

first version- not playable yet

File:
1 edited

Legend:

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

    r6502 r6686  
    3434#include "worldentities/pawns/TeamBaseMatchBase.h"
    3535#include "gametypes/TeamDeathmatch.h"
     36#include "gametypes/Dynamicmatch.h"
    3637#include "controllers/WaypointPatrolController.h"
     38
    3739
    3840namespace orxonox
     
    244246            }
    245247        }
    246 
    247         return (team1 == team2 && team1 != -1);
    248     }
     248        Dynamicmatch* dynamic = orxonox_cast<Dynamicmatch*>(gametype);
     249        if (dynamic)
     250        {
     251            if (entity1->getPlayer())
     252                team1 = dynamic->getParty(entity1->getPlayer());
     253
     254            if (entity2->getPlayer())
     255                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
    249260}
Note: See TracChangeset for help on using the changeset viewer.