Starsector API
Loading...
Searching...
No Matches
EvasiveAction.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 EvasiveAction {
8
9 public static final float MANEUVERABILITY_BONUS = 50;
10 public static final float DAMAGE_TO_MODULES_REDUCTION = 50;
11 public static final float EFFECTIVE_ARMOR_BONUS = 50;
12
13
14 public static class Level1 implements ShipSkillEffect {
15
16 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
17 stats.getAcceleration().modifyPercent(id, MANEUVERABILITY_BONUS);
18 stats.getDeceleration().modifyPercent(id, MANEUVERABILITY_BONUS);
19 stats.getTurnAcceleration().modifyPercent(id, MANEUVERABILITY_BONUS * 2f);
20 stats.getMaxTurnRate().modifyPercent(id, MANEUVERABILITY_BONUS);
21 }
22
23 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
24 stats.getAcceleration().unmodify(id);
25 stats.getDeceleration().unmodify(id);
26 stats.getTurnAcceleration().unmodify(id);
27 stats.getMaxTurnRate().unmodify(id);
28 }
29
30 public String getEffectDescription(float level) {
31 return "+" + (int)(MANEUVERABILITY_BONUS) + "% maneuverability";
32 }
33
34 public String getEffectPerLevelDescription() {
35 return null;
36 }
37
38 public ScopeDescription getScopeDescription() {
39 return ScopeDescription.PILOTED_SHIP;
40 }
41 }
42
43 public static class Level2 implements ShipSkillEffect {
44
45 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
46 stats.getEngineDamageTakenMult().modifyMult(id, 1f - DAMAGE_TO_MODULES_REDUCTION / 100f);
47 stats.getWeaponDamageTakenMult().modifyMult(id, 1f - DAMAGE_TO_MODULES_REDUCTION / 100f);
48 }
49
50 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
51 stats.getEngineDamageTakenMult().unmodify(id);
52 stats.getWeaponDamageTakenMult().unmodify(id);
53 }
54
55 public String getEffectDescription(float level) {
56 return "-" + (int)(DAMAGE_TO_MODULES_REDUCTION) + "% weapon and engine damage taken";
57 }
58
59 public String getEffectPerLevelDescription() {
60 return null;
61 }
62
63 public ScopeDescription getScopeDescription() {
64 return ScopeDescription.PILOTED_SHIP;
65 }
66 }
67
68 public static class Level3 implements ShipSkillEffect {
69
70 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
71 stats.getEffectiveArmorBonus().modifyPercent(id, EFFECTIVE_ARMOR_BONUS);
72 }
73
74 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
75 stats.getEffectiveArmorBonus().unmodify(id);
76 }
77
78 public String getEffectDescription(float level) {
79 return "+" + (int)(EFFECTIVE_ARMOR_BONUS) + "% armor for damage reduction calculation only";
80 }
81
82 public String getEffectPerLevelDescription() {
83 return null;
84 }
85
86 public ScopeDescription getScopeDescription() {
87 return ScopeDescription.PILOTED_SHIP;
88 }
89 }
90
91}