1package com.fs.starfarer.api.impl.combat.threat;
3import com.fs.starfarer.api.combat.MutableShipStatsAPI;
4import com.fs.starfarer.api.combat.ShipAPI;
5import com.fs.starfarer.api.combat.ShipCommand;
6import com.fs.starfarer.api.combat.ShipwideAIFlags.AIFlags;
7import com.fs.starfarer.api.combat.WeaponAPI;
25 if (effectLevel <= 0f)
return;
32 if (state == State.IN || state == State.ACTIVE) {
36 if (state == State.OUT) {
41 if (w.isDecorative())
continue;
42 if (w.getSlot().isSystemSlot())
continue;
43 if (w.usesAmmo() && w.getAmmo() < w.getMaxAmmo()) {
44 w.setAmmo(w.getMaxAmmo());
54 public StatusData
getStatusData(
int index, State state,
float effectLevel) {
55 if (effectLevel <= 0f)
return null;
58 return new StatusData(
"improved maneuverability",
false);
59 }
else if (index == 1) {
60 return new StatusData(
"+" + (
int)
SPEED_BONUS +
" top speed",
false);
77 if (w.isDecorative())
continue;
78 if (w.getSlot().isSystemSlot())
continue;
80 float op = w.getSpec().getOrdnancePointCost(
null);
83 if (w.getAmmo() < w.getMaxAmmo() && w.getMaxAmmo() > 0 && w.getAmmoPerSecond() > 0) {
84 needAmmo += (1f - (float)w.getAmmo() / (
float) w.getMaxAmmo()) * op;
89 level += 0.25f * needAmmo / useAmmo;
90 if (level > 1f) level = 1f;
94 float threshold = 0.7f;
105 return (level - threshold) / (1f - threshold);
void modifyFlat(String source, float value)
void setFlag(AIFlags flag)
Object getCustom(AIFlags flag)
void unsetFlag(AIFlags flag)
boolean hasFlag(AIFlags flag)
void setStandardJitter(ShipAPI ship, State state, float effectLevel)
void makeAllGroupsAutofireOneFrame(ShipAPI ship)
MutableStat getDeceleration()
MutableStat getMaxSpeed()
MutableStat getAcceleration()
List< WeaponAPI > getAllWeapons()
ShipwideAIFlags getAIFlags()
ShipSystemAPI getSystem()
ShipEngineControllerAPI getEngineController()
void giveCommand(ShipCommand command, Object param, int groupNumber)
void extendFlame(Object key, float extendLengthFraction, float extendWidthFraction, float extendGlowFraction)