Starsector API
Loading...
Searching...
No Matches
NovaBurstStats.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.combat;
2
3import java.awt.Color;
4
5import org.lwjgl.util.vector.Vector2f;
6
7import com.fs.starfarer.api.Global;
8import com.fs.starfarer.api.combat.ShipAPI;
9import com.fs.starfarer.api.combat.WeaponAPI;
10import com.fs.starfarer.api.impl.campaign.ids.Tags;
11
15public class NovaBurstStats extends OrionDeviceStats {
16
17 public NovaBurstStats() {
18 p = new OrionDeviceParams();
19
20 p.bombWeaponId = "nb_bomblauncher";
21 p.shapedExplosionColor = new Color(100,165,255,155);
22 p.shapedExplosionColor = new Color(100,165,255,85);
23 p.shapedExplosionScatter = 0f;
24
25 p.shapedExplosionNumParticles = 200;
26 p.shapedExplosionOffset = 20f;
27 p.shapedExplosionEndSizeMin = 1.5f;
28 p.shapedExplosionEndSizeMax = 2f;
29 p.shapedExplosionMinParticleSize = 50;
30 p.shapedExplosionMaxParticleSize = 80;
31 p.shapedExplosionMinParticleVel = 100;
32 p.shapedExplosionMaxParticleVel = 500f;
33 p.shapedExplosionArc = 270f;
34 p.shapedExplosionArc = 60f;
35
36 p.jitterColor = new Color(100,165,255,35);
37 p.maxJitterDur = 1f;
38
39 p.impactAccel = 10000f;
40 p.impactRateMult = 1f;
41
42
43 p.bombFadeInTime = 1f;
44 p.bombLiveTime = 0f;
45 p.bombSpeed = 0f;
46 }
47
48
49
50 @Override
51 protected void advanceImpl(float amount, ShipAPI ship, State state, float effectLevel) {
52 super.advanceImpl(amount, ship, state, effectLevel);
53
54 if (effectLevel > 0) {
55 for (WeaponAPI w : ship.getAllWeapons()) {
56 if (w.isDecorative() && w.getSpec().hasTag(Tags.NOVA)) {
57 w.setForceFireOneFrame(true);
58 w.forceShowBeamGlow();
59 }
60 }
61 }
62 }
63
64
65
66 @Override
67 protected void notifySpawnedExplosionParticles(Vector2f bombLoc) {
68 Color c = new Color(100,165,255,255);
69 float expSize = 800f;
70 float durFringe = 1f;
71 float durFringe2 = 0.75f;
72 float dur = 0.75f;
73// durFringe2 = 1;
74// dur = 1;
75 Global.getCombatEngine().addHitParticle(bombLoc, new Vector2f(), expSize, 1f, durFringe, c);
76 Global.getCombatEngine().addHitParticle(bombLoc, new Vector2f(), expSize * 0.67f, 1f, durFringe2, c);
77 Global.getCombatEngine().addHitParticle(bombLoc, new Vector2f(), expSize * 0.33f, 1f, dur, Color.white);
78
79 }
80
81
82
83}
84
85
86
87
88
89
90
91
92
93
94
95
static CombatEngineAPI getCombatEngine()
Definition Global.java:63
void advanceImpl(float amount, ShipAPI ship, State state, float effectLevel)