Starsector API
Loading...
Searching...
No Matches
IndustrialPlanning.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.CharacterStatsSkillEffect;
6import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;
7import com.fs.starfarer.api.characters.SkillSpecAPI;
8import com.fs.starfarer.api.impl.campaign.ids.Stats;
9import com.fs.starfarer.api.ui.TooltipMakerAPI;
10import com.fs.starfarer.api.util.Misc;
11
12public class IndustrialPlanning {
13
14 public static int SUPPLY_BONUS = 1;
15 public static float CUSTOM_PRODUCTION_BONUS = 50f;
16
17 public static class Level1 implements CharacterStatsSkillEffect {
18 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
19 stats.getDynamic().getMod(Stats.SUPPLY_BONUS_MOD).modifyFlat(id, SUPPLY_BONUS);
20 }
21
22 public void unapply(MutableCharacterStatsAPI stats, String id) {
23 stats.getDynamic().getMod(Stats.SUPPLY_BONUS_MOD).unmodifyFlat(id);
24 }
25
26 public String getEffectDescription(float level) {
27 return "All industries supply " + SUPPLY_BONUS + " more unit of all the commodities they produce";
28 }
29
30 public String getEffectPerLevelDescription() {
31 return null;
32 }
33
34 public ScopeDescription getScopeDescription() {
35 return ScopeDescription.GOVERNED_OUTPOST;
36 }
37 }
38
39 public static class Level2 extends BaseSkillEffectDescription implements CharacterStatsSkillEffect {
40 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
41 //stats.getDynamic().getMod(Stats.CUSTOM_PRODUCTION_MOD).modifyPercent(id, CUSTOM_PRODUCTION_BONUS, "Industrial planning");
42 stats.getDynamic().getMod(Stats.CUSTOM_PRODUCTION_MOD).modifyMult(id, 1f + CUSTOM_PRODUCTION_BONUS/100f, "Industrial planning");
43 }
44
45 public void unapply(MutableCharacterStatsAPI stats, String id) {
46 //stats.getDynamic().getMod(Stats.CUSTOM_PRODUCTION_MOD).unmodifyPercent(id);
47 stats.getDynamic().getMod(Stats.CUSTOM_PRODUCTION_MOD).unmodifyMult(id);
48 }
49
50 public void createCustomDescription(MutableCharacterStatsAPI stats, SkillSpecAPI skill,
51 TooltipMakerAPI info, float width) {
52 init(stats, skill);
53 float opad = 10f;
54 Color c = Misc.getBasePlayerColor();
55 info.addPara("Affects: %s", opad + 5f, Misc.getGrayColor(), c, "all colonies");
56 info.addSpacer(opad);
57 info.addPara("+%s maximum value of custom ship and weapon production per month", 0f, hc, hc,
58 "" + (int) CUSTOM_PRODUCTION_BONUS + "%");
59 }
60
61 public ScopeDescription getScopeDescription() {
62 return ScopeDescription.ALL_OUTPOSTS;
63 }
64 }
65
66// public static class Level1A implements CharacterStatsSkillEffect {
67//
68// public void apply(MutableCharacterStatsAPI stats, String id, float level) {
69// stats.getDynamic().getMod(Stats.DEMAND_REDUCTION_MOD).modifyFlat(id, DEMAND_REDUCTION);
70// }
71//
72// public void unapply(MutableCharacterStatsAPI stats, String id) {
73// stats.getDynamic().getMod(Stats.DEMAND_REDUCTION_MOD).unmodifyFlat(id);
74// }
75//
76// public String getEffectDescription(float level) {
77// return "All industries require " + DEMAND_REDUCTION + " less unit of all the commodities they need";
78// }
79//
80// public String getEffectPerLevelDescription() {
81// return null;
82// }
83//
84// public ScopeDescription getScopeDescription() {
85// return ScopeDescription.GOVERNED_OUTPOST;
86// }
87// }
88//
89// public static class Level1B implements MarketSkillEffect {
90// public void apply(MarketAPI market, String id, float level) {
91// market.getUpkeepMult().modifyMult(id, UPKEEP_MULT, "Industrial planning");
92// }
93//
94// public void unapply(MarketAPI market, String id) {
95// market.getUpkeepMult().unmodifyMult(id);
96// }
97//
98// public String getEffectDescription(float level) {
99// return "-" + (int)Math.round(Math.abs((1f - UPKEEP_MULT)) * 100f) + "% upkeep for colonies";
100// }
101//
102// public String getEffectPerLevelDescription() {
103// return null;
104// }
105//
106// public ScopeDescription getScopeDescription() {
107// return ScopeDescription.GOVERNED_OUTPOST;
108// }
109// }
110//
111// public static class Level3A implements MarketSkillEffect {
112// public void apply(MarketAPI market, String id, float level) {
113// market.getIncomeMult().modifyMult(id, INCOME_MULT, "Industrial planning");
114// }
115//
116// public void unapply(MarketAPI market, String id) {
117// market.getIncomeMult().unmodifyMult(id);
118// }
119//
120// public String getEffectDescription(float level) {
121// return "+" + (int)Math.round((INCOME_MULT - 1f) * 100f) + "% income from colonies, including exports";
122// }
123//
124// public String getEffectPerLevelDescription() {
125// return null;
126// }
127//
128// public ScopeDescription getScopeDescription() {
129// return ScopeDescription.GOVERNED_OUTPOST;
130// }
131// }
132
133// public static void main(String[] args) {
134// System.out.println((int)((1.331 - 1.) * 1000.));
135// }
136
137}
138
139
void init(MutableCharacterStatsAPI stats, SkillSpecAPI skill)