Starsector API
Loading...
Searching...
No Matches
EfficiencyOverhaul.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.hullmods;
2
3import com.fs.starfarer.api.combat.MutableShipStatsAPI;
4import com.fs.starfarer.api.combat.ShipAPI;
5import com.fs.starfarer.api.combat.ShipAPI.HullSize;
6
8 public static float MAINTENANCE_MULT = 0.8f;
9
10 public static float REPAIR_RATE_BONUS = 50f;
11 public static float CR_RECOVERY_BONUS = 50f;
12 public static float REPAIR_BONUS = 50f;
13
14 public static float SMOD_MODIFIER = 0.1f;
15
16 public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
17
18 boolean sMod = isSMod(stats);
19
20 stats.getMinCrewMod().modifyMult(id, MAINTENANCE_MULT - (sMod ? SMOD_MODIFIER : 0));
21 stats.getSuppliesPerMonth().modifyMult(id, MAINTENANCE_MULT - (sMod ? SMOD_MODIFIER : 0));
22 stats.getFuelUseMod().modifyMult(id, MAINTENANCE_MULT - (sMod ? SMOD_MODIFIER : 0));
23
24 stats.getBaseCRRecoveryRatePercentPerDay().modifyPercent(id, CR_RECOVERY_BONUS);
25 stats.getRepairRatePercentPerDay().modifyPercent(id, REPAIR_RATE_BONUS);
26 }
27
28 public String getSModDescriptionParam(int index, HullSize hullSize, ShipAPI ship) {
29 if (index == 0) return "" + (int) Math.round(SMOD_MODIFIER * 100f) + "%";
30 return null;
31 }
32
33 public String getDescriptionParam(int index, HullSize hullSize, ShipAPI ship) {
34 if (index == 0) return "" + (int) Math.round((1f - MAINTENANCE_MULT) * 100f) + "%";
35 if (index == 1) return "" + (int) Math.round(CR_RECOVERY_BONUS) + "%";
36 return null;
37 }
38
39
40}
41
42
43
44
45
46
47
String getSModDescriptionParam(int index, HullSize hullSize, ShipAPI ship)
String getDescriptionParam(int index, HullSize hullSize, ShipAPI ship)
void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id)