ACTOR SmoothPain : PainElemental replaces PainElemental
{
  States
  {
  Spawn:
    PAIN A 10 A_Look
    Loop
  see:
	SAIN abcdedcb 3 a_chase
	loop
  Missile:
    PATT abc 3 a_facetarget
	PATT d 3 bright a_facetarget
	PATT e 2 bright a_facetarget
	PATT e 1 bright a_painattack
    Goto See
  Pain:
    PPPP a 4
	PPPP b 2
	PPPP b 2 a_pain
	PPPP c 4 a_pain
	goto see
  death:
		TNT1 A 0 A_JumpIf(CallACS("PainElGore")==1, "deathgore")
		SPAI A 5 bright
		SPAI b 4 bright
		spai c 4 bright a_scream
		spai defgh 4 bright
		spai i 3 bright a_paindie
		spai jk 3 bright
		stop
	deathgore:
		SPAI A 5 bright
		SPAI b 4 bright
		spai c 4 bright a_scream
		spai def 4 bright
		TNT1 AAAAAAAAAAAAAAA 0 A_CustomMissile ("Gibs1", 32, 0, random (0, 360), 2, random (0, 160))
		TNT1 AA 0 A_CustomMissile ("Gibs2", 32, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItem("XBlood2", 0, 40)
		spai g 4 bright
		TNT1 AA 0 A_CustomMissile ("Gibs1", 32, 0, random (0, 360), 2, random (0, 160))
		spai h 3 bright
		TNT1 AA 0 A_CustomMissile ("Gibs1", 32, 0, random (0, 360), 2, random (0, 160))
		spai i 3 bright a_paindie
		TNT1 AA 0 A_CustomMissile ("Gibs2", 32, 0, random (0, 360), 2, random (0, 160))
		spai j 3 bright
		spai k 3 bright
		stop
  raise:
		SPAI kigeca 8
		goto see
  }
}