24 tracker.advance(days);
25 if (tracker.intervalElapsed() && fleet.getAI() !=
null) {
32 FleetAssignmentDataAPI assignment = fleet.getAI().getCurrentAssignment();
33 if (assignment !=
null && assignment.getAssignment() != FleetAssignment.STANDING_DOWN) {
34 SectorEntityToken target = assignment.getTarget();
35 if (target !=
null && target.getFaction() !=
null) {
36 boolean targetHostile = target.getFaction().isHostileTo(origFaction);
37 boolean mathchesTarget = fleet.getFaction().getId().equals(target.getFaction().getId());
38 boolean mathchesOrig = fleet.getFaction().getId().equals(origFaction);
39 float dist = Misc.getDistance(fleet.getLocation(), target.getLocation());
40 if (dist < target.getRadius() + fleet.getRadius() + 1000) {
41 if (targetHostile && !mathchesTarget) {
42 fleet.setFaction(target.getFaction().getId(),
true);
46 fleet.setFaction(origFaction,
true);