001package com.fs.starfarer.api.impl.combat;
002
003import java.awt.Color;
004
005import org.lwjgl.util.vector.Vector2f;
006
007import com.fs.starfarer.api.Global;
008import com.fs.starfarer.api.combat.ShipAPI;
009import com.fs.starfarer.api.combat.WeaponAPI;
010import com.fs.starfarer.api.impl.campaign.ids.Tags;
011
012/**
013 * Copyright 2022 Fractal Softworks, LLC
014 */
015public class NovaBurstStats extends OrionDeviceStats {
016
017        public NovaBurstStats() {
018                p = new OrionDeviceParams();
019                
020                p.bombWeaponId = "nb_bomblauncher";
021                p.shapedExplosionColor = new Color(100,165,255,155);
022                p.shapedExplosionColor = new Color(100,165,255,85);
023                p.shapedExplosionScatter = 0f;
024                
025                p.shapedExplosionNumParticles = 200;
026                p.shapedExplosionOffset = 20f;
027                p.shapedExplosionEndSizeMin = 1.5f;
028                p.shapedExplosionEndSizeMax = 2f;
029                p.shapedExplosionMinParticleSize = 50;
030                p.shapedExplosionMaxParticleSize = 80;
031                p.shapedExplosionMinParticleVel = 100;
032                p.shapedExplosionMaxParticleVel = 500f;
033                p.shapedExplosionArc = 270f;
034                p.shapedExplosionArc = 60f;
035                
036                p.jitterColor = new Color(100,165,255,35);
037                p.maxJitterDur = 1f;
038                
039                p.impactAccel = 10000f;
040                p.impactRateMult = 1f;
041                
042
043                p.bombFadeInTime = 1f;
044                p.bombLiveTime = 0f;
045                p.bombSpeed = 0f;
046        }
047        
048        
049
050        @Override
051        protected void advanceImpl(float amount, ShipAPI ship, State state, float effectLevel) {
052                super.advanceImpl(amount, ship, state, effectLevel);
053
054                if (effectLevel > 0) {
055                        for (WeaponAPI w : ship.getAllWeapons()) {
056                                if (w.isDecorative() && w.getSpec().hasTag(Tags.NOVA)) {
057                                        w.setForceFireOneFrame(true);
058                                        w.forceShowBeamGlow();
059                                }
060                        }
061                }
062        }
063
064
065
066        @Override
067        protected void notifySpawnedExplosionParticles(Vector2f bombLoc) {
068                Color c = new Color(100,165,255,255);
069                float expSize = 800f;
070                float durFringe = 1f;
071                float durFringe2 = 0.75f;
072                float dur = 0.75f;
073//              durFringe2 = 1;
074//              dur = 1;
075                Global.getCombatEngine().addHitParticle(bombLoc, new Vector2f(), expSize, 1f, durFringe, c);
076                Global.getCombatEngine().addHitParticle(bombLoc, new Vector2f(), expSize * 0.67f, 1f, durFringe2, c);
077                Global.getCombatEngine().addHitParticle(bombLoc, new Vector2f(), expSize * 0.33f, 1f, dur, Color.white);
078                
079        }
080        
081        
082        
083}
084
085
086
087
088
089
090
091
092
093
094
095