Starsector API
Loading...
Searching...
No Matches
PointDefense.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 PointDefense {
8
9 public static float FIGHTER_DAMAGE_BONUS = 50f;
10 public static float MISSILE_DAMAGE_BONUS = 50f;
11// public static float FIGHTER_DAMAGE_BONUS = 75f;
12// public static float MISSILE_DAMAGE_BONUS = 75f;
13
14 public static float PD_RANGE_BONUS_FLAT = 200f;
15
16
17
18 public static class Level1 implements ShipSkillEffect {
19
20 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
21 stats.getDamageToFighters().modifyFlat(id, FIGHTER_DAMAGE_BONUS / 100f);
22 }
23
24 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
25 stats.getDamageToFighters().unmodify(id);
26 }
27
28 public String getEffectDescription(float level) {
29 return "+" + (int)(FIGHTER_DAMAGE_BONUS) + "% damage to fighters";
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 Level2 implements ShipSkillEffect {
42
43 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
44 stats.getDamageToMissiles().modifyFlat(id, MISSILE_DAMAGE_BONUS / 100f);
45 }
46
47 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
48 stats.getDamageToMissiles().unmodify(id);
49 }
50
51 public String getEffectDescription(float level) {
52 return "+" + (int)(MISSILE_DAMAGE_BONUS) + "% damage to missiles";
53 }
54
55 public String getEffectPerLevelDescription() {
56 return null;
57 }
58
59 public ScopeDescription getScopeDescription() {
60 return ScopeDescription.PILOTED_SHIP;
61 }
62 }
63
64 public static class Level3 implements ShipSkillEffect {
65
66 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
67 stats.getNonBeamPDWeaponRangeBonus().modifyFlat(id, PD_RANGE_BONUS_FLAT);
68 stats.getBeamPDWeaponRangeBonus().modifyFlat(id, PD_RANGE_BONUS_FLAT);
69 }
70
71 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
72 stats.getNonBeamPDWeaponRangeBonus().unmodifyFlat(id);
73 stats.getBeamPDWeaponRangeBonus().unmodifyFlat(id);
74 }
75
76 public String getEffectDescription(float level) {
77 //return "+" + (int)(PD_RANGE_BONUS_FLAT) + " range ";
78 return "Extends the range of point-defense weapons by " + (int)(PD_RANGE_BONUS_FLAT) + "";
79 }
80
81 public String getEffectPerLevelDescription() {
82 return null;
83 }
84
85 public ScopeDescription getScopeDescription() {
86 return ScopeDescription.PILOTED_SHIP;
87 }
88 }
89}