31 boolean playerInSameLocation =
fleet.getContainingLocation() ==
Global.
getSector().getCurrentLocation();
34 if ((playerInSameLocation || (
float) Math.random() < 0.1f) &&
source !=
null) {
36 fleet.addAssignment(FleetAssignment.ORBIT_AGGRESSIVE,
source, 3f + (
float) Math.random() * 2f);
41 Vector2f loc = Misc.getPointAtRadius(target.getLocation(), target.getRadius() + 100f);
42 fleet.setLocation(loc.x, loc.y);
44 Vector2f loc = Misc.getPointAtRadius(
new Vector2f(), 5000f);
45 fleet.setLocation(loc.x, loc.y);
52 boolean standDown =
source !=
null && (float) Math.random() < 0.2f;
56 float speed = Misc.getSpeedForBurnLevel(8);
57 float dist = Misc.getDistance(
fleet.getLocation(), target.getLocation());
58 float seconds = dist / speed;
59 float days = seconds /
Global.
getSector().getClock().getSecondsPerDay();
60 days += 5f + 5f * (float) Math.random();
61 fleet.addAssignment(FleetAssignment.PATROL_SYSTEM, target, days,
"patrolling");
64 float days = 5f + 5f * (float) Math.random();
65 fleet.addAssignment(FleetAssignment.PATROL_SYSTEM,
null, days,
"patrolling");
70 float dist = Misc.getDistance(
fleet.getLocation(),
source.getLocation());
72 fleet.addAssignment(FleetAssignment.PATROL_SYSTEM,
source, 3f,
"returning from patrol");
74 fleet.addAssignment(FleetAssignment.ORBIT_PASSIVE,
source, 3f + (
float) Math.random() * 2f,
"standing down");
75 fleet.addAssignment(FleetAssignment.GO_TO_LOCATION_AND_DESPAWN,
source, 5f);