ACTOR QuietusX : MyrmidonWeapon
{
	//"Quietus" means quiet, as in the quiet of the dead, which is very
	//chuuni-level dramatic, thanks original Hexen writers... 
	//I instead made it the surname of the original founder of the Legion, 
	//Aurelius Quietus, and the sword itself remains technically nameless but 
	//is instead referenced by its old users moniker, which makes sense to me. 
	//
	//As its supposed to be a greatsword, its swings gain speed & power the longer
	//you swing, as the correct way to use one in real-life is use its pendulum
	//like momentum. Of course, Baratus is a serious meaty boi, so I can allow the
	//fact that he can probably build up momentum on the spot rather than dancing
	//around, lol. Greatswords are always mis-portrayed in games as being heavy;
	//but they're really not, they're insanely swift and versatile when used right. 
	Inventory.RestrictedTo MyrmidonPlayer
	Health 3
	Weapon.SelectionOrder 1
	Weapon.SlotNumber 4
	Weapon.SlotPriority 0
	+WEAPON.AXEBLOOD
	+WEAPON.PRIMARY_USES_BOTH
	+Inventory.NoAttenPickupSound
	+UNDROPPABLE
	Weapon.AmmoGive1 25
	Weapon.AmmoGive2 25
	Weapon.YAdjust 6
	Weapon.AmmoType1 "Mana1W"
	Weapon.AmmoType2 "Mana2W"
	//Decal "QuietusGlowDecal" 
	Inventory.PickupMessage "\c[white]Crafted the \c[brick]Greatsword\c[white] of \c[green]Duke Aurelius Quietus\c[white]!! [\c[yellow]4\c[white]]"
	Inventory.PickupSound "WeaponBuild"
	Tag "Sword of Aurelius Quietus"
	Obituary "%o was being too loud. Now they are Quietus."
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	Select:
		TNT1 A 1
		SLQC A 0 A_GiveInventory("QuietusInHand",1) 
		Goto Select2
	Select2:
		SLQC A 1 A_Raise
		Loop
	Deselect:
		SLQC A 1 A_TakeInventory("QuietusInHand")
		Goto Deselect2
	Deselect2:
		SLQC A 1 A_Lower
		Loop
	Ready:
		SLQC AABBCCBB 3
		{	A_WeaponReady(WRF_ALLOWRELOAD);
			if (random(1,3) == 1) // Spews decorative sparklies because why not?
			{	A_SpawnItemEx("QuietSparklies",random(25,35)* cos(pitch),random(10,25),(random(26,30) - (40 * sin(pitch))),velx,vely,velz+0.3);}
		}
		Loop
	Fire:
		TNT1 A 0 A_TakeInventory("TKCounter")
		SLQC A 0 A_JumpIfInventory ("Queensbury", 1, "Check")
		Goto Ready
	Check:
		W04L A 0 A_JumpIfInventory("ComboCounter",3,"Attack")
		W04J A 0 A_JumpIfInventory("ComboCounter",2,"Attack")
		W04C A 0 A_JumpIfInventory("ComboCounter",1,"Attack")
		SLQU A 0
		Goto Attack
	Attack:
		"####" B 1 //2
		"####" A 0 
		"####" B 1 //A_JumpIf(CountInv("ComboCounter") == 1,1) //2
		"####" C 1 {if(random(0,3) >= 2 && (GetCVar("walp_silentprotagonists")==0) && (CountInv("PowerShutItWilson")) == 0)
				{A_StartSound("MyrmExertsLight",CHAN_AUTO,CHANF_OVERLAP,0.9,ATTN_NONE,frandom(0.97,1.04));}}
		"####" D 1 A_AlertMonsters
		"####" E 1 
		"####" E 1 
		"####" F 1 
		{
			if(CountInv("ComboCounter") == 3)
				{
				A_FireProjectile("QuietSlash4",0,false,0,0,FPF_NOAUTOAIM); //Thrust
				A_CustomPunch (random (75,125) + ((CountInv("TKCounter")+1)*random(12,22)), 1, CPF_NOTURN, "QuietPuff", 164, 0);
				A_CustomPunch (1, 1, CPF_NOTURN, "QuietPuffS", 550, 0);
				}
			else if (CountInv("ComboCounter") == 2)
				{
				A_FireProjectile("QuietSlash3",0,false,-13,0,FPF_NOAUTOAIM); //Down
				A_CustomPunch (random (75,125) + ((CountInv("TKCounter")+1)*random(12,22)), 1, CPF_NOTURN, "QuietPuff", 164, 0);
				A_CustomPunch (1, 1, CPF_NOTURN, "QuietPuffD", 550, 0);
				}
			else if (CountInv("ComboCounter") == 1)
				{
				A_FireProjectile("QuietSlash2",0,false,0,7,FPF_NOAUTOAIM); //Left
				A_CustomPunch (random (75,125) + ((CountInv("TKCounter")+1)*random(12,22)), 1, CPF_NOTURN, "QuietPuff", 164, 0);
				A_CustomPunch (1, 1, CPF_NOTURN, "QuietPuffR", 550, 0);
				}
			else 
				{
				A_FireProjectile("QuietSlash1",0,false,5,8,FPF_NOAUTOAIM); //Right
				A_CustomPunch (random (75,125) + ((CountInv("TKCounter")+1)*random(12,22)), 1, CPF_NOTURN, "QuietPuff", 164, 0);
				A_CustomPunch (1, 1, CPF_NOTURN, "QuietPuffL", 550, 0);
				}
		}
		"####" F 1 //A_JumpIf(CountInv("ComboCounter") != 1,1) //2
		"####" G 1 
		"####" H 1 
		"####" I 1  
		"####" J 1  
		{
			A_GiveInventory("ComboCounter",1);
			if(CountInv("QuietusUpgrade") == 1 || CountInv("QuietusUpgrade") == 4 || CountInv("QuietusUpgrade") == 6 || CountInv("QuietusUpgrade") == 9)
				{	
				A_GiveInventory("TKCounter", 3);
				}
			else
				{
				A_GiveInventory("TKCounter", 1);
				}		
			if(CountInv("ComboCounter") > 3)
			{
				A_TakeInventory("ComboCounter");
			}
		}
		"####" J 0 A_JumpIf((CountInv("TKCounter") >=1),(CountInv("TKCounter")))
		TNT1 A 4
		TNT1 A 4 
		TNT1 A 4
		TNT1 A 1 A_Refire("Check")
		TNT1 A 0 A_TakeInventory("ComboCounter") //Reset combo
		SLQC A 1 Offset (5, 60) 
		SLQC A 1 Offset (5, 55)
		SLQC A 1 Offset (5, 50)
		SLQC A 1 Offset (5, 45)
		SLQC A 1 Offset (5, 40)
	Goto Ready
	AltFire:
		W04L I 7 
		Goto TorpedoCheck1
	TorpedoCheck1:
		QLZR A 0 A_JumpIfInventory("PowerAmbitMana", 1, "TorpedoSetup")
		QLZR A 0 A_JumpIfInventory ("Mana1W", 1, "TorpedoCheck2")
		Goto Fire
	TorpedoCheck2:
		QLZR A 0 A_JumpIfInventory ("Mana2W", 1, "TorpedoSetup")
		Goto Fire
	TorpedoSetup:
		QLZR I 2 
		QLZR H 2 A_AlertMonsters
		QLZR G 2 A_PlaySound("QuietusLoop", 7, 0.6, true,ATTN_STATIC,false,0.8)
		QLZR A 2 {
				if(CountInv("QuietusUpgrade") == 3 || CountInv("QuietusUpgrade") == 4 || CountInv("QuietusUpgrade") == 8 || CountInv("QuietusUpgrade") == 9)
				{
				A_SpawnItemEx("QuietusTorpedoUpgraded",70,0,46,0,0,0,0,SXF_SETMASTER|SXF_TRANSFERPITCH);
				}
				else
				{
				A_SpawnItemEx("QuietusTorpedo",70,0,46,0,0,0,0,SXF_SETMASTER|SXF_TRANSFERPITCH);
				}}
		Goto TorpedoLoop
	TorpedoLC1:
		QLZR A 0 A_JumpIfInventory("PowerAmbitMana", 1, "TorpedoLoop")
		QLZR A 0 A_JumpIfInventory ("Mana1W", 2, "TorpedoLC2")
		Goto TorpFire
	TorpedoLC2:
		QLZR A 0 A_JumpIfInventory ("Mana2W", 2, "TorpedoLoop")
		Goto TorpFire
	TorpedoLoop:
		QLZR B 2 Offset (1, 32)
		{	A_PlaySound("LB2Hit", 2, 0.7, false);
			A_Overlay(-23,"TorpOverlay");
			A_OverlayFlags(-23,PSPF_ADDBOB|PSPF_ADDWEAPON,true);	}
		QLZR C 2 Offset (1, 33) A_GiveToChildren("MaceChargeCheck2",1)
		QLZR B 2 Offset (-1, 33) { if(CountInv("PowerAmbitMana") < 1) 
				{A_TakeInventory ("Mana1W", 2); A_TakeInventory ("Mana2W", 2);	}} //replace manachecks with me plz.
		QLZR A 2 Offset (-1, 32)
		QLZR A 0 A_JumpIfInventory("LightningCheck", 1, "TorpFire") //Stops the loop if the ball explodes in your face
		QLZR A 0 A_Refire("TorpedoLC1")
		Goto TorpFire
	TorpFire:
		QLZR G 2 A_GiveToChildren("ComboCounter",1)
		QLZR H 2 A_StopSound(7)
		QLZR I 1 A_TakeInventory("LightningCheck")
		TNT1 A 1 
		SLQC A 1 Offset (5, 60) 
		SLQC A 1 Offset (5, 55)
		SLQC A 1 Offset (5, 50)
		SLQC A 1 Offset (5, 45)
		SLQC A 1 Offset (5, 40)
		Goto Ready		
	TorpOverlay:
		QLZR WUVWUV 2
		Stop
	Reload:
		SLQC A 8 
		TNT1 A 0 A_StartSound("SwingItNow",1,CHANF_OVERLAP|CHANF_LOCAL,0.9,ATTN_STATIC,frandom(1,1.15))
		Goto QuietusSSG
	QuietusSSG:
		SLQC A 0 A_JumpIfInventory("PowerAmbitMana", 1, "QuietusSSGSwing")
		SLQC A 0 A_JumpIfInventory ("Mana1W", 5, "QuietusSSG2")
		Goto Fire
	QuietusSSG2:
		SLQC A 0 A_JumpIfInventory ("Mana2W", 5, "QuietusSSGSwing")
		Goto Fire
	QuietusSSGSwing: 
		FSRD D 1 Offset (5, 36) A_StartSound("QuietBlstX",CHAN_7,CHANF_OVERLAP,1.6,false,ATTN_NONE)
		FSRD D 1 Offset (-15, 50) A_AlertMonsters
		FSRD E 1 Offset (5, 36) 
		{
			if(GetCVar("walp_silentprotagonists")==0)
				{A_StartSound("MyrmExerts",CHAN_AUTO,CHANF_OVERLAP,0.9,ATTN_NONE,frandom(0.97,1.04));}
			A_FireProjectile("QuietusChibiBlast",-24, 0, 0, 2,FPF_NOAUTOAIM);	
			A_FireProjectile("QuietusChibiBlast",-21, 0, 0, 1,FPF_NOAUTOAIM);	
			if(CountInv("QuietusUpgrade") == 5 || CountInv("QuietusUpgrade") == 6 || CountInv("QuietusUpgrade") == 8 || CountInv("QuietusUpgrade") == 9)
				{
				 A_FireProjectile("QuietusChibiBlast",-23, 0, 0, 6,FPF_NOAUTOAIM);
				}
			A_TakeInventory("Mana1W", 1,TIF_NOTAKEINFINITE);
			A_TakeInventory("Mana2W", 1,TIF_NOTAKEINFINITE);
		}
		FSRD E 2 Offset (-15, 50) 
		{
			A_FireProjectile("QuietusChibiBlast",-18, 0, 0, 2,FPF_NOAUTOAIM);
			A_FireProjectile("QuietusChibiBlast",-15, 0, 0, 1,FPF_NOAUTOAIM);
			if(CountInv("QuietusUpgrade") == 5 || CountInv("QuietusUpgrade") == 6 || CountInv("QuietusUpgrade") == 8 || CountInv("QuietusUpgrade") == 9)
				{
				 A_FireProjectile("QuietusChibiBlast",-17, 0, 0, 6,FPF_NOAUTOAIM);
				}
			A_TakeInventory("Mana1W", 1,TIF_NOTAKEINFINITE);
			A_TakeInventory("Mana2W", 1,TIF_NOTAKEINFINITE);
		}
		FSRD F 1 Offset (5, 36) 
		{
			A_FireProjectile("QuietusChibiBlast",-12, 0, 0, 2,FPF_NOAUTOAIM); 
			A_FireProjectile("QuietusChibiBlast",-9, 0, 0, 1,FPF_NOAUTOAIM);
			if(CountInv("QuietusUpgrade") == 5 || CountInv("QuietusUpgrade") == 6 || CountInv("QuietusUpgrade") == 8 || CountInv("QuietusUpgrade") == 9)
				{
				 A_FireProjectile("QuietusChibiBlast",-10, 0, 0, 6,FPF_NOAUTOAIM);
				}
			A_TakeInventory("Mana1W", 1,TIF_NOTAKEINFINITE);
			A_TakeInventory("Mana2W", 1,TIF_NOTAKEINFINITE);
		}
		FSRD F 2 Offset (-15, 50) 
		{
			A_FireProjectile("QuietusChibiBlast",-6, 0, 0, 2,FPF_NOAUTOAIM);
			A_FireProjectile("QuietusChibiBlast",-3, 0, 0, 1,FPF_NOAUTOAIM);
			if(CountInv("QuietusUpgrade") == 5 || CountInv("QuietusUpgrade") == 6 || CountInv("QuietusUpgrade") == 8 || CountInv("QuietusUpgrade") == 9)
				{
				 A_FireProjectile("QuietusChibiBlast",-4, 0, 0, 6,FPF_NOAUTOAIM);
				}
			A_TakeInventory("Mana1W", 1,TIF_NOTAKEINFINITE);
			A_TakeInventory("Mana2W", 1,TIF_NOTAKEINFINITE);
		}
		FSRD G 1 Offset (5, 36) 
		{
			A_FireProjectile("QuietusChibiBlast",0, 0, 0, 2,FPF_NOAUTOAIM);
			A_TakeInventory("Mana1W", 1,TIF_NOTAKEINFINITE);
			A_TakeInventory("Mana2W", 1,TIF_NOTAKEINFINITE);
		}
		FSRD G 2 Offset (-15, 50) 
		{
			A_FireProjectile("QuietusChibiBlast",3, 0, 0, 1,FPF_NOAUTOAIM);
			A_FireProjectile("QuietusChibiBlast",6, 0, 0, 2,FPF_NOAUTOAIM);
			if(CountInv("QuietusUpgrade") == 5 || CountInv("QuietusUpgrade") == 6 || CountInv("QuietusUpgrade") == 8 || CountInv("QuietusUpgrade") == 9)
				{
				 A_FireProjectile("QuietusChibiBlast",4, 0, 0, 6,FPF_NOAUTOAIM);
				}
			A_TakeInventory("Mana1W", 1,TIF_NOTAKEINFINITE);
			A_TakeInventory("Mana2W", 1,TIF_NOTAKEINFINITE);
		}
		FSRD H 1 Offset (5, 36) 
		{
			A_FireProjectile("QuietusChibiBlast",9, 0, 0, 1,FPF_NOAUTOAIM);
			A_FireProjectile("QuietusChibiBlast",12, 0, 0, 2,FPF_NOAUTOAIM);
			if(CountInv("QuietusUpgrade") == 5 || CountInv("QuietusUpgrade") == 6 || CountInv("QuietusUpgrade") == 8 || CountInv("QuietusUpgrade") == 9)
				{
				 A_FireProjectile("QuietusChibiBlast",10, 0, 0, 6,FPF_NOAUTOAIM);
				}
		}
		FSRD H 2 Offset (-15, 50) 
		{
			A_FireProjectile("QuietusChibiBlast",15, 0, 0, 1,FPF_NOAUTOAIM);
			A_FireProjectile("QuietusChibiBlast",18, 0, 0, 2,FPF_NOAUTOAIM);
			if(CountInv("QuietusUpgrade") == 5 || CountInv("QuietusUpgrade") == 6 || CountInv("QuietusUpgrade") == 8 || CountInv("QuietusUpgrade") == 9)
				{
				 A_FireProjectile("QuietusChibiBlast",17, 0, 0, 6,FPF_NOAUTOAIM);
				}
		}
		FSRD I 2 Offset (5, 36)  
		{
			A_FireProjectile("QuietusChibiBlast",21, 0, 0, 1,FPF_NOAUTOAIM);
			A_FireProjectile("QuietusChibiBlast",24, 0, 0, 2,FPF_NOAUTOAIM);
			if(CountInv("QuietusUpgrade") == 5 || CountInv("QuietusUpgrade") == 6 || CountInv("QuietusUpgrade") == 8 || CountInv("QuietusUpgrade") == 9)
				{
				 A_FireProjectile("QuietusChibiBlast",23, 0, 0, 6,FPF_NOAUTOAIM);
				}
		}
		FSRD I 10 Offset (5, 150)
		SLQC A 1 Offset (5, 60) A_PlaySound("FlmGysr1",6,1.1)
		SLQC A 1 Offset (5, 55)
		SLQC A 1 Offset (5, 50)
		SLQC A 1 Offset (5, 45)
		SLQC A 1 Offset (5, 40)
		Goto Ready
	}
}

/////////////////////////////////
/// PRIMARY FIRE (SLASHUMS!!) ///
/////////////////////////////////

//ACTOR QuietPuff : AxePuff
//{
//	SeeSound "SwordCut"
//}

ACTOR QuietPuff : AxePuffWalp
{
	SeeSound "SwordSlashums"
	ActiveSound "SwingItNow"
	AttackSound "None"
}

ACTOR QuietPuffD : QuietPuff //Down Slash; these 4 only exist for decal purposes!
{
	SeeSound "SwordCut"
	ActiveSound "None"
	AttackSound "WallMurder"
}

ACTOR QuietPuffR : QuietPuff //Right Slash
{
	SeeSound "SwordCut"
	ActiveSound "None"
	AttackSound "WallMurder"
}

ACTOR QuietPuffL : QuietPuff //Right Slash
{
	SeeSound "SwordCut"
	ActiveSound "None"
	AttackSound "WallMurder"
}

ACTOR QuietPuffS : QuietPuff //Stab
{
	SeeSound "SwordCut" 
	ActiveSound "None"
	AttackSound "WallMurder"
}

ACTOR QuietSlash1 : AxeBladeSlash
{
	+NOCLIP //changed 0.8; all Quietus Slashes now damage purely via Explode
	Scale 0.7
	Speed 33
	Alpha 0.4
	Reactiontime 4
	MissileType "QuietSlashTrail1"
	States
	{
	Spawn:
		SLSQ C 0 Bright Nodelay //A_SetRoll(6)
		Goto Spawn2
	Spawn2:
		SLSQ A 0 Bright A_Explode(9,60,XF_THRUSTZ,true,30)
		SLSQ A 1 Bright {A_Countdown; A_SpawnItemEx("QuietSlashTrail1",0,0);}
		Loop
	Death:
		SLSQ A 1 Bright A_Fadeout(0.33)
		Stop
	}
}

ACTOR QuietSlashTrail1 : SlashTrail
{
	+NOINTERACTION
	Scale 0.7
	Speed 30
	Alpha 0.6
	States
	{
	Spawn:
		SLSQ C 0 Bright Nodelay //A_SetRoll(6)
		Goto Spawn2
	Spawn2:
		SLSQ A 0 Bright A_Fadeout(0.33)
		SLSQ A 1 Bright 
		Loop
	}
}

ACTOR QuietSlash2 : QuietSlash1
{
	+NOCLIP //changed 0.8; all Quietus Slashes now damage purely via Explode
	MissileType "QuietSlashTrail2"
	States
	{
	Spawn:
		SLSQ B 0 Bright A_Explode(9,60,XF_THRUSTZ,true,30)
		SLSQ B 1 Bright {A_Countdown; A_SpawnItemEx("QuietSlashTrail2",0,0);}
		Loop
	Death:
		SLSQ B 1 Bright A_Fadeout(0.33)
		Stop
	}
}

ACTOR QuietSlashTrail2 : SlashTrail
{
	Scale 0.7
	Speed 28
	Alpha 0.6
	+NOINTERACTION
	States
	{
	Spawn:
		SLSQ B 0 Bright A_Fadeout(0.33)
		SLSQ B 1 Bright 
		Loop
	}
}

ACTOR QuietSlash3 : QuietSlash1
{
	+NOCLIP //changed 0.8; all Quietus Slashes now damage purely via Explode
	+ROLLSPRITE
	+ROLLCENTER
	MissileType "QuietSlashTrail3"
	States
	{
	Spawn:
		SLSQ C 0 Bright Nodelay A_SetRoll(-17)
		Goto Spawn2
	Spawn2:
		SLSQ C 0 Bright A_Explode(9,60,XF_THRUSTZ,true,30)
		SLSQ C 1 Bright {A_Countdown; A_SpawnItemEx("QuietSlashTrail3",0,0);}
		Loop
	Death:
		SLSQ C 1 Bright A_Fadeout(0.33)
		Stop
	}
}

ACTOR QuietSlashTrail3 : SlashTrail
{
	Scale 0.7
	Speed 28
	Alpha 0.6
	+ROLLSPRITE
	+ROLLCENTER
	+NOINTERACTION
	States
	{
	Spawn:
		SLSQ C 0 Bright Nodelay A_SetRoll(-17)
		Goto Spawn2
	Spawn2:
		SLSQ C 0 Bright A_Fadeout(0.33)
		SLSQ C 1 Bright 
		Loop
	}
}

ACTOR QuietSlash4 : QuietSlash1
{
	+NOCLIP //changed 0.8; all Quietus Slashes now damage purely via Explode
	XScale 0.5
	YScale 0.1
	MissileType "QuietSlashTrail4"
	States
	{
	Spawn:
		SLSQ D 0 Bright A_Explode(9,60,XF_THRUSTZ,true,30)
		SLSQ D 1 Bright {A_Countdown; A_SpawnItemEx("QuietSlashTrail4",0,0);}
		Loop
	Death:
		SLSQ D 1 Bright A_Fadeout(0.33)
		Stop
	}
}

ACTOR QuietSlashTrail4 : SlashTrail
{
	XScale 0.5
	YScale 0.1
	Alpha 0.6
	+NOINTERACTION
	Speed 28
	States
	{
	Spawn:
		SLSQ D 0 Bright A_Fadeout(0.33)
		SLSQ D 1 Bright 
		Loop
	}
}

/////////////////////////////////
/// SECONDARY (NRG TORPEDO!!) ///
/////////////////////////////////

Actor QuietusTorpedo //JT- Quietus Chargeable Torpedo
{
	Height 12
	Radius 12
	Damage 15
	RenderStyle Translucent
	Species "PlayerAlly"
	Speed 55
	Alpha 0.5
	XScale 0.2
	YScale 0.2
	DamageType "Blast"
	ProjectileKickBack 500
	PROJECTILE
	+ForceXYBillBoard
	+ROLLSPRITE
	+ROLLCENTER
	+NOCLIP
	+THRUACTORS
	+NOGRAVITY
	+PIERCEARMOR
	+FORCERADIUSDMG
	+EXTREMEDEATH
	+SKYEXPLODE
	+EXPLODEONWATER
	+NONSHOOTABLE
	+FRIENDLY
	-SOLID
	States
	{
	Spawn:
		TNT1 A 0
		Goto Charge
	Charge:
		TORP ABC 1 Bright 
		{
			A_SetRoll(roll-(-3-(CountInv("LightningCheck")*2)));
			A_Warp(AAPTR_TARGET,70 * cos(pitch),0,46- (40 * sin(pitch)),0,WARPF_NOCHECKPOSITION|WARPF_COPYPITCH);
			A_SpawnItemEx("QuietSparklies",random(25,35)* cos(pitch),random(10,25),(random(26,30) - (40 * sin(pitch))),velx,vely,velz+0.3);
		}
		TORP A 0 A_JumpIfInventory("ComboCounter", 1, "ShotTorpedo")
		TORP A 0 A_JumpIfInventory("LightningCheck", 13, "Oops")
		TORP A 0 A_JumpIfInventory("MaceChargeCheck2", 1, "Enlarge")
		TORP A 0 A_Warp(AAPTR_TARGET,70 * cos(pitch),0,46- (40 * sin(pitch)),0,WARPF_NOCHECKPOSITION|WARPF_COPYPITCH) //46 Z
		Loop
	Enlarge:
		TORP ABC 1 Bright
		{
		A_SetScale(ScaleX+0.033,ScaleY+0.033);
		A_SetRoll(roll-(-3-(CountInv("LightningCheck")*2)));
		A_SetRenderStyle(alpha+0.01,STYLE_Translucent);
		A_SpawnItemEx("QuietSparklies",0,0,0,random(-1,1),random(-1,1),0.3);
		A_Warp(AAPTR_TARGET,70 * cos(pitch),0,46- (40 * sin(pitch)),0,WARPF_NOCHECKPOSITION|WARPF_COPYPITCH);
		}
		TORP A 0 Bright
		{	
		A_GiveInventory("LightningCheck", 1);
		A_TakeInventory("MaceChargeCheck2");	
		A_SetSize(Radius+1,Height+1);
		}
		Goto Charge
	Oops: //No longer kills the player as of 0.91 lol.
		"####" A 0 A_GiveInventory ("LightningCheck", 1, AAPTR_TARGET) //Stops the players animation
		Goto ShotTorpedo
	ShotTorpedo:
		"####" A 0
		{
		A_ChangeFlag("NOCLIP",false);
		A_ChangeFlag("THRUACTORS",false);
		A_ChangeFlag("SOLID",true);
		A_PlaySound("QuietusFire", 5, 1, false);
		A_ChangeVelocity(cos(pitch)*36,0,-sin(pitch)*36,CVF_RELATIVE|CVF_REPLACE); 
		A_GiveInventory("CoptersSound",(CountInv("LightningCheck")-2)); //revision 0.96 for blasty version.
		}
		Goto Flight
	Flight:
		"####" ABC 2 Bright 
		{
		A_SetRoll(roll+20);
		A_SpawnItemEx("QuietSparklies2",0,0,0,-8,random(3,-3),-1);
		A_SpawnItemEx("QuietSparklies2",0,0,0,-4,random(3,-3),random(3,-3));
		A_SpawnItemEx("QuietSparklies",0,0,0,-8,random(-1,1),0);
		A_SpawnItemEx("DecorativeEmberQ",random(-4,4),random(-4,4),4,-2,random(-3,1),random(3,7));
		}
		Loop
	Crash:
		"####" D 0 A_Stop
		Goto Kaboom
	XDeath:
		"####" D 0 A_Stop
		Goto Kaboom
	Death:
		"####" D 0 A_ChangeVelocity(-2,0,0,CVF_RELATIVE|CVF_REPLACE) //inches it away from wall to prevent sprite clipping
		Goto Kaboom
	Kaboom:
		"####" DDDD 2 Bright {
		A_SetScale(ScaleX+(0.005*(CountInv("LightningCheck"))),ScaleY+(0.005*(CountInv("LightningCheck"))));
		A_SetRoll(roll+25); A_SetRenderStyle(0.8,STYLE_Translucent);}
		"####" D 2 Bright
		{
		A_SetScale(ScaleX+(0.005*(CountInv("LightningCheck"))),ScaleY+(0.005*(CountInv("LightningCheck"))));
		A_Explode((CountInv("LightningCheck")*33),(CountInv("LightningCheck")*30),XF_HURTSOURCE|XF_THRUSTZ,true,(CountInv("LightningCheck")*25));
			if(CountInv("LightningCheck") > 10)
				{
				A_PlaySound("QuietExp3", 6, 0.9, false,ATTN_NONE);
				A_SpawnItemEx("DecorativeQuietFlameSpawner",30,-30,0,0,0,0);
				A_SpawnItemEx("DecorativeQuietFlameSpawner",30,30,0,0,0,0);
				A_SpawnItemEx("DecorativeQuietFlameSpawner",-30,30,0,0,0,0);
				A_SpawnItemEx("DecorativeQuietFlameSpawner",-30,-30,0,0,0,0);
				While (CountInv("Mana2")<180)
				{
					A_SpawnItemEx("QuietExplodeGreen",(cos(pitch)*260),0,(-(sin(pitch)*2)),(cos(pitch)*(CountInv("LightningCheck")*1)),(CountInv("LightningCheck")),(-sin(pitch)*2));
					A_GiveInventory("Mana1",randompick(25,45,65));
					A_SetAngle(angle+(CountInv("Mana1")));
					A_SetPitch(randompick(-90,90));
					A_TakeInventory("Mana1");
					A_GiveInventory("Mana2",1);
				}
				}
			else if (CountInv("LightningCheck") > 7)
				{
				A_SpawnItemEx("DecorativeQuietFlameSpawner",-15,15,0,0,0,0);
				A_SpawnItemEx("DecorativeQuietFlameSpawner",15,15,0,0,0,0);
				A_PlaySound("QuietExp2", 6, 0.9, false,ATTN_NONE);
				While (CountInv("Mana2")<180)
				{
					A_SpawnItemEx("QuietExplodeGreen",(cos(pitch)*220),0,(-(sin(pitch)*2)),(cos(pitch)*(CountInv("LightningCheck")*1)),(CountInv("LightningCheck")),(-sin(pitch)*2));
					A_GiveInventory("Mana1",randompick(15,30,45));
					A_SetAngle(angle+(CountInv("Mana1")));
					A_SetPitch(randompick(-90,90));
					A_TakeInventory("Mana1");
					A_GiveInventory("Mana2",1);
				}
				}
			else if (CountInv("LightningCheck") > 4)
				{
				A_PlaySound("QuietExp1", 6, 1.6, false,ATTN_NONE);
				A_SpawnItemEx("DecorativeQuietFlameSpawner",0,0,0,0,0,0);
				While (CountInv("Mana2")<180)
				{
					A_SpawnItemEx("QuietExplodeGreen",(cos(pitch)*180),0,(-(sin(pitch)*2)),(cos(pitch)*(CountInv("LightningCheck")*1)),(CountInv("LightningCheck")),(-sin(pitch)*2));
					A_GiveInventory("Mana1",randompick(10,20,30));
					A_SetAngle(angle+(CountInv("Mana1")));
					A_SetPitch(randompick(-90,90));
					A_TakeInventory("Mana1");
					A_GiveInventory("Mana2",1);
				}
				}
			else 
				{
				A_PlaySound("QuietExp1", 6, 0.8, false,ATTN_NONE);
				A_PlaySound("LightningCheck", 6, 0.9, false,ATTN_NONE);
				A_SpawnItemEx("DecorativeQuietFlameSpawner",0,0,0,0,0,0);
				}
		}
		Goto Fadeout
	Fadeout:
		"####" E 2 Bright
		"####" EEE 2 Bright
		{
		A_Fadeout(0.05);
		A_SetScale(ScaleX+(0.01*(CountInv("LightningCheck"))),ScaleY+(0.01*(CountInv("LightningCheck"))));
		A_SetRoll(roll+30);
		}
		//"####" F 2 Bright
		"####" FFFF 2 Bright
		{
		A_Fadeout(0.05);
		A_SetScale(ScaleX+(0.02*(CountInv("LightningCheck"))),ScaleY+(0.02*(CountInv("LightningCheck"))));
		A_SetRoll(roll+40);
		}
		"####" GGGG 2 Bright
		{
		A_Fadeout(0.05);
		A_SetScale(ScaleX+(0.03*(CountInv("LightningCheck"))),ScaleY+(0.03*(CountInv("LightningCheck"))));
		A_SetRoll(roll+50);
		}
		Stop
	}
}

ACTOR QuietusTorpedoUpgraded //Adds Aurora Effect to Explosion. Again super annoying this fails in it inherits.
{
	Height 12
	Radius 12
	Damage 15
	RenderStyle Translucent
	Species "PlayerAlly"
	Speed 55
	Alpha 0.5
	XScale 0.2
	YScale 0.2
	DamageType "Blast"
	ProjectileKickBack 500
	PROJECTILE
	+ForceXYBillBoard
	+ROLLSPRITE
	+ROLLCENTER
	+NOCLIP
	+THRUACTORS
	+NOGRAVITY
	+PIERCEARMOR
	+FORCERADIUSDMG
	+EXTREMEDEATH
	+SKYEXPLODE
	+EXPLODEONWATER
	+NONSHOOTABLE
	+FRIENDLY
	-SOLID
	States
	{
	Spawn:
		TNT1 A 0
		Goto Charge
	Charge:
		TORP ABC 1 Bright 
		{
			A_SetRoll(roll-(-3-(CountInv("LightningCheck")*2)));
			A_Warp(AAPTR_TARGET,70 * cos(pitch),0,46- (40 * sin(pitch)),0,WARPF_NOCHECKPOSITION|WARPF_COPYPITCH);
			A_SpawnItemEx("QuietSparklies",random(25,35)* cos(pitch),random(10,25),(random(26,30) - (40 * sin(pitch))),velx,vely,velz+0.3);
		}
		TORP A 0 A_JumpIfInventory("ComboCounter", 1, "ShotTorpedo")
		TORP A 0 A_JumpIfInventory("LightningCheck", 13, "Oops")
		TORP A 0 A_JumpIfInventory("MaceChargeCheck2", 1, "Enlarge")
		TORP A 0 A_Warp(AAPTR_TARGET,70 * cos(pitch),0,46- (40 * sin(pitch)),0,WARPF_NOCHECKPOSITION|WARPF_COPYPITCH) //46 Z
		Loop
	Enlarge:
		TORP ABC 1 Bright
		{
		A_SetScale(ScaleX+0.033,ScaleY+0.033);
		A_SetRoll(roll-(-3-(CountInv("LightningCheck")*2)));
		A_SetRenderStyle(alpha+0.01,STYLE_Translucent);
		A_SpawnItemEx("QuietSparklies",0,0,0,random(-1,1),random(-1,1),0.3);
		A_Warp(AAPTR_TARGET,70 * cos(pitch),0,46- (40 * sin(pitch)),0,WARPF_NOCHECKPOSITION|WARPF_COPYPITCH);
		}
		TORP A 0 Bright
		{	
		A_GiveInventory("LightningCheck", 1);
		A_TakeInventory("MaceChargeCheck2");	
		A_SetSize(Radius+1,Height+1);
		}
		Goto Charge
	Oops: //No longer kills the player as of 0.91 lol.
		"####" A 0 A_GiveInventory ("LightningCheck", 1, AAPTR_TARGET) //Stops the players animation
		Goto ShotTorpedo
	ShotTorpedo:
		"####" A 0
		{
		A_ChangeFlag("NOCLIP",false);
		A_ChangeFlag("THRUACTORS",false);
		A_ChangeFlag("SOLID",true);
		A_PlaySound("QuietusFire", 5, 1, false);
		A_ChangeVelocity(cos(pitch)*36,0,-sin(pitch)*36,CVF_RELATIVE|CVF_REPLACE); 
		A_GiveInventory("CoptersSound",(CountInv("LightningCheck")-2)); //revision 0.96 for blasty version.
		}
		Goto Flight
	Flight:
		"####" ABC 2 Bright 
		{
		A_SetRoll(roll+20);
		A_SpawnItemEx("QuietSparklies2",0,0,0,-8,random(3,-3),-1);
		A_SpawnItemEx("QuietSparklies2",0,0,0,-4,random(3,-3),random(3,-3));
		A_SpawnItemEx("QuietSparklies",0,0,0,-8,random(-1,1),0);
		A_SpawnItemEx("DecorativeEmberQ",random(-4,4),random(-4,4),4,-2,random(-3,1),random(3,7));
		}
		Loop
	Crash:
		"####" D 0 A_Stop
		Goto Kaboom
	XDeath:
		"####" D 0 A_Stop
		Goto Kaboom
	Death:
		"####" D 0 A_ChangeVelocity(-2,0,0,CVF_RELATIVE|CVF_REPLACE) //inches it away from wall to prevent sprite clipping
		Goto Kaboom
	Kaboom:
		"####" DDDD 2 Bright {
		A_SetScale(ScaleX+(0.005*(CountInv("LightningCheck"))),ScaleY+(0.005*(CountInv("LightningCheck"))));
		A_SetRoll(roll+25); A_SetRenderStyle(0.8,STYLE_Translucent);}
		"####" D 2 Bright
		{
		A_SetScale(ScaleX+(0.005*(CountInv("LightningCheck"))),ScaleY+(0.005*(CountInv("LightningCheck"))));
		A_Explode((CountInv("LightningCheck")*33),(CountInv("LightningCheck")*30),XF_HURTSOURCE|XF_THRUSTZ,true,(CountInv("LightningCheck")*25));
			if(CountInv("LightningCheck") > 10)
				{
				A_PlaySound("QuietExp3", 6, 0.9, false,ATTN_NONE);
				A_SpawnItemEx("DecorativeQuietFlameSpawner",30,-30,0,0,0,0);
				A_SpawnItemEx("DecorativeQuietFlameSpawner",30,30,0,0,0,0);
				A_SpawnItemEx("DecorativeQuietFlameSpawner",-30,30,0,0,0,0);
				A_SpawnItemEx("DecorativeQuietFlameSpawner",-30,-30,0,0,0,0);
				A_SpawnItemEx("QuietusWanderer",randompick(5,0,-5),randompick(5,0,-5),0);
				A_SpawnItemEx("QuietusWanderer",randompick(5,0,-5),randompick(5,0,-5),0);
				A_SpawnItemEx("QuietusWanderer",randompick(5,0,-5),randompick(5,0,-5),0);
				A_SpawnItemEx("QuietusWanderer",randompick(5,0,-5),randompick(5,0,-5),0);
				While (CountInv("Mana2")<180)
				{
					A_SpawnItemEx("QuietExplodeGreen",(cos(pitch)*260),0,(-(sin(pitch)*2)),(cos(pitch)*(CountInv("LightningCheck")*1)),(CountInv("LightningCheck")),(-sin(pitch)*2));
					A_GiveInventory("Mana1",randompick(25,45,65));
					A_SetAngle(angle+(CountInv("Mana1")));
					A_SetPitch(randompick(-90,90));
					A_TakeInventory("Mana1");
					A_GiveInventory("Mana2",1);
				}
				}
			else if (CountInv("LightningCheck") > 7)
				{
				A_SpawnItemEx("DecorativeQuietFlameSpawner",-15,15,0,0,0,0);
				A_SpawnItemEx("DecorativeQuietFlameSpawner",15,15,0,0,0,0);
				A_SpawnItemEx("QuietusWanderer",randompick(5,0,-5),randompick(5,0,-5),0);
				A_SpawnItemEx("QuietusWanderer",randompick(5,0,-5),randompick(5,0,-5),0);
				A_PlaySound("QuietExp2", 6, 0.9, false,ATTN_NONE);
				While (CountInv("Mana2")<180)
				{
					A_SpawnItemEx("QuietExplodeGreen",(cos(pitch)*220),0,(-(sin(pitch)*2)),(cos(pitch)*(CountInv("LightningCheck")*1)),(CountInv("LightningCheck")),(-sin(pitch)*2));
					A_GiveInventory("Mana1",randompick(15,30,45));
					A_SetAngle(angle+(CountInv("Mana1")));
					A_SetPitch(randompick(-90,90));
					A_TakeInventory("Mana1");
					A_GiveInventory("Mana2",1);
				}
				}
			else if (CountInv("LightningCheck") > 4)
				{
				A_PlaySound("QuietExp1", 6, 1.6, false,ATTN_NONE);
				A_SpawnItemEx("DecorativeQuietFlameSpawner",0,0,0,0,0,0);
				A_SpawnItemEx("QuietusWanderer",randompick(5,0,-5),randompick(5,0,-5),0);
				While (CountInv("Mana2")<180)
				{
					A_SpawnItemEx("QuietExplodeGreen",(cos(pitch)*180),0,(-(sin(pitch)*2)),(cos(pitch)*(CountInv("LightningCheck")*1)),(CountInv("LightningCheck")),(-sin(pitch)*2));
					A_GiveInventory("Mana1",randompick(10,20,30));
					A_SetAngle(angle+(CountInv("Mana1")));
					A_SetPitch(randompick(-90,90));
					A_TakeInventory("Mana1");
					A_GiveInventory("Mana2",1);
				}
				}
			else 
				{
				A_PlaySound("QuietExp1", 6, 0.8, false,ATTN_NONE);
				A_PlaySound("LightningCheck", 6, 0.9, false,ATTN_NONE);
				A_SpawnItemEx("DecorativeQuietFlameSpawner",0,0,0,0,0,0);
				}
		}
		Goto Fadeout
	Fadeout:
		"####" E 2 Bright
		"####" EEE 2 Bright
		{
		A_Fadeout(0.05);
		A_SetScale(ScaleX+(0.01*(CountInv("LightningCheck"))),ScaleY+(0.01*(CountInv("LightningCheck"))));
		A_SetRoll(roll+30);
		}
		//"####" F 2 Bright
		"####" FFFF 2 Bright
		{
		A_Fadeout(0.05);
		A_SetScale(ScaleX+(0.02*(CountInv("LightningCheck"))),ScaleY+(0.02*(CountInv("LightningCheck"))));
		A_SetRoll(roll+40);
		}
		"####" GGGG 2 Bright
		{
		A_Fadeout(0.05);
		A_SetScale(ScaleX+(0.03*(CountInv("LightningCheck"))),ScaleY+(0.03*(CountInv("LightningCheck"))));
		A_SetRoll(roll+50);
		}
		Stop
	}
}

ACTOR QuietusWanderer //Creates the Aurora Effect on Upgraded Ball
{
	Radius 2
	Height 2
	+NOINTERACTION
	+NOCLIP
	+NOGRAVITY
	+FRIGHTENED
	Speed 8
	Projectile
	-MISSILE
	DamageType "Blast"
	States
	{
	Spawn:
		TNT1 A 0 Nodelay A_SetAngle(angle+random(60,120))
		TNT1 AAA 0 A_Wander
		TNT1 A 0 A_SpawnItemEx("TriggeredQFissure",0,0,0,0,0,0,0,SXF_SETMASTER)
		TNT1 A 0 A_GiveToChildren("Walpurgisnacht",1)
		TNT1 A 0 A_GiveInventory("Walpurgisnacht",1)
		TNT1 A 0 A_JumpIfInventory("Walpurgisnacht",23,"Death")
		Loop
	Death:
		ICWS I 1 A_GiveToChildren("MaceChargeCheck2",1)
		Stop
	}
}

ACTOR TriggeredQFissure //Main part of the Aurora
{
	Speed 0
	Damage 0
	Projectile
	Radius 3
	Height 1
	YScale 0.9
	XScale 0.65
	Alpha 0.3
	+DONTBLAST
	+NOCLIP
	+NOINTERACTION
	Renderstyle Add
	States
	{
	Spawn:
		TNT1 A 0 
		TNT1 A 0 A_JumpIfInventory("MaceChargeCheck2",1,"Unleash")
		Loop
	Unleash:
		TNT1 A 14
	UnleashX:
		TNT1 A 0 A_GiveInventory("Walpurgisnacht",1)
		TNT1 A 3 A_JumpIfInventory("Walpurgisnacht",16,"Unleash2")
		Loop
	Unleash2:
		QAUR K 2 A_RadiusThrust(120,60,RTF_NOTMISSILE|RTF_THRUSTZ,60)
		QAUR KKK 2 {A_Fadein(0.125);}
		QAUR LMN 4 A_Explode(random(1,8),120,XF_THRUSTZ,true,85,0,0,"None","Blast")
		QAUR OOO 2 {A_Explode(random(1,8),120,XF_THRUSTZ,true,85,0,0,"None","Blast"); A_Setscale(scalex,scaley+0.1);}
		QAUR OOO 2 {A_Explode(random(1,8),120,XF_THRUSTZ,true,85,0,0,"None","Blast"); A_Setscale(scalex,scaley-0.1);}
		QAUR NM 3 {A_Explode(random(1,8),120,XF_THRUSTZ,true,85,0,0,"None","Blast"); A_SpawnItemEx("DecorativeEmberQ",random(-4,4),random(-4,4),4,-2,random(-3,1),random(3,7));}
		QAUR LKKKKKKK 3 {A_Fadeout(0.1); A_Setscale(scalex,scaley-0.1);}
		Stop
	Death:
		TNT1 A 1
		Stop 
	} 
}

ACTOR QuietusFireBlastCore : FastProjectile //Not actually used right now was an upgrade experiment
{
	Radius 10
	Height 8
	Damage 0 //(random(80,140)+random(2,8))
	DamageType "Blast"
	Alpha 0.7
	Scale 0.3
	Renderstyle Add
	Projectile
	+CANBOUNCEWATER
	+FORCEXYBILLBOARD
	+FORCERADIUSDMG
	+DONTBLAST
	+FRIENDLY
	+ROLLSPRITE
	+ROLLCENTER
	Speed 36
	DeathSound "FireCast"
	States
	{
	Spawn:
		Q1BU BCDCBA 1 Bright {
		A_SetRoll(roll+11); 
		A_Weave(3, 0, 1.0, 0.0);
		A_SpawnItemEx("QuietSparklies2",0,0,0,-4,random(3,-3),random(3,-3));
		A_SpawnItemEx("QuietSparklies",0,0,0,-8,random(-1,1),0);}
		Loop
	Death:
		Q1BU A 0 Bright A_Explode(random(40,80),90)
		Q1BU BCDCBA 1 Bright {A_Fadeout(0.1); A_Setscale(scalex+0.05,scaley+0.05);}
		Loop
	}
}

ACTOR QuietusTarget //This makes the Torpedo Ball stay on course. Probably.
{
  +NOBLOCKMAP
  +NOGRAVITY
  +ALLOWPARTICLES
  +RANDOMIZE
  +ALWAYSPUFF
  +INVISIBLE
  +NOCLIP
  +NOINTERACTION
  Damage 0
  States
  {
  Spawn:
    TNT1 A 0 Nodelay
	TNT1 A 1 Bright A_TransferPointer(AAPTR_DEFAULT,AAPTR_TARGET,AAPTR_TARGET,AAPTR_TRACER)
  Melee:
    TNT1 A 8
    Stop
  }
}

/////////////////////////////////
/// TERTIARY (HOMING BLASTS!) ///
/////////////////////////////////

ACTOR QuietusChibiBlast //Used in Tertiary Fire
{	
	Speed 20
	Radius 6
	Height 6
	Damage (Random(12,16))
	Projectile
	RenderStyle Add //Translucent 
	Scale 0.2
	Alpha 0.6
	DamageType "Blast"
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+FRIENDLY
	+SEEKERMISSILE
	+ROLLSPRITE
	+ROLLCENTER //QBLL ABCDABCDABCD
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 2
		TNT1 A 1 A_Stop
		TNT1 A 0
		{	
			A_ChangeVelocity(random(-1,1),random(-1,1),random(0,1),CVF_RELATIVE|CVF_REPLACE);
			A_SetPitch(random(-5,5));
		}
		3MBR ABCDEFGHIJKA 1 Bright { A_SpawnItemEx("QuietSparklies",0,0,0,random(-1,1),random(-1,1),0.3); A_Setroll(random(-10,10));}
		Goto FireBalls
	FireBalls:
		3MBR B 0 Bright A_ChangeVelocity(30,0,0,CVF_RELATIVE|CVF_REPLACE)
		3MBR B 0 Bright A_PlaySound("CruxShots",0,1,false,ATTN_STATIC)
		Goto Inflight
	Inflight:
		3MBR BCDEFGHIJKA 1 
		{	A_SeekerMissile(12,8,SMF_LOOK|SMF_PRECISE,128,2);
		A_SpawnItemEx("QuietSparklies",0,0,0,random(-2,-5),random(-1,1),0.3); 
		A_SpawnItemEx("QuietSparklies",0,0,0,random(-2,-5),random(-1,1),0.3);
		A_Setroll(roll+random(40,52));}
		Loop
	Death:
		QLIT A 0 A_Setscale(1,1)
		QLIT ABCDEFGH 1
		TNT1 A 2 A_SpawnItemEx("QuietFlame",0, 0, 0, 0,0,-2)
		Stop
	}
}

/////////////////////////////////
/// QUIETUS VISUAL CLUTTER    ///
/////////////////////////////////

Actor QuietSparklies //OOOH! SPARKLIES!! Used in lots of effects!
{
 +NOGRAVITY
 +NOCLIP
 +NOINTERACTION
 +ROLLSPRITE
 +ROLLCENTER
 +FORCEXYBILLBOARD
 -SOLID
 Radius 0
 Height 0
 RenderStyle Add
 Alpha 1.0
 Scale 0.03
 States
 {
  Spawn:
   GRNS A 0 Bright
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}
   GRNS A 1 Bright 
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}  
   GRNS A 1 Bright 
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}
   GRNS A 1 Bright
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}
   GRNS A 1 Bright 
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}
   GRNS A 1 Bright 
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}  
   GRNS A 1 Bright  
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}
   GRNS A 1 Bright  
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);} 
   GRNS A 1 Bright  
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}  
   GRNS A 1 Bright  
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}  
   Stop
 }
}

Actor QuietSparklies2 //These ones also grow as they fade out. Used as trail for Torpedo!
{
 +NOGRAVITY
 +NOCLIP
 +NOINTERACTION
 +ROLLSPRITE
 +ROLLCENTER
 +FORCEXYBILLBOARD
 -SOLID
 Radius 0
 Height 0
 RenderStyle Add
 Alpha 1.0
 Scale 0.05
 States
 {
  Spawn:
   GRNS A 0 Bright
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}
   GRNS A 1 Bright A_SetScale(0.1)   
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}  
   GRNS A 1 Bright A_SetScale(0.15)   
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}
   GRNS A 1 Bright A_SetScale(0.2)   
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}
   GRNS A 1 Bright A_SetScale(0.25)   
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}
   GRNS A 1 Bright A_SetScale(0.3)   
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}  
   GRNS A 1 Bright A_SetScale(0.35)   
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}
   GRNS A 1 Bright A_SetScale(0.4)   
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);} 
   GRNS A 1 Bright A_SetScale(0.45)   
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}  
   GRNS A 1 Bright A_SetScale(0.5)   
   GRNS A 1 Bright {A_FadeOut(0.1);	A_SetRoll(roll+30);}  
   Stop
 }
}

ACTOR QuietFlame //Spawned from explosions etc. 
{
	+NOCLIP
	+FRIENDLY
	+NOBLOCKMAP
	+DONTSPLASH
	+PAINLESS
	+NODAMAGETHRUST
	+FORCERADIUSDMG
	+NOGRAVITY
	DamageType "Blast"
	RenderStyle Add
	Scale 1.5
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_GiveInventory ("Walpurgisnacht",random(1,3))
		FSFX N 2 
		Goto FireLoop
	FireLoop:
		TNT1 A 0 A_GiveInventory ("mana1", 1)
		FSFX OP 1 Bright 
		{
			A_GiveInventory("Mana2",(random(1,CountInv("Walpurgisnacht")))-1);
			A_Explode (countinv("Mana2"), 64,0); 	
			A_TakeInventory("Mana2");
			A_SpawnItemEx("DecorativeEmberQ",random(-4,4),random(-4,4),4,random(-3,3),random(-3,1),random(3,7));
			A_SpawnItemEx("DecorativeEmberQ",random(-4,4),random(-4,4),4,random(-3,3),random(-3,1),random(3,7));
		}											
		FSFX QRST 1 Bright 
		TNT1 A 0 A_JumpIfInventory ("mana1", 10, "Die")	//lasts for 10 cycles
		Loop
	Die:
		TNT1 A 0 
		Goto Death
	Death:
		FSFX UVW 2 Bright
		TNT1 A 0
		Stop
	}
}

ACTOR DecorativeEmberQ //0.91 Decorative green embers.
{
	+NOINTERACTION
	+FORCEXYBILLBOARD
	Gravity .1
	Mass 6
	Scale 0.6
	States
	{
		Spawn:
			TNT1 A 0
			QRBL QRSJKLMNOP 2 Bright
			Stop
	}
}

ACTOR QuietExplodeGreen : QuietFlame //Explosive flames for Torpedo 0.85
{
Scale 0.3
+ROLLSPRITE
+ROLLCENTER
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_GiveInventory ("Walpurgisnacht",random(1,3))
		QB0M AAA 3 Bright A_Setscale(scalex+0.1,scaley+0.1)
		Goto GreenBoom
	GreenBoom:
		QB0M BCDEFGHIJKL 3 Bright {
		A_Explode(countinv("Walpurgisnacht"), 64,0);
		A_SetRoll(roll+(randompick(-35,-20,20,35)));
		A_Setscale(scalex+0.03,scaley+0.03);
		A_SpawnItemEx("DecorativeEmberQ",random(-4,4),random(-4,4),4,random(-3,3),random(-3,1),random(3,7));
		A_SpawnItemEx("DecorativeEmberQ",random(-4,4),random(-4,4),4,random(-3,3),random(-3,1),random(3,7));
		A_Fadeout(0.05);
		}
		Stop
	Death:
		Goto GreenBoom
	}
}

ACTOR SpearExplodeOrange : QuietFlame //Actually used for Crusaders Spear.
{
Scale 0.3
+ROLLSPRITE
+ROLLCENTER
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_GiveInventory ("Walpurgisnacht",random(1,3))
		OZ4Z ABC 3 Bright A_Setscale(scalex+0.1,scaley+0.1)
		Goto GreenBoom
	GreenBoom:
		OZ4Z DABCD 3 Bright {
		A_Explode(countinv("Walpurgisnacht"), 64,0);
		A_SetRoll(roll+(randompick(-35,-20,20,35)));
		A_Setscale(scalex+0.03,scaley+0.03);
		A_SpawnItemEx("DecorativeHolyZaps",random(-4,4),random(-4,4),4,random(-3,3),random(-3,1),random(3,7));
		A_SpawnItemEx("DecorativeHolyZaps",random(-4,4),random(-4,4),4,random(-3,3),random(-3,1),random(3,7));
		A_Fadeout(0.1);
		}
		Stop
	Death:
		Goto GreenBoom
	}
}

ACTOR CruxExplodeBlue : QuietFlame //Actually used for Upgraded Crux Calicus
{
Scale 0.8
+ROLLSPRITE
+ROLLCENTER
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_GiveInventory ("Walpurgisnacht",random(1,3))
		STAR ABC 1 Bright A_Setscale(scalex+0.1,scaley+0.1)
		Goto BlueBoom
	BlueBoom:
		STAR DEFGHIJKLMNOPQRSTUVWXY 1 Bright {
		A_Explode(countinv("Walpurgisnacht"), 200,0);
		A_SetRoll(roll+(randompick(-35,-20,20,35)));
		A_Setscale(scalex+0.03,scaley+0.03);
		A_SpawnItemEx("VortexSparklies",random(-4,4),random(-4,4),4,random(-3,3),random(-3,1),random(3,7));
		A_Fadeout(0.05);
		}
		Stop
	Death:
		TNT1 A 0 
		Stop
	}
}

ACTOR DecorativeQuietFlame : QuietFlame //Decorative version for Torpedo
{
	States
	{
	FireLoop:
		TNT1 A 0 A_GiveInventory ("mana1", 1)
		FSFX OP 1 Bright 
		FSFX QRST 1 Bright 
		TNT1 A 0 A_JumpIfInventory ("mana1", 12, "Die")	
		Loop
	}
}

ACTOR BaronsGreenFlame : DecorativeQuietFlame //version for Barons and Hell Knights
{
-FRIENDLY
-NOCLIP
+NOINTERACTION
}

ACTOR DecorativeQuietFlameNoLight : DecorativeQuietFlame //Less GLDEF lights for better performance
{
}

ACTOR DecorativeQuietFlameSpawner: DecorativeQuietFlame //Spits out greenfire!
{
+NOINTERACTION
Scale 2.5
	States
	{
	Spawn:
		TNT1 A 0 
		TNT1 A 2 {
				While(CountInv("Mana1") < 180)
				{
					A_SpawnItemEx("DecorativeQuietFlameNoLight",random(0,50)+5*CountInv("Mana2"),0,0,0,1,0,(CountInv("Mana1")*2)+Random(-10,10));
					A_GiveInventory("Mana1", 10);
				}
					A_TakeInventory("Mana1");
			}
		FSFX N 2 A_TransferPointer(AAPTR_TRACER,AAPTR_DEFAULT,AAPTR_TARGET,AAPTR_TARGET)
		Goto FireLoop
	}
}


ACTOR DecorativeQuietFlameSpawnerAlt: DecorativeQuietFlame //Spits out greenfire!
{
+NOINTERACTION
Scale 2.5
	States
	{
	Spawn:
		TNT1 A 0 
		TNT1 A 0 A_SpawnItemEx("DecorativeQuietFlame",random(-40,40),random(-40,40),random(-4,4),random(-4,4),-3,0)
		TNT1 A 0 A_SpawnItemEx("DecorativeQuietFlame",random(-40,40),random(-40,40),random(-4,4),random(-4,4),-3,0)
		TNT1 A 0 A_SpawnItemEx("DecorativeQuietFlame",random(-40,40),random(-40,40),random(-4,4),random(-4,4),-3,0)
		TNT1 A 0 A_GiveInventory ("Walpurgisnacht",CountInv("mana1", AAPTR_TRACER))
		FSFX N 2 A_TransferPointer(AAPTR_TRACER,AAPTR_DEFAULT,AAPTR_TARGET,AAPTR_TARGET)
		Goto FireLoop
	}
}

ACTOR QuietusPulse //Originally there was a Quietus Laser, which used this; but it sucked.
{
	Damage 0
	Alpha 0.5
	XScale 0.2
	YScale 0.4
	Speed 35
	Radius 8
	Height 8
	Species "PlayerAlly"
	Damage (0)
	+ALWAYSPUFF
	+SPAWNSOUNDSOURCE
	+NOTAUTOAIMED
	+MTHRUSPECIES
	+THRUSPECIES
	+NOCLIP
	+NOINTERACTION
	+BLOODLESSIMPACT
	+NOINTERACTION
	RenderStyle Add
	States
	{
	Spawn:
		QLAZ A 2 Nodelay A_Fadeout(0.05)
		Loop
	Death:
		TNT1 A 0 
		Stop
	}
}
