Starsector API
Loading...
Searching...
No Matches
OfficerTraining.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.Global;
6import com.fs.starfarer.api.characters.CharacterStatsSkillEffect;
7import com.fs.starfarer.api.characters.DescriptionSkillEffect;
8import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;
9import com.fs.starfarer.api.impl.campaign.ids.Stats;
10import com.fs.starfarer.api.util.Misc;
11
12public class OfficerTraining {
13
14 public static final float MAX_LEVEL_BONUS = 1;
15 public static final float MAX_ELITE_SKILLS_BONUS = 1;
16 public static final float CP_BONUS = 2f;
17
18 public static class Level0 implements DescriptionSkillEffect {
19 public String getString() {
20 int base = (int)Global.getSettings().getInt("officerMaxLevel");
21 return "*The base maximum officer level is " + base + ".";
22 }
23 public Color[] getHighlightColors() {
24 Color h = Misc.getDarkHighlightColor();
25 return new Color[] {h};
26 }
27 public String[] getHighlights() {
28 int base = (int)Global.getSettings().getInt("officerMaxLevel");
29 return new String [] {"" + base};
30 }
31 public Color getTextColor() {
32 return null;
33 }
34 }
35
36 public static class Level1 implements CharacterStatsSkillEffect {
37
38 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
39 stats.getDynamic().getMod(Stats.OFFICER_MAX_LEVEL_MOD).modifyFlat(id, MAX_LEVEL_BONUS);
40 }
41
42 public void unapply(MutableCharacterStatsAPI stats, String id) {
43 stats.getDynamic().getMod(Stats.OFFICER_MAX_LEVEL_MOD).unmodify(id);
44 }
45
46 public String getEffectDescription(float level) {
47 return "+" + (int) MAX_LEVEL_BONUS + " to maximum level* of officers under your command";
48 }
49
50 public String getEffectPerLevelDescription() {
51 return null;
52 }
53
54 public ScopeDescription getScopeDescription() {
55 return ScopeDescription.NONE;
56 }
57 }
58
59 public static class Level2 implements CharacterStatsSkillEffect {
60
61 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
62 stats.getDynamic().getMod(Stats.OFFICER_MAX_ELITE_SKILLS_MOD).modifyFlat(id, MAX_ELITE_SKILLS_BONUS);
63 }
64
65 public void unapply(MutableCharacterStatsAPI stats, String id) {
66 stats.getDynamic().getMod(Stats.OFFICER_MAX_ELITE_SKILLS_MOD).unmodify(id);
67 }
68
69 public String getEffectDescription(float level) {
70 return "+" + (int) MAX_ELITE_SKILLS_BONUS + " to maximum number of elite skills for officers under your command";
71 }
72
73 public String getEffectPerLevelDescription() {
74 return null;
75 }
76
77 public ScopeDescription getScopeDescription() {
78 return ScopeDescription.NONE;
79 }
80 }
81
82 public static class Level3 implements CharacterStatsSkillEffect {
83
84 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
85 stats.getCommandPoints().modifyFlat(id, CP_BONUS);
86 }
87
88 public void unapply(MutableCharacterStatsAPI stats, String id) {
89 stats.getCommandPoints().unmodify(id);
90 }
91
92 public String getEffectDescription(float level) {
93 return "+" + (int) CP_BONUS + " command points";
94 }
95
96 public String getEffectPerLevelDescription() {
97 return null;
98 }
99
100 public ScopeDescription getScopeDescription() {
101 return ScopeDescription.FLEET;
102 }
103 }
104
105}
static SettingsAPI getSettings()
Definition Global.java:51