- Timestamp:
- Jan 30, 2007, 8:57:58 PM (18 years ago)
- Location:
- trunk/src
- Files:
-
- 6 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 } -
trunk/src/ai/attack_module.cc
r10499 r10515 54 54 void AttackModule::process(float dt) 55 55 { 56 //PRINTF(0)("attack process\n"); 57 56 58 if(npc == NULL)return; 57 59 … … 116 118 Vector vectorToDestination=destination-myPosition; 117 119 118 Vector correction= playerCollision* 50*3 *6/myRadius120 Vector correction= playerCollision*40*3 *6/myRadius 119 121 + npcCollision*50*3 *6/myRadius 120 122 + destinationMovement*2//-movement … … 147 149 148 150 view = target->getAbsCoor()+randomView-myPosition; 149 view = view.cross( Vector(0, 1,0) ).getNormalized();151 view = view.cross( Vector(0,-1,0) ).getNormalized(); 150 152 151 153 npc->setAbsDirSoft( Quaternion( view, Vector(0,1,0)),8/myRadius); … … 156 158 if(fireTimeout<=0){ 157 159 fireTimeout=(rand()%21)/10+1; 158 std::cout << "Fiiiiirrreee!\n";160 //std::cout << "Fiiiiirrreee!\n"; 159 161 NPC* npc2 = static_cast<NPC*>(npc); 160 162 npc2->fire(); -
trunk/src/ai/movement_module.cc
r10376 r10515 140 140 141 141 //rotate NPC 142 view = movement.cross( Vector(0, 1,0) ).getNormalized();142 view = movement.cross( Vector(0,-1,0) ).getNormalized(); 143 143 npc->setAbsDirSoft( Quaternion( view, Vector(0,1,0)),10/myRadius); 144 144 -
trunk/src/ai/swarm_wait.cc
r10376 r10515 19 19 void SwarmWait::process(float dt) 20 20 { 21 if(taskRelObject!=NULL){ 22 Vector distVect=taskRelObject->getAbsCoor()-getSwarmPosition(); 23 float distance=distVect.len(); 24 if(distance<attackDistance+60)taskComplete=true; //### change wakeup distance here 25 } 26 21 27 taskMaxTime-=dt; 22 28 if(taskMaxTime<=0)taskComplete=true; -
trunk/src/story_entities/game_world.cc
r10473 r10515 331 331 /* network synchronisation */ 332 332 this->synchronize (); 333 334 /* perform ai check*/ 335 this->checkAI(); 336 337 this->update (); 333 338 /* process time */ 334 339 this->tick (); … … 344 349 /* collision reaction */ 345 350 this->collisionReaction (); 346 347 /* perform ai check*/348 this->checkAI();349 351 350 352 /* check the game rules */ -
trunk/src/world_entities/particles/particle_system.cc
r9869 r10515 135 135 { 136 136 if (emitter->isA(ParticleEmitter::staticClassID())) 137 { 138 // init the emitertter with the coordinates of the system 139 dynamic_cast<ParticleEmitter*>(emitter)->setAbsCoor(this->getAbsCoor()); 137 140 this->addEmitter(dynamic_cast<ParticleEmitter*>(emitter)); 141 } 138 142 else 139 143 {
Note: See TracChangeset
for help on using the changeset viewer.