66 String
id =
"escort_package_bonus" + ship.getId();
67 MutableShipStatsAPI stats = ship.getMutableStats();
70 boolean sMod = isSMod(ship);
73 stats.getAcceleration().modifyPercent(
id, maneuver);
74 stats.getDeceleration().modifyPercent(
id, maneuver);
75 stats.getTurnAcceleration().modifyPercent(
id, maneuver * 2f);
76 stats.getMaxTurnRate().modifyPercent(
id, maneuver);
79 stats.getMaxSpeed().modifyPercent(
id, speed);
82 stats.getBallisticWeaponRangeBonus().modifyPercent(
id, range);
83 stats.getEnergyWeaponRangeBonus().modifyPercent(
id, range);
85 if (sMod && ship.isDestroyer()) {
87 stats.getShieldDamageTakenMult().modifyMult(
id, 1f - shields / 100f);
90 stats.getAcceleration().unmodify(
id);
91 stats.getDeceleration().unmodify(
id);
92 stats.getTurnAcceleration().unmodify(
id);
93 stats.getMaxTurnRate().unmodify(
id);
95 stats.getMaxSpeed().unmodify(
id);
97 stats.getBallisticWeaponRangeBonus().unmodify(
id);
98 stats.getEnergyWeaponRangeBonus().unmodify(
id);
100 stats.getShieldDamageTakenMult().unmodify(
id);
107 super.advanceInCombat(ship, amount);
109 if (!ship.isAlive())
return;
114 EscortPackageData data = (EscortPackageData) engine.getCustomData().get(key);
116 data =
new EscortPackageData();
117 engine.getCustomData().put(key, data);
122 data.interval.advance(amount * 4f);
123 if (data.interval.intervalElapsed() || playerShip) {
128 ship.getLocation(), checkSize, checkSize);
132 while (iter.hasNext()) {
133 Object next = iter.next();
134 if (!(next instanceof ShipAPI))
continue;
136 ShipAPI other = (ShipAPI) next;
138 if (ship == other)
continue;
139 if (other.getOwner() != ship.getOwner())
continue;
140 if (other.isHulk())
continue;
142 if (other.getHullSize().ordinal() <= ship.getHullSize().ordinal())
continue;
144 float radSum = ship.getShieldRadiusEvenIfNoShield() + other.getShieldRadiusEvenIfNoShield();
146 float dist = Misc.getDistance(ship.getShieldCenterEvenIfNoShield(), other.getShieldCenterEvenIfNoShield());
156 if (ship.isDestroyer() && other.isCapital()) {
174 if (data.mag > 0.005f) {
176 String percent =
"" + (int) Math.round(data.mag * 100f) +
"%";
178 STATUS_KEY, icon,
"Escort package", percent +
" telemetry quality",
false);
182 STATUS_KEY, icon,
"Escort package",
"no connection",
true);