Starsector API
Loading...
Searching...
No Matches
Helmsmanship.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 Helmsmanship {
8
9 public static float MANEUVERABILITY_BONUS = 50;
10 public static float SPEED_BONUS = 15f;
11
12 public static float ELITE_SPEED_BONUS_FLAT = 10f;
13
14 public static float ZERO_FLUX_LEVEL = 1f;
15
16 //public static float DAMAGE_BONUS = 100f;
17
18
19 public static class Level1 implements ShipSkillEffect {
20 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
21 stats.getAcceleration().modifyPercent(id, MANEUVERABILITY_BONUS);
22 stats.getDeceleration().modifyPercent(id, MANEUVERABILITY_BONUS);
23 stats.getTurnAcceleration().modifyPercent(id, MANEUVERABILITY_BONUS * 2f);
24 stats.getMaxTurnRate().modifyPercent(id, MANEUVERABILITY_BONUS);
25
26// stats.getBallisticWeaponDamageMult().modifyPercent(id, DAMAGE_BONUS);
27// stats.getEnergyWeaponDamageMult().modifyPercent(id, DAMAGE_BONUS);
28// stats.getMissileWeaponDamageMult().modifyPercent(id, DAMAGE_BONUS);
29 }
30
31 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
32 stats.getAcceleration().unmodify(id);
33 stats.getDeceleration().unmodify(id);
34 stats.getTurnAcceleration().unmodify(id);
35 stats.getMaxTurnRate().unmodify(id);
36
37// stats.getBallisticWeaponDamageMult().unmodify(id);
38// stats.getEnergyWeaponDamageMult().unmodify(id);
39// stats.getMissileWeaponDamageMult().unmodify(id);
40 }
41
42 public String getEffectDescription(float level) {
43 return "+" + (int)(MANEUVERABILITY_BONUS) + "% maneuverability";
44 }
45
46 public String getEffectPerLevelDescription() {
47 return null;
48 }
49
50 public ScopeDescription getScopeDescription() {
51 return ScopeDescription.PILOTED_SHIP;
52 }
53 }
54
55 public static class Level2 implements ShipSkillEffect {
56 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
57 stats.getMaxSpeed().modifyPercent(id, SPEED_BONUS);
58 }
59
60 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
61 stats.getMaxSpeed().unmodify(id);
62 }
63
64 public String getEffectDescription(float level) {
65 return "+" + (int)(SPEED_BONUS) + "% top speed";
66 }
67
68 public String getEffectPerLevelDescription() {
69 return null;
70 }
71
72 public ScopeDescription getScopeDescription() {
73 return ScopeDescription.PILOTED_SHIP;
74 }
75 }
76
77// public static class Level3 implements ShipSkillEffect {
78//
79// public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
80// stats.getZeroFluxMinimumFluxLevel().modifyFlat(id, ZERO_FLUX_LEVEL * 0.01f);
81// }
82//
83// public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
84// stats.getZeroFluxMinimumFluxLevel().unmodify(id);
85// }
86//
87// public String getEffectDescription(float level) {
88// return "The 0-flux speed boost is activated at up to " + (int)(ZERO_FLUX_LEVEL) + "% flux";
89// }
90//
91// public String getEffectPerLevelDescription() {
92// return null;
93// }
94//
95// public ScopeDescription getScopeDescription() {
96// return ScopeDescription.PILOTED_SHIP;
97// }
98// }
99
100 public static class Level3 implements ShipSkillEffect {
101
102 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
103 stats.getAllowZeroFluxAtAnyLevel().modifyFlat(id, 1f);
104 }
105
106 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
107 stats.getAllowZeroFluxAtAnyLevel().unmodifyFlat(id);
108 }
109
110 public String getEffectDescription(float level) {
111 return "The 0-flux speed boost is activated at any flux level, as long as the ship is not generating flux or is venting / overloaded";
112 }
113
114 public String getEffectPerLevelDescription() {
115 return null;
116 }
117
118 public ScopeDescription getScopeDescription() {
119 return ScopeDescription.PILOTED_SHIP;
120 }
121 }
122
123 public static class Level4 implements ShipSkillEffect {
124 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
125 stats.getMaxSpeed().modifyFlat(id, ELITE_SPEED_BONUS_FLAT);
126 }
127
128 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
129 stats.getMaxSpeed().unmodify(id);
130 }
131
132 public String getEffectDescription(float level) {
133 return "+" + (int)(ELITE_SPEED_BONUS_FLAT) + " su/second to top speed";
134 }
135
136 public String getEffectPerLevelDescription() {
137 return null;
138 }
139
140 public ScopeDescription getScopeDescription() {
141 return ScopeDescription.PILOTED_SHIP;
142 }
143 }
144}