Starsector API
Loading...
Searching...
No Matches
CombatEngineAPI.java
Go to the documentation of this file.
1package com.fs.starfarer.api.combat;
2
3import java.util.List;
4import java.util.Map;
5
6import java.awt.Color;
7
8import org.lwjgl.util.vector.Vector2f;
9
10import com.fs.starfarer.api.campaign.CombatDamageData;
11import com.fs.starfarer.api.combat.EmpArcEntityAPI.EmpArcParams;
12import com.fs.starfarer.api.combat.WeaponAPI.WeaponType;
13import com.fs.starfarer.api.combat.listeners.CombatListenerManagerAPI;
14import com.fs.starfarer.api.loading.DamagingExplosionSpec;
15import com.fs.starfarer.api.loading.WeaponSlotAPI;
16import com.fs.starfarer.api.loading.WeaponSpecAPI;
17import com.fs.starfarer.api.mission.FleetSide;
18
24public interface CombatEngineAPI {
25
30 boolean isInCampaign();
31
32 boolean isInCampaignSim();
33
35
37
41 @Deprecated
42 List<BattleObjectiveAPI> getAllObjectives();
46 @Deprecated
47 List<ShipAPI> getAllShips();
48
49 List<BattleObjectiveAPI> getObjectives();
50 List<ShipAPI> getShips();
51 List<MissileAPI> getMissiles();
52 List<CombatEntityAPI> getAsteroids();
53 List<BeamAPI> getBeams();
57 List<DamagingProjectileAPI> getProjectiles();
58
60
62
64
67
69
70 boolean isPaused();
71
72 void endCombat(float delay);
73 void setDoNotEndCombat(boolean doNotEndCombat);
74 void endCombat(float delay, FleetSide winner);
75
76
78
90 void applyDamage(CombatEntityAPI entity, Vector2f point,
91 float damageAmount, DamageType damageType, float empAmount,
92 boolean bypassShields, boolean dealsSoftFlux,
93 Object source, boolean playSound);
94
95 void applyDamage(CombatEntityAPI entity, Vector2f point,
96 float damageAmount, DamageType damageType, float empAmount,
97 boolean bypassShields, boolean dealsSoftFlux,
98 Object source);
99
100 void applyDamage(Object damageModifierParam, CombatEntityAPI entity, Vector2f point,
101 float damageAmount, DamageType damageType, float empAmount,
102 boolean bypassShields, boolean dealsSoftFlux,
103 Object source, boolean playSound);
104
111 void addHitParticle(Vector2f loc, Vector2f vel, float size, float brightness, float duration, Color color);
117 public void addSmoothParticle(Vector2f loc, Vector2f vel, float size, float brightness, float duration, Color color);
118
124 public void addSmokeParticle(Vector2f loc, Vector2f vel, float size, float opacity, float duration, Color color);
125
126
130 void spawnExplosion(Vector2f loc, Vector2f vel, Color color, float size, float maxDuration);
131
140 CombatEntityAPI spawnAsteroid(int size, float x, float y, float dx, float dy);
141
142
143 void addFloatingText(Vector2f loc, String text, float size, Color color, CombatEntityAPI attachedTo, float flashFrequency, float flashDuration);
144 void addFloatingDamageText(Vector2f loc, float damage, Color color, CombatEntityAPI attachedTo, CombatEntityAPI damageSource);
145
146
147
157 public CombatEntityAPI spawnProjectile(ShipAPI ship, WeaponAPI weapon, String weaponId,
158 Vector2f point, float angle, Vector2f shipVelocity);
159
160
177 Vector2f point,
178 CombatEntityAPI pointAnchor,
179 CombatEntityAPI empTargetEntity,
180 DamageType damageType,
181 float damAmount,
182 float empDamAmount,
183 float maxRange,
184 String impactSoundId,
185 float thickness,
186 Color fringe, Color core);
187
189 Vector2f point,
190 CombatEntityAPI pointAnchor,
191 CombatEntityAPI empTargetEntity,
192 DamageType damageType,
193 float damAmount,
194 float empDamAmount,
195 float maxRange,
196 String impactSoundId,
197 float thickness,
198 Color fringe, Color core, EmpArcParams params);
199
204 Vector2f point, CombatEntityAPI pointAnchor,
205 CombatEntityAPI empTargetEntity, DamageType damageType,
206 float damAmount, float empDamAmount, float maxRange,
207 String impactSoundId, float thickness, Color fringe, Color core);
209 Vector2f point, CombatEntityAPI pointAnchor,
210 CombatEntityAPI empTargetEntity, DamageType damageType,
211 float damAmount, float empDamAmount, float maxRange,
212 String impactSoundId, float thickness, Color fringe, Color core, EmpArcParams params);
213
214
215 float getMapWidth();
217
223
224
225 float getTotalElapsedTime(boolean includePaused);
226
233
239
241
242 boolean isSimulation();
243 boolean isMission();
244 String getMissionId();
245
246
249 boolean isUIShowingHUD();
251
252
258
260
261 void setSideDeploymentOverrideSide(FleetSide sideDeploymentOverrideSide);
262
263 Map<String, Object> getCustomData();
264
273 void maintainStatusForPlayerShip(Object key, String spriteName, String title, String data, boolean isDebuff);
274
275 void setPaused(boolean paused);
276
278
280
282
284
285 void setMaxFleetPoints(FleetSide side, int fleetPoints);
286
288
290
295 String weaponId, String projSpecId, Vector2f point, float angle,
296 Vector2f shipVelocity);
297
299
300
321
323 DamagingProjectileAPI spawnDamagingExplosion(DamagingExplosionSpec spec, ShipAPI source, Vector2f location, boolean canDamageSource);
324
330 boolean isCombatOver();
331
332 void removeObject(Object object);
333
335
337
338
339 boolean isMissileAlive(MissileAPI missile);
340
341 void spawnMuzzleFlashOrSmoke(ShipAPI ship, WeaponSlotAPI slot, WeaponSpecAPI spec, int barrel, float targetAngle);
342
346
353 boolean isAwareOf(int owner, CombatEntityAPI other);
354
361 void headInDirectionWithoutTurning(MissileAPI missile, float desiredHeading, float desiredSpeed);
362
369 void headInDirectionWithoutTurning(ShipAPI ship, float desiredHeading, float desiredSpeed);
370
380 Vector2f getAimPointWithLeadForAutofire(CombatEntityAPI from, float accuracyFactor, CombatEntityAPI to, float projSpeed);
381
383
384 void applyDamageModifiersToSpawnedProjectileWithNullWeapon(ShipAPI source, WeaponType type, boolean isBeam, DamageAPI damage);
385
386 void addHitParticle(Vector2f loc, Vector2f vel, float size, float brightness, float durationIn, float totalDuration, Color color);
387
396 void addHitParticle(Vector2f loc, Vector2f vel, float size, float brightness, Color color);
397
398 EmpArcEntityAPI spawnEmpArcVisual(Vector2f from, CombatEntityAPI fromAnchor, Vector2f to, CombatEntityAPI toAnchor,
399 float thickness, Color fringe, Color core);
400 EmpArcEntityAPI spawnEmpArcVisual(Vector2f from, CombatEntityAPI fromAnchor, Vector2f to, CombatEntityAPI toAnchor,
401 float thickness, Color fringe, Color core, EmpArcParams params);
402
403 void addSmoothParticle(Vector2f loc, Vector2f vel, float size,
404 float brightness, float rampUpFraction, float totalDuration,
405 Color color);
406
407 void addNegativeParticle(Vector2f loc, Vector2f vel, float size, float rampUpFraction, float totalDuration, Color color);
408
409 void addNebulaParticle(Vector2f loc, Vector2f vel, float size,
410 float endSizeMult, float rampUpFraction,
411 float fullBrightnessFraction, float totalDuration, Color color);
412
413 void addNegativeNebulaParticle(Vector2f loc, Vector2f vel, float size,
414 float endSizeMult, float rampUpFraction,
415 float fullBrightnessFraction, float totalDuration, Color color);
416
417 void addNebulaSmokeParticle(Vector2f loc, Vector2f vel, float size,
418 float endSizeMult, float rampUpFraction,
419 float fullBrightnessFraction, float totalDuration, Color color);
420
422
423 void addNebulaParticle(Vector2f loc, Vector2f vel, float size,
424 float endSizeMult, float rampUpFraction,
425 float fullBrightnessFraction, float totalDuration, Color color,
426 boolean expandAsSqrt);
427
428 void addSwirlyNebulaParticle(Vector2f loc, Vector2f vel, float size,
429 float endSizeMult, float rampUpFraction,
430 float fullBrightnessFraction, float totalDuration, Color color,
431 boolean expandAsSqrt);
432
433 void addNegativeSwirlyNebulaParticle(Vector2f loc, Vector2f vel,
434 float size, float endSizeMult, float rampUpFraction,
435 float fullBrightnessFraction, float totalDuration, Color color);
436
437 boolean isInPlay(Object object);
438
439 void setCombatNotOverForAtLeast(float seconds);
440 void setCombatNotOverFor(float seconds);
442
443 void setCustomExit(String buttonTitle, String confirmString);
446
447 void addFloatingTextAlways(Vector2f loc, String text, float size, Color color, CombatEntityAPI attachedTo,
448 float flashFrequency, float flashDuration, float durInPlace, float durFloatingUp, float durFadingOut, float baseAlpha);
449
450 WeaponAPI createFakeWeapon(ShipAPI ship, String weaponId);
451
453
455
457
459
461
462 void addNebulaSmoothParticle(Vector2f loc, Vector2f vel, float size, float endSizeMult, float rampUpFraction,
463 float fullBrightnessFraction, float totalDuration, Color color);
464
465 void addNebulaSmoothParticle(Vector2f loc, Vector2f vel, float size, float endSizeMult, float rampUpFraction,
466 float fullBrightnessFraction, float totalDuration, Color color, boolean expandAsSqrt);
467
469 void setBackgroundColor(Color backgroundColor);
471 void setBackgroundGlowColorNonAdditive(boolean backgroundGlowColorNonAdditive);
472 void setBackgroundGlowColor(Color backgroundGlowColor);
475 void setRenderStarfield(boolean renderStarfield);
476
478
479 void spawnMuzzleFlashOrSmoke(ShipAPI ship, Vector2f point, WeaponSpecAPI spec, float targetAngle);
480
481 boolean isInMissionSim();
482
483 boolean isShipAlive(ShipAPI ship);
484
485 void spawnDebrisSmall(Vector2f loc, Vector2f vel, int num, float facing, float spread, float minVel, float velRange,
486 float maxRotation);
487 void spawnDebrisMedium(Vector2f loc, Vector2f vel, int num, float facing, float spread, float minVel,
488 float velRange, float maxRotation);
489 void spawnDebrisLarge(Vector2f loc, Vector2f vel, int num, float facing, float spread, float minVel, float velRange,
490 float maxRotation);
491
492 void addFloatingDamageText(Vector2f loc, float damage, float spread, Color color, CombatEntityAPI to,
493 CombatEntityAPI source);
494
497
498 boolean isInEngine(ShipAPI ship);
499
500 boolean hasPluginOfClass(Class c);
501
502 void applyImpact(Vector2f vel, float impact, CombatEntityAPI target, Vector2f point);
503
505
506 CombatEntityAPI spawnAsteroid(String spriteName, float x, float y, float dx, float dy, boolean fromRing);
507
508 //float getElapsedInCurrentFrame();
509
510}
511
512
513
514
515
516
void applyImpact(Vector2f vel, float impact, CombatEntityAPI target, Vector2f point)
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)
CombatEntityAPI spawnAsteroid(String spriteName, float x, float y, float dx, float dy, boolean fromRing)
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 addFloatingDamageText(Vector2f loc, float damage, float spread, Color color, CombatEntityAPI to, CombatEntityAPI source)
void maintainStatusForPlayerShip(Object key, String spriteName, String title, String data, boolean isDebuff)
CombatFleetManagerAPI getFleetManager(FleetSide side)
void spawnDebrisLarge(Vector2f loc, Vector2f vel, int num, float facing, float spread, float minVel, float velRange, float maxRotation)
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)
void spawnDebrisSmall(Vector2f loc, Vector2f vel, int num, float facing, float spread, float minVel, float velRange, float maxRotation)
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)
EmpArcEntityAPI spawnEmpArcVisual(Vector2f from, CombatEntityAPI fromAnchor, Vector2f to, CombatEntityAPI toAnchor, float thickness, Color fringe, Color core, EmpArcParams params)
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)
MissileAIPlugin createProximityFuseAI(MissileAPI missile)
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)
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, EmpArcParams params)
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 spawnDebrisMedium(Vector2f loc, Vector2f vel, int num, float facing, float spread, float minVel, float velRange, float maxRotation)
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()
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, EmpArcParams params)
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)