actor SSTPainElemental : PainElemental replaces PainElemental
{
damagefactor "RedPaint", 0.3
damagefactor "OrangePaint", 0.3
damagefactor "YellowPaint", 0.3
damagefactor "GreenPaint", 0.3
damagefactor "BluePaint", 0.3
damagefactor "PurplePaint", 0.3
damagefactor "WhitePaint", 0.3
damagefactor "BlackPaint", 0.3
  PainChance "ShotgunWeak", 32

  spawnid 115
  health 400
  radius 31
  height 56
  mass 400
  speed 8
  painchance 128
  seesound "pain/sight"
  painsound "pain/pain"
  deathsound "pain/death"
  activesound "pain/active"
  MONSTER
  +FLOAT
  +NOGRAVITY
	+FORCEXYBILLBOARD
  states
  {
  Spawn:
    PAIN A 10 A_Look
    loop
  See:
    PAIN AABBCC 3 A_Chase
    loop
  Missile:
    PAIN DE 5 A_FaceTarget
    PAIN F 5 bright A_FaceTarget
    PAIN F 0 bright A_PainAttack    // See LostSoul
    goto See
  Pain:
    PAIN G 6
    PAIN G 6 A_Pain
    goto See
  Death:
    PAIN H 8 bright
    PAIN I 8 bright A_Scream
    PAIN JK 8 bright
	NULL A 0 A_SpawnItemEx ("PEDebrisSpawner", 0,0,25, 0,0,0, 0, 160) 
    PAIN L 1 bright A_PainDie       // See LostSoul
    PAIN L 7 bright
    PAIN M 8 bright
    stop
  Raise:
    PAIN MLKJIH 8
    goto See
  Pain.GreenPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 0,0,0)
	Goto See
  Pain.BluePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 1,0,0)
	Goto See
  Pain.RedPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 2,0,0)
	Goto See
  Pain.OrangePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 3,0,0)
	Goto See
  Pain.PurplePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 4,0,0)
	Goto See
  Pain.WhitePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 5,0,0)
	Goto See
  Pain.YellowPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 6,0,0)
	Goto See
  Pain.BlackPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 7,0,0)
	Goto See
  }
}
actor PEDebrisSpawner
{
 renderstyle NONE
 +NOGRAVITY
 States
 {
  Spawn:
  NULL A 0
  NULL A 0 A_SpawnDebris("PEMeat",1)
  NULL A 0 A_SpawnDebris("PEhorn",1)
  NULL A 0 A_SpawnDebris("PEArm",1)
  NULL A 0 A_SpawnDebris("PEJaw",1)
  Stop
 }
}

Actor PEHorn
{
    Radius 1
    Height 1
    Speed  3
    Damage 0
    Health 1
    RenderStyle Translucent
    Alpha 1.0
    PROJECTILE
    -NOGRAVITY
    +HEXENBOUNCE
	bouncefactor 0.5
    +DONTSPLASH
    -ACTIVATEPCROSS
    -ACTIVATEIMPACT
    +RANDOMIZE
	+thruactors
	+movewithsector
    States
    {
    Spawn:
    	NULL A 0
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	NULL A 0 A_Jump(128,"Spawn1a")
    Spawn1:
    	LSF3 A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	LSF3 A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	LSF3 A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    Spawn1a:
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	LSF3 A 1 A_Fadeout(0.01)
		loop
    }
}  

Actor PEArm
{
    Radius 1
    Height 1
    Speed  3
    Damage 0
    Health 1
    RenderStyle Translucent
    Alpha 1.0
    PROJECTILE
    -NOGRAVITY
    +HEXENBOUNCE
    +DONTSPLASH
    -ACTIVATEPCROSS
    -ACTIVATEIMPACT
    -RANDOMIZE
	+thruactors
	+movewithsector
	bouncefactor 0.5
    States
    {
    Spawn:
    	NULL A 0
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	NULL A 0 A_Jump(64,"Spawn1a")
    Spawn1:
    	PARM AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItemEx("GibTrail", 0,0,0, random(-10,10)*0.1,random(-10,10)*0.1,random(-10,10)*0.1, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
    	PARM AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItemEx("GibTrail", 0,0,0, random(-10,10)*0.1,random(-10,10)*0.1,random(-10,10)*0.1, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
    	PARM A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	PARM A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    Spawn1a:
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	PARM A 1 A_Fadeout(0.01)
		loop
    }
}  

Actor PEJaw
{
    Radius 1
    Height 1
    Speed  3
    Damage 0
    Health 1
    RenderStyle Translucent
    Alpha 1.0
    PROJECTILE
    -NOGRAVITY
    +HEXENBOUNCE
    +DONTSPLASH
    -ACTIVATEPCROSS
    -ACTIVATEIMPACT
    -RANDOMIZE
	+thruactors
	+movewithsector
	bouncefactor 0.5
    States
    {
    Spawn:
    	NULL A 0
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	NULL A 0 A_Jump(64,"Spawn1a")
    Spawn1:
    	PJAW AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItemEx("GibTrail", 0,0,0, random(-10,10)*0.1,random(-10,10)*0.1,random(-10,10)*0.1, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
    	PJAW AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItemEx("GibTrail", 0,0,0, random(-10,10)*0.1,random(-10,10)*0.1,random(-10,10)*0.1, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
    	PJAW A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	PJAW A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    Spawn1a:
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	PJAW A 1 A_Fadeout(0.01)
		loop
    }
}  

Actor PEMeat
{
    Radius 1
    Height 1
    Speed  3
    Damage 0
    Health 4
    RenderStyle Translucent
    Alpha 1.0
    PROJECTILE
    -NOGRAVITY
    +HEXENBOUNCE
	bouncefactor 0.5
    +DONTSPLASH
    -ACTIVATEPCROSS
    -ACTIVATEIMPACT
    -RANDOMIZE
	+thruactors
	+movewithsector
    States
    {
    Spawn:
    	NULL A 0
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    Spawn1:
    	PMET AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItemEx("GibTrail", 0,0,0, random(-10,10)*0.1,random(-10,10)*0.1,random(-10,10)*0.1, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
    	PMET AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItemEx("GibTrail", 0,0,0, random(-10,10)*0.1,random(-10,10)*0.1,random(-10,10)*0.1, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
    	PMET A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	PMET A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    Spawn1a:
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	PMET A 1 A_Fadeout(0.01)
		loop
    }
}  