40 public static class Level1
implements FleetStatsSkillEffect {
41 public void apply(MutableFleetStatsAPI stats, String
id,
float level) {
42 stats.getDynamic().getMod(Stats.SHIP_RECOVERY_MOD).modifyFlat(
id,
RECOVERY_PROB);
44 public void unapply(MutableFleetStatsAPI stats, String
id) {
45 stats.getDynamic().getMod(Stats.SHIP_RECOVERY_MOD).unmodify(
id);
47 public String getEffectDescription(
float level) {
48 return "All of your ships are almost always recoverable if lost in combat";
50 public String getEffectPerLevelDescription() {
53 public ScopeDescription getScopeDescription() {
54 return ScopeDescription.FLEET;
58 public static class Level2
implements ShipSkillEffect {
59 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String
id,
float level) {
61 if (stats.getFleetMember() !=
null) {
62 dp = stats.getFleetMember().getDeploymentPointsCost();
65 if (mult > 1f) mult = 1f;
66 if (mult < 0f) mult = 0f;
70 stats.getDynamic().getMod(Stats.DMOD_ACQUIRE_PROB_MOD).modifyMult(
id, 1f - probAvoid);
73 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String
id) {
74 stats.getDynamic().getMod(Stats.DMOD_ACQUIRE_PROB_MOD).unmodify(
id);
77 public String getEffectDescription(
float level) {
80 String lowChance =
"" + (int) Math.round(
DMOD_AVOID_MIN * 100f) +
"%";
81 String highChance =
"" + (int) Math.round(
DMOD_AVOID_MAX * 100f) +
"%";
82 return "Ships lost in combat have a " + lowChance +
" (if " + highDP +
" deployment points or higher) to " + highChance +
" (" + lowDP +
" DP or lower) chance to avoid d-mods";
87 public String getEffectPerLevelDescription() {
91 public ScopeDescription getScopeDescription() {
92 return ScopeDescription.PILOTED_SHIP;
95 public static class Level3
implements ShipSkillEffect {
96 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String
id,
float level) {
98 if (stats.getVariant() !=
null) {
99 num = stats.getVariant().getSMods().size();
101 stats.getMaxCombatReadiness().modifyFlat(
id, num *
CR_PER_SMOD * 0.01f,
"Hull Restoration skill");
104 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String
id) {
105 stats.getMaxCombatReadiness().unmodify(
id);
108 public String getEffectDescription(
float level) {
109 return "+" + (int)(
CR_PER_SMOD) +
"% maximum combat readiness per s-mod built into the hull";
112 public String getEffectPerLevelDescription() {
116 public ScopeDescription getScopeDescription() {
117 return ScopeDescription.PILOTED_SHIP;
121 public static class Level3B
implements ShipSkillEffect {
122 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String
id,
float level) {
123 FleetMemberAPI member = stats.getFleetMember();
127 if (member !=
null) {
128 dmods = DModManager.getNumDMods(member.getVariant());
129 }
else if (stats.getVariant() !=
null) {
130 dmods = DModManager.getNumDMods(stats.getVariant());
134 bonus = Math.round(bonus);
135 if (bonus < 0) bonus = 0;
137 stats.getMaxCombatReadiness().modifyFlat(
id, bonus * 0.01f,
"Hull Restoration skill");
140 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String
id) {
141 stats.getMaxCombatReadiness().unmodify(
id);
144 public String getEffectDescription(
float level) {
145 return "+" + (int)(
CR_MAX_BONUS) +
"% maximum combat readiness for all ships, minus " + (int)
CR_MINUS_PER_DMOD +
"% per d-mod (minimum of 0%)";
148 public String getEffectPerLevelDescription() {
152 public ScopeDescription getScopeDescription() {
153 return ScopeDescription.PILOTED_SHIP;
157 public static class Level4A
implements FleetStatsSkillEffect {
158 public void apply(MutableFleetStatsAPI stats, String
id,
float level) {
161 public void unapply(MutableFleetStatsAPI stats, String
id) {
164 public String getEffectDescription(
float level) {
165 if (FieldRepairsScript.MONTHS_PER_DMOD_REMOVAL == 1) {
166 return "Chance to remove one d-mod per month from a randomly selected ship in your fleet; faster for low-DP ships";
167 }
else if (FieldRepairsScript.MONTHS_PER_DMOD_REMOVAL == 2) {
168 return "Chance to remove a d-mod from a randomly selected ship in your fleet every two months";
170 return "Chance to remove a d-mod from a randomly selected ship in your fleet every " +
171 FieldRepairsScript.MONTHS_PER_DMOD_REMOVAL +
" months";
174 public String getEffectPerLevelDescription() {
177 public ScopeDescription getScopeDescription() {
178 return ScopeDescription.FLEET;
182 public static class Level4B
implements FleetStatsSkillEffect {
183 public void apply(MutableFleetStatsAPI stats, String
id,
float level) {
186 public void unapply(MutableFleetStatsAPI stats, String
id) {
189 public String getEffectDescription(
float level) {
190 return "Chance to quickly remove one d-mod from newly acquired ships; higher for ships with more d-mods";
192 public String getEffectPerLevelDescription() {
195 public ScopeDescription getScopeDescription() {
196 return ScopeDescription.FLEET;
201 public static class Level5
extends BaseSkillEffectDescription implements ShipSkillEffect {
202 public void createCustomDescription(MutableCharacterStatsAPI stats, SkillSpecAPI skill,
203 TooltipMakerAPI info,
float width) {
206 Color c = Misc.getBasePlayerColor();
208 info.addPara(
"Affects: %s", opad + 5f, Misc.getGrayColor(), c,
"pristine and near-pristine ships (at most one d-mod)");
209 info.addSpacer(opad);
212 String percent =
"" + (int)Math.round(
DP_REDUCTION * 100f) +
"%";
213 info.addPara(
"Deployment point cost reduced by %s or %s points, whichever is less",
214 0f, Misc.getHighlightColor(), Misc.getHighlightColor(), percent, max);
218 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String
id,
float level) {
219 FleetMemberAPI member = stats.getFleetMember();
221 if (member !=
null) {
222 dmods = DModManager.getNumDMods(member.getVariant());
225 if (dmods > 1)
return;
227 float baseCost = stats.getSuppliesToRecover().getBaseValue();
230 stats.getDynamic().getMod(Stats.DEPLOYMENT_POINTS_MOD).modifyFlat(
id, -reduction);
233 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String
id) {
234 stats.getDynamic().getMod(Stats.DEPLOYMENT_POINTS_MOD).unmodifyFlat(
id);