ACTOR FireStormFont : CrusaderWeapon 23802 //replaces CWeapFlame
{
	//Firestorm never really felt like it deserved its name in the
	//original Hexen. It was more like 'Emberstream', lol. 
	//This is very much something I made sure to fix for all you
	//budding pyromaniacs out there.
	Inventory.RestrictedTo CrusaderPlayer
	+UNDROPPABLE
	Weapon.SelectionOrder 2
	Weapon.SlotNumber 3
	Weapon.SlotPriority 0
	Weapon.AmmoUse 2
	Weapon.AmmoGive 25
	Weapon.KickBack 150
	Weapon.YAdjust 6
	Decal "FireStormHot"
	Weapon.AmmoType1 "Mana2W"
	Inventory.PickupMessage "\c[white]Blessed with a \c[fire]Font of Firestorms\c[white]! [\c[green]3\c[white]]"
	Inventory.PickupSound "Pickup/WeaponClericFlame"
	Tag "Firestorm Font"
	Obituary "%o forgot to wear their asbestos pants today."
	States
	{
	Spawn:
		WCFM ABCDEFGH 4 Bright
		Loop
	Select:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("FiresInHand",1)
		TNT1 A 0 {
				if(CountInv("FiresUpgrade") == 1 || CountInv("FiresUpgrade") == 4 || CountInv("FiresUpgrade") == 6 || CountInv("FiresUpgrade") == 9)
				{
				A_GiveInventory("MaceChargeCheck2",1);				
				}
				}			
		Goto Select2
	Deselect:
		TNT1 A 0 A_TakeInventory("FiresInHand")
		TNT1 A 0 A_TakeInventory("MaceChargeCheck2")	
		TNT1 A 0 
		{
			A_StopSound(7);
		}
		Goto Deselect2
	Select2:
		CFLM A 1 A_Raise
		Loop
	Deselect2:
		CFLM A 1 A_Lower
		Loop
	Ready:
		CFLM AAABBBCCC 1 
		{	A_WeaponReady(WRF_ALLOWRELOAD);
			if (random(1,4) == 1) // Spews decorative embers because why not?
			{	A_SpawnItemEx("DecorativeEmberH",random(45,50)* cos(pitch),random(-40,40),(16 - (40 * sin(pitch))),random(-1,1)+velx,random(-1,1)+vely,random(1,2)+velz);}
		}
		Loop
	Fire:
		CFLM A 0 A_JumpIfInventory("MaceChargeCheck2", 1, "FireDouble") //if upgraded primary
		CFLM A 0 A_JumpIfInventory("Mana2W", 2, "FireZ")
		CFLM A 0 A_CheckReload
		Goto Ready
	FireZ:
		CFLM A 2 A_Playsound("FireStart",2,0.7)
		CFLM K 2 A_AlertMonsters
		CLFM L 1 Offset (0, 30)
		CLFM M 1 Offset (0, 30) A_SetBlend("f36025", 0.2, 60)
		Goto FireFlames
    FireHold:
		CFLM M 0 //A_SetBlend("f36025", 0.2, 60)
		CFLM M 0 A_JumpIfInventory("PowerAmbitMana", 1, "FireFlames")
		CFLM M 0 A_JumpIfInventory("Mana2W", 2, "FireFlames")
		CFLM M 0 A_CheckReload
		Goto Ready
	FireFlames:
		CFLM M 0 A_TakeInventory("Mana2W", 1, TIF_NOTAKEINFINITE)
		CFLM M 0 A_PlaySound("FireLoop", 7, 0.5)
		CFLM M 1 offset(1,0) A_FireProjectile("FlameTh",frandom(-10,4),0,10,10,FPF_NOAUTOAIM,random(-5,5))
		CFLM M 1 offset(-1,0) A_SetPitch(pitch-0.3,SPF_INTERPOLATE)
		CFLM N 1 offset(1,0) A_FireProjectile("FlameTh",frandom(-4,10),0,10,10,FPF_NOAUTOAIM,random(-5,5))
		CFLM N 1 offset(-1,0) A_SetPitch(pitch+0.3,SPF_INTERPOLATE)
		CFLM O 1 offset(1,0) A_FireProjectile("FlameTh",frandom(-10,4),0,10,10,FPF_NOAUTOAIM,random(-5,5))
		CFLM O 1 offset(-1,0) A_SetPitch(pitch-0.3,SPF_INTERPOLATE)
		CFLM N 0 A_TakeInventory("Mana2W", 1, TIF_NOTAKEINFINITE)
		CFLM N 1 offset(1,0) A_FireProjectile("FlameTh",frandom(-4,10),0,10,10,FPF_NOAUTOAIM,random(-5,5))
		CFLM N 1 offset(-1,0) A_SetPitch(pitch+0.3,SPF_INTERPOLATE)
		CFLM M 1 offset(1,0) A_FireProjectile("FlameTh",frandom(-10,4),0,10,10,FPF_NOAUTOAIM,random(-5,5))
		CFLM M 1 offset(-1,0) A_SetPitch(pitch-0.3,SPF_INTERPOLATE)
		CFLM O 1 offset(1,0) A_FireProjectile("FlameTh",frandom(-4,10),0,10,10,FPF_NOAUTOAIM,random(-5,5))
		CFLM O 1 offset(-1,0) A_SetPitch(pitch+0.3,SPF_INTERPOLATE)
		CFLM O 0 offset(0,0) A_ReFire ("FireHold")
		CFLM M 1 Offset (0, 30) 
		CFLM L 2 Offset (0, 30) A_StopSound(7) 
		CFLM K 2 Offset (0, 30) A_StopSound(2) 
		Goto Ready
	FireDouble: //upgraded primary uses double hand sprite
		CFLM A 2 A_Playsound("FireStart",2,0.7)
		CFLM P 2 A_AlertMonsters
		CLFM Q 1 Offset (0, 30)
		CLFM Q 1 Offset (0, 30) A_SetBlend("f36025", 0.2, 60)
		Goto FireFlamesDouble
	FireHoldDouble:
		CFLM M 0 A_SetBlend("f36025", 0.2, 60)
		CFLM M 0 A_JumpIfInventory("PowerAmbitMana", 1, "FireFlamesDouble")
		CFLM M 0 A_JumpIfInventory("Mana2W", 2, "FireFlamesDouble")
		CFLM M 0 A_CheckReload
		Goto Ready
	FireFlamesDouble:
		CFLM R 0 A_TakeInventory("Mana2W", 1, TIF_NOTAKEINFINITE)
		CFLM R 0 A_PlaySound("FireLoop", 7, 0.5)
		CFLM R 1 offset(1,0) A_FireProjectile("FlameThrAlt",random(-9,9),0,random(-11,11),10,FPF_NOAUTOAIM,random(-5,5))
		CFLM R 1 offset(-1,0) A_SetPitch(pitch-0.3,SPF_INTERPOLATE)
		CFLM S 1 offset(1,0) A_FireProjectile("FlameThrAlt",random(-9,9),0,random(-11,11),10,FPF_NOAUTOAIM,random(-5,5))
		CFLM S 1 offset(-1,0) {A_SetPitch(pitch+0.3,SPF_INTERPOLATE); A_FireProjectile("FlameThrAlt",random(-9,9),0,random(-11,11),10,FPF_NOAUTOAIM,random(-5,5));}
		CFLM Q 1 offset(1,0) A_FireProjectile("FlameThrAlt",random(-9,9),0,random(-11,11),10,FPF_NOAUTOAIM,random(-5,5))
		CFLM Q 1 offset(-1,0) A_SetPitch(pitch-0.3,SPF_INTERPOLATE)
		CFLM R 0 A_TakeInventory("Mana2W", 1, TIF_NOTAKEINFINITE)
		CFLM R 1 offset(1,0) A_FireProjectile("FlameThrAlt",random(-9,9),0,random(-11,11),10,FPF_NOAUTOAIM,random(-5,5))
		CFLM R 1 offset(-1,0) {A_SetPitch(pitch+0.3,SPF_INTERPOLATE); A_FireProjectile("FlameThrAlt",random(-9,9),0,random(-11,11),10,FPF_NOAUTOAIM,random(-5,5));}
		CFLM S 1 offset(1,0) A_FireProjectile("FlameThrAlt",random(-9,9),0,random(-11,11),10,FPF_NOAUTOAIM,random(-5,5))
		CFLM S 1 offset(-1,0) A_SetPitch(pitch-0.3,SPF_INTERPOLATE)
		CFLM Q 1 offset(1,0) A_FireProjectile("FlameThrAlt",random(-9,9),0,random(-11,11),10,FPF_NOAUTOAIM,random(-5,5))
		CFLM Q 1 offset(-1,0) {A_SetPitch(pitch+0.3,SPF_INTERPOLATE); A_FireProjectile("FlameThrAlt",random(-9,9),0,random(-11,11),10,FPF_NOAUTOAIM,random(-5,5));}
		CFLM Q 0 offset(0,0) A_ReFire ("FireHoldDouble")
		CFLM Q 1 Offset (0, 30) 
		CFLM P 2 Offset (0, 30) A_StopSound(7) 
		CFLM P 2 Offset (0, 30) A_StopSound(2) 
		Goto Ready
	Altfire:
		TNT1 A 0 A_CheckReload
		Goto FireSpearManaCheck
	FireSpearManaCheck:
		TNT1 A 0 A_JumpIfInventory("PowerAmbitMana", 1, "FireSpear")
		TNT1 A 0 A_JumpIfInventory("Mana2W", 10, "FireSpear")
		Goto Fire
	FireSpear: 
		CFLM A 3 
		CFLM K 3 {if(random(1,4) >= 2 && (GetCVar("walp_silentprotagonists")==0) && (CountInv("PowerShutItWilson")) == 0)
				{A_StartSound("CrusExertsHeavy",CHAN_AUTO,CHANF_OVERLAP,0.9,ATTN_NONE,frandom(0.97,1.04));}}
		CFLM L 3 
		CFLM M 2 
		CFLM N 5 Offset (40, 50) A_AlertMonsters
		CFLM O 2 Offset (80, 80)
		{
			A_TakeInventory("Mana2W", 2,TIF_NOTAKEINFINITE);
			A_Recoil(6);
			A_SetBlend("f36025", 0.2, 60);
			if(CountInv("FiresUpgrade") == 3 || CountInv("FiresUpgrade") == 4 || CountInv("FiresUpgrade") == 8 || CountInv("FiresUpgrade") == 9)
				{
				if(GetCVar("walp_wheresthefire")==1)	
				{	A_FireProjectile("FireSpearNOSOOT",0,0,14,9,FPF_NOAUTOAIM); }
				else
				{	A_FireProjectile("FireSpear",0,0,14,9,FPF_NOAUTOAIM);}
				}
				else
				{
				if(GetCVar("walp_wheresthefire")==1)	
				{	A_FireProjectile("FireSpearLesserNOSOOT",0,0,14,9,FPF_NOAUTOAIM); }
				else
				{	A_FireProjectile("FireSpearLesser",0,0,14,9,FPF_NOAUTOAIM);}
				}
		}
		CFLM M 2 Offset (120, 100) {A_SetPitch(Pitch+0.5); A_TakeInventory("Mana2W", 2,TIF_NOTAKEINFINITE);}
		CFLM N 2 Offset (140, 130) {A_SetPitch(Pitch+0.5); A_TakeInventory("Mana2W", 2,TIF_NOTAKEINFINITE);}
		CFLM O 2 Offset (160, 160) {A_SetPitch(Pitch+0.5); A_TakeInventory("Mana2W", 2,TIF_NOTAKEINFINITE);}
		CFLM L 2 Offset (180, 180) {A_SetPitch(Pitch+0.5); A_TakeInventory("Mana2W", 2,TIF_NOTAKEINFINITE); A_StartSound("FireSummon",CHAN_5,CHANF_OVERLAP,1,false,ATTN_NONE);}
		CFLM L 2 Offset (200, 220) 
		TNT1 A 1 A_WeaponOffset(0,0)
		CFLM A 1 Offset (0, 50)
		CFLM A 1 Offset (0, 45)
		CFLM B 1 Offset (0, 40)
		CFLM C 1 Offset (0, 35)
		Goto Ready
	Reload:
		TNT1 A 0 A_JumpIfInventory("PowerAmbitMana", 1, "SummonBarrier")
		TNT1 A 0 A_JumpIfInventory("Mana2W", 5, "SummonBarrier")
		Goto Fire
	SummonBarrier:
		CFLM A 2 A_Playsound("FStormBurst",2,2)
		CFLM D 2 A_PlaySound("FireStart", 7, 0.5)
		CFLM D 2 A_SetBlend("f36025", 0.2, 60)
		CFLM G 2 A_AlertMonsters
		CFLM G 0 A_PlaySound("FireLoop", 7, 0.5, TRUE)
		Goto SummonBarrier2
	RefireBarrier:
		CFLM E 0 A_JumpIfInventory("Mana2W", 5, "SummonBarrier2")
		CFLM E 0 A_CheckReload
		Goto Fire
	SummonBarrier2:
		CFLM E 4 
		CFLM E 0 {
				if(CountInv("FiresUpgrade") == 5 || CountInv("FiresUpgrade") == 6 || CountInv("FiresUpgrade") == 8 || CountInv("FiresUpgrade") == 9)
				{
				A_SpawnItemEx("PinwheelSpinner",0,0,0,0,0,0,0,SXF_SETTARGET|SXF_SETMASTER);
				}
				else
				{
				A_SpawnItemEx("PillarPinwheel",0,0,0,0,0,0,0,SXF_SETTARGET|SXF_SETMASTER);
				}
				}
		CFLM FE 2 {A_SetBlend("f36025", 0.2, 60); A_TakeInventory("Mana2W", 1,TIF_NOTAKEINFINITE);}
		CFLM F 2 A_TakeInventory("Mana2W", 1,TIF_NOTAKEINFINITE)
		CFLM EE 1 A_TakeInventory("Mana2W", 1,TIF_NOTAKEINFINITE)
		CFLM FE 2 
		CFLM FEF 2 
		CFLM G 0 A_JumpIf((GetPlayerInput (INPUT_BUTTONS) & BT_RELOAD),"RefireBarrier")
		CFLM F 0 A_Playsound("FStormEnd",5,1.2)
		CFLM G 3 A_StopSound(7)
		CFLM A 2 
		CFLM A 2 
		{
		A_WeaponReady(WRF_ALLOWRELOAD);
		A_Stopsound(7);
		}
		Goto Ready
	}
}

ACTOR FlameTh //JT- This is for the new Flamethrower Primary Fire
{
	Radius 8
	Height 8
	Speed 13
	Damage (0)
	Projectile
	Gravity 85
	Species "PlayerAlly"
	+ROLLSPRITE
	+ROLLCENTER
	+DOOMBOUNCE
	+EXPLODEONWATER
	+MTHRUSPECIES 
	+NODAMAGETHRUST
	+DONTBLAST
	+FORCERADIUSDMG
	+BLOODLESSIMPACT
	BounceFactor 1
	XScale 0.6
	YScale 0.8
	RenderStyle Add
	Alpha 0.60
	Damagetype "Fire"
	States
	{
	Spawn:
		FX06 A 0 Bright ThrustThingZ(0,frandom(-8,8),0,1)
		FX06 A 0 Bright A_SpawnItemEx ("NapalmTrail", 50, 0, 0, 0, 0, 0, 0, 0, 85) //Has a 2/3 chance of spawning napalm
		FX06 ABC 2 Bright 
		{
		A_FadeOut(0.06); //Gives it a maximum range.
		A_SetRoll(Roll - Random(15,25), SPF_INTERPOLATE);
		A_SetScale(frandom(0.5,0.7),frandom(0.7,0.9),SPF_INTERPOLATE);
		A_Weave(2, 2, 4.0, 4.0); //It rolls and weaves to make it seem more like Napalm!
		}
		Loop
	Death:
		FX06 D 0 Bright A_Explode((random(22,35)),52,0,TRUE)
		FX06 DEFG 5 Bright A_SpawnItemEx ("FireActive", 50, 0, 0, 0, 0, 0, 0, 0, 0)
		Stop
	}
}

ACTOR FlameThrAlt : FlameTh
{
	States
	{
	Spawn:
		FX06 A 0 Bright ThrustThingZ(0,frandom(-8,8),0,1)
		FX06 A 0 Bright A_SpawnItemEx ("NapalmTrail", 50, 0, 0, 0, 0, 0, 0, 0, 85) //Has a 2/3 chance of spawning napalm
		FX06 ABC 2 Bright 
		{
		A_FadeOut(0.06); //Gives it a maximum range.
		A_SetRoll(Roll - Random(15,25), SPF_INTERPOLATE);
		A_SetScale(frandom(0.5,0.7),frandom(0.7,0.9),SPF_INTERPOLATE);
		}
		Loop
	}
}

ACTOR FlameThrSerp : FlameTh //Used by the Serpent Elite in Hexen
{
	XScale 0.8
	YScale 1
	Radius 18
	Height 18
	States
	{
	Spawn:
		FX06 A 0 Bright A_SetRoll(Random(0,250), SPF_INTERPOLATE)
		FX06 ABC 2 Bright 
		{
		A_FadeOut(0.05); //Gives it a maximum range.
		A_SetRoll(Roll - Random(15,25), SPF_INTERPOLATE);
		A_Weave(2, 2, 4.0, 4.0); //It rolls and weaves to make it seem more like Napalm!
		}
		Loop
	Death:
		FX06 D 0 Bright A_Explode((random(3,9)),75,0,TRUE,50)
		FX06 DEFG 5 Bright A_SpawnItemEx ("FireActive", 50, 0, 0, 0, 0, 0, 0, 0, 0)
		Stop
	}
}

ACTOR FireSpear	//JT- Now just a big fireball (lol). Range reduced a bit
{
	Speed 1
	Radius 5
	Scale 2.5
	Damage (Random(20,40))
	Projectile
	Decal "FireStormHot"
	SeeSound "Balls1"
	Damagetype "Fire"
	+BLOODLESSIMPACT
	States
	{
		Spawn:
			TNT1 A 0
			SFIR A 0
			{
				A_ScaleVelocity(62);
				A_ChangeFlag("NOGRAVITY", FALSE);
			}
			Goto Speared
		Speared:
			SFIR ABABABABABAB 1
			{
				While(CountInv("BowCharge") < 3)
				{
					if(CountInv("Walpurgisnacht")%4 == 0)
					{
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),-CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 1)
					{
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),-CountInv("Mana1"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),CountInv("Mana1"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 2)
					{
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),-CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 3)
					{
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),CountInv("Mana1"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),-CountInv("Mana1"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					A_GiveInventory("Mana1", 1);
					if(CountInv("Mana1") >= 10)
					{
						A_TakeInventory("Mana1");
						A_GiveInventory("Walpurgisnacht", 1);
					}
					A_GiveInventory("BowCharge", 1);
					if(velz < 1 && CountInv("Mana2") == 0) 
						{
							A_SpawnProjectile("FireBombard",32,0,15,CMF_AIMDIRECTION,-5);
							A_SpawnProjectile("FireBombard",32,0,-15,CMF_AIMDIRECTION,-5);
							A_GiveInventory("Mana2", 1);
						}
				}
				A_TakeInventory("BowCharge");
			}
			loop
		Death:	
			XPL1 A 0 
			{
			A_SpawnItemEx("FireCrush",0,0,0,0,0,0,0,SXF_ORIGINATOR | SXF_SETMASTER);
			A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7));
			A_Changeflag("NOGRAVITY",TRUE);
			A_Playsound("IgniteExp",0,0.9);
			}
			XPL1 A 2 A_KillChildren("NONE", KILS_KILLMISSILES)
			XPL1 BCDEFGH 3
			Stop
	}
}

ACTOR FireSpearNOSOOT : FireSpear //walp_wheresthefire
{
	Decal "None"
	States
	{
			Speared:
			SFIR ABABABABABAB 1
			{
				While(CountInv("BowCharge") < 3)
				{
					if(CountInv("Walpurgisnacht")%4 == 0)
					{
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),-CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 1)
					{
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),-CountInv("Mana1"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),CountInv("Mana1"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 2)
					{
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),-CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 3)
					{
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),CountInv("Mana1"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),-CountInv("Mana1"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					A_GiveInventory("Mana1", 1);
					if(CountInv("Mana1") >= 10)
					{
						A_TakeInventory("Mana1");
						A_GiveInventory("Walpurgisnacht", 1);
					}
					A_GiveInventory("BowCharge", 1);
					if(velz < 1 && CountInv("Mana2") == 0) 
						{
							A_SpawnProjectile("FireBombardNOSOOT",32,0,15,CMF_AIMDIRECTION,-5);
							A_SpawnProjectile("FireBombardNOSOOT",32,0,-15,CMF_AIMDIRECTION,-5);
							A_GiveInventory("Mana2", 1);
						}
				}
				A_TakeInventory("BowCharge");
			}
			loop
	}
}

ACTOR FireSpearLesser	//JT- Now just a big fireball (lol). Range reduced a bit
{
	Speed 1
	Radius 5
	Scale 2.5
	Damage (Random(20,40))
	Projectile
	Decal "FireStormHot"
	Damagetype "Fire"
	SeeSound "Balls1"
	+BLOODLESSIMPACT
	States
	{
		Spawn:
			TNT1 A 0
			SFIR A 0
			{
				A_ScaleVelocity(62);
				A_ChangeFlag("NOGRAVITY", FALSE);
			}
			Goto Speared
		Speared:
			SFIR ABABABABABAB 1
			{
				While(CountInv("BowCharge") < 3)
				{
					if(CountInv("Walpurgisnacht")%4 == 0)
					{
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),-CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 1)
					{
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),-CountInv("Mana1"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),CountInv("Mana1"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 2)
					{
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),-CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 3)
					{
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),CountInv("Mana1"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),-CountInv("Mana1"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					A_GiveInventory("Mana1", 1);
					if(CountInv("Mana1") >= 10)
					{
						A_TakeInventory("Mana1");
						A_GiveInventory("Walpurgisnacht", 1);
					}
					A_GiveInventory("BowCharge", 1);
				}
				A_TakeInventory("BowCharge");
			}
			loop
		Death:	
			XPL1 A 0 
			{
			A_SpawnItemEx("FireCrush",0,0,0,0,0,0,0,SXF_ORIGINATOR | SXF_SETMASTER);
			A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7));
			A_Changeflag("NOGRAVITY",TRUE);
			A_Playsound("IgniteExp",0,0.9);
			}
			XPL1 A 2 A_KillChildren("NONE", KILS_KILLMISSILES)
			XPL1 BCDEFGH 3
			Stop
	}
}

ACTOR FireSpearLesserNOSOOT : FireSpearLesser
{
	Decal "None"
	States
	{
			Speared:
			SFIR ABABABABABAB 1
			{
				While(CountInv("BowCharge") < 3)
				{
					if(CountInv("Walpurgisnacht")%4 == 0)
					{
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),-CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 1)
					{
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),-CountInv("Mana1"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),CountInv("Mana1"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 2)
					{
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),-CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 3)
					{
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),CountInv("Mana1"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),-CountInv("Mana1"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					A_GiveInventory("Mana1", 1);
					if(CountInv("Mana1") >= 10)
					{
						A_TakeInventory("Mana1");
						A_GiveInventory("Walpurgisnacht", 1);
					}
					A_GiveInventory("BowCharge", 1);
				}
				A_TakeInventory("BowCharge");
			}
			loop
	}
}

ACTOR FireBombard : FireSpear
{
Speed 18
Gravity 0.8
Damage (random(10,20))
-NOGRAVITY
	States
	{
		Spawn:
			TNT1 A 0
		Speared:
			SFIR ABABABABABAB 1
			{
				While(CountInv("BowCharge") < 3)
				{
					if(CountInv("Walpurgisnacht")%4 == 0)
					{
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),-CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 1)
					{
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),-CountInv("Mana1"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),CountInv("Mana1"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 2)
					{
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),-CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 3)
					{
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),CountInv("Mana1"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTail",12*CountInv("BowCharge"),-CountInv("Mana1"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					A_GiveInventory("Mana1", 1);
					if(CountInv("Mana1") >= 10)
					{
						A_TakeInventory("Mana1");
						A_GiveInventory("Walpurgisnacht", 1);
					}
					A_GiveInventory("BowCharge", 1);
				}
				A_TakeInventory("BowCharge");
			}
			loop
		Death:	
			XPL1 A 0 
			{
			A_SpawnItemEx("FireCrush",0,0,0,0,0,0,0,SXF_ORIGINATOR | SXF_SETMASTER);
			A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7));
			A_Changeflag("NOGRAVITY",TRUE); 
			A_Playsound("IgniteExp",0,0.9);
			}
			XPL1 A 2 A_KillChildren("NONE", KILS_KILLMISSILES)
			XPL1 BCDEFGH 3
			Stop
	}
}

ACTOR FireBombardNOSOOT : FireBombard
{
	Decal "None"
	States
	{
	Speared:
			SFIR ABABABABABAB 1
			{
				While(CountInv("BowCharge") < 3)
				{
					if(CountInv("Walpurgisnacht")%4 == 0)
					{
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),-CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 1)
					{
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),-CountInv("Mana1"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),CountInv("Mana1"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 2)
					{
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),-CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1"))),CountInv("Mana1")+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					Else if(CountInv("Walpurgisnacht")%4 == 3)
					{
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),CountInv("Mana1"),-sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
						A_SpawnItemEx("CoronaTailNS",12*CountInv("BowCharge"),-CountInv("Mana1"),sqrt(100-(CountInv("Mana1")*CountInv("Mana1")))+(velz*CountInv("BowCharge")*(.30)),0,0,.2,0);
					}
					A_GiveInventory("Mana1", 1);
					if(CountInv("Mana1") >= 10)
					{
						A_TakeInventory("Mana1");
						A_GiveInventory("Walpurgisnacht", 1);
					}
					A_GiveInventory("BowCharge", 1);
				}
				A_TakeInventory("BowCharge");
			}
			loop
	}
}

ACTOR CoronaTail	//This is the tail of the fireball (and also used in some other explosions)
{
	radius 4
	Height 2
	+SPAWNSOUNDSOURCE
	+BLOODLESSIMPACT
	Projectile
	RenderStyle Add
	Alpha 0.45
	Damage (0)
	Scale 0.3
	Speed 5
	DamageType "Fire"
	Decal "FireStormHot"
	//Translation "128:145=224:230"
	States
	{
	Spawn:
		SCRG A 0 
		SCRG AA 2 Bright //A_Setscale(scalex+0.2,scaley+0.2)
	Death:
		SCRG A 3 Bright A_Setscale(scalex+0.2,scaley+0.2)
		SCRG B 3 Bright A_Setscale(scalex+0.2,scaley+0.2)
		SCRG B 0 Bright 
			{
				A_SetTranslucent(0.7,1);
				A_Setscale(scalex+0.2,scaley+0.2);
			}
		SCRG C 3 Bright A_Explode((random(0,2)), 50, 0, 0, 50)
		SCRG DEFG 3 Bright
		SCRG H 3 Bright A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7))
		SCRG I 3 Bright A_SpawnItemEx ("SmokyAlabaster",0,0,6,0,0,1)
		Stop
	}
}

ACTOR CoronaTailNS : CoronaTail
{
	Decal "None"
}

ACTOR CoronaTailAlt : CoronaTail //used in the explosion for Firestorm Secondary
{
Scale 0.1
	States
	{
	Death:
		SCRG A 3 Bright A_Setscale(scalex+0.2,scaley+0.2)
		SCRG B 3 Bright A_Setscale(scalex+0.2,scaley+0.2)
		SCRG B 0 Bright 
			{
				A_SetTranslucent(0.7,1);
				A_Setscale(scalex+0.2,scaley+0.2);
			}
		SCRG C 3 Bright A_Explode((random(0,2)), 50, 0, 0, 50)
		SCRG DEFG 3 Bright A_Setscale(scalex+frandom(-0.1,0.2),scaley+frandom(-0.1,0.2))
		SCRG H 3 Bright A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7))
		SCRG I 3 Bright  
		Stop
	}
}

ACTOR CoronaBurn : CoronaTail //used in the explosion for Firestorm Secondary
{
Scale 0.2
	States
	{
	Spawn:
		SCRG A 0 
		SCRG ABCD 1 Bright //HIJKLMNOPQR
	Death:
		FFX5 EF 2 Bright A_Setscale(scalex+0.06,scaley+0.06)
		FFX5 GH 2 Bright A_Setscale(scalex+0.06,scaley+0.06)
		FFX5 I 0 Bright 
			{
				A_SetTranslucent(0.7,1);
				A_Setscale(scalex+0.2,scaley+0.2);
			}
		FFX5 I 2 Bright A_Explode((random(0,2)), 50, 0, 0, 50)
		FFX5 JKLMNO 2 Bright A_Setscale(scalex+frandom(-0.1,0.2),scaley+frandom(-0.1,0.2))
		FFX5 P 2 Bright A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7))
		FFX5 QR 3 Bright  
		Stop
	}
}

ACTOR FireCrush	//This is the swirling flame that slowly expands
{
	Speed 50
	Radius 3
	Height 3
	Projectile
	Alpha 0.6
	DamageType "Fire"
	//Translation "128:145=224:230"
	+HITTRACER	//Makes the hit enemy this projectile's tracer
	States
	{
		Spawn:
			CFFX N 2 Bright
			CFFX O 2 Bright
			CFFX P 2 Bright
			Loop
		Death:
			CFFX N 1 A_ChangeVelocity(0,0,0,CVF_REPLACE)
			CFFX N 1 A_HideThing	//Makes this invisible
			CFFX N 0 A_Warp (AAPTR_TRACER,0,0,0,0, WARPF_COPYVELOCITY)	//Warps to its tracer
			CFFX N 0	//spawns all the fire pillars
			{
				A_PlaySound ("FStormBurst");
				A_SpawnItemEx ("FlamePillar", 0, 0, 0, 0, 0, -3, 90, SXF_SETTRACER | SXF_ORIGINATOR);
				A_SpawnItemEx ("FlamePillar", 0, 0, 0, 0, 0, 3, -90, SXF_SETTRACER | SXF_ORIGINATOR);
				A_SpawnItemEx ("FlamePillar", 0, 0, 0, 0, 0, -3, 0, SXF_SETTRACER | SXF_ORIGINATOR);
				A_SpawnItemEx ("FlamePillar", 0, 0, 0, 0, 0, 3, 180, SXF_SETTRACER | SXF_ORIGINATOR);
				A_SpawnItemEx ("FlamePillar", 0, 0, 0, 0, 0, -3, 45, SXF_SETTRACER | SXF_ORIGINATOR);
				A_SpawnItemEx ("FlamePillar", 0, 0, 0, 0, 0, 3, -45, SXF_SETTRACER | SXF_ORIGINATOR);
				A_SpawnItemEx ("FlamePillar", 0, 0, 0, 0, 0, -3, 135, SXF_SETTRACER | SXF_ORIGINATOR);
				A_SpawnItemEx ("FlamePillar", 0, 0, 0, 0, 0, 3, 225, SXF_SETTRACER | SXF_ORIGINATOR);
				
			}
			Goto Death1
		Death1:
			CFFX KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK 1
			{
				A_Warp (AAPTR_TRACER, 0, 0, 0, 0, WARPF_COPYVELOCITY);
			}
			CFFX K 0 	
			{
				A_SpawnItemEx ("FlamePillar1", 0, 0, 0, 0, 0, 0, 90, SXF_SETTRACER | SXF_ORIGINATOR);
				A_SpawnItemEx ("FlamePillar1", 0, 0, 0, 0, 0, 0, -90, SXF_SETTRACER | SXF_ORIGINATOR);
				A_SpawnItemEx ("FlamePillar1", 0, 0, 0, 0, 0, 0, 0, SXF_SETTRACER | SXF_ORIGINATOR);
				A_SpawnItemEx ("FlamePillar1", 0, 0, 0, 0, 0, 0, 180, SXF_SETTRACER | SXF_ORIGINATOR);
			}
			Goto Death2
		Death2:	//These are just to keep it alive long enough to outlive all the flame pillars
			CFFX KKKKKKKKKKKKKKKKKKKKKKKKKKKK 1 A_Warp (AAPTR_TRACER, 0, 0, 0, 0, WARPF_COPYVELOCITY)
			CFFX KKKKKKKKKKKKKKKKKKKKKKKKKKKK 1 A_Warp (AAPTR_TRACER, 0, 0, 0, 0, WARPF_COPYVELOCITY)
			CFFX KKKKKKKKKKKKKKKKKKKKKKKKKKKK 1 A_Warp (AAPTR_TRACER, 0, 0, 0, 0, WARPF_COPYVELOCITY)
			CFFX KKKKKKKKKKKKKKKKKKKKKKKKKKKK 1 A_Warp (AAPTR_TRACER, 0, 0, 0, 0, WARPF_COPYVELOCITY)
			CFFX KKKKKKKKKKKKKKKKKKKKKKKKKKKK 1 A_Warp (AAPTR_TRACER, 0, 0, 0, 0, WARPF_COPYVELOCITY)
			Stop
	}
}

ACTOR FlamePillar //JT- Made more chaotic and less damaging (really OP before; could do 500+ damage!!)
{
	Radius 4
	Damage (0)	
	Alpha 0.6
	DamageType "Fire"
	+FOILINVUL
	+RIPPER
	+NOCLIP
	+NODAMAGETHRUST
	+NODROPOFF
	+Friendly
	+NOGRAVITY
	+PIERCEARMOR
	+ROLLSPRITE 
	+ROLLCENTER
	+FORCERADIUSDMG
	+BLOODLESSIMPACT
	XScale 1.6
	YScale 1.1
	Projectile
	Speed 80
	RenderStyle Add
	States
	{
		Spawn: 
			CFFX A 2 Bright
			CFFX A 2 Bright A_PlaySound ("FireStart", 0, .2)
			CFFX BB 2 Bright A_GIVEINVENTORY("Mana1", 3)	//This simultaneously counts to death and contributes to the pillar location
			CFFX CC 2 Bright A_Warp (AAPTR_TRACER, 0 + CountInv("Mana1"), 0, 0, 15,WARPF_USECALLERANGLE | WARPF_NOCHECKPOSITION)
		Spawn1: 
			CFFX DDEEFFGGHHII 2  Bright
			{
				if(GetCVar("walp_wheresthefire")==1)	
				{	A_SpawnItemEx("CoronaBurn",0,0,0,0,2,random(-2,2)); }
				else
				{	A_SpawnItemEx("CoronaBurn",0,0,0,0,2,random(-2,2));}	
				A_Explode (random(0,2), 100, 0,0,0,0,0,"None", "Blast");
				A_Warp (AAPTR_TRACER, 0 + CountInv("Mana1"), 0, 0, 15,WARPF_USECALLERANGLE | WARPF_NOCHECKPOSITION);
				A_SetRoll(Roll - Random(35,45), SPF_INTERPOLATE);
				A_GiveInventory("Mana1", 3);
			}
			CFFX I 0 A_JumpIfInventory("Mana1", 180, "Death")
			Loop
		Death:
			CFFX DDEEFF 2 Bright A_Warp (AAPTR_TRACER, 200, 0, 0, 13,WARPF_USECALLERANGLE | WARPF_NOCHECKPOSITION)
			CFFX F 0 A_Explode ((2 * random(1,2)),156,0,0,100,0,0,"None", "Blast")
			CFFX F 0 {if(GetCVar("walp_wheresthefire")==1)	
				{	A_SpawnItemEx ("CoronaBurn",0, 0, 15, 0, 0, 3, SXF_TRANSFERTRANSLATION);}
				else
				{	A_SpawnItemEx ("CoronaBurn",0, 0, 15, 0, 0, 3, SXF_TRANSFERTRANSLATION);}}		
			CFFX JJJJKKKKLLLL 2 Bright	A_Warp (AAPTR_TRACER, 200, 0, 0, 23,WARPF_USECALLERANGLE | WARPF_NOCHECKPOSITION)
			Stop
	}	
}

ACTOR FlamePillar1
{
	Radius 18
	Damage (0)
	DamageType "Fire"
	+FOILINVUL
	+RIPPER
	+NOCLIP
	+NODAMAGETHRUST
	+Friendly
	//+PIERCEARMOR
	+NOGRAVITY
	+FORCERADIUSDMG
	+BLOODLESSIMPACT
	XScale 1.3
	YScale 0.9
	Projectile
	Speed 80
	RenderStyle Add
	Alpha 0.6
	States			//Functions just like the other Flame pillar, but the first set of frames increase scale of the sprites
	{
		Spawn: 
			CFFX A 2 Bright
			{
				A_SetScale (1.6,1.2);
				A_SpawnItemEx("FireTrail",0,0,0,0,2,random(-2,2));
				A_PlaySound ("FireStart", 0, .4);
				A_Explode (random(0,1), 100, 0,0,0,0,0,"None", "Blast");
				A_Warp (AAPTR_TRACER, 0 + CountInv("Mana1"), 0, 0, -10,WARPF_USECALLERANGLE | WARPF_NOCHECKPOSITION);
				A_GiveInventory("Mana1", 3);
			}
			CFFX A 2  Bright
			{
				A_SetScale (1.7,1.3);
				A_SpawnItemEx("FireTrail",0,0,0,0,2,random(-2,2));
				A_Explode (random(0,1), 100, 0,0,0,0,0,"None","Blast");
				A_Warp (AAPTR_TRACER, 0 + CountInv("Mana1"), 0, 0, -10,WARPF_USECALLERANGLE | WARPF_NOCHECKPOSITION);
				A_GiveInventory("Mana1", 3);
			}
			CFFX B 2 Bright
			{
				A_SetScale (1.8,1.4);
				A_SpawnItemEx("FireTrail",0,0,0,0,2,random(-2,2));
				A_Explode (random(0,1), 100, 0,0,0,0,0,"None", "Blast");
				A_Warp (AAPTR_TRACER, 0 + CountInv("Mana1"), 0, 0, -10,WARPF_USECALLERANGLE | WARPF_NOCHECKPOSITION);
				A_GiveInventory("Mana1", 3);
			}
			CFFX B 2  Bright
			{
				A_SetScale (1.9,1.5);
				A_SpawnItemEx("FireTrail",0,0,0,0,2,random(-2,2));
				A_Explode (random(0,1), 100, 0,0,0,0,0,"None", "Blast");
				A_Warp (AAPTR_TRACER, 0 + CountInv("Mana1"), 0, 0, -10,WARPF_USECALLERANGLE | WARPF_NOCHECKPOSITION);
				A_GiveInventory("Mana1", 3);
			}
			CFFX C 2 Bright
			{
				A_SetScale (2.1,1.6);
				A_SpawnItemEx("FireTrail",0,0,0,0,2,random(-2,2));
				A_Explode (random(0,1), 100, 0,0,0,0,0,"None", "Blast");
				A_Warp (AAPTR_TRACER, 0 + CountInv("Mana1"), 0, 0, -10,WARPF_USECALLERANGLE | WARPF_NOCHECKPOSITION);
				A_GiveInventory("Mana1", 3);
			}
			CFFX C 2 Bright
			{
				A_SetScale (2.3,1.7);
				A_SpawnItemEx("FireTrail",0,0,0,0,2,random(-2,2));
				A_Explode (random(0,1), 100, 0,0,0,0,0,"None", "Blast");
				A_Warp (AAPTR_TRACER, 0 + CountInv("Mana1"), 0, 0, -10,WARPF_USECALLERANGLE | WARPF_NOCHECKPOSITION);
				A_GiveInventory("Mana1", 3);
			}
		Spawn1: 
			CFFX DDEEFFGGHHII 2  Bright
			{
				A_SpawnItemEx("FireTrail",0,0,0,0,2,random(-2,2));
				A_Explode (random(0,1), 90, 0,0,0,0,0,"None", "Blast");
				A_Warp (AAPTR_TRACER, 0 + CountInv("Mana1"), 0, 0, -10,WARPF_USECALLERANGLE | WARPF_NOCHECKPOSITION);
				A_GiveInventory("Mana1", 3);
			}
			CFFX I 0 A_JumpIfInventory("Mana1", 140, "Death")
			Loop
		Death:
			CFFX F 0 A_SpawnItemEx ("Splode",0, 0, 15, 0, 0, 3, SXF_TRANSFERTRANSLATION)
			CFFX F 0 A_Explode ((2 * random(3, 4)),250,0,0,100,0,0,"None", "Blast")
			CFFX JJJJKKKKLLLL 2 Bright	A_Warp (AAPTR_TRACER, 200, 0, 0, -15,WARPF_USECALLERANGLE | WARPF_NOCHECKPOSITION)
			Stop
	}	
}

ACTOR SpiralPillar : FlamePillar
{
	States
	{
		Spawn: 
			TNT1 A 0
			CFFX A 2 Bright
			CFFX B 2 Bright
			CFFX C 2 Bright A_PlaySound ("FireStart",0,.25)
		Spawn1: 
			CFFX DEF 2  Bright
			{
				A_SpawnItemEx("FireTrail",0,0,0,frandom(-2,2),frandom(-2,2),frandom(-2,2.3));	//Spawns a fire trail, sets its velocity to look good
			}
			Goto Death
		Death:
			CFFX GHIDEF 2 Bright 
			CFFX F 0 A_Explode (random(2,12),50,0,0,50,0,0,"None", "Blast")//(2 * random(2,5))
			CFFX F 0 A_SpawnItemEx ("Splode",0, 0, 15, 0, 0, 3, SXF_TRANSFERTRANSLATION)	//Spawns a explosion animation
			CFFX JJJKKKLLL 2 Bright	
			Stop
	}
}

ACTOR Splode	//Explosion animation
{
	Speed 10
	+NOCLIP
	+NOGRAVITY
	//Translation "128:145=224:230"
	RenderStyle Add
	Alpha 0.75
	States
	{
		Spawn:
			CFCF Q 2 A_ChangeVelocity (0,0,2, CVF_REPLACE)
			CFCF RSTUVWXYZ 2
			Stop
	}
}

ACTOR SmallSplode : Splode
{
	//Translation "128:145=224:230"
	States
	{
		Spawn:
			TNT1 A 0
			CFCF Q 0 A_SetScale(frandom(0.4,0.8))
			CFCF Q 2 
			CFCF RSTUVWXYZ 2
			Stop
	}
}

//////////PINWHEEL AREA EFFECT//////////////
//This spawns a flaming burst arond the player; revised from 4page code
ACTOR PillarPinwheel
{
	Radius 5
	Height 5
	Alpha 0.65
	Decal "FireStormHot"
	+BLOODLESSIMPACT
	States
	{
		Spawn:
		TNT1 A 0
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAAA 1
		{
			A_Warp(AAPTR_MASTER,0,0,0,0,WARPF_USECALLERANGLE);	//Constantly warps to the player
			while(CountInv("Mana2") < 40) //shorter than it used to be
			{
				A_GiveInventory("Mana2", 5);	//Now loops 8 times
				
				while(CountInv("Mana1") < 6)
				{	//Mana1 is for the position of each arm to keep them even around the player in 60 degree increments
					//Mana2 is for extending the arms outward, the distance from the player goes out further one increment after each loop
					//Mana2 also bends the arm backward to give it a swooping shape
					//Walpurgisnacht spins the whole thing.  After the outer loop ends Walpurgisnacht is incremented by one, then it goes in the loops again
					//Then it turns the whole structure by 5 degrees
					if(random(1,8) == 1)
					{
						A_SpawnItemEx("DamageSplode", CountInv("Mana2")*3*(CountInv("PunchLeft", AAPTR_MASTER)+1), 0, 0, 0, 0, 0, (60 * CountInv("Mana1")) - (CountInv("Mana2")) + (5*CountInv("Walpurgisnacht")), SXF_SETTARGET);
					}
					else
					{	
						A_SpawnItemEx("DamageSplodeNOGL", CountInv("Mana2")*3*(CountInv("PunchLeft", AAPTR_MASTER)+1), 0, 0, 0, 0, 0, (60 * CountInv("Mana1")) - (CountInv("Mana2")) + (5*CountInv("Walpurgisnacht")), SXF_SETTARGET);
					}
					A_GiveInventory("Mana1", 1);
				}
				A_TakeInventory("Mana1");	//This resets the Mana1 counter
			}
			A_TakeInventory("Mana2");	//This resets the Mana2 counter
			A_GiveInventory("Walpurgisnacht", 1);
		}
		Stop
	}
}

ACTOR PinwheelSpinner 
{
	Speed 18
	Radius 5
	Height 5
	Alpha 0.65
	Decal "FireStormHot"
	+NOGRAVITY
	+NOINTERACTION
	+NOCLIP
	States
	{
		Spawn:
		TNT1 A 0
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAAA 1
		{
			A_Warp(AAPTR_MASTER,0,0,0,0,WARPF_USECALLERANGLE);	//Constantly warps to the player
			while(CountInv("Mana2") < 50) //shorter than it used to be
			{
				A_GiveInventory("Mana2", 5);	//Now loops 10 times
				while(CountInv("Mana1") < 6)
				{	//Mana1 is for the position of each arm to keep them even around the player in 60 degree increments
					//Mana2 is for extending the arms outward, the distance from the player goes out further one increment after each loop
					//Mana2 also bends the arm backward to give it a swooping shape
					//Walpurgisnacht spins the whole thing.  After the outer loop ends Walpurgisnacht is incremented by one, then it goes in the loops again
					//Then it turns the whole structure by 5 degrees
					if(random(1,8) == 1)
					{
						A_SpawnItemEx("DamageSplode", CountInv("Mana2")*3*(CountInv("PunchLeft", AAPTR_MASTER)+1), 0, 0, 0, 0, 0, (60 * CountInv("Mana1")) - (CountInv("Mana2")) + (7*CountInv("Walpurgisnacht")), SXF_SETTARGET);
					}
					else
					{	
						A_SpawnItemEx("DamageSplodeNOGL", CountInv("Mana2")*3*(CountInv("PunchLeft", AAPTR_MASTER)+1), 0, 0, 0, 0, 0, (60 * CountInv("Mana1")) - (CountInv("Mana2")) + (7*CountInv("Walpurgisnacht")), SXF_SETTARGET);
					}
					A_GiveInventory("Mana1", 1);
				}
				A_TakeInventory("Mana1");	//This resets the Mana1 counter
			}
			A_TakeInventory("Mana2");	//This resets the Mana2 counter
			A_GiveInventory("Walpurgisnacht", 1);
		}
		Stop
	}
}
ACTOR DamageSplode	//Considerably Revised Pinwheel
{	Speed 9
	+NOCLIP
	+NOGRAVITY
	+PAINLESS
	+FORCERADIUSDMG
	+FRIENDLY
	+BLOODLESSIMPACT
	Damagetype "Blast"
	Decal "FireStormHot"
	RenderStyle Add
	Alpha 0.55
	States
	{
		Spawn:
			TNT1 A 0 A_GiveInventory("Mana2",1)
			TNT1 A 0 {if (random(1,2) == 1) // randomly flips the burning monster
			{ A_Changeflag("SPRITEFLIP",TRUE);}}
			CFCF J 1 Bright A_SetScale(0.6,1.2)
			CFCF K 1 Bright A_SetScale(0.8,1.4)
			CFCF L 1 Bright A_SetScale(1,1.6)
			CFCF L 0 A_Explode(random(0,3),45)
			CFCF M 1 Bright A_SetScale(1.2,1.8)
			CFCF N 1 Bright A_SetScale(1.1,1.7)
			CFCF O 1 Bright A_SetScale(1,1.6)
			CFCF O 0 A_Explode(random(1,3),45)
			CFCF P 1 Bright A_SetScale(0.9,1.5) //Killafterhere
			CFCF P 0 A_JumpifInventory("Mana2",10,"Death")
		Death:
			CFCF J 0 Bright 
			{			
			if (random(1,2) == 1) 
			{A_SpawnItemEx("DecorativeEmberH",random(-4,4),random(-4,4),4,-2,random(-3,1),random(3,7));}
			}
			CFCF J 1 Bright A_SetScale(0.7,1.2) 
			CFCF L 1 Bright A_SetScale(0.6,1)
			CFCF K 1 Bright A_SetScale(0.5,0.8)
			CFCF L 1 Bright A_SetScale(0.4,0.6)
			CFCF L 1 Bright A_SetScale(0.2,0.4)
			CFCF L 0 A_Explode(random(2,6),45)
			CFCF M 1 Bright A_SetScale(0.1,0.25)
			Stop
	}
}

ACTOR DamageSplodeNOGL : DamageSplode
{
}

ACTOR FireActive	//This is the small flame animation - JT-Made it peter out quicker.
{
	+NOCLIP
	+NOBLOCKMAP
	+DONTSPLASH
	+FRIENDLY
	+NODAMAGETHRUST
	+PAINLESS
	+NOGRAVITY
	+BLOODLESSIMPACT
	DamageType "Blast"
	RenderStyle Add
	Alpha 0.8
	States
	{
	Spawn:
		TNT1 A 0 A_PlaySound ("FireStart", 0, .025)
		CFCF AB 3 Bright 
		CFCF CD 3 Bright
		CFCF EF 3 Bright 
		Goto FireLoop
	FireLoop:
		CFCF G 1 Bright {A_SetScale (0.9); A_SpawnItemEx ("SmokyOily",0,0,30,0,0,1);}
		CFCF G 1 Bright A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7))
		CFCF H 1 Bright A_SetScale (0.8)
		CFCF H 1 Bright 
		CFCF I 1 Bright A_SetScale (0.7)
		CFCF I 1 Bright 
		CFCF J 1 Bright A_SetScale (0.6)
		CFCF J 1 Bright 
		CFCF K 1 Bright A_SetScale (0.5)
		CFCF K 1 Bright 
		CFCF L 1 Bright A_SetScale (0.4)
		CFCF L 1 Bright A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7))
		CFCF M 1 Bright A_SetScale (0.3)
		CFCF M 1 Bright 
		Goto Die
	Die:
		TNT1 A 0 A_Die
		Goto Death
	Death:
		TNT1 A 0 A_PlaySound ("FireEnd", 0, .025)
		CFCF NOP 2 Bright
		Stop
	}
}

ACTOR FireTallWall : FireActive
{
YScale 1.3
}

ACTOR FireTrail : FireActive	//These ones have no friction 
{
	Alpha 0.3
	Scale 0.9
	+NOFRICTION
}

ACTOR NapalmTrail : FireActive	//JT- These ones are affected by gravity BurningMonsterEffect
{
	Alpha 0.3
	Scale 0.9
	-NOCLIP
	-NOGRAVITY
	Gravity 8
	Mass 10
}

ACTOR BurningMonsterEffect : FireActive	//JT- These ones are affected by gravity 
{
	Alpha 0.15
	Scale 2
	States
	{
	Spawn:
		CFCF AB 1 Bright A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7))
		CFCF CD 1 Bright A_SpawnItemEx ("SmokyOily",0,0,30,0,0,1)
		CFCF EF 1 Bright A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7))
		Goto FireLoop
	FireLoop:
		CFCF GHIJKLM 1 Bright 
		Goto Die
	}
}

ACTOR FireActive1 : FireActive	//This and the next ones are variations on the flame animation to give some variety
{
	//Translation "128:145=224:230"
	States
	{
	FireLoop:
		CFCF I 1 Bright A_SetScale (0.9)
		CFCF I 1 Bright A_Explode (1, 64,0)
		CFCF J 1 Bright A_SetScale (0.8)
		CFCF J 1 Bright A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7))
		CFCF K 1 Bright A_SetScale (0.7)
		CFCF K 1 Bright 
		CFCF L 1 Bright A_SetScale (0.6)
		CFCF L 1 Bright A_Explode (1, 64,0)
		CFCF M 1 Bright A_SetScale (0.5)
		CFCF M 1 Bright 
		CFCF G 1 Bright A_SetScale (0.4)
		CFCF G 1 Bright A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7))
		CFCF H 1 Bright A_SetScale (0.3)
		CFCF H 1 Bright A_Explode (1, 64,0)
		Goto Die
	}
}

ACTOR FireActive2 : FireActive
{
	//Translation "128:145=224:230"
	States
	{
	FireLoop:
		CFCF L 1 Bright A_SetScale (0.9)
		CFCF L 1 Bright A_Explode (1, 64)
		CFCF M 1 Bright A_SetScale (0.8)
		CFCF M 1 Bright 
		CFCF G 1 Bright A_SetScale (0.7)
		CFCF G 1 Bright A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7))
		CFCF H 1 Bright A_SetScale (0.6)
		CFCF H 1 Bright A_Explode (1, 64)
		CFCF I 1 Bright A_SetScale (0.5)
		CFCF I 1 Bright A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7))
		CFCF J 1 Bright A_SetScale (0.4)
		CFCF J 1 Bright 
		CFCF K 1 Bright A_SetScale (0.3)
		CFCF K 1 Bright A_Explode (1, 64)
		Goto Die
	}
}

ACTOR HammerNapalm : FireActive	//JT- A version used by the hammer Tertiary
{
	Alpha 0.3
	Scale 0.4
	-NOCLIP
	-NOGRAVITY
	Gravity 8
	States
	{
	FireLoop:
		CFCF L 1 Bright A_SetScale (0.9)
		CFCF L 1 Bright A_Explode (1, 64)
		CFCF M 1 Bright A_SetScale (0.8)
		CFCF M 1 Bright 
		CFCF G 1 Bright A_SetScale (.7)
		CFCF G 1 Bright A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7))
		CFCF H 1 Bright A_SetScale (0.6)
		CFCF H 1 Bright A_Explode (1, 64)
		CFCF I 1 Bright A_SetScale (0.5)
		CFCF I 1 Bright A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,1),random(3,7))
		CFCF J 1 Bright A_SetScale (0.4)
		CFCF J 1 Bright 
		CFCF K 1 Bright A_SetScale (0.3)
		CFCF K 1 Bright A_Explode (1, 64)
		Goto Die
	}
}