ACTOR PainElemental1 Replaces PainElemental
{
	Health 400
	Radius 31
	Height 56
	Mass 400
    Scale 1.0
	Speed 9
	PainChance 128

	Damagefactor "Avoid", 0.0	Damagefactor "BHFTOnBarrel", 0.0	Damagefactor "Blood", 0.0
	Damagefactor "CancelTeleportFog", 0.0	Damagefactor "CauseWaterSplash", 0.0	DamageFactor "Crush", 4.0
	Damagefactor "GibRemoving", 0.0	Damagefactor "HangingHook", 0.0
	Damagefactor "Head", 0.0	Damagefactor "PussyGrab", 0.0	Damagefactor "Repair", 0.0
	Damagefactor "RevenantHitStomach", 0.0	Damagefactor "SpawnMarine", 0.0	Damagefactor "Stealth", 0.0
	Damagefactor "TeleportRemover", 0.0	Damagefactor "Use", 0.0	Damagefactor "Burn", 0.5
	Damagefactor "Fire", 0.5	Damagefactor "Flames", 0.5	Damagefactor "GreenFire", 0.5
	Damagefactor "HumanBBQ", 0.5	Damagefactor "SSG", 5.0	DamageFactor "TankWeakSpot", 0.0
	Damagefactor "ExtremePunches", 5.0	Damagefactor "Fatality", 5.0	Damagefactor "HelperMarineFatallity", 5.0

	PainChance "Taunt", 255
	PainChance "Burn", 16	PainChance "Fire", 16	PainChance "Flames", 16
	PainChance "GreenFire", 16	PainChance "HumanBBQ", 16

	Monster
	+FLOAT
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+DONTHARMSPECIES
	SeeSound "pain/sight"
	PainSound "pain/pain"
	DeathSound "pain/death"
	ActiveSound "pain/active"
    BloodType "Brutal_Blood", "SawBlood", "SawBlood"
	DropItem "DemonStrengthRune" 4
    damagetype Flames
	DeathHeight 4
	BurnHeight 0
	Species "LostSoul"
	Tag "Pain Elemental"
	States
	{
	Spawn:
		PAIN A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCHeckClassicMonsters", 0, 0, 0, 0)//Check if Vanilla Mode is activated
		PAIN A 2
		TNT1 A 0 A_RadiusGive("SlaughterToken", 128, RGF_GIVESELF | RGF_MONSTERS |RGF_CUBE | RGF_NOSIGHT, 1)
		PAIN A 2
		TNT1 A 0 A_JumpIfInventory("SlaughterToken",15,"ReplaceVanilla")
		Goto Stand

	ReplaceVanilla:
		TNT1 A 0 A_ChangeFlag("COUNTKILL", 0)
		TNT1 A 2 A_ChangeFlag("NOINTERACTION", 1)
		TNT1 A 0 A_SpawnItemEx("VanillaPainElemental",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG ,0)
		TNT1 A 2 Thing_Remove(0)
		Stop

	Idle:
	Stand:
		PAIN A 10 A_Look
		Loop

	See:
		PAIN AABBCC 3 A_Chase
		Loop

	Missile:
		TNT1 A 0 A_Stop
		PAIN D 7 A_FaceTarget
		PAIN E 7 A_FaceTarget
		PAIN F 5 BRIGHT A_FaceTarget
		PAIN F 2 BRIGHT A_PainAttack
		PAIN ED 7
		Goto See

	    Death.Fatality:
		TNT1 A 0 A_Pain
		TNT1 A 0 A_JumpIfIntargetInventory("FistsSelected", 1, 1)
		Goto Death
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_SpawnItemEx("HealthCrueltyBonus2", 0, 0, 28, frandom (-2.5, 2.5), frandom (-2.5, 2.5), 5)
		TNT1 A 0 A_SpawnItemEx("ArmorCrueltyBonus2", 0, 0, 28, frandom (-2.5, 2.5), frandom (-2.5, 2.5), 5)
	Death.HelperMarineFatallity:
        TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_GiveToTarget("GoFatality", 1)
        TNT1 A 0 A_GiveToTarget("PEFatality", 1)
        Stop

	Pain:
		PAIN G 6
		PAIN G 6 A_Pain
		Goto See

	Pain.Kick:
        TNT1 A 0 A_FaceTarget
		PAIN G 12
		PAIN G 12 A_Pain
		Goto See
	Death.Telefrag:
		TNT1 A 0
		Goto Death+5
	Death:
		PAIN H 8 BRIGHT
		PAIN I 8 BRIGHT
		PAIN J 8 BRIGHT A_Scream
		TNT1 A 0 A_Explode (50,220)
		TNT1 AAAAAA 0 A_CustomMissile ("FireworkSFXType1", 0, 0, random (0, 360), 2, random (10, 80))
		TNT1 AAAAAA 0 bright A_CustomMissile ("SuperGoreSpawner", 5, 0, random (0, 360), 2, random (30, 180))
        TNT1 AAAAAAAAA 0 A_CustomMissile ("CeilBloodLauncherLong", 0, 0, random (0, 360), 2, random (50, 130))

		TNT1 AAA 0 A_CustomMissile ("XDeathPainElementalNew1", 32, 0, random (0, 360), 2, random (30, 90))
        TNT1 AAA 0 A_CustomMissile ("XDeathPainElementalNew2", 32, 0, random (0, 360), 2, random (30, 90))

		TNT1 AAAAAAAAAAAA 0 A_CustomMissile ("BloodMistExtraBig", 30, 0, random (0, 360), 2, random (30, 90))
		TNT1 AA 0 A_CustomMissile ("XDeath2", 30, 0, random (0, 360), 2, random (40, 90))
		TNT1 AA 0 A_CustomMissile ("XDeath3", 30, 0, random (0, 360), 2, random (40, 90))
		TNT1 AA 0 A_CustomMissile ("XDeath1", 30, 0, random (0, 360), 2, random (40, 90))
		TNT1 AAA 0 A_CustomMissile ("BDExplosionparticles", 30, 0, random (0, 360), 2, random (40, 90))
		TNT1 AA 0 A_CustomMissile ("BDExplosionparticles2", 30, 0, random (0, 360), 2, random (40, 90))
		TNT1 AA 0 A_CustomMissile ("BDExplosionparticles3", 10, 0, random (0, 360), 2, random (40, 90))
		TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece3", random (-5, 5), random (-5, 5))
		TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece", random (-5, 5), random (-5, 5))
		TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece2", random (-5, 5), random (-5, 5))
		TNT1 A 0 A_SpawnItemEx ("DetectFloorCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		EXPL A 0 A_SpawnItemEx("ExplosionParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
		TNT1 A 0 A_SpawnItem("BigBloodSpot")
		EXPL AAAAAAAAAAAAAAAAA 0 A_CustomMissile ("FireBallExplosion", 6, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 BRIGHT A_PainDie
		PAIN N -1
		Stop

    Pain.KillMe:
    Pain.Taunt:
        TNT1 A 0
		TNT1 A 0 HealThing(2)
        Goto Missile
    Death.KillMe:
    Death.Taunt:
	    TNT1 A 0 A_ChangeFlag("SOLID", 0)
        TNT1 A 0 A_SpawnItem("PainElemental")
        Stop
	Death.Ice:
	Death.Freeze:
	Death.Frost:
	TNT1 A 0 A_NOBLOCKING
	TNT1 A 0 A_SpawnItem("FrozenPainElemental")
	Stop
	}
}

ACTOR PEPart1
{
    Radius 8
    Height 8
    Speed 12
    Scale 1.5
	Mass 1
    +NOBLOCKMAP
	+MISSILE
    +NOTELEPORT
    +MOVEWITHSECTOR
    +CLIENTSIDEONLY
    +RIPPER
    +BLOODLESSIMPACT
    +DOOMBOUNCE
	+SKYEXPLODE
    BounceFactor 0.5
damagetype Blood
    SeeSound "misc/xdeath4"
    DeathSound "misc/xdeath1"
	Decal BloodSuper
    States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
        ID22 A 2 A_CustomMissile("BloodTrails",0,0,180,2)
        TNT1 A 0 A_CustomMissile ("SmallFlameTrails", 2, 0, random (0, 360), 2, random (70, 110))
        ID22 B 2 A_CustomMissile("BloodTrails",0,0,180,2)
        TNT1 A 0 A_CustomMissile ("SmallFlameTrails", 2, 0, random (0, 360), 2, random (70, 110))
        ID22 C 2 A_CustomMissile("BloodTrails",0,0,180,2)
        TNT1 A 0 A_CustomMissile ("SmallFlameTrails", 2, 0, random (0, 360), 2, random (70, 110))
        ID22 D 2 A_CustomMissile("BloodTrails",0,0,180,2)
        TNT1 A 0 A_CustomMissile ("SmallFlameTrails", 2, 0, random (0, 360), 2, random (70, 110))
        Loop
    Death:
        ID22 F 1
		TNT1 A 0 A_QueueCorpse
        ID22 F -1
        Stop
        TNT1 A 1
     Splash:
        TNT1 A 0
        Stop
    }
}

ACTOR PEPart2
{
    Radius 8
    Height 8
    Speed 16
    Scale 1.5
	Mass 1
    +NOBLOCKMAP
	+MISSILE
    +NOTELEPORT
    +MOVEWITHSECTOR
    +CLIENTSIDEONLY
    +RIPPER
    +BLOODLESSIMPACT
    +DOOMBOUNCE
	+SKYEXPLODE
    BounceFactor 0.5
damagetype Blood
    SeeSound "misc/xdeath4"
    DeathSound "misc/xdeath1"
	Decal BloodSuper
    States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
        ID22 A 2 A_CustomMissile("BloodTrails",0,0,180,2)
		TNT1 A 0 bright A_SpawnItem("FireballFlare",0,2)
		TNT1 A 0 A_SPawnItem("PlasmaSmoke")
        TNT1 A 0 A_CustomMissile ("SmallFlameTrails", 2, 0, random (0, 360), 2, random (70, 110))

        ID22 B 2 A_CustomMissile("BloodTrails",0,0,180,2)
		TNT1 A 0 bright A_SpawnItem("FireballFlare",0,2)
        TNT1 A 0 A_CustomMissile ("SmallFlameTrails", 2, 0, random (0, 360), 2, random (70, 110))

		ID22 C 2 A_CustomMissile("BloodTrails",0,0,180,2)
		TNT1 A 0 bright A_SpawnItem("FireballFlare",0,2)
        TNT1 A 0 A_SPawnItem("PlasmaSmoke")
		TNT1 A 0 A_CustomMissile ("SmallFlameTrails", 2, 0, random (0, 360), 2, random (70, 110))

		ID22 D 2 A_CustomMissile("BloodTrails",0,0,180,2)
		TNT1 A 0 bright A_SpawnItem("FireballFlare",0,2)
        TNT1 A 0 A_CustomMissile ("SmallFlameTrails", 2, 0, random (0, 360), 2, random (70, 110))
        Loop
    Death:
        ID22 F 1 A_SpawnItem("Brutal_FlyingBlood",0,5,0,1)
		TNT1 A 0 A_QueueCorpse
		TNT1 A 0 A_SpawnItem("100SmallFireFocusSpawnerz")
		ID22 F -1
        Stop
        TNT1 A 1
     Splash:
        TNT1 A 0
        Stop
    }
}

Actor PEPart2SuperFast: PEPart2
{
Speed 22
States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
        ID22 A 1 A_CustomMissile("BloodTrails",0,0,180,2)
		TNT1 A 0 bright A_SpawnItem("FireballFlare",0,2)

        TNT1 A 0 A_CustomMissile ("SmallFlameTrails", 2, 0, random (0, 360), 2, random (70, 110))

        ID22 B 1 A_CustomMissile("BloodTrails",0,0,180,2)
		TNT1 A 0 bright A_SpawnItem("FireballFlare",0,2)
        TNT1 A 0 A_CustomMissile ("SmallFlameTrails", 2, 0, random (0, 360), 2, random (70, 110))

		ID22 C 1 A_CustomMissile("BloodTrails",0,0,180,2)
		TNT1 A 0 bright A_SpawnItem("FireballFlare",0,2)

		TNT1 A 0 A_CustomMissile ("SmallFlameTrails", 2, 0, random (0, 360), 2, random (70, 110))

		ID22 D 1 A_CustomMissile("BloodTrails",0,0,180,2)
		TNT1 A 0 bright A_SpawnItem("FireballFlare",0,2)
        TNT1 A 0 A_CustomMissile ("SmallFlameTrails", 2, 0, random (0, 360), 2, random (70, 110))
		Loop
	}
}

Actor FatalizedPE
{
	Game Doom
    Radius 12
    Height 32
    Scale 1.0
    -COUNTKILL
	+SHOOTABLE
    +PUSHABLE
    +WINDTHRUST
	+CORPSE
	+FLOORCLIP
	+FORCEXYBILLBOARD
	-SOLID
    +MOVEWITHSECTOR
    Mass 400
    Health 100
    Damagefactor "Avoid", 0.0	Damagefactor "BHFTOnBarrel", 0.0	Damagefactor "Blood", 0.0
	Damagefactor "CancelTeleportFog", 0.0	Damagefactor "CauseWaterSplash", 0.0	DamageFactor "Crush", 4.0
	Damagefactor "GibRemoving", 0.0	Damagefactor "HangingHook", 0.0
	Damagefactor "Head", 4.0	Damagefactor "PussyGrab", 0.0	Damagefactor "Repair", 0.0
	Damagefactor "RevenantHitStomach", 0.0	Damagefactor "SpawnMarine", 0.0	Damagefactor "Stealth", 0.0
	Damagefactor "TeleportRemover", 0.0	Damagefactor "Use", 0.0	Damagefactor "Burn", 0.5
	Damagefactor "Fire", 0.5	Damagefactor "Flames", 0.5	Damagefactor "GreenFire", 0.5
	Damagefactor "HumanBBQ", 0.5	Damagefactor "SSG", 5.0	DamageFactor "TankWeakSpot", 0.0
	Damagefactor "ExtremePunches", 5.0	Damagefactor "Fatality", 5.0	Damagefactor "HelperMarineFatallity", 5.0
States
    {
    Spawn:
		PA1F U -1
        Stop

	Death:
		TNT1 AAAAAAAAAAAA 0 A_CustomMissile ("BloodMistExtraBig", 30, 0, random (0, 360), 2, random (30, 90))
		TNT1 AA 0 A_CustomMissile ("XDeath2", 30, 0, random (0, 360), 2, random (40, 90))
		TNT1 AA 0 A_CustomMissile ("XDeath3", 30, 0, random (0, 360), 2, random (40, 90))
		TNT1 AA 0 A_CustomMissile ("XDeath1", 30, 0, random (0, 360), 2, random (40, 90))
		TNT1 AAA 0 A_CustomMissile ("BDExplosionparticles", 30, 0, random (0, 360), 2, random (40, 90))
		TNT1 AA 0 A_CustomMissile ("BDExplosionparticles2", 30, 0, random (0, 360), 2, random (40, 90))
		TNT1 AA 0 A_CustomMissile ("BDExplosionparticles3", 10, 0, random (0, 360), 2, random (40, 90))
		TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece3", random (-5, 5), random (-5, 5))
		TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece", random (-5, 5), random (-5, 5))
		TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece2", random (-5, 5), random (-5, 5))
		TNT1 A 0 A_SpawnItemEx ("DetectFloorCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		EXPL A 0 A_SpawnItemEx("ExplosionParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
		TNT1 A 0 A_SpawnItem("BigBloodSpot")
		TNT1 A 0 A_Explode
		EXPL AAAAAAAAAAAAAAAAA 0 A_CustomMissile ("FireBallExplosion", 6, 0, random (0, 360), 2, random (0, 360))
		PAIN N 1
		PAIN N -1
		Stop
		}}