actor FlareBurstWep_NormalBar : NormalBar{args 87,41}
actor FlareBurstWep : BaseMM8BDMWep 
{
Weapon.AmmoUse 4
Weapon.AmmoGive 28
Weapon.SlotNumber 5
Inventory.Pickupmessage "$PU_FLAREBURST"
Obituary "$OB_FLAREBURST"
Tag "$TAG_FLAREBURST"
weapon.ammotype "FlareBurstAmmo"
inventory.icon "FLBSICON"
States
{
SpawnLoop:
FLBS Z -1
loop
Ready:
FLBS A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_FLAREBURST)
FLBS A 1 A_WeaponReady
Goto Ready+1
ReadyC: Goto Ready+1
Deselect:
FLBS A 0 
goto DeselectSwap
Select:
FLBS A 0 
goto SelectSwap
Fire:
FLBS A 0 A_JumpIfNoAmmo("NoAmmo")
FLBS A 0 A_PlaySoundEx("weapon/commandoshot","Weapon")
FLBS A 0 A_FireCustomMissile("FlareBurst",-4,1,8,0)
FLBS A 0 A_FireCustomMissile("FlareBurst",4,0,8,0)
FLBS A 0 A_FireCustomMissile("FlareBurst2",0,0,8,0)
FLS0 ABCDEF 2
FLBS A 9
FLBS A 0 A_Refire
Goto Ready+1
NoAmmo:
FLBS A 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
}
}

actor FlareBurstAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor FlareBurst : BasicProjectile
{
PROJECTILE
+BRIGHT
damagetype "FlareBurst"
Obituary "$OB_FLAREBURST"
Radius 15
Height 15
scale 2.75
damage (CallACS("vile_cbm_damage",18))
speed 27
States
{
Spawn:
FLBS FG 2
FLBS D 0 A_Changeflag("NOGRAVITY",0)
loop
Death:
TNT1 A 0 A_JumpIf(z-floorz<=8,"Death2")
TNT1 A 3
stop
Death2:
TNT1 B 0 A_PlaySoundEx("misc/mm3explosion", "Item")
TNT1 A 0 A_SpawnItemEx("FlareBurstWave", 0, 0, 0, 1, 0, 0, 0, SXF_MULTIPLYSPEED)
TNT1 A 0 A_SpawnItemEx("FlareBurstWaveTrail")
TNT1 A 3
stop
}
}

actor FlareBurst2 : FlareBurst {speed 34}

actor FlareBurstWave : BasicProjectile
{
    PROJECTILE
	Translation "209:229=41:41"
    Obituary "$OB_FLAREBURST"
    damagetype "FlareBurst"
    +RIPPER
    +STEPMISSILE
    maxstepheight 32
    Speed 20
    Damage 0
    height 2
    radius 1
    scale 2.5
    reactiontime 6
    States
    {
    Spawn:
        TNT1 A 1
	Spawn1: 
		TNT1 A 1
        //TNT1 A 0 A_JumpIf(z-floorz > 24, "Death")
        TNT1 A 0 A_JumpIf(z-floorz > 0, "WarpToFloor1")
        goto Spawn2
    Spawn2:
        TNT1 A 2
        //TNT1 A 0 A_JumpIf(z-floorz > 24, "Death")
		TNT1 A 0 A_PlaySoundEx("misc/mm3explosion", "Weapon")
        TNT1 A 0 A_SpawnItemEx("FlareBurstWaveTrail")
        TNT1 A 0 A_Countdown
        TNT1 A 0 A_JumpIf(z-floorz > 0, "WarpToFloor2")
        goto Spawn1
    WarpToFloor1:
        TNT1 A 0 A_Warp(AAPTR_DEFAULT, 0, 0, -(z-floorz))
        goto Spawn2
    WarpToFloor2:
        TNT1 A 0 A_Warp(AAPTR_DEFAULT, 0, 0, -(z-floorz))
        goto Spawn1
    Death:
        TNT1 A 0
        stop
    }
}

actor FlareBurstDamagerA 
{
    Obituary "$OB_FLAREBURST"
    damagetype "FlareBurst"
    PROJECTILE
    +FLOORHUGGER
    Damage (CallACS("vile_cbm_damage",4))
    Radius 10
    Height 30
    States
    {
    Spawn:
        TNT1 A 0
        TNT1 A 1
        stop
    }
}

actor FlareBurstDamagerB : FlareBurstDamagerA { height 40  }
actor FlareBurstDamagerC : FlareBurstDamagerA { height 75  }
actor FlareBurstDamagerD : FlareBurstDamagerA { height 112 }

actor FlareBurstDamagerX : FlareBurstDamagerA { damage (5) }
actor FlareBurstDamagerY : FlareBurstDamagerB { damage (5) }
actor FlareBurstDamagerZ : FlareBurstDamagerC { damage (5) }

actor FlareBurstWaveTrail : FlareBurstWave
{
    speed 0
    +FLOORHUGGER
    +FORCEYBILLBOARD
    +BRIGHT
    States
    {
    Spawn:
        ETRA A 1 A_SpawnItemEx("FlareBurstDamagerX")
        ETRA B 1 A_SpawnItemEx("FlareBurstDamagerY")
        ETRA C 1 A_SpawnItemEx("FlareBurstDamagerZ")
        ETRA D 1 A_SpawnItemEx("FlareBurstDamagerD")
        ETRA C 1 A_SpawnItemEx("FlareBurstDamagerC")
        ETRA B 1 A_SpawnItemEx("FlareBurstDamagerB")
        ETRA A 1 A_SpawnItemEx("FlareBurstDamagerA")
        stop
    }
}