1
0
Fork 0

Add a variant of the tanker request function that produces a tanker with

a more random (challenging to intercept) starting point and heading.
This commit is contained in:
Curtis L. Olson 2011-01-13 16:36:57 -06:00
parent 98277733d5
commit d9d6d1ed12

View file

@ -283,6 +283,27 @@ var request = func {
} }
var request_random = func {
var tanker = values(Tanker.active);
if (size(tanker))
return tanker[0].identify();
var type = props.globals.getNode("systems/refuel", 1).getChildren("type");
if (!size(type))
return;
type = type[rand() * size(type)].getValue();
var (aiid, callsign, tacanid) =_= identity.get();
var hdg = rand() * 360;
var course = rand() * 360;
var dist = 6000 + rand() * 4000;
var alt = int(10 + rand() * 15) * 1000; # FL100--FL250
alt = skip_cloud_layer(alt * FT2M);
var coord = geo.aircraft_position().apply_course_distance(course, dist).set_alt(alt);
Tanker.new(aiid, callsign, tacanid, type, 250, hdg, coord);
}
var report = func { var report = func {
var tanker = values(Tanker.active); var tanker = values(Tanker.active);
if (size(tanker)) if (size(tanker))