Starsector API
Loading...
Searching...
No Matches
CommandAndControl.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.skills;
2
3import com.fs.starfarer.api.Global;
4import com.fs.starfarer.api.characters.CharacterStatsSkillEffect;
5import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;
6import com.fs.starfarer.api.impl.campaign.ids.Stats;
7
8public class CommandAndControl {
9
10 public static final float BASE_SECONDS_PER_POINT = Global.getSettings().getFloat("baseSecondsPerCommandPoint");
11 public static final float RATE_BONUS = 50f;
12 public static final float CP_BONUS = 3f;
13
14 public static final float CM_BONUS = 5f;
15 public static final float EW_BONUS = 5f;
16
17
18 public static class Level1A implements CharacterStatsSkillEffect {
19
20 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
21 stats.getCommandPoints().modifyFlat(id, CP_BONUS);
22 }
23
24 public void unapply(MutableCharacterStatsAPI stats, String id) {
25 stats.getCommandPoints().unmodify(id);
26 }
27
28 public String getEffectDescription(float level) {
29 return "+" + (int) CP_BONUS + " command points";
30 }
31
32 public String getEffectPerLevelDescription() {
33 return null;
34 }
35
36 public ScopeDescription getScopeDescription() {
37 return ScopeDescription.FLEET;
38 }
39 }
40
41 public static class Level1B implements CharacterStatsSkillEffect {
42
43 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
44 stats.getDynamic().getStat(Stats.COMMAND_POINT_RATE_COMMANDER).modifyFlat(id, RATE_BONUS / 100f);
45 }
46
47 public void unapply(MutableCharacterStatsAPI stats, String id) {
48 stats.getDynamic().getStat(Stats.COMMAND_POINT_RATE_COMMANDER).unmodify(id);
49 }
50
51 public String getEffectDescription(float level) {
52 return "" + (int) RATE_BONUS + "% faster command point recovery";
53 }
54
55 public String getEffectPerLevelDescription() {
56 return null;
57 }
58
59 public ScopeDescription getScopeDescription() {
60 return ScopeDescription.FLEET;
61 }
62 }
63
64
65
66
67
68
69
70 public static class Level3A implements CharacterStatsSkillEffect {
71 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
72 stats.getDynamic().getMod(Stats.COORDINATED_MANEUVERS_MAX).modifyFlat(id, CM_BONUS);
73 }
74 public void unapply(MutableCharacterStatsAPI stats, String id) {
75 stats.getDynamic().getMod(Stats.COORDINATED_MANEUVERS_MAX).unmodify(id);
76 }
77 public String getEffectDescription(float level) {
78 return "" + (int) CM_BONUS + "% maximum bonus from Coordinated Maneuvers";
79 }
80 public String getEffectPerLevelDescription() {
81 return null;
82 }
83 public ScopeDescription getScopeDescription() {
84 return ScopeDescription.NONE;
85 }
86 }
87
88 public static class Level3B implements CharacterStatsSkillEffect {
89 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
90 stats.getDynamic().getMod(Stats.ELECTRONIC_WARFARE_MAX).modifyFlat(id, EW_BONUS);
91 }
92 public void unapply(MutableCharacterStatsAPI stats, String id) {
93 stats.getDynamic().getMod(Stats.ELECTRONIC_WARFARE_MAX).unmodify(id);
94 }
95 public String getEffectDescription(float level) {
96 return "" + (int) CM_BONUS + "% maximum bonus from Electronic Warfare";
97 }
98 public String getEffectPerLevelDescription() {
99 return null;
100 }
101 public ScopeDescription getScopeDescription() {
102 return ScopeDescription.NONE;
103 }
104 }
105
106}
static SettingsAPI getSettings()
Definition Global.java:51