Starsector API
Loading...
Searching...
No Matches
ForceConcentration.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 ForceConcentration {
13
14 // these actually get applied in CoordinatedManeuversScript, based on the ship having
15 // Stats.HAS_FORCE_CONCENTRATION_BONUS > 0
16 public static float ZERO_FLUX_SPEED_BONUS_SMALL = 25f;
17 public static float ZERO_FLUX_SPEED_BONUS = 100f;
19 public static float ZERO_FLUX_TURN_BONUS = 20f;
21
22 public static float COMMAND_POINT_REGEN_PERCENT = 100f;
23
24
25
26// public static class Level1 implements ShipSkillEffect {
27//
28// public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
29// //stats.getDynamic().getMod(Stats.MAX_PERMANENT_HULLMODS_MOD).modifyFlat(id, EXTRA_MODS);
30// }
31//
32// public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
33// //stats.getDynamic().getMod(Stats.MAX_PERMANENT_HULLMODS_MOD).unmodifyFlat(id);
34// }
35//
36// public String getEffectDescription(float level) {
37// return "Able to build " + EXTRA_MODS + " more permanent hullmod* into ships";
38// }
39//
40// public String getEffectPerLevelDescription() {
41// return null;
42// }
43//
44// public ScopeDescription getScopeDescription() {
45// return ScopeDescription.FLEET;
46// }
47// }
48
49
50 public static class Level2 implements CharacterStatsSkillEffect {
51 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
52 //stats.getDynamic().getMod(Stats.HAS_FORCE_CONCENTRATION_BONUS_MOD).modifyFlat(id, 1f);
53 }
54
55 public void unapply(MutableCharacterStatsAPI stats, String id) {
56 //stats.getDynamic().getMod(Stats.HAS_FORCE_CONCENTRATION_BONUS_MOD).unmodifyFlat(id);
57 }
58
59 public String getEffectDescription(float level) {
60 return "+" + (int)ZERO_FLUX_SPEED_BONUS + " to 0-flux speed boost and a high maneuverability bonus if no enemy presence nearby, +" +
61 (int)ZERO_FLUX_SPEED_BONUS_SMALL + " to 0-flux boost otherwise";
62 }
63
64 public String getEffectPerLevelDescription() {
65 return null;
66 }
67
68 public ScopeDescription getScopeDescription() {
69 return ScopeDescription.ALL_SHIPS;
70 }
71 }
72
73 public static class Level3 implements CharacterStatsSkillEffect {
74 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
75 stats.getDynamic().getMod(Stats.CAN_DEPLOY_LEFT_RIGHT_MOD).modifyFlat(id, 1f);
76 }
77
78 public void unapply(MutableCharacterStatsAPI stats, String id) {
79 stats.getDynamic().getMod(Stats.CAN_DEPLOY_LEFT_RIGHT_MOD).unmodifyFlat(id);
80 }
81
82 public String getEffectDescription(float level) {
83 return "Able to deploy ships of all size classes from the flanks in all combat scenarios";
84 }
85
86 public String getEffectPerLevelDescription() {
87 return null;
88 }
89
90 public ScopeDescription getScopeDescription() {
91 return ScopeDescription.ALL_SHIPS;
92 }
93 }
94
95 public static class Level4 extends BaseSkillEffectDescription implements CharacterStatsSkillEffect {
96
97 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
98 stats.getDynamic().getStat(Stats.COMMAND_POINT_RATE_COMMANDER).modifyFlat(id, COMMAND_POINT_REGEN_PERCENT / 100f);
99 }
100
101 public void unapply(MutableCharacterStatsAPI stats, String id) {
102 stats.getDynamic().getStat(Stats.COMMAND_POINT_RATE_COMMANDER).unmodify(id);
103 }
104
105 public void createCustomDescription(MutableCharacterStatsAPI stats, SkillSpecAPI skill,
106 TooltipMakerAPI info, float width) {
107 init(stats, skill);
108
109 float opad = 10f;
110 Color c = Misc.getBasePlayerColor();
111 //info.addPara("Affects: %s", opad + 5f, Misc.getGrayColor(), c, "fleet");
112 info.addPara("Affects: %s", opad + 5f, Misc.getGrayColor(), c, "fleet");
113 info.addSpacer(opad);
114 info.addPara("%s faster command point recovery", 0f, hc, hc,
115 "" + (int) COMMAND_POINT_REGEN_PERCENT + "%");
116 }
117
118 public String getEffectDescription(float level) {
119 return null;
120 }
121
122 public String getEffectPerLevelDescription() {
123 return null;
124 }
125
126 public ScopeDescription getScopeDescription() {
127 return ScopeDescription.FLEET;
128 }
129 }
130}
131
132
133
134
135
void init(MutableCharacterStatsAPI stats, SkillSpecAPI skill)