ACTOR BrutalGuncastCyberdemon: TheCyberdemon Replaces TheCyberdemon
{
	//Loot
	DropItem Diamond
	DropItem "StratSpawner" 32

	//Cybers are generally hard to destroy.
	//They don't like energy-based attacks, though.

	//Weaknesses & Resists
	DamageFactor BlueTiberium, 0.8
	DamageFactor Tiberium, 0.8
	DamageFactor Crow, 0.6
	DamageFactor Crow2, 0.6
	DamageFactor Matriarch, 0.9
	DamageFactor Normal, 0.9
	DamageFactor LightningBlue, 1.0
	
	DamageFactor Lightning, 1.25
	DamageFactor Annihilation, 1.25
	
	DamageFactor CloseCombat, 0.75
	DamageFactor Shoelaces, 0.75
	DamageFactor SuperCloseCombat, 0.75
	DamageFactor SuperShoelaces, 0.75
	DamageFactor SuperMidasCloseCombat, 0.75
	DamageFactor SuperMidasShoelaces, 0.75
	
	//PAAAAAIN
	PainChance 20
	PainChance Crow, 1
	PainChance Crow2, 1
	
	//Guaranteed Effects
	PainChance SuperCloseCombat, 256
	PainChance SuperShoelaces, 256
	PainChance SuperMidasCloseCombat, 256
	PainChance SuperMidasShoelaces, 256
	PainChance Acid, 256
	PainChance Meteorfist, 256
	
	//Chance Effects
	PainChance Lightning, 72
	PainChance LightningBlue, 4
	PainChance Manuel, 20
	PainChance Fire, 20
	
	var int User_DeathByFire;
	var int User_DeathByTiberium;
	var int User_DeathByBlueTiberium;
	var int User_LightningLock;
	-NOICEDEATH
	States
	{
	Pain.SuperCloseCombat:
	Pain.SuperMidasCloseCombat:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_ChangeVelocity(frandom(-2.0,-4.0),0,frandom(0.5,1.0),CVF_RELATIVE)
		Goto Pain
	Pain.SuperShoelaces:
	Pain.SuperMidasShoelaces:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_ChangeVelocity(frandom(-3.0,-7.0),0,frandom(3.0,6.0),CVF_RELATIVE)
		Goto Pain
	Death.SuperCloseCombat:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_ChangeVelocity(frandom(-2.0,-4.0),0,frandom(0.5,1.0),CVF_RELATIVE)
		Goto Death
	Death.SuperShoelaces:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_ChangeVelocity(frandom(-3.0,-7.0),0,frandom(3.0,6.0),CVF_RELATIVE)
		Goto Death
	Death.MidasCloseCombat:
	Death.MidasShoelaces:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_NoBlocking
		"####" "######" 0 A_DropItem("MajorManaPod",-1,224)
		TNT1 A 0 A_Pain
		TNT1 A 0 A_PlaySound("Midas/Touched")
		TNT1 A 0 A_SpawnItemEx("Midas_Statue_Cyberdemon",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_TRANSFERSCALE) //SXF_TRANSFERSPRITEFRAME|SXF_SETMASTER)
		TNT1 A 5 A_BossDeath
		Stop
	Death.SuperMidasCloseCombat:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_NoBlocking
		"####" "######" 0 A_DropItem("MajorManaPod",-1,224)
		TNT1 A 0 A_Pain
		TNT1 A 0 A_PlaySound("Midas/Touched")
		TNT1 A 0 A_SpawnItemEx("Midas_Statue_Cyberdemon",0,0,0,frandom(-2.0,-4.0),0,frandom(0.5,1.0),0,SXF_TRANSFERPOINTERS|SXF_SETMASTER|SXF_TRANSFERSCALE)
		TNT1 A 0 A_BossDeath
		TNT1 A 10 A_KillChildren
		stop
	Death.SuperMidasShoelaces:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_NoBlocking
		"####" "######" 0 A_DropItem("MajorManaPod",-1,224)
		TNT1 A 0 A_Pain
		TNT1 A 0 A_PlaySound("Midas/Touched")
		TNT1 A 0 A_SpawnItemEx("Midas_Statue_Cyberdemon",0,0,0,frandom(-3.0,-7.0),0,frandom(3.0,6.0),0,SXF_TRANSFERPOINTERS|SXF_SETMASTER|SXF_TRANSFERSCALE)
		TNT1 A 0 A_BossDeath
		TNT1 A 10 A_KillChildren
		Stop

	//Standard death stuff
	Crush:
		TNT1 A 0 A_BossDeath
		TNT1 AAAAAAAAAA 0 A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 A_PlaySound("misc/xdeath4")
		XBIG EEEEE 1 A_CustomMissile ("CeilBloodLauncherLong", 0, 0, random (0, 360), 2, random (50, 130))
		TNT1 A 0 A_CustomMissile ("GiantBloodSpot", 4, 0, random (0, 360), 2, random (0, 160))
		XBIG E 0
		Goto Looplet2
	Death:
		CYBR H 0 A_StopSound(5)
		"####" "######" 0 A_DropItem("MajorManaPod",-1,224)
		CYBR H 10
		EXPL A 0 Radius_Quake (6, 100, 0, 22, 0)
        TNT1 AAAA 0 A_CustomMissile ("ExplosionSpawner", 90, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAA 0 A_CustomMissile ("ExplosionSpawner", 90, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAA 0 A_CustomMissile ("UltraGoreSPawner", 90, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("XDeathCyberdemonHead", 120, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("XDeathCyberdemonArm", 120, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("XDeathCyberdemonGun", 120, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("XDeathCyberdemonPiece", 120, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("XDeathCyberdemonTorso", 120, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAA 0 A_CustomMissile ("UltraGoreSpawner", 90, 0, random (0, 360), 2, random (0, 180))
        TNT1 A 0 A_CustomMissile ("CyberXDeath", 0, 0, random (0, 360), 2, random (0, 160))
		CYBR I 5 A_Scream
		CYBR JKL 5
		CYBR M 5 A_NoBlocking
		CYBR NOP 5
		CYBR P 0 A_BossDeath
		Goto Looplet
	
	Death.Head:
		TNT1 A 0 A_PlaySound("misc/xdeath4")
	    TNT1 AAAAAAAAA 0 A_CustomMissile ("BloodMistBig", 120, 0, random (0, 360), 2, random (30, 90))
		TNT1 AAAAA 0 A_CustomMissile ("Brutal_FlyingBlood", 120, 0, random (0, 360), 2, random (30, 90))
		TNT1 AAA 0 A_CustomMissile ("Brains6Big", 120, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAA 0 A_CustomMissile ("Brains7Big", 120, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAA 0 A_CustomMissile ("XDeath1", 120, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAAAA 0 A_CustomMissile ("XDeath3b", 120, 0, random (0, 360), 2, random (50, 90))
		TNT1 AAAAA 0 A_CustomMissile ("XDeath2b", 120, 0, random (0, 360), 2, random (50, 90))
		TNT1 A 0 A_Jump(256,2)
	Death.Decaptate:
	    TNT1 A 0 A_CustomMissile ("XDeathCyberdemonHead", 120, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_StopSound(5)
		TNT1 AAAAAAAAA 0 A_CustomMissile ("XDeath1", 120, 0, random (0, 360), 2, random (0, 180))
		CYBB AAAAA 8 A_SpawnItem("MuchBlood", 0, 90)
		CYBB ABCABCB 8 A_SpawnItem("MuchBlood", 0, 90)
		EXPL A 0 Radius_Quake (6, 100, 0, 22, 0)
        TNT1 AAAA 0 A_CustomMissile ("ExplosionSpawner", 90, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAA 0 A_CustomMissile ("ExplosionSpawner", 90, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAA 0 A_CustomMissile ("UltraGoreSPawner", 90, 0, random (0, 360), 2, random (0, 180))
		
        TNT1 AAAAAA 0 A_CustomMissile ("UltraGoreSpawner", 90, 0, random (0, 360), 2, random (0, 180))
        TNT1 A 0 A_CustomMissile ("CyberXDeath", 0, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_NoBlocking
		"####" "######" 0 A_DropItem("MajorManaPod",-1,224)
		CYBR P 0 A_BossDeath
	Looplet:
		"####" "#" 0 A_JumpIfInventory("CorpseTrigger2",1,"CorpseBlastB")
		"####" "#" 1 A_JumpIfInventory("CorpseTrigger",1,"CorpseBlastA")
		Loop
	CorpseBlastA:
		TNT1 A 0 A_SpawnItemEx("CyberdemonBlast",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
		Stop
	CorpseBlastB:
		"####" "#" 0 A_SpawnItemEx("CyberdemonBlast",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
		"####" "#" 0 A_TakeInventory("CorpseTrigger2",1)
		Goto Looplet
	CorpseBlastC:
		"####" "#" 0 A_SpawnItemEx("CyberdemonBlast",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
		"####" "#" 0 A_TakeInventory("CorpseTrigger2",1)
		Goto Looplet2
	
	//Gumpop
	Pain.Acid:
		"####" "#" 0 A_JumpIfInventory("PowerGumpopDamage",1,2)
		"####" "#" 0 A_SpawnItemEx("GumpopIndicator",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_SETTARGET|SXF_ORIGINATOR|SXF_TRANSFERSPRITEFRAME|SXF_TRANSFERSCALE)
		"####" "#" 0 A_SpawnItemEx("GumpopGlow",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_SETTARGET|SXF_ORIGINATOR)
		"####" "#" 0 A_Jump(20,"Pain")
		Goto See
	Death.Acid:
		CYBR G 1 A_ChangeFlag("SOLID",0)
		"####" "#" 1 A_Playsound("Gumpop/Expand",5)
		"####" "###################################" 1 A_SetScale(ScaleX+frandom(0.01,0.025))
		"####" "#" 1 A_Playsound("Gumpop/Pop",5)
		"####" "######" 0 A_DropItem("MajorManaPod",-1,224)
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_BossDeath
		TNT1 A 0 A_SpawnItemEx("CyberdemonGibbed",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
		CYBR I 0 A_QuakeEx(9,9,9,60,0,512,none,QF_SCALEDOWN)
        TNT1 AAAA 0 A_CustomMissile ("ExplosionSpawner", 90, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAA 0 A_CustomMissile ("ExplosionSpawner", 90, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAA 0 A_CustomMissile ("UltraGoreSPawner", 90, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("GC_XDeathCyberdemonHead", 120, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("GC_XDeathCyberdemonArm", 120, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("GC_XDeathCyberdemonGun", 120, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("GC_XDeathCyberdemonPiece", 120, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("GC_XDeathCyberdemonTorso", 120, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAA 0 A_CustomMissile ("UltraGoreSpawner", 90, 0, random (0, 360), 2, random (0, 180))
        TNT1 A 0 A_CustomMissile ("GC_CyberXDeath", 0, 0, random (0, 360), 2, random (0, 160))
		XBIG ABCDE 5
	Looplet2:
		"####" "#" 0 A_JumpIfInventory("CorpseTrigger2",1,"CorpseBlastC")
		"####" "#" 1 A_JumpIfInventory("CorpseTrigger",1,"CorpseBlastA")
		Loop
	//Dreadful
	Death.Tiberium:
		TNT1 A 0 A_SetUserVar("User_DeathByTiberium", 1)
		TNT1 A 0 ACS_NamedExecuteAlways("Toxic Avenger")
		TNT1 A 0 A_SpawnItemEx("TiberiumDeath",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_SETTARGET|SXF_ORIGINATOR)
		TNT1 A 0 A_GiveInventory("TibDeathCounter")
		Goto Death
	Death.BlueTiberium:
		TNT1 A 0 A_SetUserVar("User_DeathByBlueTiberium", 1)
		TNT1 A 0 ACS_NamedExecuteAlways("Blue Oyster Cult")
		TNT1 A 0 A_SpawnItemEx("BlueTiberiumDeath",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_SETTARGET|SXF_ORIGINATOR)
		TNT1 A 0 A_GiveInventory("BlueTibDeathCounter")		
		Goto Death
		
	//Threadcutter
	Pain.Manuel:
		"####" "#" 0 A_Jump(128,1)
		Goto Pain
		"####" "#" 0 A_GiveInventory("BleedItem")
		"####" "#" 0 A_SpawnItemEx("BleedIndicator",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_SETTARGET|SXF_ORIGINATOR)
		Goto Pain
		
	//Thunderstruck
	Pain.Lightning:
		"####" "#" 0 A_Jump(164,1)
		Goto Pain
		CYBR G 0 A_ChangeFlag("NOPAIN",1)
		"####" "#" 0 A_SetUserVar("User_LightningLock", User_LightningLock + 10)
	LightningLock:
		"####" "#" 0 A_SpawnItem("CybersHitBox", 0, 100, 0)
		"####" "#" 0 A_SetUserVar("User_LightningLock", User_LightningLock - 1)
		"####" "#" 0 A_Pain
		"####" "#" 0 A_PlaySound("Thunderstruck/Shocked",5,0.6,1)
		"####" "##" 0 ACS_NamedExecuteAlways("Shock me Plenty")
		"####" "###" 2 A_SpawnItemEx("MonsterShock",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_TRANSFERPOINTERS)
		"####" "##" 0 ACS_NamedExecuteAlways("Shock me Plenty")
		"####" "###" 2 A_SpawnItemEx("MonsterShock",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_TRANSFERPOINTERS)
		"####" "##" 0 ACS_NamedExecuteAlways("Shock me Plenty")
		"####" "###" 2 A_SpawnItemEx("MonsterShock",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_TRANSFERPOINTERS)
		"####" "#" 0 A_JumpIf(User_LightningLock >= 1, "LightningLock")
		"####" "#" 0 A_StopSound(5)
		"####" "#" 0 A_ChangeFlag("NOPAIN",0)
		Goto See
		
	//Cauterizer
	Pain.LightningBlue:
		"####" "#" 0 A_Jump(48,1)
		Goto Pain
		CYBR G 0 A_ChangeFlag("NOPAIN",1)
		"####" "#" 0 A_SetUserVar("User_LightningLock", User_LightningLock + 10)
	BlueLightningLock:
		"####" "#" 0 A_SpawnItem("CybersHitBox", 0, 100, 0)
		"####" "#" 0 A_SetUserVar("User_LightningLock", User_LightningLock - 1)
		"####" "#" 0 A_Pain
		"####" "#" 0 A_PlaySound("Thunderstruck/Shocked",5,0.6,1)
		"####" "##" 0 ACS_NamedExecuteAlways("Shock me Plenty Blue")
		"####" "###" 2 A_SpawnItemEx("CauterMonsterShock",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_TRANSFERPOINTERS)
		"####" "##" 0 ACS_NamedExecuteAlways("Shock me Plenty Blue")
		"####" "###" 2 A_SpawnItemEx("CauterMonsterShock",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_TRANSFERPOINTERS)
		"####" "##" 0 ACS_NamedExecuteAlways("Shock me Plenty Blue")
		"####" "###" 2 A_SpawnItemEx("CauterMonsterShock",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_TRANSFERPOINTERS)
		"####" "#" 0 A_JumpIf(User_LightningLock >= 1, "BlueLightningLock")
		"####" "#" 0 A_StopSound(5)
		"####" "#" 0 A_ChangeFlag("NOPAIN",0)
		Goto See
		
	//Fire
	Pain.Meteorfist:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_ChangeVelocity(frandom(-3.0,-7.0),0,frandom(3.0,6.0),CVF_RELATIVE)
		"####" "#" 0 A_Jump(256,2) //Guaranteed "On Fire!" effect, heeeh.
	Pain.Fire:
		TNT1 A 0 A_FaceTarget
		"####" "#" 0 A_Jump(16,1)
		Goto Pain
		"####" "#" 0 A_JumpIfInventory("PowerOnFire",1,"Pain")
		"####" "#" 0 A_GiveInventory("OnFireItem")
		"####" "#" 0 A_SpawnItemEx("OnFireIndicator",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_SETTARGET|SXF_ORIGINATOR)
		Goto Pain
	Death.Meteorfist:
		TNT1 A 0 A_ChangeVelocity(frandom(-3.0,-7.0),0,frandom(3.0,6.0),CVF_RELATIVE)
	Death.Lightning:
	Death.LightningBlue:
	Death.Fire:
		//"####" "#" 0 A_SetUserVar("User_DeathByFire", 1)
		//"####" "#" 0 ACS_NamedExecuteAlways("Extra Crispy")
		"####" "#" 0 A_SpawnItemEx("FlamingDeath",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_SETTARGET|SXF_ORIGINATOR)
		Goto Death
	FireMelt:
		"####" "#" 0 A_JumpIf(ScaleX > 1.35, "EndOfMelt")
		"####" "#" 0 ACS_NamedExecuteAlways("Extra Crispy")
		"####" "#" 1 A_SetScale(ScaleX + frandom(0.002,0.003),ScaleY - frandom(0.003,0.004))
		Goto Looplet
	EndOfMelt:
		"####" "#" 0 A_SetUserVar("User_DeathByTiberium", 0)
		"####" "#" 0 A_SetUserVar("User_DeathByFire", 0)
		Goto Looplet
		
	//Crows
	Death.Crow:
		TNT1 AAAAAA 0 A_SpawnItemEx("FlockOfCrows",random(45,-45),random(45,-45),random(25,0),0,0,0,0,SXF_TRANSFERPOINTERS)
		Goto Death
		
	//Scourgebreath
	Death.Breath:
		"####" "######" 0 A_DropItem("MajorManaPod",-1,224)
		"####" "#" 0 ACS_NamedExecuteAlways("Extra Crispy")
		"####" "#" 0 A_Scream
		"####" "#" 0 A_BossDeath
		"####" "#" 0 A_NoBlocking
		"####" "#" 0 A_SpawnItemEx("BreathSoulburst",0,0,0,0,0,0,0,SXF_TRANSFERSPRITEFRAME|SXF_TRANSFERPOINTERS)
	DeathBreathLoop:
		"####" "#" 0 A_SpawnItemEx("BreathDisintegration",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
		"####" "#" 0 A_JumpIf(ScaleX <= 0, "Null")
		"####" "#" 0 A_FadeOut(0.05)
		"####" "#" 1 A_SetScale(ScaleX - 0.03, ScaleY - 0.005)
		Loop
		
	//Ice
	GenericFreezeDeath:
		"####" "#" 0 A_BossDeath
		"####" "#" 5 A_GenericFreezeDeath
		"####" "######" 0 A_DropItem("MajorManaPod",-1,224)
		"----" A 0 A_JumpIfInventory("ChillgraspTrigger",1,2)
		"----" A 0 A_Jump(256,2)
		"----" A 0 A_SpawnItemEx("ChillgraspBlast",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
		"----" A 1 A_FreezeDeathChunks
		Wait
	}
}

ACTOR BrutalGuncastCyberdemonBoss: CyberdemonBoss replaces CyberdemonBoss
{
	//Loot
	DropItem Diamond
	DropItem Diamond
	DropItem Diamond
	DropItem Diamond
	DropItem "StratSpawner"

	//65. WAT. LIGHTBULB.

	//Weaknesses & Resists
	DamageFactor BlueTiberium, 0.3
	DamageFactor Tiberium, 0.3
	DamageFactor Crow, 0.1
	DamageFactor Crow2, 0.1
	DamageFactor Matriarch, 0.4
	DamageFactor Normal, 0.4
	DamageFactor LightningBlue, 0.5
	
	DamageFactor Lightning, 0.675
	DamageFactor Annihilation, 0.675
	
	DamageFactor CloseCombat, 0.375
	DamageFactor Shoelaces, 0.375
	DamageFactor SuperCloseCombat, 0.375
	DamageFactor SuperShoelaces, 0.375
	DamageFactor SuperMidasCloseCombat, 0.375
	DamageFactor SuperMidasShoelaces, 0.375
	
	//PAAAAAIN
	PainChance 5
	PainChance Crow, 0
	PainChance Crow2, 0
	
	//Guaranteed Effects
	PainChance SuperCloseCombat, 256
	PainChance SuperShoelaces, 256
	PainChance SuperMidasCloseCombat, 256
	PainChance SuperMidasShoelaces, 256
	PainChance Acid, 256
	PainChance Meteorfist, 256
	
	//Chance Effects
	PainChance Lightning, 18
	PainChance LightningBlue, 1
	PainChance Manuel, 20
	PainChance Fire, 20
	
	var int User_DeathByFire;
	var int User_DeathByTiberium;
	var int User_DeathByBlueTiberium;
	var int User_LightningLock;
	var int User_BreathLoop;
	States
	{
	Pain.SuperCloseCombat:
	Pain.SuperMidasCloseCombat:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_ChangeVelocity(frandom(-2.0,-4.0),0,frandom(0.5,1.0),CVF_RELATIVE)
		Goto Pain
	Pain.SuperShoelaces:
	Pain.SuperMidasShoelaces:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_ChangeVelocity(frandom(-3.0,-7.0),0,frandom(3.0,6.0),CVF_RELATIVE)
		Goto Pain
	Death.SuperCloseCombat:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_ChangeVelocity(frandom(-2.0,-4.0),0,frandom(0.5,1.0),CVF_RELATIVE)
		Goto Death
	Death.SuperShoelaces:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_ChangeVelocity(frandom(-3.0,-7.0),0,frandom(3.0,6.0),CVF_RELATIVE)
		Goto Death
	Death.MidasCloseCombat:
	Death.MidasShoelaces:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_NoBlocking
		"####" "######" 0 A_DropItem("MajorManaPod",-1,224)
		TNT1 A 0 A_Pain
		TNT1 A 0 A_PlaySound("Midas/Touched")
		TNT1 A 0 A_SpawnItemEx("Midas_Statue_Cyberdemon",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_TRANSFERSCALE) //SXF_TRANSFERSPRITEFRAME|SXF_SETMASTER)
		TNT1 A 5 A_BossDeath
		TNT1 A 200
		TNT1 A 0 A_BrainDie
		Stop
	Death.SuperMidasCloseCombat:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_NoBlocking
		"####" "######" 0 A_DropItem("MajorManaPod",-1,224)
		TNT1 A 0 A_Pain
		TNT1 A 0 A_PlaySound("Midas/Touched")
		TNT1 A 0 A_SpawnItemEx("Midas_Statue_Cyberdemon",0,0,0,frandom(-2.0,-4.0),0,frandom(0.5,1.0),0,SXF_TRANSFERPOINTERS|SXF_SETMASTER|SXF_TRANSFERSCALE)
		TNT1 A 0 A_BossDeath
		TNT1 A 10 A_KillChildren
		TNT1 A 200
		TNT1 A 0 A_BrainDie
		stop
	Death.SuperMidasShoelaces:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_NoBlocking
		"####" "######" 0 A_DropItem("MajorManaPod",-1,224)
		TNT1 A 0 A_Pain
		TNT1 A 0 A_PlaySound("Midas/Touched")
		TNT1 A 0 A_SpawnItemEx("Midas_Statue_Cyberdemon",0,0,0,frandom(-3.0,-7.0),0,frandom(3.0,6.0),0,SXF_TRANSFERPOINTERS|SXF_SETMASTER|SXF_TRANSFERSCALE)
		TNT1 A 0 A_BossDeath
		TNT1 A 10 A_KillChildren
		TNT1 A 200
		TNT1 A 0 A_BrainDie
		Stop

	//Standard death stuff
	Crush:
		TNT1 A 0 A_BossDeath
		TNT1 AAAAAAAAAA 0 A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 A_PlaySound("misc/xdeath4")
		XBIG EEEEE 1 A_CustomMissile ("CeilBloodLauncherLong", 0, 0, random (0, 360), 2, random (50, 130))
		TNT1 A 0 A_CustomMissile ("GiantBloodSpot", 4, 0, random (0, 360), 2, random (0, 160))
		XBIG E 200
		XBIG E 0 A_BrainDie
		Stop	
	Death:
		CYBR H 10
		EXPL A 0 Radius_Quake (6, 100, 0, 22, 0)
        TNT1 AAAA 0 A_CustomMissile ("ExplosionSpawner", 190, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAA 0 A_CustomMissile ("ExplosionSpawner", 190, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAA 0 A_CustomMissile ("UltraGoreSPawner", 190, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAA 0 A_CustomMissile ("UltraGoreSpawner", 190, 0, random (0, 360), 2, random (0, 180))
        TNT1 A 0 A_CustomMissile ("CyberXDeath", 100, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAAA 0 A_CustomMissile ("MuchMeatDeath", 0, 0, random (0, 360), 2, random (0, 160))
		CYBR I 5 A_Scream
		TNT1 A 0 A_CustomMissile ("RidiculousExplosionSpawner", 150, 0, random (0, 360), 2, 90)
		CYBR JKL 5
		CYBR M 5 A_NoBlocking
		CYBR NOP 5
		CYBR P 200
		TNT1 A 0 A_BrainDie
		CYBR P -1 A_BossDeath
		Stop
	Death.Head:
		TNT1 A 0 A_PlaySound("misc/xdeath4")
	    TNT1 AAAAAAAAA 0 A_CustomMissile ("BloodMistBig", 220, 0, random (0, 360), 2, random (30, 90))
		TNT1 AAAAA 0 A_CustomMissile ("Brutal_FlyingBlood", 220, 0, random (0, 360), 2, random (30, 90))
		TNT1 AAA 0 A_CustomMissile ("Brains6Big", 220, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAA 0 A_CustomMissile ("Brains7Big", 220, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAA 0 A_CustomMissile ("XDeath1", 220, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAAAA 0 A_CustomMissile ("XDeath3b", 220, 0, random (0, 360), 2, random (50, 90))
		TNT1 AAAAA 0 A_CustomMissile ("XDeath2b", 220, 0, random (0, 360), 2, random (50, 90))
		TNT1 A 0 A_Jump(256,2)
	Death.Decaptate:
	    TNT1 A 0 A_CustomMissile ("XDeathCyberdemonHead", 220, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_StopSound(5)
		TNT1 AAAAAAAAA 0 A_CustomMissile ("XDeath1", 220, 0, random (0, 360), 2, random (0, 180))
		CYBB AAAAA 8 A_SpawnItem("MuchBlood", 0, 190)
		CYBB ABCABCB 8 A_SpawnItem("MuchBlood", 0, 190)
		EXPL A 0 Radius_Quake (12, 100, 0, 22, 0)
        TNT1 AAAA 0 A_CustomMissile ("ExplosionSpawner", 190, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAA 0 A_CustomMissile ("ExplosionSpawner", 190, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAA 0 A_CustomMissile ("UltraGoreSPawner", 190, 0, random (0, 360), 2, random (0, 180))
		
        TNT1 AAAAAA 0 A_CustomMissile ("UltraGoreSpawner", 190, 0, random (0, 360), 2, random (0, 180))
        TNT1 A 0 A_CustomMissile ("CyberXDeath", 100, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_NoBlocking
		"####" "######" 0 A_DropItem("MajorManaPod",-1,224)
		CYBR P 200
		CYBR P 0 A_BrainDie
		CYBR P -1 A_BossDeath

	//Gumpop
	Pain.Acid:
		"####" "#" 0 A_JumpIfInventory("PowerGumpopDamage",1,2)
		"####" "#" 0 A_SpawnItemEx("GumpopIndicator",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_SETTARGET|SXF_ORIGINATOR|SXF_TRANSFERSPRITEFRAME|SXF_TRANSFERSCALE)
		"####" "#" 0 A_SpawnItemEx("GumpopGlow",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_SETTARGET|SXF_ORIGINATOR)
		"####" "#" 0 A_Jump(20,"Pain")
		Goto See
	Death.Acid:
		CYBR G 1 A_ChangeFlag("SOLID",0)
		"####" "#" 1 A_Playsound("Gumpop/Expand",5)
		"####" "###################################" 1 A_SetScale(ScaleX+frandom(0.01,0.025))
		"####" "#" 1 A_Playsound("Gumpop/Pop",5)
		"####" "######" 0 A_DropItem("MajorManaPod",-1,224)
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_BossDeath
		TNT1 A 0 A_SpawnItemEx("CyberdemonGibbed",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
		CYBR I 0 A_QuakeEx(9,9,9,60,0,512,none,QF_SCALEDOWN)
        TNT1 AAAA 0 A_CustomMissile ("ExplosionSpawner", 90, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAA 0 A_CustomMissile ("ExplosionSpawner", 90, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAA 0 A_CustomMissile ("UltraGoreSPawner", 90, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("GC_XDeathCyberdemonHead", 120, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("GC_XDeathCyberdemonArm", 120, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("GC_XDeathCyberdemonGun", 120, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("GC_XDeathCyberdemonPiece", 120, 0, random (0, 360), 2, random (0, 180))
		TNT1 A 0 A_CustomMissile ("GC_XDeathCyberdemonTorso", 120, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAA 0 A_CustomMissile ("UltraGoreSpawner", 90, 0, random (0, 360), 2, random (0, 180))
        TNT1 A 0 A_CustomMissile ("GC_CyberXDeath", 0, 0, random (0, 360), 2, random (0, 160))
		XBIG ABCD 5
		XBIG E 200
		XBIG E -1 A_BrainDie
		Stop
	//Dreadful
	Death.Tiberium:
		TNT1 A 0 A_SetUserVar("User_DeathByTiberium", 1)
		TNT1 A 0 ACS_NamedExecuteAlways("Toxic Avenger")
		TNT1 A 0 A_SpawnItemEx("TiberiumDeath",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_SETTARGET|SXF_ORIGINATOR)
		TNT1 A 0 A_GiveInventory("TibDeathCounter")
		Goto Death
	Death.BlueTiberium:
		TNT1 A 0 A_SetUserVar("User_DeathByBlueTiberium", 1)
		TNT1 A 0 ACS_NamedExecuteAlways("Blue Oyster Cult")
		TNT1 A 0 A_SpawnItemEx("BlueTiberiumDeath",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_SETTARGET|SXF_ORIGINATOR)
		TNT1 A 0 A_GiveInventory("BlueTibDeathCounter")		
		Goto Death
		
	//Threadcutter
	Pain.Manuel:
		"####" "#" 0 A_Jump(128,1)
		Goto Pain
		"####" "#" 0 A_GiveInventory("BleedItem")
		"####" "#" 0 A_SpawnItemEx("BleedIndicator",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_SETTARGET|SXF_ORIGINATOR)
		Goto Pain
		
	//Thunderstruck
	Pain.Lightning:
		"####" "#" 0 A_Jump(164,1)
		Goto Pain
		CYBR G 0 A_ChangeFlag("NOPAIN",1)
		"####" "#" 0 A_SetUserVar("User_LightningLock", User_LightningLock + 10)
	LightningLock:
		"####" "#" 0 A_SpawnItem("CybersHitBox", 0, 200, 0)
		"####" "#" 0 A_SetUserVar("User_LightningLock", User_LightningLock - 1)
		"####" "#" 0 A_Pain
		"####" "#" 0 A_PlaySound("Thunderstruck/Shocked",5,0.6,1)
		"####" "##" 0 ACS_NamedExecuteAlways("Shock me Plenty")
		"####" "###" 2 A_SpawnItemEx("MonsterShock",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_TRANSFERPOINTERS)
		"####" "##" 0 ACS_NamedExecuteAlways("Shock me Plenty")
		"####" "###" 2 A_SpawnItemEx("MonsterShock",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_TRANSFERPOINTERS)
		"####" "##" 0 ACS_NamedExecuteAlways("Shock me Plenty")
		"####" "###" 2 A_SpawnItemEx("MonsterShock",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_TRANSFERPOINTERS)
		"####" "#" 0 A_JumpIf(User_LightningLock >= 1, "LightningLock")
		"####" "#" 0 A_StopSound(5)
		"####" "#" 0 A_ChangeFlag("NOPAIN",0)
		Goto See
		
	//Cauterizer
	Pain.LightningBlue:
		"####" "#" 0 A_Jump(48,1)
		Goto Pain
		CYBR G 0 A_ChangeFlag("NOPAIN",1)
		"####" "#" 0 A_SetUserVar("User_LightningLock", User_LightningLock + 10)
	BlueLightningLock:
		"####" "#" 0 A_SpawnItem("CybersHitBox", 0, 200, 0)
		"####" "#" 0 A_SetUserVar("User_LightningLock", User_LightningLock - 1)
		"####" "#" 0 A_Pain
		"####" "#" 0 A_PlaySound("Thunderstruck/Shocked",5,0.6,1)
		"####" "##" 0 ACS_NamedExecuteAlways("Shock me Plenty Blue")
		"####" "###" 2 A_SpawnItemEx("CauterMonsterShock",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_TRANSFERPOINTERS)
		"####" "##" 0 ACS_NamedExecuteAlways("Shock me Plenty Blue")
		"####" "###" 2 A_SpawnItemEx("CauterMonsterShock",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_TRANSFERPOINTERS)
		"####" "##" 0 ACS_NamedExecuteAlways("Shock me Plenty Blue")
		"####" "###" 2 A_SpawnItemEx("CauterMonsterShock",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_TRANSFERPOINTERS)
		"####" "#" 0 A_JumpIf(User_LightningLock >= 1, "BlueLightningLock")
		"####" "#" 0 A_StopSound(5)
		"####" "#" 0 A_ChangeFlag("NOPAIN",0)
		Goto See
		
	//Fire
	Pain.Meteorfist:
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_ChangeVelocity(frandom(-3.0,-7.0),0,frandom(3.0,6.0),CVF_RELATIVE)
		"####" "#" 0 A_Jump(256,2) //Guaranteed "On Fire!" effect, heeeh.
	Pain.Fire:
		TNT1 A 0 A_FaceTarget
		"####" "#" 0 A_Jump(16,1)
		Goto Pain
		"####" "#" 0 A_JumpIfInventory("PowerOnFire",1,"Pain")
		"####" "#" 0 A_GiveInventory("OnFireItem")
		"####" "#" 0 A_SpawnItemEx("OnFireIndicator",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_SETTARGET|SXF_ORIGINATOR)
		Goto Pain
	Death.Meteorfist:
		TNT1 A 0 A_ChangeVelocity(frandom(-3.0,-7.0),0,frandom(3.0,6.0),CVF_RELATIVE)
	Death.Lightning:
	Death.LightningBlue:
	Death.Fire:
		//"####" "#" 0 A_SetUserVar("User_DeathByFire", 1)
		//"####" "#" 0 ACS_NamedExecuteAlways("Extra Crispy")
		"####" "#" 0 A_SpawnItemEx("FlamingDeath",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_SETTARGET|SXF_ORIGINATOR)
		Goto Death
	/*FireMelt:
		"####" "#" 0 A_JumpIf(ScaleX > 1.35, "EndOfMelt")
		"####" "#" 0 ACS_NamedExecuteAlways("Extra Crispy")
		"####" "#" 1 A_SetScale(ScaleX + frandom(0.002,0.003),ScaleY - frandom(0.003,0.004))
		Goto Looplet
	EndOfMelt:
		"####" "#" 0 A_SetUserVar("User_DeathByTiberium", 0)
		"####" "#" 0 A_SetUserVar("User_DeathByFire", 0)
		Goto Looplet*/
		
	//Crows
	Death.Crow:
		TNT1 AAAAAA 0 A_SpawnItemEx("FlockOfCrows",random(45,-45),random(45,-45),random(25,0),0,0,0,0,SXF_TRANSFERPOINTERS)
		Goto Death
		
	//Scourgebreath
	Death.Breath:
		"####" "######" 0 A_DropItem("MajorManaPod",-1,224)
		"####" "#" 0 ACS_NamedExecuteAlways("Extra Crispy")
		"####" "#" 0 A_Scream
		"####" "#" 0 A_BossDeath
		"####" "#" 0 A_NoBlocking
		"####" "#" 0 A_SpawnItemEx("BreathSoulburst",0,0,0,0,0,0,0,SXF_TRANSFERSPRITEFRAME|SXF_TRANSFERPOINTERS)
	DeathBreathLoop:
		"####" "#" 0 A_SpawnItemEx("BreathDisintegration",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
		"####" "#" 0 A_JumpIf(ScaleX <= 0, "DeathBreathEnd")
		"####" "#" 0 A_FadeOut(0.05)
		"####" "#" 1 A_SetScale(ScaleX - 0.03, ScaleY - 0.005)
		Loop
	DeathBreathEnd:
		TNT1 A 200 
		TNT1 A 0 A_BrainDie
		Stop
	}
}