/*
 * eriguns2: super immolator
 * (c) xaser 2017
 * sprites (c) Amuscaria
 */

Actor EriSuperImmolator : HellWeapon
{
	Scale 0.8
	Weapon.SelectionOrder 1900
	Weapon.AmmoUse 2
	Weapon.AmmoGive 20
	Weapon.AmmoType "FlameAmmo"
	Weapon.SisterWeapon "EriSuperImmolatorPowered"
	Inventory.Pickupmessage "$GOTSUPERLATOR"
	Tag "$TAG_SUPERLATOR"
	+WEAPON.WIMPY_WEAPON
	States
	{
	Ready:
		HSIG A 1 A_WeaponReady
		Loop
	Deselect:
		HSIG A 0 A_StopSound(CHAN_5)
		HSIG A 1 A_Lower
		Wait
	Select:
		HSIG A 1 A_Raise
		Wait
	Fire:
		HSIG A 0 A_PlaySound("weapons/immolatorstart", CHAN_AUTO)
		HSIG B 2 //A_WeaponOffset(0, 36)
		HSIF C 2 Bright //A_WeaponOffset(0, 40)
	Hold:
		HSIF A 1 Bright A_GunFlash
		TNT1 A 0 A_StopSound(CHAN_WEAPON)
		TNT1 A 0 A_FireCustomMissile("SuperImmolatorFireball")
		TNT1 A 0 A_PlaySound("weapons/immolatorsuper", CHAN_5)
		HSIF B 2 Bright
		HSIF C 2 Bright
		HSIF E 0 A_Refire
		HSIF E 2 A_StopSound(CHAN_5)
		HSIF F 2 //A_WeaponOffset(0, 36)
		HSIF G 2 //A_WeaponOffset(0, 32)
		HSIF HI 2
		Goto Ready
	Flash:
		TNT1 A 1 A_Light(1)
		TNT1 A 2 A_Light(2)
		TNT1 A 1 A_Light(1)
		Goto LightDone
 	Spawn:
		HESI A -1
		Stop
	}
}

Actor EriSuperImmolatorPowered : EriSuperImmolator
{
	Weapon.SisterWeapon "EriSuperImmolator"
	+WEAPON.POWERED_UP
	States
	{
	Deselect:
		HSIG A 0 A_StopSound(CHAN_WEAPON)
		HSIG A 1 A_Lower
		Wait
	Fire:
		HSIG A 0 A_PlaySound("weapons/immolatorstart", CHAN_AUTO)
		HSIG B 2 //A_WeaponOffset(0, 36)
		HSIF C 2 Bright //A_WeaponOffset(0, 40)
		HSIF C 0 A_PlaySound("weapons/immolatorburn2", CHAN_WEAPON, 1.0, true)
	Hold:
		TNT1 A 0 A_PlaySound("weapons/immolatorsuper", CHAN_5)
		HSIF B 1 Bright A_GunFlash
		HSIF B 1 Bright A_FireCustomMissile("SuperImmolatorFirestream", frandom(-4, 4), true)
		HSIF D 2 Bright A_FireCustomMissile("SuperImmolatorFirestream", frandom(-4, 4), true)
		HSIF C 2 Bright A_Refire
		HSIF E 2 A_StopSound(CHAN_WEAPON)
		HSIF F 2 //A_WeaponOffset(0, 36)
		HSIF G 2 //A_WeaponOffset(0, 32)
		HSIF HI 2
		Goto Ready
	Flash:
		TNT1 A 1 A_Light(2)
		TNT1 A 1 A_Light(1)
		Goto LightDone
	}
}

Actor EriSuperImmolatorAsh : EriSuperImmolator
{
	Weapon.AmmoUse 1
	Weapon.AmmoType "AshAmmo"
	Weapon.SisterWeapon "EriSuperImmolatorAshPowered"
}

Actor EriSuperImmolatorAshPowered : EriSuperImmolatorPowered
{
	Weapon.AmmoUse 1
	Weapon.AmmoType "AshAmmo"
	Weapon.SisterWeapon "EriSuperImmolatorAsh"
	+WEAPON.POWERED_UP
}

Actor EriSuperImmolatorMana : EriSuperImmolator replaces FighterWeaponPiece
{
	Weapon.AmmoUse 1
	Weapon.AmmoGive 25
	Weapon.AmmoType "Mana1"
	Weapon.SisterWeapon "EriSuperImmolatorManaPowered"
}

Actor EriSuperImmolatorManaPowered : EriSuperImmolatorPowered
{
	Weapon.AmmoUse 1
	Weapon.AmmoType "Mana1"
	Weapon.SisterWeapon "EriSuperImmolatorMana"
	+WEAPON.POWERED_UP
}

Actor EriSuperImmolatorManaSpawner //: ActorSpawner
{
	States
	{
	Spawn:
		TNT1 A 0 A_SpawnItemEX("EriSuperImmolatorMana")
		Stop
	}
}

Actor EriSuperImmolatorHexen0 : EriSuperImmolatorManaSpawner replaces QuietusDrop   {}
Actor EriSuperImmolatorHexen1 : EriSuperImmolatorManaSpawner replaces FWeaponPiece1 {}
Actor EriSuperImmolatorHexen2 : EriSuperImmolatorManaSpawner replaces FWeaponPiece2 {}
Actor EriSuperImmolatorHexen3 : EriSuperImmolatorManaSpawner replaces FWeaponPiece3 {}
Actor EriSuperImmolatorHexen4 : EriSuperImmolatorManaSpawner replaces FWeapQuietus  {}

Actor SuperImmolatorFireball : ImmolatorFireball
{
	Speed 25
	Obituary "$OB_MPSUPERLATOR"
}

Actor SuperImmolatorFirestream : ImmolatorFirestream
{
	Obituary "$OB_MPSUPERLATORPOW"
	Scale 0.6
	Speed 40
}
