Starsector API
Loading...
Searching...
No Matches
CombatEngineAPI.java
Go to the documentation of this file.
1package com.fs.starfarer.api.combat;
2
3import java.awt.Color;
4import java.util.List;
5import java.util.Map;
6
7import org.lwjgl.util.vector.Vector2f;
8
9import com.fs.starfarer.api.campaign.CombatDamageData;
10import com.fs.starfarer.api.combat.WeaponAPI.WeaponType;
11import com.fs.starfarer.api.combat.listeners.CombatListenerManagerAPI;
12import com.fs.starfarer.api.loading.DamagingExplosionSpec;
13import com.fs.starfarer.api.loading.WeaponSlotAPI;
14import com.fs.starfarer.api.loading.WeaponSpecAPI;
15import com.fs.starfarer.api.mission.FleetSide;
16
22public interface CombatEngineAPI {
23
28 boolean isInCampaign();
29
30 boolean isInCampaignSim();
31
33
35
39 @Deprecated
40 List<BattleObjectiveAPI> getAllObjectives();
44 @Deprecated
45 List<ShipAPI> getAllShips();
46
47 List<BattleObjectiveAPI> getObjectives();
48 List<ShipAPI> getShips();
49 List<MissileAPI> getMissiles();
50 List<CombatEntityAPI> getAsteroids();
51 List<BeamAPI> getBeams();
55 List<DamagingProjectileAPI> getProjectiles();
56
58
60
62
65
67
68 boolean isPaused();
69
70 void endCombat(float delay);
71 void setDoNotEndCombat(boolean doNotEndCombat);
72 void endCombat(float delay, FleetSide winner);
73
74
76
88 void applyDamage(CombatEntityAPI entity, Vector2f point,
89 float damageAmount, DamageType damageType, float empAmount,
90 boolean bypassShields, boolean dealsSoftFlux,
91 Object source, boolean playSound);
92
93 void applyDamage(CombatEntityAPI entity, Vector2f point,
94 float damageAmount, DamageType damageType, float empAmount,
95 boolean bypassShields, boolean dealsSoftFlux,
96 Object source);
97
98 void applyDamage(Object damageModifierParam, CombatEntityAPI entity, Vector2f point,
99 float damageAmount, DamageType damageType, float empAmount,
100 boolean bypassShields, boolean dealsSoftFlux,
101 Object source, boolean playSound);
102
109 void addHitParticle(Vector2f loc, Vector2f vel, float size, float brightness, float duration, Color color);
115 public void addSmoothParticle(Vector2f loc, Vector2f vel, float size, float brightness, float duration, Color color);
116
122 public void addSmokeParticle(Vector2f loc, Vector2f vel, float size, float opacity, float duration, Color color);
123
124
128 void spawnExplosion(Vector2f loc, Vector2f vel, Color color, float size, float maxDuration);
129
138 CombatEntityAPI spawnAsteroid(int size, float x, float y, float dx, float dy);
139
140
141 void addFloatingText(Vector2f loc, String text, float size, Color color, CombatEntityAPI attachedTo, float flashFrequency, float flashDuration);
142 void addFloatingDamageText(Vector2f loc, float damage, Color color, CombatEntityAPI attachedTo, CombatEntityAPI damageSource);
143
144
145
155 public CombatEntityAPI spawnProjectile(ShipAPI ship, WeaponAPI weapon, String weaponId,
156 Vector2f point, float angle, Vector2f shipVelocity);
157
158
175 Vector2f point,
176 CombatEntityAPI pointAnchor,
177 CombatEntityAPI empTargetEntity,
178 DamageType damageType,
179 float damAmount,
180 float empDamAmount,
181 float maxRange,
182 String impactSoundId,
183 float thickness,
184 Color fringe, Color core);
185
190 Vector2f point, CombatEntityAPI pointAnchor,
191 CombatEntityAPI empTargetEntity, DamageType damageType,
192 float damAmount, float empDamAmount, float maxRange,
193 String impactSoundId, float thickness, Color fringe, Color core);
194
195
196 float getMapWidth();
198
204
205
206 float getTotalElapsedTime(boolean includePaused);
207
214
220
222
223 boolean isSimulation();
224 boolean isMission();
225 String getMissionId();
226
227
230 boolean isUIShowingHUD();
232
233
239
241
242 void setSideDeploymentOverrideSide(FleetSide sideDeploymentOverrideSide);
243
244 Map<String, Object> getCustomData();
245
254 void maintainStatusForPlayerShip(Object key, String spriteName, String title, String data, boolean isDebuff);
255
256 void setPaused(boolean paused);
257
259
261
262 CombatDamageData getDamageData();
263
265
266 void setMaxFleetPoints(FleetSide side, int fleetPoints);
267
269
271
276 String weaponId, String projSpecId, Vector2f point, float angle,
277 Vector2f shipVelocity);
278
280
281
302
303 DamagingProjectileAPI spawnDamagingExplosion(DamagingExplosionSpec spec, ShipAPI source, Vector2f location);
304 DamagingProjectileAPI spawnDamagingExplosion(DamagingExplosionSpec spec, ShipAPI source, Vector2f location, boolean canDamageSource);
305
311 boolean isCombatOver();
312
313 void removeObject(Object object);
314
316
318
319
320 boolean isMissileAlive(MissileAPI missile);
321
322 void spawnMuzzleFlashOrSmoke(ShipAPI ship, WeaponSlotAPI slot, WeaponSpecAPI spec, int barrel, float targetAngle);
323
327
334 boolean isAwareOf(int owner, CombatEntityAPI other);
335
342 void headInDirectionWithoutTurning(MissileAPI missile, float desiredHeading, float desiredSpeed);
343
350 void headInDirectionWithoutTurning(ShipAPI ship, float desiredHeading, float desiredSpeed);
351
361 Vector2f getAimPointWithLeadForAutofire(CombatEntityAPI from, float accuracyFactor, CombatEntityAPI to, float projSpeed);
362
363 CombatListenerManagerAPI getListenerManager();
364
365 void applyDamageModifiersToSpawnedProjectileWithNullWeapon(ShipAPI source, WeaponType type, boolean isBeam, DamageAPI damage);
366
367 void addHitParticle(Vector2f loc, Vector2f vel, float size, float brightness, float durationIn, float totalDuration, Color color);
368
377 void addHitParticle(Vector2f loc, Vector2f vel, float size, float brightness, Color color);
378
379 EmpArcEntityAPI spawnEmpArcVisual(Vector2f from, CombatEntityAPI fromAnchor, Vector2f to, CombatEntityAPI toAnchor,
380 float thickness, Color fringe, Color core);
381
382 void addSmoothParticle(Vector2f loc, Vector2f vel, float size,
383 float brightness, float rampUpFraction, float totalDuration,
384 Color color);
385
386 void addNegativeParticle(Vector2f loc, Vector2f vel, float size, float rampUpFraction, float totalDuration, Color color);
387
388 void addNebulaParticle(Vector2f loc, Vector2f vel, float size,
389 float endSizeMult, float rampUpFraction,
390 float fullBrightnessFraction, float totalDuration, Color color);
391
392 void addNegativeNebulaParticle(Vector2f loc, Vector2f vel, float size,
393 float endSizeMult, float rampUpFraction,
394 float fullBrightnessFraction, float totalDuration, Color color);
395
396 void addNebulaSmokeParticle(Vector2f loc, Vector2f vel, float size,
397 float endSizeMult, float rampUpFraction,
398 float fullBrightnessFraction, float totalDuration, Color color);
399
401
402 void addNebulaParticle(Vector2f loc, Vector2f vel, float size,
403 float endSizeMult, float rampUpFraction,
404 float fullBrightnessFraction, float totalDuration, Color color,
405 boolean expandAsSqrt);
406
407 void addSwirlyNebulaParticle(Vector2f loc, Vector2f vel, float size,
408 float endSizeMult, float rampUpFraction,
409 float fullBrightnessFraction, float totalDuration, Color color,
410 boolean expandAsSqrt);
411
412 void addNegativeSwirlyNebulaParticle(Vector2f loc, Vector2f vel,
413 float size, float endSizeMult, float rampUpFraction,
414 float fullBrightnessFraction, float totalDuration, Color color);
415
416 boolean isInPlay(Object object);
417
418 void setCombatNotOverForAtLeast(float seconds);
419 void setCombatNotOverFor(float seconds);
421
422 void setCustomExit(String buttonTitle, String confirmString);
425
426 void addFloatingTextAlways(Vector2f loc, String text, float size, Color color, CombatEntityAPI attachedTo,
427 float flashFrequency, float flashDuration, float durInPlace, float durFloatingUp, float durFadingOut, float baseAlpha);
428
429 WeaponAPI createFakeWeapon(ShipAPI ship, String weaponId);
430
432
434
436
438
440
441 void addNebulaSmoothParticle(Vector2f loc, Vector2f vel, float size, float endSizeMult, float rampUpFraction,
442 float fullBrightnessFraction, float totalDuration, Color color);
443
444 void addNebulaSmoothParticle(Vector2f loc, Vector2f vel, float size, float endSizeMult, float rampUpFraction,
445 float fullBrightnessFraction, float totalDuration, Color color, boolean expandAsSqrt);
446
448 void setBackgroundColor(Color backgroundColor);
450 void setBackgroundGlowColorNonAdditive(boolean backgroundGlowColorNonAdditive);
451 void setBackgroundGlowColor(Color backgroundGlowColor);
454 void setRenderStarfield(boolean renderStarfield);
455
457
458 void spawnMuzzleFlashOrSmoke(ShipAPI ship, Vector2f point, WeaponSpecAPI spec, float targetAngle);
459
460 //float getElapsedInCurrentFrame();
461
462}
463
464
465
466
467
468
void addNebulaParticle(Vector2f loc, Vector2f vel, float size, float endSizeMult, float rampUpFraction, float fullBrightnessFraction, float totalDuration, Color color, boolean expandAsSqrt)
void addHitParticle(Vector2f loc, Vector2f vel, float size, float brightness, float duration, Color color)
ShipAPI createFXDrone(ShipVariantAPI variant)
EmpArcEntityAPI spawnEmpArcVisual(Vector2f from, CombatEntityAPI fromAnchor, Vector2f to, CombatEntityAPI toAnchor, float thickness, Color fringe, Color core)
boolean isAwareOf(int owner, CombatEntityAPI other)
void addHitParticle(Vector2f loc, Vector2f vel, float size, float brightness, Color color)
CombatEntityAPI addLayeredRenderingPlugin(CombatLayeredRenderingPlugin plugin)
void maintainStatusForPlayerShip(Object key, String spriteName, String title, String data, boolean isDebuff)
CombatFleetManagerAPI getFleetManager(FleetSide side)
void addHitParticle(Vector2f loc, Vector2f vel, float size, float brightness, float durationIn, float totalDuration, Color color)
void setSideDeploymentOverrideSide(FleetSide sideDeploymentOverrideSide)
void applyDamage(CombatEntityAPI entity, Vector2f point, float damageAmount, DamageType damageType, float empAmount, boolean bypassShields, boolean dealsSoftFlux, Object source, boolean playSound)
Vector2f getAimPointWithLeadForAutofire(CombatEntityAPI from, float accuracyFactor, CombatEntityAPI to, float projSpeed)
void addSmoothParticle(Vector2f loc, Vector2f vel, float size, float brightness, float duration, Color color)
void spawnExplosion(Vector2f loc, Vector2f vel, Color color, float size, float maxDuration)
void setCustomExit(String buttonTitle, String confirmString)
List< BattleObjectiveAPI > getObjectives()
void addNebulaSmoothParticle(Vector2f loc, Vector2f vel, float size, float endSizeMult, float rampUpFraction, float fullBrightnessFraction, float totalDuration, Color color)
void removeEntity(CombatEntityAPI entity)
DamagingProjectileAPI spawnDamagingExplosion(DamagingExplosionSpec spec, ShipAPI source, Vector2f location)
void addFloatingDamageText(Vector2f loc, float damage, Color color, CombatEntityAPI attachedTo, CombatEntityAPI damageSource)
void addNebulaSmoothParticle(Vector2f loc, Vector2f vel, float size, float endSizeMult, float rampUpFraction, float fullBrightnessFraction, float totalDuration, Color color, boolean expandAsSqrt)
CombatEntityAPI spawnProjectile(ShipAPI ship, WeaponAPI weapon, String weaponId, Vector2f point, float angle, Vector2f shipVelocity)
CombatFleetManagerAPI getFleetManager(int owner)
void spawnMuzzleFlashOrSmoke(ShipAPI ship, Vector2f point, WeaponSpecAPI spec, float targetAngle)
EmpArcEntityAPI spawnEmpArcPierceShields(ShipAPI damageSource, Vector2f point, CombatEntityAPI pointAnchor, CombatEntityAPI empTargetEntity, DamageType damageType, float damAmount, float empDamAmount, float maxRange, String impactSoundId, float thickness, Color fringe, Color core)
void headInDirectionWithoutTurning(MissileAPI missile, float desiredHeading, float desiredSpeed)
List< CombatEntityAPI > getAsteroids()
void removePlugin(EveryFrameCombatPlugin plugin)
List< DamagingProjectileAPI > getProjectiles()
void addSmokeParticle(Vector2f loc, Vector2f vel, float size, float opacity, float duration, Color color)
void addFloatingTextAlways(Vector2f loc, String text, float size, Color color, CombatEntityAPI attachedTo, float flashFrequency, float flashDuration, float durInPlace, float durFloatingUp, float durFadingOut, float baseAlpha)
DamagingProjectileAPI spawnDamagingExplosion(DamagingExplosionSpec spec, ShipAPI source, Vector2f location, boolean canDamageSource)
CombatEntityAPI spawnAsteroid(int size, float x, float y, float dx, float dy)
boolean isEntityInPlay(CombatEntityAPI entity)
boolean isMissileAlive(MissileAPI missile)
void addSwirlyNebulaParticle(Vector2f loc, Vector2f vel, float size, float endSizeMult, float rampUpFraction, float fullBrightnessFraction, float totalDuration, Color color, boolean expandAsSqrt)
void addNegativeParticle(Vector2f loc, Vector2f vel, float size, float rampUpFraction, float totalDuration, Color color)
void setBackgroundGlowColor(Color backgroundGlowColor)
void spawnMuzzleFlashOrSmoke(ShipAPI ship, WeaponSlotAPI slot, WeaponSpecAPI spec, int barrel, float targetAngle)
float getTotalElapsedTime(boolean includePaused)
void setMaxFleetPoints(FleetSide side, int fleetPoints)
void addPlugin(EveryFrameCombatPlugin plugin)
void addNegativeNebulaParticle(Vector2f loc, Vector2f vel, float size, float endSizeMult, float rampUpFraction, float fullBrightnessFraction, float totalDuration, Color color)
CombatEntityAPI spawnProjectile(ShipAPI ship, WeaponAPI weapon, String weaponId, String projSpecId, Vector2f point, float angle, Vector2f shipVelocity)
void applyDamageModifiersToSpawnedProjectileWithNullWeapon(ShipAPI source, WeaponType type, boolean isBeam, DamageAPI damage)
void addNebulaSmokeParticle(Vector2f loc, Vector2f vel, float size, float endSizeMult, float rampUpFraction, float fullBrightnessFraction, float totalDuration, Color color)
CombatListenerManagerAPI getListenerManager()
void addEntity(CombatEntityAPI entity)
void setBackgroundColor(Color backgroundColor)
void setShipPlayerLastTransferredCommandTo(ShipAPI ship)
void setRenderStarfield(boolean renderStarfield)
WeaponAPI createFakeWeapon(ShipAPI ship, String weaponId)
void endCombat(float delay, FleetSide winner)
EmpArcEntityAPI spawnEmpArc(ShipAPI damageSource, Vector2f point, CombatEntityAPI pointAnchor, CombatEntityAPI empTargetEntity, DamageType damageType, float damAmount, float empDamAmount, float maxRange, String impactSoundId, float thickness, Color fringe, Color core)
void setBackgroundGlowColorNonAdditive(boolean backgroundGlowColorNonAdditive)
void headInDirectionWithoutTurning(ShipAPI ship, float desiredHeading, float desiredSpeed)
boolean hasAttachedFloaty(CombatEntityAPI entity)
void applyDamage(Object damageModifierParam, CombatEntityAPI entity, Vector2f point, float damageAmount, DamageType damageType, float empAmount, boolean bypassShields, boolean dealsSoftFlux, Object source, boolean playSound)
void addNebulaParticle(Vector2f loc, Vector2f vel, float size, float endSizeMult, float rampUpFraction, float fullBrightnessFraction, float totalDuration, Color color)
void setDoNotEndCombat(boolean doNotEndCombat)
void addFloatingText(Vector2f loc, String text, float size, Color color, CombatEntityAPI attachedTo, float flashFrequency, float flashDuration)
void updateStationModuleLocations(ShipAPI station)
void applyDamage(CombatEntityAPI entity, Vector2f point, float damageAmount, DamageType damageType, float empAmount, boolean bypassShields, boolean dealsSoftFlux, Object source)
List< BattleObjectiveAPI > getAllObjectives()
void addSmoothParticle(Vector2f loc, Vector2f vel, float size, float brightness, float rampUpFraction, float totalDuration, Color color)
void addNegativeSwirlyNebulaParticle(Vector2f loc, Vector2f vel, float size, float endSizeMult, float rampUpFraction, float fullBrightnessFraction, float totalDuration, Color color)