Starsector API
Loading...
Searching...
No Matches
AdvancedCountermeasures.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
8
9 public static final float ARMOR_KINETIC_REDUCTION = 50f;
10 public static final float SHIELD_HE_REDUCTION = 25f;
11 public static final float FIGHTER_DAMAGE_BONUS = 50f;
12 public static final float MISSILE_DAMAGE_BONUS = 50f;
13
14
15
16 public static class Level1 implements ShipSkillEffect {
17
18 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
20 }
21
22 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
24 }
25
26 public String getEffectDescription(float level) {
27 return "-" + (int)(ARMOR_KINETIC_REDUCTION) + "% kinetic damage taken by armor";
28 }
29
30 public String getEffectPerLevelDescription() {
31 return null;
32 }
33
34 public ScopeDescription getScopeDescription() {
35 return ScopeDescription.PILOTED_SHIP;
36 }
37 }
38
39 public static class Level2 implements ShipSkillEffect {
40 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
42 }
43
44 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
46 }
47
48 public String getEffectDescription(float level) {
49 return "-" + (int)(SHIELD_HE_REDUCTION) + "% high-explosive damage taken by shields";
50 }
51
52 public String getEffectPerLevelDescription() {
53 return null;
54 }
55
56 public ScopeDescription getScopeDescription() {
57 return ScopeDescription.PILOTED_SHIP;
58 }
59 }
60
61 public static class Level3A implements ShipSkillEffect {
62
63 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
64 stats.getDamageToFighters().modifyFlat(id, FIGHTER_DAMAGE_BONUS / 100f);
65 }
66
67 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
68 stats.getDamageToFighters().unmodify(id);
69 }
70
71 public String getEffectDescription(float level) {
72 return "+" + (int)(FIGHTER_DAMAGE_BONUS) + "% damage to fighters";
73 }
74
75 public String getEffectPerLevelDescription() {
76 return null;
77 }
78
79 public ScopeDescription getScopeDescription() {
80 return ScopeDescription.PILOTED_SHIP;
81 }
82 }
83
84 public static class Level3B implements ShipSkillEffect {
85
86 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
87 stats.getDamageToMissiles().modifyFlat(id, MISSILE_DAMAGE_BONUS / 100f);
88 }
89
90 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
91 stats.getDamageToMissiles().unmodify(id);
92 }
93
94 public String getEffectDescription(float level) {
95 return "+" + (int)(MISSILE_DAMAGE_BONUS) + "% damage to missiles";
96 }
97
98 public String getEffectPerLevelDescription() {
99 return null;
100 }
101
102 public ScopeDescription getScopeDescription() {
103 return ScopeDescription.PILOTED_SHIP;
104 }
105 }
106}
void modifyMult(String source, float value)