Starsector API
Loading...
Searching...
No Matches
OfficerManagement.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.util.Misc;
10
11public class OfficerManagement {
12
13 public static float NUM_OFFICERS_BONUS = 2;
14 public static float CP_BONUS = 2f;
15
16 public static class Level0 implements DescriptionSkillEffect {
17 public String getString() {
18 int baseOfficers = (int)Global.getSector().getPlayerStats().getOfficerNumber().getBaseValue();
19
20 return "*The base maximum number of officers you're able to command is " + baseOfficers + ".";
21 }
22 public Color[] getHighlightColors() {
23 Color h = Misc.getDarkHighlightColor();
24 return new Color[] {h};
25 }
26 public String[] getHighlights() {
27 String baseOfficers = "" + (int)Global.getSector().getPlayerStats().getOfficerNumber().getBaseValue();
28 return new String [] {baseOfficers};
29 }
30 public Color getTextColor() {
31 return null;
32 }
33 }
34 public static class Level1 implements CharacterStatsSkillEffect {
35
36 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
37 stats.getOfficerNumber().modifyFlat(id, NUM_OFFICERS_BONUS);
38 }
39
40 public void unapply(MutableCharacterStatsAPI stats, String id) {
41 stats.getOfficerNumber().unmodify(id);
42 }
43
44 public String getEffectDescription(float level) {
45 //return "Able to command up to " + (int) (max) + " officers";
46 return "+" + (int)NUM_OFFICERS_BONUS + " to maximum number of officers* you're able to command";
47 }
48
49 public String getEffectPerLevelDescription() {
50 return null;
51 }
52
53 public ScopeDescription getScopeDescription() {
54 return ScopeDescription.NONE;
55 }
56 }
57
58 public static class Level1B implements CharacterStatsSkillEffect {
59
60 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
61 stats.getCommandPoints().modifyFlat(id, CP_BONUS);
62 }
63
64 public void unapply(MutableCharacterStatsAPI stats, String id) {
65 stats.getCommandPoints().unmodify(id);
66 }
67
68 public String getEffectDescription(float level) {
69 return "+" + (int) CP_BONUS + " command points";
70 }
71
72 public String getEffectPerLevelDescription() {
73 return null;
74 }
75
76 public ScopeDescription getScopeDescription() {
77 return ScopeDescription.FLEET;
78 }
79 }
80}
static SectorAPI getSector()
Definition Global.java:59