Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10515 in orxonox.OLD for trunk/src/ai/ai_team.cc


Ignore:
Timestamp:
Jan 30, 2007, 8:57:58 PM (17 years ago)
Author:
patrick
Message:

ai fix, mp fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ai/ai_team.cc

    r10376 r10515  
    5454
    5555                                Vector targetPos=target->getAbsCoor();
     56                                float distanceToPlayer=(targetPos-position).len();
     57
    5658                                int zNorm=(position.z>targetPos.z)?1:-1;
    5759
    58                                 if((position.z-targetPos.z)*zNorm>60){  //go to start position
    59                                         //std::cout << "Go Start Position\n";
     60                                if(distanceToPlayer<attackDistance+60){ //### change wakeup distance here
     61                                        std::cout << "AI Sleeps \n";
     62                                        changeSwarmModule(it, new SwarmWait);
     63                                        maxTime=1000;   //sleep 2 seconds..
     64                                }else{
     65                                /*if((position.z-targetPos.z)*zNorm>60){        //go to start position
     66                                        std::cout << "Go Start Position\n";
    6067                                        changeSwarmModule(it, new SwarmGoRel);
    6168                                        zNorm=1-(rand()%2)*2;   //1 or -1
     
    6370                                        speed=60;
    6471                                }else if(position.x > targetPos.x+attackDistance+40){   //go to attack position
    65                                         //std::cout << "Go Attack Position\n";
     72                                        std::cout << "Go Attack Position\n";
    6673                                        changeSwarmModule(it, new SwarmGoRel);
    67                                         newPosition=Vector(attackDistance+30,0,0);
     74                                        newPosition=Vector(attackDistance+30,0,0)
    6875                                        speed=60;
    69                                 }else if(position.x > targetPos.x+attackDistance+20){   //go to attack mode
    70                                         //std::cout << "Go Attack Mode\n";
     76                                }else if(position.x > targetPos.x+attackDistance+20){   //go to attack mode;
     77                                        std::cout << "Go Attack Mode \n";*/
     78                                        std::cout << "AI Attacks \n";
    7179                                        changeSwarmModule(it, new SwarmAttack);
    7280                                        newPosition=Vector(attackDistance,0,0);
    7381                                        speed=60;
    74                                         maxTime=(rand()%11)+4;//4-14 Sekunden
    75                                 }else{                                                                                          //go to fallback point
    76                                         //std::cout << "Go  Fallback Point\n";
     82                                        maxTime=(1000);//rand()%11)+4;//4-14 Sekunden
     83                                /*}else{                                                                                                //go to fallback point
     84                                        std::cout << "Go  Fallback Point\n";
    7785                                        changeSwarmModule(it, new SwarmGoRel);
    7886                                        newPosition=Vector(80,0,zNorm*90);
    79                                         speed=80;
     87                                        speed=80;*/
    8088                                }
    81                         }else{
     89                        //}else{
    8290
    8391                        }
Note: See TracChangeset for help on using the changeset viewer.