32 String desc =
"Salvaging skill";
40 public String getEffectDescription(
float level) {
42 return "+" + (int)
SALVAGE_BONUS +
"% resources - but not rare items, such as blueprints - recovered from abandoned stations and other derelicts";
45 public String getEffectPerLevelDescription() {
49 public ScopeDescription getScopeDescription() {
50 return ScopeDescription.FLEET;
63 public String getEffectDescription(
float level) {
66 return "+" + (int) max +
"% fuel salvaged";
69 public String getEffectPerLevelDescription() {
73 public ScopeDescription getScopeDescription() {
74 return ScopeDescription.FLEET;
78 public static class Level3
implements FleetStatsSkillEffect {
79 public void apply(MutableFleetStatsAPI stats, String
id,
float level) {
80 stats.getDynamic().getStat(Stats.BATTLE_SALVAGE_MULT_FLEET).modifyFlat(
id,
COMBAT_SALVAGE * 0.01f);
83 public void unapply(MutableFleetStatsAPI stats, String
id) {
84 stats.getDynamic().getStat(Stats.BATTLE_SALVAGE_MULT_FLEET).unmodify(
id);
87 public String getEffectDescription(
float level) {
91 public String getEffectPerLevelDescription() {
95 public ScopeDescription getScopeDescription() {
96 return ScopeDescription.FLEET;
100 public static class Level5
implements FleetStatsSkillEffect {
101 public void apply(MutableFleetStatsAPI stats, String
id,
float level) {
102 stats.getDynamic().getStat(Stats.NON_COMBAT_CREW_LOSS_MULT).modifyMult(
id, 1f -
CREW_LOSS_REDUCTION / 100f);
105 public void unapply(MutableFleetStatsAPI stats, String
id) {
106 stats.getDynamic().getStat(Stats.NON_COMBAT_CREW_LOSS_MULT).unmodify(
id);
109 public String getEffectDescription(
float level) {
113 public String getEffectPerLevelDescription() {
117 public ScopeDescription getScopeDescription() {
118 return ScopeDescription.FLEET;
127 float capMult = getCargoCapacityMult(
id,
getFleetData(stats));
136 public String getEffectDescription(
float level) {
140 protected float getCargoCapacityBase(String
id,
FleetDataAPI data) {
141 if (data ==
null)
return 0f;
145 StatBonus stat = curr.getStats().getCargoMod();
150 cargoCap += curr.getCargoCapacity();
152 stat.
modifyMult(mod.source, mod.value, mod.desc);
158 protected float getCargoCapacityMult(String
id,
FleetDataAPI data) {
159 if (data ==
null)
return 0f;
161 String key =
"salvaging1";
163 if (bonus !=
null)
return bonus;
165 float cargoBase = getCargoCapacityBase(
id, data);
172 capMult = 1f + addCapacity / cargoBase;
173 capMult = Math.round(capMult * 100f) / 100f;
185 info.
addPara(
"Cargo capacity increased by %s or %s units, whichever is lower",
194 float cargoCap = getCargoCapacityBase(
id, data);
195 float capMult = getCargoCapacityMult(
id, data);
197 float increase = cargoCap * (capMult - 1f);
199 boolean has = stats.getSkillLevel(skill.
getId()) > 0;
201 if (!has) is =
"would be";
202 info.
addPara(
indent +
"Your fleet has a base cargo capacity of %s, which " + is +
" increased by %s, or approximately %s units",
205 "" + (
int)(Math.round((capMult - 1f) * 100f)) +
"%",
212 public ScopeDescription getScopeDescription() {
213 return ScopeDescription.FLEET;