Starsector API
Loading...
Searching...
No Matches
WingCommander.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 WingCommander {
8
9 public static final float SPEED_BONUS = 25f;
10 public static final float DAMAGE_TO_FIGHTERS_BONUS = 30f;
11 public static final float DAMAGE_TO_MISSILES_BONUS = 30f;
12 public static final float TARGET_LEADING_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) {
19 stats.getMaxSpeed().modifyPercent(id, SPEED_BONUS);
20 stats.getAcceleration().modifyPercent(id, SPEED_BONUS);
21 stats.getDeceleration().modifyPercent(id, SPEED_BONUS);
22 stats.getTurnAcceleration().modifyPercent(id, SPEED_BONUS * 2f);
23 stats.getMaxTurnRate().modifyPercent(id, SPEED_BONUS);
24 }
25
26 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
27 stats.getMaxSpeed().unmodify(id);
28 stats.getAcceleration().unmodify(id);
29 stats.getDeceleration().unmodify(id);
30 stats.getTurnAcceleration().unmodify(id);
31 stats.getMaxTurnRate().unmodify(id);
32 }
33
34 public String getEffectDescription(float level) {
35 return "+" + (int)(SPEED_BONUS) + "% top speed and maneuverability";
36 }
37
38 public String getEffectPerLevelDescription() {
39 return null;
40 }
41
42 public ScopeDescription getScopeDescription() {
43 return ScopeDescription.SHIP_FIGHTERS;
44 }
45 }
46
47 public static class Level2A implements ShipSkillEffect {
48
49 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
50 stats.getDamageToFighters().modifyFlat(id, DAMAGE_TO_FIGHTERS_BONUS / 100f);
51 }
52
53 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
54 stats.getDamageToFighters().unmodify(id);
55 }
56
57 public String getEffectDescription(float level) {
58 return "+" + (int)(DAMAGE_TO_FIGHTERS_BONUS) + "% damage to fighters";
59 }
60
61 public String getEffectPerLevelDescription() {
62 return null;
63 }
64
65 public ScopeDescription getScopeDescription() {
66 return ScopeDescription.SHIP_FIGHTERS;
67 }
68 }
69
70 public static class Level2B implements ShipSkillEffect {
71
72 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
73 stats.getDamageToMissiles().modifyFlat(id, DAMAGE_TO_MISSILES_BONUS / 100f);
74 }
75
76 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
77 stats.getDamageToMissiles().unmodify(id);
78 }
79
80 public String getEffectDescription(float level) {
81 return "+" + (int)(DAMAGE_TO_MISSILES_BONUS) + "% damage to missiles";
82 }
83
84 public String getEffectPerLevelDescription() {
85 return null;
86 }
87
88 public ScopeDescription getScopeDescription() {
89 return ScopeDescription.SHIP_FIGHTERS;
90 }
91 }
92
93 public static class Level3 implements ShipSkillEffect {
94
95 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
96 stats.getAutofireAimAccuracy().modifyFlat(id, TARGET_LEADING_BONUS * 0.01f);
97 }
98
99 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
100 stats.getAutofireAimAccuracy().unmodify(id);
101 }
102
103 public String getEffectDescription(float level) {
104 return "+" + (int)(TARGET_LEADING_BONUS) + "% target leading accuracy";
105 }
106
107 public String getEffectPerLevelDescription() {
108 return null;
109 }
110
111 public ScopeDescription getScopeDescription() {
112 return ScopeDescription.SHIP_FIGHTERS;
113 }
114 }
115
116}