Starsector API
Loading...
Searching...
No Matches
MissileSpecialization.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
8
9 public static final float MISSILE_AMMO_BONUS = 100f;
10 public static final float MISSILE_SPEC_PERK_HEALTH_BONUS = 25f;
11 public static final float MISSILE_SPEC_ROF_BONUS = 25f;
12 public static final float MISSILE_SPEC_AMMO_REGEN_BONUS = 25f;
13 public static final float MISSILE_SPEC_DAMAGE_BONUS = 10f;
14
15 public static class Level1 implements ShipSkillEffect {
16
17 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
18 stats.getMissileAmmoBonus().modifyPercent(id, MISSILE_AMMO_BONUS);
19 }
20
21 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
22 stats.getMissileAmmoBonus().unmodify(id);
23 }
24
25 public String getEffectDescription(float level) {
26 return "+" + (int)(MISSILE_AMMO_BONUS) + "% missile weapon ammo capacity";
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
40 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
41 stats.getMissileHealthBonus().modifyPercent(id, MISSILE_SPEC_PERK_HEALTH_BONUS);
42 }
43
44 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
45 stats.getMissileHealthBonus().unmodify(id);
46 }
47
48 public String getEffectDescription(float level) {
49 //return "+" + (int)(MISSILE_SPEC_PERK_HEALTH_BONUS) + "% missile, rocket, bomb, and torpedo hitpoints";
50 return "+" + (int)(MISSILE_SPEC_PERK_HEALTH_BONUS) + "% missile hitpoints";
51 }
52
53 public String getEffectPerLevelDescription() {
54 return null;
55 }
56
57 public ScopeDescription getScopeDescription() {
58 return ScopeDescription.PILOTED_SHIP;
59 }
60
61 }
62
63 public static class Level3 implements ShipSkillEffect {
64
65 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
66 //stats.getMissileWeaponDamageMult().modifyPercent(id, MISSILE_SPEC_PERK_DAMAGE_BONUS);
67 stats.getMissileRoFMult().modifyPercent(id, MISSILE_SPEC_ROF_BONUS);
68 }
69
70 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
71 //stats.getMissileWeaponDamageMult().unmodify(id);
72 stats.getMissileRoFMult().unmodify(id);
73 }
74
75 public String getEffectDescription(float level) {
76 return "+" + (int)(MISSILE_SPEC_ROF_BONUS) + "% rate of fire for missile weapons";
77 }
78
79 public String getEffectPerLevelDescription() {
80 return null;
81 }
82
83 public ScopeDescription getScopeDescription() {
84 return ScopeDescription.PILOTED_SHIP;
85 }
86 }
87
88 public static class Level3A implements ShipSkillEffect {
89
90 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
91 //stats.getMissileWeaponDamageMult().modifyPercent(id, MISSILE_SPEC_PERK_DAMAGE_BONUS);
92 stats.getMissileAmmoRegenMult().modifyPercent(id, MISSILE_SPEC_AMMO_REGEN_BONUS);
93 }
94
95 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
96 //stats.getMissileWeaponDamageMult().unmodify(id);
97 stats.getMissileAmmoRegenMult().unmodify(id);
98 }
99
100 public String getEffectDescription(float level) {
101 return "+" + (int)(MISSILE_SPEC_AMMO_REGEN_BONUS) + "% missile weapon ammo regeneration rate (only for missile weapons that regenerate ammo)";
102 }
103
104 public String getEffectPerLevelDescription() {
105 return null;
106 }
107
108 public ScopeDescription getScopeDescription() {
109 return ScopeDescription.PILOTED_SHIP;
110 }
111 }
112
113 public static class Level4 implements ShipSkillEffect {
114
115 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
116 stats.getMissileWeaponDamageMult().modifyPercent(id, MISSILE_SPEC_DAMAGE_BONUS);
117 }
118
119 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
120 stats.getMissileWeaponDamageMult().unmodify(id);
121 }
122
123 public String getEffectDescription(float level) {
124 return "+" + (int)(MISSILE_SPEC_DAMAGE_BONUS) + "% damage dealt by missile weapons";
125 }
126
127 public String getEffectPerLevelDescription() {
128 return null;
129 }
130
131 public ScopeDescription getScopeDescription() {
132 return ScopeDescription.PILOTED_SHIP;
133 }
134 }
135}