Starsector API
Loading...
Searching...
No Matches
OmegaECM.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.skills;
2
3import java.util.HashMap;
4import java.util.Map;
5
6import com.fs.starfarer.api.characters.ShipSkillEffect;
7import com.fs.starfarer.api.combat.MutableShipStatsAPI;
8import com.fs.starfarer.api.combat.ShipAPI;
9import com.fs.starfarer.api.combat.ShipAPI.HullSize;
10import com.fs.starfarer.api.impl.campaign.ids.Stats;
11
12public class OmegaECM {
13
14 public static Map<HullSize, Float> BONUS = new HashMap<ShipAPI.HullSize, Float>();
15 static {
16 BONUS.put(HullSize.FRIGATE, 5f);
17 BONUS.put(HullSize.DESTROYER, 10f);
18 BONUS.put(HullSize.CRUISER, 15f);
19 BONUS.put(HullSize.CAPITAL_SHIP, 30f);
20 }
21
22 public static class Level1 implements ShipSkillEffect {
23 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
24 Float bonus = BONUS.get(hullSize);
25 if (bonus != null) {
26 stats.getDynamic().getMod(Stats.ELECTRONIC_WARFARE_FLAT).modifyFlat(id, bonus);
27 }
28 }
29 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
30 stats.getDynamic().getMod(Stats.ELECTRONIC_WARFARE_FLAT).unmodify(id);
31 }
32 public String getEffectDescription(float level) {
33 int min = (int)Math.round(BONUS.get(HullSize.FRIGATE));
34 int max = (int)Math.round(BONUS.get(HullSize.CAPITAL_SHIP));
35 return "+" + min + "-" + max + "% to ECM rating of ships, depending on ship size";
36 }
37 public String getEffectPerLevelDescription() {
38 return null;
39 }
40
41 public ScopeDescription getScopeDescription() {
42 return ScopeDescription.PILOTED_SHIP;
43 }
44 }
45
46}