Changeset 10515 in orxonox.OLD for trunk/src/ai/ai_team.cc
- Timestamp:
- Jan 30, 2007, 8:57:58 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ai/ai_team.cc
r10376 r10515 54 54 55 55 Vector targetPos=target->getAbsCoor(); 56 float distanceToPlayer=(targetPos-position).len(); 57 56 58 int zNorm=(position.z>targetPos.z)?1:-1; 57 59 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"; 60 67 changeSwarmModule(it, new SwarmGoRel); 61 68 zNorm=1-(rand()%2)*2; //1 or -1 … … 63 70 speed=60; 64 71 }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"; 66 73 changeSwarmModule(it, new SwarmGoRel); 67 newPosition=Vector(attackDistance+30,0,0) ;74 newPosition=Vector(attackDistance+30,0,0) 68 75 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"; 71 79 changeSwarmModule(it, new SwarmAttack); 72 80 newPosition=Vector(attackDistance,0,0); 73 81 speed=60; 74 maxTime=( rand()%11)+4;//4-14 Sekunden75 }else{ //go to fallback point76 //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"; 77 85 changeSwarmModule(it, new SwarmGoRel); 78 86 newPosition=Vector(80,0,zNorm*90); 79 speed=80; 87 speed=80;*/ 80 88 } 81 }else{89 //}else{ 82 90 83 91 }
Note: See TracChangeset
for help on using the changeset viewer.