45 for (
int i = 0; i < 4; i++)
168 Ship* potential_target = tgt;
184 obj_tgt = (
Ship*) obj_sim_obj;
187 potential_target = obj_tgt;
193 potential_target = 0;
208 Ship* potential_target = 0;
209 Shot* current_shot_target = 0;
212 double target_dist = 1.0e15;
213 double min_dist = 5.0e3;
246 if (!rogue && (c_iff <= 0 || c_iff == ship->GetIFF() || c_iff == 1000))
266 if (dist < 0.75 * target_dist) {
275 potential_target = c_ship;
280 else if (c_shot && c_shot->
IsDrone()) {
282 if (c_shot->
GetEta() < 10)
288 if (!current_shot_target) {
289 current_shot_target = c_shot;
298 (dist < target_dist)) {
299 current_shot_target = c_shot;
306 if (current_shot_target) {
353 double best_range = 0;
354 double best_damage = 0;
367 if (best_range < range)
376 if (w_range > range) {
377 if (w_range < best_range || w_damage > best_damage)
386 if (current_missile && best && current_missile != best) {
390 while (m != current_missile && m != best) {
425 Point delta(5*s, 0, -5*s);
430 case 2: delta =
Point( 12, -1, -10);
break;
431 case 3: delta =
Point(-12, -1, -10);
break;
432 case 4: delta =
Point( 0, -2, -20);
break;
439 case 2: delta =
Point( 15, 0, 0);
break;
440 case 3: delta =
Point(-15, 0, 0);
break;
441 case 4: delta =
Point(-30, 0, 0);
break;
448 case 2: delta =
Point(15, 0, 0);
break;
449 case 3: delta =
Point( 0, -2, -20);
break;
450 case 4: delta =
Point(15, -2, -20);
break;
456 delta =
Point(0, s, -20*s);
468 Ship* threat_ship = 0;
469 Shot* threat_missile = 0;
470 double threat_dist = 1e9;
483 threat_missile = contact->
GetShot();
486 else if (rng < threat_dist && contact->GetShip()) {
493 threat_ship = candidate;
497 else if (candidate->
IsDropship() && rng < 25e3) {
498 threat_ship = candidate;
503 else if (rng < 30e3) {
504 threat_ship = candidate;
537 for (
int i = 0; i < element->
NumShips(); i++) {