Starsector API
Loading...
Searching...
No Matches
WeaponAPI.java
Go to the documentation of this file.
1package com.fs.starfarer.api.combat;
2
3import java.util.List;
4
5import java.awt.Color;
6
7import org.lwjgl.util.vector.Vector2f;
8
9import com.fs.starfarer.api.AnimationAPI;
10import com.fs.starfarer.api.graphics.SpriteAPI;
11import com.fs.starfarer.api.loading.MuzzleFlashSpec;
12import com.fs.starfarer.api.loading.WeaponSlotAPI;
13import com.fs.starfarer.api.loading.WeaponSpecAPI;
14
20public interface WeaponAPI {
21
22 public static interface DerivedWeaponStatsAPI {
23 float getBurstFireDuration();
24 float getSustainedDps();
25 float getEmpPerSecond();
26 float getDamageOver30Sec();
27 float getDps();
28 float getBurstDamage();
29 float getFluxPerDam();
30 float getRoF();
31 float getFluxPerSecond();
32 float getSustainedFluxPerSecond();
37 float getDamagePerShot();
38 float getEmpPerShot();
39 }
40
41 public static enum WeaponType {
42 BALLISTIC("Ballistic"),
43 ENERGY("Energy"),
44 MISSILE("Missile"),
45 LAUNCH_BAY("Launch Bay"),
46 UNIVERSAL("Universal"),
47 HYBRID("Hybrid"),
48 SYNERGY("Synergy"),
49 COMPOSITE("Composite"),
50 BUILT_IN("Built in"),
51 DECORATIVE("Decorative"),
52 SYSTEM("System"),
53 STATION_MODULE("Station Module");
54
55 private String displayName;
56 private WeaponType(String displayName) {
57 this.displayName = displayName;
58 }
59 public String getDisplayName() {
60 return displayName;
61 }
62
63 }
64
65 public static enum WeaponSize {
66 SMALL("Small"),
67 MEDIUM("Medium"),
68 LARGE("Large");
69
70 private String displayName;
71 private WeaponSize(String name) {
72 this.displayName = name;
73 }
74 public String getDisplayName() {
75 return displayName;
76 }
77 }
78
79 public static enum AIHints {
80 PD,
81 PD_ONLY,
82 PD_ALSO, // PD, but only if there are no other targets
83 USE_VS_FRIGATES,
84 STRIKE,
85 DANGEROUS,
86 BOMB,
87 GUIDED_POOR,
88 DO_NOT_AIM,
89 ANTI_FTR,
90 HEATSEEKER,
91 SYSTEM,
92 SHOW_IN_CODEX,
93 AUTOZOOM,
94 DO_NOT_CONSERVE,
95 CONSERVE_1,
96 CONSERVE_2,
97 CONSERVE_3,
98 CONSERVE_4,
99 CONSERVE_5,
100 CONSERVE_ALL,
101 CONSERVE_FOR_ANTI_ARMOR,
102 FIRE_WHEN_INEFFICIENT,
103 EXTRA_RANGE_ON_FIGHTER,
104
105 IGNORES_FLARES,
106
107 GROUP_LINKED,
108 GROUP_ALTERNATING,
109
110 MISSILE_SPREAD,
111 DIRECT_AIM,
112 NO_TURN_RATE_BOOST_WHEN_IDLE,
113 RESET_BARREL_INDEX_ON_BURST,
114
115 USE_LESS_VS_SHIELDS,
116
121 RANGE_FROM_TARGETING_OVAL,
122
128 RANGE_FROM_SHIP_RADIUS,
129
133 IMPORTANT,
134
139 NO_MANUAL_FIRE,
140 }
141
142
143 String getId();
144 WeaponType getType();
145 WeaponSize getSize();
146
147 void setPD(boolean pd);
148
154 float distanceFromArc(Vector2f target);
155 boolean isAlwaysFire();
156
160 float getArc();
161 void setCurrAngle(float angle);
162
163 float getRange();
166 float getTurnRate();
169 int getAmmo();
171 void setMaxAmmo(int maxAmmo);
172 void resetAmmo();
174 float getCooldown();
175 void setRemainingCooldownTo(float value);
176
177 boolean isBeam();
178 boolean isBurstBeam();
179 boolean isPulse();
181
185 Vector2f getLocation();
186
187 boolean isFiring();
188
189 boolean usesAmmo();
190 boolean usesEnergy();
191
192 boolean hasAIHint(AIHints hint);
194
197
200 boolean isDisabled();
202
204
206
208
213 DerivedWeaponStatsAPI getDerivedStats();
214
215 void setAmmo(int ammo);
216
221
222
232
238
248 void renderBarrel(SpriteAPI sprite, Vector2f loc, float alphaMult);
254
255
256 void disable();
257
258 void disable(boolean permanent);
259
260 void repair();
261
264
266
267 List<MissileRenderDataAPI> getMissileRenderData();
270 boolean isDecorative();
273 void setPDAlso(boolean pdAlso);
274 void setCurrHealth(float currHealth);
276 List<BeamAPI> getBeams();
277 Vector2f getFirePoint(int barrel);
278 void setTurnRateOverride(Float turnRateOverride);
281 void setRefireDelay(float delay);
282 void setFacing(float facing);
285 void setKeepBeamTargetWhileChargingDown(boolean keepTargetWhileChargingDown);
286 void setScaleBeamGlowBasedOnDamageEffectiveness(boolean scaleGlowBasedOnDamageEffectiveness);
287 void setForceFireOneFrame(boolean forceFire);
288 void setGlowAmount(float glow, Color glowColor);
289 void setForceNoFireOneFrame(boolean forceNoFireOneFrame);
290 void setSuspendAutomaticTurning(boolean suspendAutomaticTurning);
293 void setRenderOffsetForDecorativeBeamWeaponsOnly(Vector2f renderOffsetForDecorativeBeamWeaponsOnly);
296 boolean isInBurst();
298 void setWeaponGlowWidthMult(float weaponGlowWidthMult);
299 void setWeaponGlowHeightMult(float weaponGlowHeightMult);
302 void setForceDisabled(boolean forceDisabled);
303 Object getCustom();
304 void setCustom(Object custom);
306}
307
308
Vector2f getRenderOffsetForDecorativeBeamWeaponsOnly()
void setRenderOffsetForDecorativeBeamWeaponsOnly(Vector2f renderOffsetForDecorativeBeamWeaponsOnly)
DerivedWeaponStatsAPI getDerivedStats()
void setForceNoFireOneFrame(boolean forceNoFireOneFrame)
void renderBarrel(SpriteAPI sprite, Vector2f loc, float alphaMult)
float distanceFromArc(Vector2f target)
CollisionClass getProjectileCollisionClass()
void setKeepBeamTargetWhileChargingDown(boolean keepTargetWhileChargingDown)
EveryFrameWeaponEffectPlugin getEffectPlugin()
void setForceDisabled(boolean forceDisabled)
void setGlowAmount(float glow, Color glowColor)
void setTurnRateOverride(Float turnRateOverride)
void setSuspendAutomaticTurning(boolean suspendAutomaticTurning)
void setForceFireOneFrame(boolean forceFire)
void setCurrHealth(float currHealth)
List< MissileRenderDataAPI > getMissileRenderData()
void setRemainingCooldownTo(float value)
void disable(boolean permanent)
void setScaleBeamGlowBasedOnDamageEffectiveness(boolean scaleGlowBasedOnDamageEffectiveness)
void setWeaponGlowHeightMult(float weaponGlowHeightMult)
void setWeaponGlowWidthMult(float weaponGlowWidthMult)