33 if (ship ==
null)
return false;
40 if (member ==
null)
return false;
57 public String getEffectDescription(
float level) {
61 public void createCustomDescription(MutableCharacterStatsAPI stats,
SkillSpecAPI skill,
69 info.
addPara(
"-%s crew lost due to fighter losses in combat (maximum: %s)", 0f,
hc,
hc,
70 "" + (
int) crewLossReduction +
"%",
75 public ScopeDescription getScopeDescription() {
76 return ScopeDescription.ALL_SHIPS;
82 public static class Level2
extends BaseSkillEffectDescription implements ShipSkillEffect, FleetTotalSource {
84 public FleetTotalItem getFleetTotalItem() {
88 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String
id,
float level) {
94 float speedBonus = getMaxSpeedBonus(stats);
96 stats.getMaxSpeed().modifyPercent(
id, speedBonus);
97 stats.getAcceleration().modifyPercent(
id, speedBonus * 2f);
98 stats.getDeceleration().modifyPercent(
id, speedBonus * 2f);
100 float aimBonus = getAimBonus(stats);
102 stats.getAutofireAimAccuracy().modifyFlat(
id, aimBonus * 0.01f);
104 float damBonus = getDamageBonus(stats);
106 stats.getBallisticWeaponDamageMult().modifyPercent(
id, damBonus);
107 stats.getEnergyWeaponDamageMult().modifyPercent(
id, damBonus);
108 stats.getMissileWeaponDamageMult().modifyPercent(
id, damBonus);
111 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String
id) {
116 stats.getMaxSpeed().unmodifyPercent(
id);
117 stats.getAcceleration().unmodifyPercent(
id);
118 stats.getDeceleration().unmodifyPercent(
id);
120 stats.getAutofireAimAccuracy().unmodifyFlat(
id);
122 stats.getBallisticWeaponDamageMult().unmodifyPercent(
id);
123 stats.getEnergyWeaponDamageMult().unmodifyPercent(
id);
124 stats.getMissileWeaponDamageMult().unmodifyPercent(
id);
127 public String getEffectDescription(
float level) {
147 protected float getMaxSpeedBonus(MutableShipStatsAPI stats) {
149 return getMaxSpeedBonus(data);
152 protected float getMaxSpeedBonus(FleetDataAPI data) {
154 String key =
"fighter_uplink_max_speed";
155 Float bonus = (Float) data.getCacheClearedOnSync().get(key);
156 if (bonus !=
null)
return bonus;
161 data.getCacheClearedOnSync().put(key, bonus);
165 protected float getAimBonus(MutableShipStatsAPI stats) {
167 return getAimBonus(data);
170 protected float getAimBonus(FleetDataAPI data) {
172 String key =
"fighter_uplink_aim";
173 Float bonus = (Float) data.getCacheClearedOnSync().get(key);
174 if (bonus !=
null)
return bonus;
179 data.getCacheClearedOnSync().put(key, bonus);
183 protected float getDamageBonus(MutableShipStatsAPI stats) {
185 return getDamageBonus(data);
188 protected float getDamageBonus(FleetDataAPI data) {
190 String key =
"fighter_uplink_damage";
191 Float bonus = (Float) data.getCacheClearedOnSync().get(key);
192 if (bonus !=
null)
return bonus;
197 data.getCacheClearedOnSync().put(key, bonus);
201 public void createCustomDescription(MutableCharacterStatsAPI stats, SkillSpecAPI skill,
202 TooltipMakerAPI info,
float width) {
212 float speedBonus = getMaxSpeedBonus(data);
213 float aimBonus = getAimBonus(data);
214 float damBonus = getDamageBonus(data);
224 info.addPara(
"+%s top speed (maximum: %s)", 0f,
hc,
hc,
225 "" + (
int) speedBonus +
"%",
227 info.addPara(
"+%s target leading accuracy (maximum: %s)", 0f,
hc,
hc,
228 "" + (
int) aimBonus +
"%",
230 info.addPara(
"+%s damage dealt (maximum: %s)", 0f,
hc,
hc,
231 "" + (
int) damBonus +
"%",
234 info.addPara(
indent +
"Effect increased by %s for ships with officers, including flagship",
236 "" + Misc.getRoundedValueMaxOneAfterDecimal(
OFFICER_MULT) + Strings.X);
241 public ScopeDescription getScopeDescription() {
242 return ScopeDescription.ALL_FIGHTERS;