Starsector API
Loading...
Searching...
No Matches
SensorArrayEffect.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.combat;
2
3import java.util.ArrayList;
4import java.util.List;
5
6import com.fs.starfarer.api.Global;
7import com.fs.starfarer.api.combat.BattleObjectiveAPI;
8import com.fs.starfarer.api.combat.CombatEngineAPI;
9import com.fs.starfarer.api.combat.ShipAPI;
10import com.fs.starfarer.api.impl.campaign.skills.ElectronicWarfareScript;
11
13
14// public static final float SENSOR_ARRAY_RANGE_BONUS = 25f;
15// public static final float SENSOR_ARRAY_DAMAGE_BONUS = 10f;
16 //public static final float SENSOR_ARRAY_FOG_LIFT_RADIUS = 5000f;
17 public static final float SENSOR_ARRAY_FOG_LIFT_RADIUS = 999f;
18// public static final int SENSOR_ARRAY_COMMAND_POINTS = 1;
19
20 private List<ShipStatusItem> items = new ArrayList<ShipStatusItem>();
21 private String id;
22
23 public void init(CombatEngineAPI engine, BattleObjectiveAPI objective) {
24 super.init(engine, objective);
25 id = "sensor_array_boost_" + objective.toString();
26
27// ShipStatusItem item = new ShipStatusItem(objective.getDisplayName(),
28// String.format("+%d%% weapon damage",
29// (int) SENSOR_ARRAY_DAMAGE_BONUS),
30// false);
31// items.add(item);
32 }
33
34 public void advance(float amount) {
35// for (ShipAPI ship : engine.getShips()) {
36// //if (ship.isFighter() || ship.isFrigate()) continue;
37// if (ship.getOwner() == objective.getOwner()) {
40//
41// ship.getMutableStats().getBallisticWeaponDamageMult().modifyPercent(id, SENSOR_ARRAY_DAMAGE_BONUS);
42// ship.getMutableStats().getEnergyWeaponDamageMult().modifyPercent(id, SENSOR_ARRAY_DAMAGE_BONUS);
43// ship.getMutableStats().getMissileWeaponDamageMult().modifyPercent(id, SENSOR_ARRAY_DAMAGE_BONUS);
44//
45// } else {
48//
49// ship.getMutableStats().getBallisticWeaponDamageMult().unmodify(id);
50// ship.getMutableStats().getEnergyWeaponDamageMult().unmodify(id);
51// ship.getMutableStats().getMissileWeaponDamageMult().unmodify(id);
52// }
53// }
54//
55// giveCommandPointsForCapturing(SENSOR_ARRAY_COMMAND_POINTS);
56
58 }
59
60
61 public String getLongDescription() {
62 float min = Global.getSettings().getFloat("minFractionOfBattleSizeForSmallerSide");
63 int total = Global.getSettings().getBattleSize();
64 int maxPoints = (int)Math.round(total * (1f - min));
65 return String.format(
66 "+%d%% ECM rating\n" +
67 "reduces enemy weapon range\n" +
68 "by half of the total ECM rating\n" +
69 //"%d%% base maximum reduction\n" +
70 "%d%% maximum reduction\n\n" +
71 //"can be improved by skills\n\n" +
72 "+%d bonus deployment points\n" +
73 "up to a maximum of " + maxPoints + " points",
74 (int)ElectronicWarfareScript.PER_JAMMER,
75 (int)ElectronicWarfareScript.BASE_MAXIMUM,
77// return String.format(
78// "+%d%% ECM rating\n" +
79// "reduces weapon range for\n" +
80// "side with lower ECM rating\n" +
81// //"%d%% base maximum reduction\n" +
82// "%d%% maximum reduction\n\n" +
83// //"can be improved by skills\n\n" +
84// "+%d bonus deployment points\n" +
85// "up to a maximum of " + maxPoints + " points",
86// (int)ElectronicWarfareScript.PER_JAMMER,
87// (int)ElectronicWarfareScript.BASE_MAXIMUM,
88// getBonusDeploymentPoints());
89// return String.format(
90// "command points: +%s\n" +
91// "reveal area: %d\n" +
92// "\n" +
93// //"ship weapon range: +%d%%\n" +
94// "damage: +%d%%\n",
95// //"no bonus to fighters\n" +
96// //"no bonus to frigates",
97// SENSOR_ARRAY_COMMAND_POINTS,
98// (int) SENSOR_ARRAY_FOG_LIFT_RADIUS,
99// (int) SENSOR_ARRAY_DAMAGE_BONUS);
100 }
101
102 public List<ShipStatusItem> getStatusItemsFor(ShipAPI ship) {
103// if (ship.getOwner() == objective.getOwner()) {
110// return items;
111// }
112 return null;
113 }
114}
115
116
117
118
119
120
121
static SettingsAPI getSettings()
Definition Global.java:51
void init(CombatEngineAPI engine, BattleObjectiveAPI objective)
List< ShipStatusItem > getStatusItemsFor(ShipAPI ship)