Starsector API
Loading...
Searching...
No Matches
PhaseMastery.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.skills;
2
3import com.fs.starfarer.api.characters.ShipSkillEffect;
4import com.fs.starfarer.api.combat.MutableShipStatsAPI;
5import com.fs.starfarer.api.combat.ShipAPI.HullSize;
6import com.fs.starfarer.api.impl.campaign.ids.Stats;
7
8public class PhaseMastery {
9
10 public static final float FLUX_UPKEEP_REDUCTION = 25f;
11 public static final float PHASE_COOLDOWN_REDUCTION = 50f;
12 public static final float PHASE_SPEED_BONUS = 100f;
13
14
15 public static class Level1 implements ShipSkillEffect {
16
17 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
18 stats.getPhaseCloakUpkeepCostBonus().modifyMult(id, 1f - FLUX_UPKEEP_REDUCTION / 100f);
19 }
20
21 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
22 stats.getPhaseCloakUpkeepCostBonus().unmodify(id);
23 }
24
25 public String getEffectDescription(float level) {
26 return "-" + (int)(FLUX_UPKEEP_REDUCTION) + "% flux generated by active phase cloak";
27 }
28
29 public String getEffectPerLevelDescription() {
30 return null;
31 }
32
33 public ScopeDescription getScopeDescription() {
34 return ScopeDescription.PILOTED_SHIP;
35 }
36 }
37
38 public static class Level2 implements ShipSkillEffect {
39 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
40 stats.getPhaseCloakCooldownBonus().modifyMult(id, 1f - PHASE_COOLDOWN_REDUCTION / 100f);
41 }
42
43 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
44 stats.getPhaseCloakCooldownBonus().unmodify(id);
45 }
46
47 public String getEffectDescription(float level) {
48 return "-" + (int)(PHASE_COOLDOWN_REDUCTION) + "% phase cloak cooldown";
49 }
50
51 public String getEffectPerLevelDescription() {
52 return null;
53 }
54
55 public ScopeDescription getScopeDescription() {
56 return ScopeDescription.PILOTED_SHIP;
57 }
58 }
59
60 public static class Level3 implements ShipSkillEffect {
61
62 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
63 stats.getDynamic().getMod(Stats.PHASE_CLOAK_SPEED_MOD).modifyFlat(id, PHASE_SPEED_BONUS);
64 }
65
66 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
67 stats.getDynamic().getMod(Stats.PHASE_CLOAK_SPEED_MOD).unmodifyFlat(id);
68 }
69
70 public String getEffectDescription(float level) {
71 return "+" + (int)(PHASE_SPEED_BONUS) + "% top speed while phase cloak active";
72 }
73
74 public String getEffectPerLevelDescription() {
75 return null;
76 }
77
78 public ScopeDescription getScopeDescription() {
79 return ScopeDescription.PILOTED_SHIP;
80 }
81 }
82
83
84}