1package com.fs.starfarer.api.impl.hullmods;
3import java.util.Iterator;
5import com.fs.starfarer.api.Global;
6import com.fs.starfarer.api.combat.BaseHullMod;
7import com.fs.starfarer.api.combat.CombatEngineAPI;
8import com.fs.starfarer.api.combat.MutableShipStatsAPI;
9import com.fs.starfarer.api.combat.ShipAPI;
10import com.fs.starfarer.api.combat.ShipAPI.HullSize;
11import com.fs.starfarer.api.util.IntervalUtil;
12import com.fs.starfarer.api.util.Misc;
28 if (index == 0)
return "1000";
30 if (index == 2)
return "" + (int)Math.round(
SPEED_BONUS) +
"%";
31 if (index == 3)
return "" + (int)Math.round(
RANGE_BONUS) +
"%";
32 if (index == 4)
return "doubled";
37 if (index == 0)
return "" + (int)Math.round(
SHIELD_BONUS) +
"%";
50 return "Can not be installed on frigates";
53 return "Can not be installed on capital ships";
55 return super.getUnapplicableReason(ship);
59 public static String
EP_DATA_KEY =
"core_escort_package_data_key";
60 public static class EscortPackageData {
66 String
id =
"escort_package_bonus" + ship.
getId();
70 boolean sMod =
isSMod(ship);
107 super.advanceInCombat(ship, amount);
110 if (amount <= 0f)
return;
115 EscortPackageData data = (EscortPackageData) engine.
getCustomData().get(key);
117 data =
new EscortPackageData();
123 data.interval.
advance(amount * 4f);
124 if (data.interval.intervalElapsed() || playerShip) {
133 while (iter.hasNext()) {
134 Object next = iter.next();
135 if (!(next instanceof
ShipAPI))
continue;
139 if (ship == other)
continue;
141 if (other.
isHulk())
continue;
175 if (data.mag > 0.005f) {
177 String percent =
"" + (int) Math.round(data.mag * 100f) +
"%";
179 STATUS_KEY, icon,
"Escort package", percent +
" telemetry quality",
false);
183 STATUS_KEY, icon,
"Escort package",
"no connection",
true);
static SettingsAPI getSettings()
static CombatEngineAPI getCombatEngine()
boolean isSMod(MutableShipStatsAPI stats)
void modifyPercent(String source, float value)
void modifyMult(String source, float value)
void modifyPercent(String source, float value)
String getSModDescriptionParam(int index, HullSize hullSize)
static float MANEUVER_BONUS
String getUnapplicableReason(ShipAPI ship)
static float SHIELD_BONUS
String getDescriptionParam(int index, HullSize hullSize)
static float EFFECT_RANGE
static String EP_DATA_KEY
boolean isApplicableToShip(ShipAPI ship)
void advanceInCombat(ShipAPI ship, float amount)
void applyEPEffect(ShipAPI ship, ShipAPI other, float mag)
void advance(float amount)
static float getDistance(SectorEntityToken from, SectorEntityToken to)
String getSpriteName(String category, String id)
Iterator< Object > getCheckIterator(Vector2f loc, float checkWidth, float checkHeight)
CollisionGridAPI getShipGrid()
void maintainStatusForPlayerShip(Object key, String spriteName, String title, String data, boolean isDebuff)
Map< String, Object > getCustomData()
float getCollisionRadius()
StatBonus getBallisticWeaponRangeBonus()
MutableStat getDeceleration()
MutableStat getTurnAcceleration()
MutableStat getMaxTurnRate()
StatBonus getEnergyWeaponRangeBonus()
MutableStat getMaxSpeed()
MutableStat getAcceleration()
MutableStat getShieldDamageTakenMult()
float getShieldRadiusEvenIfNoShield()
MutableShipStatsAPI getMutableStats()
Vector2f getShieldCenterEvenIfNoShield()