Starsector API
Loading...
Searching...
No Matches
FieldModulation.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.skills;
2
3import com.fs.starfarer.api.characters.ShipSkillEffect;
4import com.fs.starfarer.api.combat.MutableShipStatsAPI;
5import com.fs.starfarer.api.combat.ShipAPI.HullSize;
6
7public class FieldModulation {
8
9 public static float SHIELD_DAMAGE_REDUCTION = 15f;
10 public static float FLUX_SHUNT_DISSIPATION = 20f;
11
12 public static float PHASE_FLUX_UPKEEP_REDUCTION = 25f;
13 public static float PHASE_COOLDOWN_REDUCTION = 50f;
14
15 public static float ELITE_DAMAGE_TO_SHIELDS_PERCENT = 5f;
16 public static float OVERLOAD_REDUCTION = 25f;
17
18
19 public static class Level1 implements ShipSkillEffect {
20 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
21 stats.getShieldDamageTakenMult().modifyMult(id, 1f - SHIELD_DAMAGE_REDUCTION / 100f);
22 }
23
24 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
25 stats.getShieldDamageTakenMult().unmodify(id);
26 }
27
28 public String getEffectDescription(float level) {
29 return "-" + (int)(SHIELD_DAMAGE_REDUCTION) + "% damage taken by shields";
30 }
31
32 public String getEffectPerLevelDescription() {
33 return null;
34 }
35
36 public ScopeDescription getScopeDescription() {
37 return ScopeDescription.PILOTED_SHIP;
38 }
39 }
40
41 public static class Level2 implements ShipSkillEffect {
42
43 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
44 stats.getPhaseCloakUpkeepCostBonus().modifyMult(id, 1f - PHASE_FLUX_UPKEEP_REDUCTION / 100f);
45 }
46
47 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
48 stats.getPhaseCloakUpkeepCostBonus().unmodify(id);
49 }
50
51 public String getEffectDescription(float level) {
52 return "-" + (int)(PHASE_FLUX_UPKEEP_REDUCTION) + "% flux generated by active phase cloak";
53 }
54
55 public String getEffectPerLevelDescription() {
56 return null;
57 }
58
59 public ScopeDescription getScopeDescription() {
60 return ScopeDescription.PILOTED_SHIP;
61 }
62 }
63
64 public static class Level3 implements ShipSkillEffect {
65
66 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
67 stats.getHardFluxDissipationFraction().modifyFlat(id, FLUX_SHUNT_DISSIPATION / 100f);
68 }
69
70 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
71 stats.getHardFluxDissipationFraction().unmodify(id);
72 }
73
74 public String getEffectDescription(float level) {
75 return "" + (int)(FLUX_SHUNT_DISSIPATION) + "% hard flux dissipation while shields are active";
76 }
77
78 public String getEffectPerLevelDescription() {
79 return null;
80 }
81
82 public ScopeDescription getScopeDescription() {
83 return ScopeDescription.PILOTED_SHIP;
84 }
85 }
86
87 public static class Level4 implements ShipSkillEffect {
88 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
89 stats.getPhaseCloakCooldownBonus().modifyMult(id, 1f - PHASE_COOLDOWN_REDUCTION / 100f);
90 }
91
92 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
93 stats.getPhaseCloakCooldownBonus().unmodify(id);
94 }
95
96 public String getEffectDescription(float level) {
97 return "-" + (int)(PHASE_COOLDOWN_REDUCTION) + "% phase cloak cooldown";
98 }
99
100 public String getEffectPerLevelDescription() {
101 return null;
102 }
103
104 public ScopeDescription getScopeDescription() {
105 return ScopeDescription.PILOTED_SHIP;
106 }
107 }
108
109
110 public static class Level5 implements ShipSkillEffect {
111
112 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
113 stats.getDamageToTargetShieldsMult().modifyPercent(id, ELITE_DAMAGE_TO_SHIELDS_PERCENT);
114 }
115
116 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
117 stats.getDamageToTargetShieldsMult().unmodifyPercent(id);
118 }
119
120 public String getEffectDescription(float level) {
121 return "+" + (int)(ELITE_DAMAGE_TO_SHIELDS_PERCENT) + "% damage dealt to shields";
122 }
123
124 public String getEffectPerLevelDescription() {
125 return null;
126 }
127
128 public ScopeDescription getScopeDescription() {
129 return ScopeDescription.PILOTED_SHIP;
130 }
131 }
132
133 public static class Level6 implements ShipSkillEffect {
134
135 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
136 stats.getOverloadTimeMod().modifyMult(id, 1f - OVERLOAD_REDUCTION / 100f);
137 }
138
139 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
140 stats.getOverloadTimeMod().unmodify(id);
141 }
142
143 public String getEffectDescription(float level) {
144 return "-" + (int)(OVERLOAD_REDUCTION) + "% overload duration";
145 }
146
147 public String getEffectPerLevelDescription() {
148 return null;
149 }
150
151 public ScopeDescription getScopeDescription() {
152 return ScopeDescription.PILOTED_SHIP;
153 }
154 }
155}