44 super.advance(amount);
51 float dist = Misc.getDistance(fleet.getLocation(),
toGuard.getLocation());
52 if (dist >
toGuard.getRadius() + fleet.getRadius() + 1500 &&
53 fleet.getAI().getCurrentAssignmentType() == FleetAssignment.ORBIT_AGGRESSIVE) {
54 fleet.addAssignmentAtStart(FleetAssignment.ORBIT_PASSIVE,
toGuard, 1f,
null);
55 CampaignFleetAIAPI ai = fleet.getAI();
56 if (ai instanceof ModularFleetAIAPI) {
58 ModularFleetAIAPI m = (ModularFleetAIAPI) ai;
59 m.getStrategicModule().getDoNotAttack().add(m.getTacticalModule().getTarget(), 1f);
60 m.getTacticalModule().setTarget(
null);
65 float days = Misc.getDays(amount);
73 public static void spawnMote(SectorEntityToken from) {
74 if (!from.isInCurrentLocation())
return;
76 float dur = 1f + 2f * (float) Math.random();
78 float size = 3f + (float) Math.random() * 5f;
80 Color color =
new Color(255,100,255,175);
82 Vector2f loc = Misc.getPointWithinRadius(from.getLocation(), from.getRadius());
83 Vector2f vel = Misc.getUnitVectorAtDegreeAngle((
float) Math.random() * 360f);
84 vel.scale(5f + (
float) Math.random() * 10f);
85 Vector2f.add(vel, from.getVelocity(), vel);
86 Misc.addGlowyParticle(from.getContainingLocation(), loc, vel, size, 0.5f,
dur, color);