Starsector API
Loading...
Searching...
No Matches
Sensors.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.skills;
2
3import java.awt.Color;
4
5import com.fs.starfarer.api.characters.DescriptionSkillEffect;
6import com.fs.starfarer.api.characters.FleetStatsSkillEffect;
7import com.fs.starfarer.api.fleet.MutableFleetStatsAPI;
8import com.fs.starfarer.api.impl.campaign.ids.Stats;
9
10public class Sensors {
11
12 public static float DETECTED_BONUS = 25f;
13 public static float SENSOR_BONUS = 25f;
14
15 public static float SLOW_BURN_BONUS = 3f;
16
17 public static float GO_DARK_MULT = 0.5f;
18 public static float SENSOR_BURST_PENALTY_MULT = 0.5f;
19
20
21
22 public static class Level0 implements DescriptionSkillEffect {
23 public String getString() {
24 //int base = (int) RingSystemTerrainPlugin.MAX_SNEAK_BURN_LEVEL;
25// return "*A slow-moving fleet is harder to detect in some types of terrain, and can avoid some hazards. " +
26// "Several abilities also make the fleet move slowly when they are activated. The base burn " +
27// "level at which a fleet is considered to be slow-moving is " + base + ".";
28 //int reduction = (int)Math.round((1f - Misc.SNEAK_BURN_MULT) * 100f);
29 return "*A slow-moving fleet is harder to detect in some types of terrain, and can avoid some hazards. " +
30 "Some abilities also make the fleet move slowly when activated. A fleet is considered " +
31 "slow-moving at a burn level of half that of its slowest ship.";
32 }
33 public Color[] getHighlightColors() {
34 return null;
35// Color h = Misc.getHighlightColor();
36// h = Misc.getDarkHighlightColor();
37// return new Color[] {h};
38 }
39 public String[] getHighlights() {
40 return null;
41// int base = (int) RingSystemTerrainPlugin.MAX_SNEAK_BURN_LEVEL;
42// return new String [] {"" + base};
43 }
44 public Color getTextColor() {
45 return null;
46 }
47 }
48// public static class Level1 implements FleetStatsSkillEffect {
49// public void apply(MutableFleetStatsAPI stats, String id, float level) {
50// stats.getDynamic().getMod(Stats.CAN_SEE_NASCENT_POINTS).modifyFlat(id, 1);
51// }
52//
53// public void unapply(MutableFleetStatsAPI stats, String id) {
54// stats.getDynamic().getMod(Stats.CAN_SEE_NASCENT_POINTS).unmodify(id);
55// }
56//
57// public String getEffectDescription(float level) {
58// return "Can detect nascent gravity wells around star systems";
59// }
60//
61// public String getEffectPerLevelDescription() {
62// return null;
63// }
64//
65// public ScopeDescription getScopeDescription() {
66// return ScopeDescription.FLEET;
67// }
68// }
69
70 public static class Level1 implements FleetStatsSkillEffect {
71 public void apply(MutableFleetStatsAPI stats, String id, float level) {
72 stats.getDetectedRangeMod().modifyMult(id, 1f - DETECTED_BONUS / 100f, "Sensors skill");
73 }
74
75 public void unapply(MutableFleetStatsAPI stats, String id) {
76 stats.getDetectedRangeMod().unmodify(id);
77 }
78
79 public String getEffectDescription(float level) {
80 return "-" + (int) DETECTED_BONUS + "% detected-at range";
81 }
82
83 public String getEffectPerLevelDescription() {
84 return null;
85 }
86
87 public ScopeDescription getScopeDescription() {
88 return ScopeDescription.FLEET;
89 }
90 }
91
92 public static class Level2 implements FleetStatsSkillEffect {
93 public void apply(MutableFleetStatsAPI stats, String id, float level) {
94 stats.getSensorRangeMod().modifyPercent(id, SENSOR_BONUS, "Sensors skill");
95 }
96
97 public void unapply(MutableFleetStatsAPI stats, String id) {
98 stats.getSensorRangeMod().unmodify(id);
99 }
100
101 public String getEffectDescription(float level) {
102 return "+" + (int) SENSOR_BONUS + "% sensor range";
103 }
104
105 public String getEffectPerLevelDescription() {
106 return null;
107 }
108
109 public ScopeDescription getScopeDescription() {
110 return ScopeDescription.FLEET;
111 }
112 }
113
114 public static class Level3 implements FleetStatsSkillEffect {
115 public void apply(MutableFleetStatsAPI stats, String id, float level) {
116 stats.getDynamic().getMod(Stats.MOVE_SLOW_SPEED_BONUS_MOD).modifyFlat(id, SLOW_BURN_BONUS);
117 }
118
119 public void unapply(MutableFleetStatsAPI stats, String id) {
120 stats.getDynamic().getMod(Stats.MOVE_SLOW_SPEED_BONUS_MOD).unmodifyFlat(id);
121 }
122
123 public String getEffectDescription(float level) {
124 return "+" + (int) SLOW_BURN_BONUS + " to burn level at which the fleet is considered to be moving slowly*";
125 }
126
127 public String getEffectPerLevelDescription() {
128 return null;
129 }
130
131 public ScopeDescription getScopeDescription() {
132 return ScopeDescription.FLEET;
133 }
134 }
135
136// public static class Level2B implements FleetStatsSkillEffect {
137// public void apply(MutableFleetStatsAPI stats, String id, float level) {
138// stats.getDynamic().getStat(Stats.GO_DARK_DETECTED_AT_MULT).modifyMult(id, GO_DARK_MULT);
139// }
140//
141// public void unapply(MutableFleetStatsAPI stats, String id) {
142// stats.getDynamic().getStat(Stats.GO_DARK_DETECTED_AT_MULT).unmodify(id);
143// }
144//
145// public String getEffectDescription(float level) {
146// return "Doubles the effectiveness of the \"Go Dark\" ability";
147// }
148//
149// public String getEffectPerLevelDescription() {
150// return null;
151// }
152//
153// public ScopeDescription getScopeDescription() {
154// return ScopeDescription.FLEET;
155// }
156// }
157//
158//
159// public static class Level3B implements FleetStatsSkillEffect {
160// public void apply(MutableFleetStatsAPI stats, String id, float level) {
161// stats.getDynamic().getStat(Stats.SENSOR_BURST_BURN_PENALTY_MULT).modifyMult(id, SENSOR_BURST_PENALTY_MULT);
162// }
163//
164// public void unapply(MutableFleetStatsAPI stats, String id) {
165// stats.getDynamic().getStat(Stats.SENSOR_BURST_BURN_PENALTY_MULT).unmodify(id);
166// }
167//
168// public String getEffectDescription(float level) {
169// return "Halves the burn level penalty of the \"Active Sensor Burst\" ability";
170// }
171//
172// public String getEffectPerLevelDescription() {
173// return null;
174// }
175//
176// public ScopeDescription getScopeDescription() {
177// return ScopeDescription.FLEET;
178// }
179// }
180}
181
182
183