Starsector API
Loading...
Searching...
No Matches
ColonyManagement.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 ColonyManagement {
12
13 public static int ADMINS = 1;
14 public static int COLONY_NUM_BONUS = 1;
15// public static int LEVEL_3_BONUS = 1;
16
17 public static class Level0 implements DescriptionSkillEffect {
18 public String getString() {
19 int baseAdmins = (int)Global.getSector().getPlayerStats().getAdminNumber().getBaseValue();
20 int baseOutposts = (int)Global.getSector().getPlayerStats().getOutpostNumber().getBaseValue();
21
22 String colonies = "colonies";
23 String admins = "administrators";
24 if (baseOutposts == 1) colonies = "colony";
25 if (baseAdmins == 1) admins = "administrator";
26
27 return "At a base level, able to manage up to " +
28 baseAdmins + " " + admins + " and to personally govern " +
29 baseOutposts + " " + colonies + ". " +
30 "The maximum number of colonies governed personally can be" +
31 " exceeded at the cost of a stability penalty.";
32// return "At a base level, able to personally govern " +
33// baseOutposts + " " + colonies + ". " +
34// "The maximum number of colonies can be" +
35// " exceeded at the cost of a stability penalty. Colonies governed by administrators " +
36// "do not count against your personal limit.";
37 }
38 public Color[] getHighlightColors() {
39 Color h = Misc.getHighlightColor();
40 h = Misc.getDarkHighlightColor();
41 return new Color[] {h, h, h};
42 }
43 public String[] getHighlights() {
44 String baseAdmins = "" + (int)Global.getSector().getPlayerStats().getAdminNumber().getBaseValue();
45 String baseOutposts = "" + (int)Global.getSector().getPlayerStats().getOutpostNumber().getBaseValue();
46 return new String [] {baseAdmins, baseOutposts};
47 }
48 public Color getTextColor() {
49 return null;
50 }
51 }
52
53
54 public static class Level1 implements CharacterStatsSkillEffect {
55
56 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
57 stats.getOutpostNumber().modifyFlat(id, COLONY_NUM_BONUS);
58 }
59
60 public void unapply(MutableCharacterStatsAPI stats, String id) {
61 stats.getOutpostNumber().unmodify(id);
62 }
63
64 public String getEffectDescription(float level) {
65 return "Able to personally govern " + (int) COLONY_NUM_BONUS + " additional colony";
66 }
67
68 public String getEffectPerLevelDescription() {
69 return null;
70 }
71
72 public ScopeDescription getScopeDescription() {
73 return ScopeDescription.NONE;
74 }
75 }
76
77 public static class Level2 implements CharacterStatsSkillEffect {
78
79 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
80 stats.getAdminNumber().modifyFlat(id, ADMINS);
81 }
82
83 public void unapply(MutableCharacterStatsAPI stats, String id) {
84 stats.getAdminNumber().unmodify(id);
85 }
86
87 public String getEffectDescription(float level) {
88 return "Able to manage " + (int) ADMINS + " additional administrator";
89 }
90
91 public String getEffectPerLevelDescription() {
92 return null;
93 }
94
95 public ScopeDescription getScopeDescription() {
96 return ScopeDescription.NONE;
97 }
98 }
99
100
101// public static class Level3A implements CharacterStatsSkillEffect {
102//
103// public void apply(MutableCharacterStatsAPI stats, String id, float level) {
104// stats.getOutpostNumber().modifyFlat(id, LEVEL_3_BONUS);
105// }
106//
107// public void unapply(MutableCharacterStatsAPI stats, String id) {
108// stats.getOutpostNumber().unmodify(id);
109// }
110//
111// public String getEffectDescription(float level) {
112// int max = (int) Global.getSector().getCharacterData().getPerson().getStats().getOutpostNumber().getBaseValue();
113// max += LEVEL_2_BONUS;
114// max += LEVEL_3_BONUS;
115//
116// return "Able to personally govern up to " + (int) (max) + " colonies";
117// //return "Able to personally govern up to " + (int) (max) + " outposts";
118// }
119//
120// public String getEffectPerLevelDescription() {
121// return null;
122// }
123//
124// public ScopeDescription getScopeDescription() {
125// return ScopeDescription.NONE;
126// }
127// }
128}
static SectorAPI getSector()
Definition Global.java:59