Starsector API
Loading...
Searching...
No Matches
BestOfTheBest.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
14public class BestOfTheBest {
15
16 public static int EXTRA_MODS = 1;
17 public static float DEPLOYMENT_BONUS = 0.1f;
18
19
20 public static class Level0 implements DescriptionSkillEffect {
21 public String getString() {
22 int max = Misc.MAX_PERMA_MODS;
23 return "*The base maximum number of permanent hullmods you're able to build into a ship is " +
24 max + "."
25 ;
26 }
27 public Color[] getHighlightColors() {
28 Color h = Misc.getHighlightColor();
29 h = Misc.getDarkHighlightColor();
30 return new Color[] {h, h, h};
31 }
32 public String[] getHighlights() {
33 int max = Misc.MAX_PERMA_MODS;
34 return new String [] {"" + max};
35 }
36 public Color getTextColor() {
37 return null;
38 }
39 }
40
41
42 public static class Level1 implements ShipSkillEffect {
43
44 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
45 stats.getDynamic().getMod(Stats.MAX_PERMANENT_HULLMODS_MOD).modifyFlat(id, EXTRA_MODS);
46 }
47
48 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
49 stats.getDynamic().getMod(Stats.MAX_PERMANENT_HULLMODS_MOD).unmodifyFlat(id);
50 }
51
52 public String getEffectDescription(float level) {
53 return "Able to build " + EXTRA_MODS + " more permanent hullmod* into ships";
54 }
55
56 public String getEffectPerLevelDescription() {
57 return null;
58 }
59
60 public ScopeDescription getScopeDescription() {
61 return ScopeDescription.FLEET;
62 }
63 }
64
65 public static class Level2 implements CharacterStatsSkillEffect {
66 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
67 stats.getDynamic().getMod(Stats.DEPLOYMENT_POINTS_MIN_FRACTION_OF_BATTLE_SIZE_BONUS_MOD).modifyFlat(id, DEPLOYMENT_BONUS);
68 }
69
70 public void unapply(MutableCharacterStatsAPI stats, String id) {
71 stats.getDynamic().getMod(Stats.DEPLOYMENT_POINTS_MIN_FRACTION_OF_BATTLE_SIZE_BONUS_MOD).unmodifyFlat(id);
72 }
73
74 public String getEffectDescription(float level) {
75// return "Deployment points increased as if holding an objective worth " +
76// (int)Math.round(DEPLOYMENT_BONUS * 100f) + "% of the battle size (equivalent to a Comm Relay)";
77 return "Deployment points bonus from objectives is at least " +
78 (int)Math.round(DEPLOYMENT_BONUS * 100f) + "% of the battle size, even if holding no objectives";
79 }
80
81 public String getEffectPerLevelDescription() {
82 return null;
83 }
84
85 public ScopeDescription getScopeDescription() {
86 return ScopeDescription.ALL_SHIPS;
87 }
88 }
89}
90
91
92
93
94