// Heatwave weapon with ZDoom DECORATE definitions
//took hours to replicate it thanks to jpalomo and spforce for the reference
// - AngelloProduct
ACTOR IDMHeatwave : IDMWeapon
{
    Weapon.AmmoType "IDMGas"
	Weapon.AmmoUse 5
    Weapon.AmmoGive 40
	Weapon.SelectionOrder 50
	Obituary "%o felt the heat being turned up by %k's Calamity Blade!"
    Inventory.PickupMessage "Calamity Blade! (Slot 7)"
    Tag "Calamity Blade"
	+WEAPON.BFG
	+WEAPON.EXPLOSIVE
	+WEAPON.NOAUTOAIM
	+WEAPON.NOLMS
    States
    {
    Spawn:
        HTGN A -1 Bright
        Stop
    Ready:
        HETG A 1 A_WeaponReady
        Loop
    Deselect:
        HETG A 1 A_Lower
        Loop
    Select:
		TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
        HETG A 1 A_Raise
        Loop
    Fire:
		TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Charge5")
	Charge:
		TNT1 A 0 A_TakeInventory("IDMGas", 5)
		HETG A 0 A_GunFlash("FlashCharge1")
		HETG A 17 A_PlayWeaponSound("Heatwave/Charge")
		HETG A 0 A_JumpIfNoAmmo ("Fire1")
		HETG A 0 A_Refire("Charge2")
		Goto Fire1
	Fire1:
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad1")
        HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -5.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", 0.0, 0)
        HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", 5.0, 0)
		Goto FireEnd
	Quad1:
		TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
		Goto Fire1+1
    Charge2:
		TNT1 A 0 A_TakeInventory("IDMGas", 5)
		HETG A 0 A_GunFlash("FlashCharge2")
		HETG A 17 A_PlayWeaponSound("Heatwave/Charge")
		HETG A 0 A_JumpIfNoAmmo ("Fire2")
		HETG A 0 A_Refire("Charge3")
		Goto Fire2
	Fire2:
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad2")
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -12.5, 0)
        HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -7.5, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -2.5, 0)
        HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", 2.5, 0)
        HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", 7.5, 0)
        HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", 12.5, 0)
		Goto FireEnd
	Quad2:
		TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
		Goto Fire2+1
    Charge3:
		TNT1 A 0 A_TakeInventory("IDMGas", 5)
		HETG A 0 A_GunFlash("FlashCharge3")
		HETG A 17 A_PlayWeaponSound("Heatwave/Charge")
		HETG A 0 A_JumpIfNoAmmo ("Fire3")
		HETG A 0 A_Refire("Charge4")
		Goto Fire3
	Fire3:
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad3")
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -20.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -15.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -10.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -5.0, 0)
        HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", 0.0, 0)
        HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", 5.0, 0)
        HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", 10.0, 0)
        HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", 15.0, 0)
        HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", 20.0, 0)
		Goto FireEnd
	Quad3:
		TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
		Goto Fire3+1
    Charge4:
		TNT1 A 0 A_TakeInventory("IDMGas", 5)
		HETG A 0 A_GunFlash("FlashCharge4")
		HETG A 17 A_PlayWeaponSound("Heatwave/Charge")
		HETG A 0 A_JumpIfNoAmmo ("Fire4")
		HETG A 0 A_Refire("Charge5")
		Goto Fire4
	Fire4:
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad4")
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -27.5, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -22.5, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -17.5, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -12.5, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",  -7.5, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",  -2.5, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",   2.5, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",   7.5, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",  12.5, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",  17.5, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",  22.5, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",  27.5, 0)
        Goto FireEnd
	Quad4:
		TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
		Goto Fire4+1		
	Charge5:
		TNT1 A 0 A_TakeInventory("IDMGas", 5)
		HETG A 0 A_GunFlash("FlashCharge5")
		HETG A 17 A_PlayWeaponSound("Heatwave/Charge")
		Goto Fire5
	Fire5:
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad5")
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -35.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -30.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -25.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -20.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -15.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper", -10.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",  -5.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",   0.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",   5.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",  10.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",  15.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",  20.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",  25.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",  30.0, 0)
		HETF A 0 A_FireCustomMissile("IDMHeatwaveRipper",  35.0, 0)
		Goto FireEnd
	Quad5:
		TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
		Goto Fire5+1
	FireEnd:
        HETG A 0 A_GunFlash("FlashCharge6")
		HETF A 3 Bright A_PlayWeaponSound("Heatwave/Fire")
        HETF B 5 Bright
        HETG DCB 4
        Goto Ready
	Flash:
        FlashCharge1:
		HETC A 6 Bright
		HETC BCD 5 Bright
		Goto LightDone
	FlashCharge2:
		HETC E 6 Bright
		HETC FGH 5 Bright
		Goto LightDone
	FlashCharge3:
		HETC I 6 Bright
		HETC JKL 5 Bright
		Goto LightDone
	FlashCharge4:
		HETC M 6 Bright
		HETC NOP 5 Bright
		Goto LightDone
	FlashCharge5:
		HETC Q 6 Bright
		HETC RST 5 Bright
		Goto LightDone
	FlashCharge6:
		TNT1 A 3 A_Light1
		TNT1 A 5 A_Light2
		Goto LightDone
    }
}

// Heatwave Ripper
//turned it into one actor since since decohack handles projectile spawning differently
ACTOR IDMHeatwaveRipper : FastProjectile
{
    Damage (3 * random(1,24))
	DamageType Fire
    Speed 25
    Radius 16
    Height 8
    RenderStyle Translucent
    Alpha 0.5
	DeathSound "Heatwave/Explode"
	Obituary "%o received a heatstroke from %k's Calamity Blade."
	SelfObituary "%o heatstruck %hself with %p own Calamity Blade."
	+EXTREMEDEATH
    +NOBLOCKMAP
    +NOGRAVITY
    +MISSILE
    +THRUGHOST
    +RIPPER
	+BLOODLESSIMPACT
	-NOTELEPORT
    States
    {
    Spawn:
        HETB AAABBBCCC 1 Bright A_Explode(8,32,0,0)
        Loop
    Death:
        HETB D 3 Bright A_Explode(128,96)
		HETB EFGHI 3 Bright
        Stop
    }
}