Starsector API
Loading...
Searching...
No Matches
ShieldModulation.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 ShieldModulation {
8
9 public static final float FLUX_UPKEEP_REDUCTION = 25f;
10 public static final float SHIELD_DAMAGE_REDUCTION = 20f;
11
12 public static final float FLUX_SHUNT_DISSIPATION = 15f;
13
14 public static final float SHIELD_HE_REDUCTION = 30f;
15
16
17 public static class Level1 implements ShipSkillEffect {
18
19 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
20 stats.getShieldUpkeepMult().modifyMult(id, 1f - FLUX_UPKEEP_REDUCTION / 100f);
21 }
22
23 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
24 stats.getShieldUpkeepMult().unmodify(id);
25 }
26
27 public String getEffectDescription(float level) {
28 return "-" + (int)(FLUX_UPKEEP_REDUCTION) + "% flux generated by raised shields";
29 }
30
31 public String getEffectPerLevelDescription() {
32 return null;
33 }
34
35 public ScopeDescription getScopeDescription() {
36 return ScopeDescription.PILOTED_SHIP;
37 }
38 }
39
40 public static class Level2 implements ShipSkillEffect {
41 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
42 stats.getShieldDamageTakenMult().modifyMult(id, 1f - SHIELD_DAMAGE_REDUCTION / 100f);
43 }
44
45 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
46 stats.getShieldDamageTakenMult().unmodify(id);
47 }
48
49 public String getEffectDescription(float level) {
50 return "-" + (int)(SHIELD_DAMAGE_REDUCTION) + "% damage taken by shields";
51 }
52
53 public String getEffectPerLevelDescription() {
54 return null;
55 }
56
57 public ScopeDescription getScopeDescription() {
58 return ScopeDescription.PILOTED_SHIP;
59 }
60 }
61
62 public static class Level3 implements ShipSkillEffect {
63
64 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
65 stats.getHardFluxDissipationFraction().modifyFlat(id, FLUX_SHUNT_DISSIPATION / 100f);
66 }
67
68 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
69 stats.getHardFluxDissipationFraction().unmodify(id);
70 }
71
72 public String getEffectDescription(float level) {
73 return "" + (int)(FLUX_SHUNT_DISSIPATION) + "% hard flux dissipation while shields are active";
74 }
75
76 public String getEffectPerLevelDescription() {
77 return null;
78 }
79
80 public ScopeDescription getScopeDescription() {
81 return ScopeDescription.PILOTED_SHIP;
82 }
83 }
84
85 public static class Level4 implements ShipSkillEffect {
86 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
87 stats.getHighExplosiveShieldDamageTakenMult().modifyMult(id, 1f - SHIELD_HE_REDUCTION / 100f);
88 }
89
90 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
91 stats.getHighExplosiveShieldDamageTakenMult().unmodify(id);
92 }
93
94 public String getEffectDescription(float level) {
95 return "-" + (int)(SHIELD_HE_REDUCTION) + "% high-explosive damage taken by shields";
96 }
97
98 public String getEffectPerLevelDescription() {
99 return null;
100 }
101
102 public ScopeDescription getScopeDescription() {
103 return ScopeDescription.PILOTED_SHIP;
104 }
105 }
106
107// public static class Level4 implements ShipSkillEffect {
108//
109// public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
110// stats.getHardFluxDissipationFraction().modifyFlat(id, FLUX_SHUNT_DISSIPATION / 100f);
111// }
112//
113// public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
114// stats.getHardFluxDissipationFraction().unmodify(id);
115// }
116//
117// public String getEffectDescription(float level) {
118// return "" + (int)(FLUX_SHUNT_DISSIPATION) + "% hard flux dissipation while shields are active";
119// }
120//
121// public String getEffectPerLevelDescription() {
122// return null;
123// }
124//
125// public ScopeDescription getScopeDescription() {
126// return ScopeDescription.PILOTED_SHIP;
127// }
128// }
129
130}