Starsector API
Loading...
Searching...
No Matches
SpecialModifications.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.DescriptionSkillEffect;
7import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;
8import com.fs.starfarer.api.characters.ShipSkillEffect;
9import com.fs.starfarer.api.combat.MutableShipStatsAPI;
10import com.fs.starfarer.api.combat.ShipAPI.HullSize;
11import com.fs.starfarer.api.impl.campaign.ids.Stats;
12import com.fs.starfarer.api.util.Misc;
13
15
16 public static int VENTS_BONUS = 10;
17 public static int CAPACITORS_BONUS = 10;
18 public static int EXTRA_MODS = 1;
19 public static float BUILD_IN_XP_BONUS = 0.20f;
20
21
22 public static class Level0 implements DescriptionSkillEffect {
23 public String getString() {
24 int max = Misc.MAX_PERMA_MODS;
25 return "*The base maximum number of permanent hullmods you're able to build into a ship is " +
26 max + "."
27 ;
28 }
29 public Color[] getHighlightColors() {
30 Color h = Misc.getHighlightColor();
31 h = Misc.getDarkHighlightColor();
32 return new Color[] {h, h, h};
33 }
34 public String[] getHighlights() {
35 int max = Misc.MAX_PERMA_MODS;
36 return new String [] {"" + max};
37 }
38 public Color getTextColor() {
39 return null;
40 }
41 }
42
43
44 public static class Level1 implements CharacterStatsSkillEffect {
45 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
46 stats.getMaxCapacitorsBonus().modifyFlat(id, CAPACITORS_BONUS);
47 }
48
49 public void unapply(MutableCharacterStatsAPI stats, String id) {
50 stats.getMaxCapacitorsBonus().unmodify(id);
51 }
52
53 public String getEffectDescription(float level) {
54 return "+" + (int) CAPACITORS_BONUS + " maximum flux capacitors";
55 }
56
57 public String getEffectPerLevelDescription() {
58 return null;
59 }
60
61 public ScopeDescription getScopeDescription() {
62 return ScopeDescription.ALL_SHIPS;
63 }
64 }
65
66 public static class Level2 implements CharacterStatsSkillEffect {
67 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
68 //stats.getShipOrdnancePointBonus().modifyPercent(id, 50f);
69 stats.getMaxVentsBonus().modifyFlat(id, VENTS_BONUS);
70 }
71
72 public void unapply(MutableCharacterStatsAPI stats, String id) {
73 //stats.getShipOrdnancePointBonus().unmodifyPercent(id);
74 stats.getMaxVentsBonus().unmodify(id);
75 }
76
77 public String getEffectDescription(float level) {
78 return "+" + (int) VENTS_BONUS + " maximum flux vents";
79 }
80
81 public String getEffectPerLevelDescription() {
82 return null;
83 }
84
85 public ScopeDescription getScopeDescription() {
86 return ScopeDescription.ALL_SHIPS;
87 }
88 }
89
90 public static class Level3 implements CharacterStatsSkillEffect {
91 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
92 stats.getDynamic().getMod(Stats.BUILD_IN_BONUS_XP_MOD).modifyFlat(id, BUILD_IN_XP_BONUS);
93 }
94
95 public void unapply(MutableCharacterStatsAPI stats, String id) {
96 stats.getDynamic().getMod(Stats.BUILD_IN_BONUS_XP_MOD).unmodifyFlat(id);
97 }
98
99 public String getEffectDescription(float level) {
100 return "+" + (int) Math.round(BUILD_IN_XP_BONUS * 100f) + "% bonus experience from building permanent hullmods* into ships";
101 }
102
103 public String getEffectPerLevelDescription() {
104 return null;
105 }
106
107 public ScopeDescription getScopeDescription() {
108 return ScopeDescription.ALL_SHIPS;
109 }
110 }
111
112 public static class Level4 implements ShipSkillEffect {
113
114 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
115 stats.getDynamic().getMod(Stats.MAX_PERMANENT_HULLMODS_MOD).modifyFlat(id, EXTRA_MODS);
116 }
117
118 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
119 stats.getDynamic().getMod(Stats.MAX_PERMANENT_HULLMODS_MOD).unmodifyFlat(id);
120 }
121
122 public String getEffectDescription(float level) {
123 return "Able to build " + EXTRA_MODS + " more permanent hullmod* into ships";
124 }
125
126 public String getEffectPerLevelDescription() {
127 return null;
128 }
129
130 public ScopeDescription getScopeDescription() {
131 return ScopeDescription.FLEET;
132 }
133 }
134
135}
136
137
138
139
140