Starsector API
Loading...
Searching...
No Matches
TargetAnalysis.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 TargetAnalysis {
8
9 public static float DAMAGE_TO_MODULES_BONUS = 100;
10// public static float DAMAGE_TO_SHIELDS_BONUS = 15;
11// public static float HIT_STRENGTH_BONUS = 50;
12
13 public static float DAMAGE_TO_FRIGATES = 5;
14 public static float DAMAGE_TO_DESTROYERS = 10;
15 public static float DAMAGE_TO_CRUISERS = 15;
16 public static float DAMAGE_TO_CAPITALS = 20;
17
18
19 public static class Level1 implements ShipSkillEffect {
20 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
21 stats.getDamageToDestroyers().modifyPercent(id, DAMAGE_TO_DESTROYERS);
22 }
23
24 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
25 stats.getDamageToDestroyers().unmodifyPercent(id);
26 }
27
28 public String getEffectDescription(float level) {
29 return "+" + (int)(DAMAGE_TO_DESTROYERS) + "% damage to destroyers";
30 }
31
32 public String getEffectPerLevelDescription() {
33 return null;
34 }
35
36 public ScopeDescription getScopeDescription() {
37 return ScopeDescription.PILOTED_SHIP;
38 }
39 }
40
41 public static class Level1A implements ShipSkillEffect {
42 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
43 stats.getDamageToFrigates().modifyPercent(id, DAMAGE_TO_FRIGATES);
44 }
45
46 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
47 stats.getDamageToFrigates().unmodifyPercent(id);
48 }
49
50 public String getEffectDescription(float level) {
51 return "+" + (int)(DAMAGE_TO_FRIGATES) + "% damage to frigates";
52 }
53
54 public String getEffectPerLevelDescription() {
55 return null;
56 }
57
58 public ScopeDescription getScopeDescription() {
59 return ScopeDescription.PILOTED_SHIP;
60 }
61 }
62
63 public static class Level2 implements ShipSkillEffect {
64 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
65 stats.getDamageToCruisers().modifyPercent(id, DAMAGE_TO_CRUISERS);
66 }
67
68 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
69 stats.getDamageToCruisers().unmodifyPercent(id);
70 }
71
72 public String getEffectDescription(float level) {
73 return "+" + (int)(DAMAGE_TO_CRUISERS) + "% damage to cruisers";
74 }
75
76 public String getEffectPerLevelDescription() {
77 return null;
78 }
79
80 public ScopeDescription getScopeDescription() {
81 return ScopeDescription.PILOTED_SHIP;
82 }
83 }
84
85 public static class Level3 implements ShipSkillEffect {
86 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
87 stats.getDamageToCapital().modifyPercent(id, DAMAGE_TO_CAPITALS);
88 }
89
90 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
91 stats.getDamageToCapital().unmodifyPercent(id);
92 }
93
94 public String getEffectDescription(float level) {
95 return "+" + (int)(DAMAGE_TO_CAPITALS) + "% damage to capital ships";
96 }
97
98 public String getEffectPerLevelDescription() {
99 return null;
100 }
101
102 public ScopeDescription getScopeDescription() {
103 return ScopeDescription.PILOTED_SHIP;
104 }
105 }
106
107
108
109
110 public static class Level4 implements ShipSkillEffect {
111
112 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
113 stats.getDamageToTargetEnginesMult().modifyPercent(id, DAMAGE_TO_MODULES_BONUS);
114 stats.getDamageToTargetWeaponsMult().modifyPercent(id, DAMAGE_TO_MODULES_BONUS);
115 }
116
117 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
118 stats.getDamageToTargetEnginesMult().unmodify(id);
119 stats.getDamageToTargetWeaponsMult().unmodify(id);
120 }
121
122 public String getEffectDescription(float level) {
123 return "+" + (int)(DAMAGE_TO_MODULES_BONUS) + "% damage to weapons and engines";
124 }
125
126 public String getEffectPerLevelDescription() {
127 return null;
128 }
129
130 public ScopeDescription getScopeDescription() {
131 return ScopeDescription.PILOTED_SHIP;
132 }
133 }
134
135// public static class Level2 implements ShipSkillEffect {
136//
137// public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
138// stats.getDamageToTargetShieldsMult().modifyPercent(id, DAMAGE_TO_SHIELDS_BONUS);
139// }
140//
141// public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
142// stats.getDamageToTargetShieldsMult().unmodify(id);
143// }
144//
145// public String getEffectDescription(float level) {
146// return "+" + (int)(DAMAGE_TO_SHIELDS_BONUS) + "% damage to shields";
147// }
148//
149// public String getEffectPerLevelDescription() {
150// return null;
151// }
152//
153// public ScopeDescription getScopeDescription() {
154// return ScopeDescription.PILOTED_SHIP;
155// }
156//
157// }
158//
159// public static class Level3 implements ShipSkillEffect {
160//
161// public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
162// stats.getHitStrengthBonus().modifyPercent(id, HIT_STRENGTH_BONUS);
163// }
164//
165// public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
166// stats.getHitStrengthBonus().unmodify(id);
167// }
168//
169// public String getEffectDescription(float level) {
170// return "+" + (int)(HIT_STRENGTH_BONUS) + "% hit strength for armor damage reduction calculation only";
171// }
172//
173// public String getEffectPerLevelDescription() {
174// return null;
175// }
176//
177// public ScopeDescription getScopeDescription() {
178// return ScopeDescription.PILOTED_SHIP;
179// }
180// }
181
182}