Starsector API
Loading...
Searching...
No Matches
StrikeCommander.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;
6
7public class StrikeCommander {
8
9// public static final float MISSILE_SPEED_BONUS = 25f;
10// public static final float MISSILE_RANGE_MULT = 0.8f;
11
12 public static final float TARGET_LEADING_BONUS = 100f;
13 public static final float MISSILE_HITPOINTS_BONUS = 50f;
14 public static final float STRIKE_DAMAGE_BONUS = 20f;
15
16
17 public static class Level4 implements ShipSkillEffect {
18
19 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
20 stats.getAutofireAimAccuracy().modifyFlat(id, TARGET_LEADING_BONUS * 0.01f);
21 }
22
23 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
24 stats.getAutofireAimAccuracy().unmodify(id);
25 }
26
27 public String getEffectDescription(float level) {
28 return "+" + (int)(TARGET_LEADING_BONUS) + "% target leading accuracy";
29 }
30
31 public String getEffectPerLevelDescription() {
32 return null;
33 }
34
35 public ScopeDescription getScopeDescription() {
36 return ScopeDescription.SHIP_FIGHTERS;
37 }
38 }
39
40// public static class Level1 implements ShipSkillEffect {
41//
42// public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
43// stats.getMissileMaxSpeedBonus().modifyPercent(id, MISSILE_SPEED_BONUS);
44// stats.getMissileWeaponRangeBonus().modifyMult(id, MISSILE_RANGE_MULT);
45//
46// stats.getMissileAccelerationBonus().modifyPercent(id, MISSILE_SPEED_BONUS);
47// stats.getMissileMaxTurnRateBonus().modifyPercent(id, MISSILE_SPEED_BONUS * 2f);
48// stats.getMissileTurnAccelerationBonus().modifyPercent(id, MISSILE_SPEED_BONUS);
49//
50// }
51//
52// public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
53// stats.getMissileMaxSpeedBonus().unmodify(id);
54// stats.getMissileWeaponRangeBonus().unmodify(id);
55//
56// stats.getMissileAccelerationBonus().unmodify(id);
57// stats.getMissileMaxTurnRateBonus().unmodify(id);
58// stats.getMissileTurnAccelerationBonus().unmodify(id);
59// }
60//
61// public String getEffectDescription(float level) {
62// return "+" + (int)(MISSILE_SPEED_BONUS) + "% missile speed and maneuverability";
63// }
64//
65// public String getEffectPerLevelDescription() {
66// return null;
67// }
68//
69// public ScopeDescription getScopeDescription() {
70// return ScopeDescription.SHIP_FIGHTERS;
71// }
72// }
73
74 public static class Level2 implements ShipSkillEffect {
75
76 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
77 stats.getMissileHealthBonus().modifyPercent(id, MISSILE_HITPOINTS_BONUS);
78 }
79
80 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
81 stats.getMissileHealthBonus().unmodify(id);
82 }
83
84 public String getEffectDescription(float level) {
85 return "+" + (int)(MISSILE_HITPOINTS_BONUS) + "% missile, rocket, bomb, and torpedo hitpoints";
86 }
87
88 public String getEffectPerLevelDescription() {
89 return null;
90 }
91
92 public ScopeDescription getScopeDescription() {
93 return ScopeDescription.SHIP_FIGHTERS;
94 }
95 }
96
97 public static class Level3 implements ShipSkillEffect {
98
99 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
100 stats.getDamageToDestroyers().modifyPercent(id, STRIKE_DAMAGE_BONUS);
101 stats.getDamageToCruisers().modifyPercent(id, STRIKE_DAMAGE_BONUS);
102 stats.getDamageToCapital().modifyPercent(id, STRIKE_DAMAGE_BONUS);
103 }
104
105 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
106 stats.getDamageToDestroyers().unmodify(id);
107 stats.getDamageToCruisers().unmodify(id);
108 stats.getDamageToCapital().unmodify(id);
109 }
110
111 public String getEffectDescription(float level) {
112 return "+" + (int)(STRIKE_DAMAGE_BONUS) + "% damage to ships of destroyer size and larger";
113 }
114
115 public String getEffectPerLevelDescription() {
116 return null;
117 }
118
119 public ScopeDescription getScopeDescription() {
120 return ScopeDescription.SHIP_FIGHTERS;
121 }
122 }
123
124}