51 if (fleet ==
null)
return;
56 if (
level > 0 && !fleet.isAIMode() && fleet.getCargo().getFuel() <= 0 &&
57 fleet.getContainingLocation() !=
null && fleet.getContainingLocation().isHyperspace()) {
62 fleet.getMemoryWithoutUpdate().set(
SB_NO_STOP,
true, 0.3f);
64 if (
level > 0 && level < 1 && amount > 0 && !fleet.getMemoryWithoutUpdate().is(
SB_NO_SLOW,
true)) {
66 float speed = fleet.getVelocity().length();
67 float acc = Math.max(speed, 200f)/activateSeconds + fleet.getAcceleration();
68 float ds = acc * amount;
69 if (ds > speed) ds = speed;
70 Vector2f dv = Misc.getUnitVectorAtDegreeAngle(Misc.getAngleInDegrees(fleet.getVelocity()));
72 fleet.setVelocity(fleet.getVelocity().x - dv.x, fleet.getVelocity().y - dv.y);
84 float b = fleet.getStats().getDynamic().getValue(Stats.SUSTAINED_BURN_BONUS, 0f);
86 burnModifier = (int)((b) *
level);
94 fleet.getStats().getFleetwideMaxBurnMod().modifyFlat(
getModId(), burnModifier,
"Sustained burn");
95 fleet.getStats().getFleetwideMaxBurnMod().modifyMult(
getModId(), burnMult,
"Sustained burn");
100 float burn = Misc.getBurnLevelForSpeed(fleet.getVelocity().length());
102 float dir = Misc.getDesiredMoveDir(fleet);
106 float velDir = Misc.getAngleInDegrees(fleet.getVelocity());
107 float diff = Misc.getAngleDiff(dir, velDir);
111 if (diff < 0) diff = 0;
112 accImpact = 1f - 0.5f * Math.min(1f, (diff / (180f - pad)));
121 for (FleetMemberViewAPI view : fleet.getViews()) {
123 view.getContrailColor().shift(
getModId(), view.getEngineColor().getBase(), 1f, 1f, 0.5f *
level);
124 view.getEngineGlowSizeMult().shift(
getModId(), 1.5f, 1f, 1f, 1f *
level);
125 view.getEngineHeightMult().shift(
getModId(), 3f, 1f, 1f, 1f *
level);
126 view.getEngineWidthMult().shift(
getModId(), 2f, 1f, 1f, 1f *
level);
165 Color gray = Misc.getGrayColor();
166 Color highlight = Misc.getHighlightColor();
168 String status =
" (off)";
173 LabelAPI title = tooltip.addTitle(
"Sustained Burn" + status);
174 title.highlightLast(status);
175 title.setHighlightColor(gray);
180 tooltip.addPara(
"Switch the drives of all ships in the fleet to a mode suited for long-distance travel. " +
181 "The fleet has to stop briefly to make the switch-over. ", pad);
187 tooltip.addPara(
"Increases the maximum burn level by %s, at the expense of lower acceleration, " +
188 "especially in the direction of the fleet's movement. " +
189 "Also increases the range at which the fleet can be detected by %s.", pad,
196 tooltip.addPara(
"The burn level increase does not apply to flat burn bonuses, " +
197 "such as those from Nav Buoys or tugs.", pad);
199 CampaignFleetAPI fleet =
getFleet();
201 if (!fleet.isAIMode() && fleet.getCargo().getFuel() <= 0 &&
202 fleet.getContainingLocation() !=
null && fleet.getContainingLocation().isHyperspace()) {
203 tooltip.addPara(
"Out of fuel.", Misc.getNegativeHighlightColor(), pad);