ACTOR PhaseElemental : SoulKeeper 21527
{
Monster
Health 600
PainChance 80
BloodColor "cf 00 b0"
Renderstyle Translucent
Alpha 0.95
DropItem "LifeEssence", 90
DropItem "ArmorBonusMax", 90
DropItem "DemonAmmoBox", 128, 200
SeeSound "Defier/Sight"
DeathSound "Defiler/Death"
Obituary "%o was pierced by a Phase Elemental."
HitObituary "%o is salty to the refined tastes of the Phase Elemental."
States
	{
	Spawn:
		PELE A 10 A_Look
		Loop
	See:
		PELE AABBCCBB 3 A_Chase
		TNT1 A 0 A_Jump(46,"Phase")	
		Loop
	Phased:
        PELE AABBCCAAAABBCCAAAABBCCAAAABBCCAA 1 A_ExtChase(0,0)
		Goto Phased2
	Phased2:
        PELE AABBCCAAAABBCCAA 1 A_Chase
		TNT1 A 0 A_Jump(24,"UnPhase")
        Goto Phased2
	Phase:
		TNT1 A 0 A_PlaySound("phaseimp/teleport")
        PELE E 2 A_FaceTarget
        PELE E 1 A_SetTranslucent(0.75)
        PELE E 1 A_SetTranslucent(0.55)
        PELE E 1 A_SetTranslucent(0.35)
		PELE E 1 A_SetTranslucent(0.15)
        Goto Phased
	UnPhase:
		TNT1 A 0 A_PlaySound("phaseimp/teleport")
		PELE E 1 A_SetTranslucent(0.15)
        PELE E 1 A_SetTranslucent(0.35)
        PELE E 1 A_SetTranslucent(0.55)
        PELE E 1 A_SetTranslucent(0.75)
		TNT1 A 0 A_SetTranslucent(0.95)
        PELE E 2 A_FaceTarget		
        Goto See
	Missile:
		TNT1 A 0
		TNT1 A 0 A_SetTranslucent(0.95)
		TNT1 A 0 Bright A_Jump(87,"Seeker")
		Goto Normal
	Normal:
        PELE DE 6 A_FaceTarget
        PELE F 5 Bright A_PainAttack("PhaseSoul")
		PELE ED 4
		Goto See
	Seeker:
		TNT1 A 0 A_SetTranslucent(0.95)
		PELE D 6 Bright A_FaceTarget 
		PELE E 4 Bright	A_FaceTarget
		TNT1 A 0 Bright A_PlaySound("imp/attack")
		TNT1 A 0 Bright A_CustomMissile("PhaseEleBall",26,0,-30)
		PELE F 3 Bright A_CustomMissile("PhaseEleBall",26,0,30)
		PELE ED 4
		Goto See
	Melee:
		TNT1 A 0 A_SetTranslucent(0.95)
        PELE DE 5 A_FaceTarget 
        PELE F 4 A_MeleeAttack
	    PELE ED 3 A_FaceTarget
        Goto See		
	Pain:
		TNT1 A 0 A_SetTranslucent(0.95)
		TNT1 A 0 A_Jump(61,"PainMissile")
		PELE G 12 A_Pain
		Goto See
	PainMissile:
		TNT1 A 0 A_SetTranslucent(0.95)
		PELE G 12 A_Pain
		Goto Missile
	XDeath:
	Death:
		TNT1 A 0 A_SetTranslucent(0.95)
		PELE H 5 
		PELE I 5 Bright A_Scream
		PELE J 5 Bright A_Fall
		TNT1 A 0 A_SetTranslucent(0.75,1)
		TNT1 A 0 A_SpawnItemEx("MutantGibbedGenerator",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE,0)
	    TNT1 AAAA 0 A_SpawnItemEx("PurpleParticleSpawner",0,0,random(20,40),0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
		TNT1 AAAA 0 A_CustomMissile("SmokeFX2",random(20,40),0,random(0,360),2,random(0,360))
		TNT1 AAAA 0 A_CustomMissile("Kaboom8",random(20,40),0,random(0,360),2,random(0,360))		
		PELE K 5 Bright A_PainDie("PhaseSoul")
		PELE LM 5 Bright
		Stop
	}
}

Actor PhaseEleBall : PhaseImpBall { DamageType "EleSouls" }