ACTOR PainElemental1 Replaces PainElemental
{
	Health 400
	Radius 31
	Height 56
	Mass 400
    Scale 1.0
	Speed 9
	PainChance 128
	Monster
	+FLOAT 
	+NOGRAVITY
	+FORCEXYBILLBOARD
	SeeSound "pain/sight"
	damagefactor "Avoid", 0.0
	damagefactor "GibRemoving", 0.0 damagefactor "HumanBBQ", 0.0
	PainSound "pain/pain"
	DeathSound "pain/death"
	ActiveSound "pain/active"
    BloodType "Brutal_Blood", "SawBlood", "SawBlood" damagefactor "HangingHook", 0
	DropItem "DemonStrengthRune" 5
	damagefactor "TeleportRemover", 0.0
	DamageFactor "CauseSplash", 0.0 DamageFactor "CauseObjectsToSplashSlime", 0.0 DamageFactor "CauseObjectsToSplashNukage", 0.0
	DamageFactor "CauseObjectsToSplashBlood", 0.0 DamageFactor "CauseObjectsToSplashLava", 0.0
	PainChance "Kick", 255
	damagefactor "Avoid", 0.0
	damagefactor "Blood", 0.0 damagefactor "BlueBlood", 0.0 damagefactor "GreenBlood", 0.0
    damagetype Flames
	DeathHeight 4
	damagefactor "Shrapnel", 3.0
	damagefactor "ExplosiveImpact", 3.0
	BurnHeight 0
	Tag "Pain Elemental"
	States
	{
	Spawn:
		PAIN A 10 A_Look
		Loop


SearchPlayer:
        TNT1 A 0 A_ClearTarget
		TNT1 A 0 A_TakeInventory("EnemyMemory", 30)
		PAIN A 10 A_Look
		TNT1 A 0 A_SetAngle(angle - 30)
		PAIN A 10 A_Look
		TNT1 A 0 A_SetAngle(angle + 30)
		PAIN A 10 A_Look
		TNT1 A 0 A_SetAngle(angle + 30)
		PAIN A 10 A_Look
		TNT1 A 0 A_SetAngle(angle - 30)
		
		PAIN AA 3 A_Wander
		PAIN A 2 A_look
		PAIN BB 3 A_Wander
		PAIN B 2 A_look
		PAIN CC 3 A_Wander
		PAIN C 2 A_look
		PAIN BB 3 A_Wander
		PAIN B 2 A_look
		PAIN AA 3 A_Wander
		PAIN A 2 A_look
		Loop
		
		
	See:
	    TNT1 A 0
		TNT1 A 0 A_CheckSight("See2")
		TNT1 A 0 A_TakeInventory("EnemyMemory", 10)
		PAIN AABBCC 3 A_Chase
		
		Loop
	
	See2:
	    TNT1 A 0 A_JumpIfInventory("EnemyMemory", 18, "SearchPlayer")
		TNT1 A 0 A_GiveInventory("EnemyMemory", 1)
		PAIN AABBCC 3 A_Chase
		Goto See
		
	Missile:
	    TNT1 A 0 A_TakeInventory("EnemyMemory", 30)
		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 AA 0 A_SpawnItemEx("HealthPlusFatalityBonus", 0, 0, 20, random (-1, 1), random (-1, 1), 8)
		TNT1 A 0 A_SpawnItemEx("ArmorShardFatalityBonus", 0, 0, 20, random (-1, 1), random (-1, 1), 8)
        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 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(1)
        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_ChangeFlag("SHOOTABLE", 0)
	TNT1 A 0 A_ChangeFlag("SOLID", 0)
	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("YellowFlare",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("YellowFlare",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("YellowFlare",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("YellowFlare",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("YellowFlare",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("YellowFlare",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("YellowFlare",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("YellowFlare",0,2)
        TNT1 A 0 A_CustomMissile ("SmallFlameTrails", 2, 0, random (0, 360), 2, random (70, 110))
		Loop
	}	
}






Actor FatalizedPE
{
    Radius 12
    Height 32
    Scale 1.0
    +SHOOTABLE
    +NOTELEPORT
    +MOVEWITHSECTOR
    +CORPSE
	-SOLID
	+PUSHABLE
	+THRUSPECIES
	SPecies "Marines"
    Mass 10000
    Health 100
    damagefactor "Blood", 0.0
    damagefactor "Trample", 0.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(100, 200)
		EXPL AAAAAAAAAAAAAAAAA 0 A_CustomMissile ("FireBallExplosion", 6, 0, random (0, 360), 2, random (0, 360))
		PAIN N 1
		PAIN N -1
		Stop
		}}
		
		