Actor ChasmPhantomLord Replaces Archvile
{
    Health 1200
    Radius 22
    Height 52
    Speed 8
    PainChance 12
	PainChance "Laser", 94
	Mass 1000
    Monster
	+DONTHARMSPECIES
	+FLOAT
	+NOGRAVITY
	+DONTFALL
	+SPAWNFLOAT
    SeeSound "PhantomLord/See"
    PainSound "PhantomLord/Pain"
    DeathSound "PhantomLord/Death"
	ActiveSound "PhantomLord/Active"
    Obituary "%o was killed by a Phantom Lord."
	BloodColor "Red"
	BloodType "RedBlood", "RedBlood"
	Species "Fantasy"
	Tag "Phantom Lord"
    States
    {
    Spawn:
	    TNT1 A 0 NoDelay
        PHW1 ABCDEF 2 A_Look
		TNT1 A 0 A_PlaySound("Phantom/Fly", 4, 0.40)
		PHW1 GHIJKL 2 A_Look
        Loop
    See:
        PHW1 ABCDEF 2 A_VileChase
		TNT1 A 0 A_PlaySound("Phantom/Fly", 4, 0.40)
		PHW1 GHIJKL 2 A_VileChase
        Loop
	Missile:
	    TNT1 A 0
		PHA1 ABC 2 A_FaceTarget
		TNT1 A 0 A_PlaySound("PhantomLord/Charge", 1)
		PHA1 DEFGHIJKL 4 A_VileTarget("PhantomLordTargetFX") 
		TNT1 A 0 A_PlaySound("PhantomLord/Attack", 3)
		PHA1 M 0 A_CustomMissile("PhantomLance",44,0,0)
		PHA1 MNO 4 BRIGHT
		PHA1 PQRSTUVWXY 2
		Goto See
	Melee:
	    PHA1 ABCDEFGHIJKLMNOP 1 A_FaceTarget
		TNT1 A 0 A_PlaySound("PhantomLord/Attack", 3)
		PHA1 Q 0 A_CustomBulletAttack(1, 1, 1, 20, "PhantomMeleePuff", 50, CBAF_AIMFACING)
		PHA1 Q 2 BRIGHT
		PHA1 RSTUVWXY 1
		Goto See
  Pain:
    PHP1 A 2 A_Pain
    PHP1 BCDEFGHIJKLM 2
    Goto See
  Death:
    PHP1 M 1 A_SetTranslucent(0.90)
	PHP1 M 1 A_SetTranslucent(0.85)
	PHP1 M 1 A_SetTranslucent(0.80)
	PHP1 M 1 A_SetTranslucent(0.75)
	TNT1 A 0 A_SetTranslucent(0.70)
    PHP1 L 1 A_Scream
	PHP1 L 1 A_SetTranslucent(0.65)
	PHP1 L 1 A_SetTranslucent(0.60)
	PHP1 L 1 A_SetTranslucent(0.55)
	PHP1 K 1 A_SetTranslucent(0.50)
    PHP1 K 3 A_NoBlocking
	PHP1 J 4
	PHP1 IHG 4
	PHP1 F 6
	TNT1 A 0 A_PlaySound("Flesh/Gib", 4)
	TNT1 AAAA 0 A_CustomMissile("GoreBloodSpawner", random(10,40), random(0,-20), random (0, 360), 2, random (0, 160))
	TNT1 AAAA 0 A_CustomMissile("GoreBloodSpawner", random(10,40), random(0,20), random (0, 360), 2, random (0, 160))
	TNT1 AAAAAA 0 A_CustomMissile("GoreSpawner", random(10,40), random(0,-20), random (0, 360), 2, random (0, 160))
	TNT1 AAAAAA 0 A_CustomMissile("GoreSpawner", random(10,40), random(0,20), random (0, 360), 2, random (0, 160))
	TNT1 AAAAA 0 A_CustomMissile("BloodGiblet", random(10,40), random(0, -20), random (0, 360), 2, random (0, 160))
	TNT1 AAAAA 0 A_CustomMissile("BloodGiblet", random(10,40), random(0, 20), random (0, 360), 2, random (0, 160))
	TNT1 A 0 A_CustomMissile("PhantomRezFX", 25, 5, random (0, 180), 2, random (0, 90))
	TNT1 A 0 A_PlaySound("PhantomLord/Soul", 7)
    Stop
  Heal:
    PHA1 ABCDEFGHIJKL 2
	PHA1 LKJIHGFEDCBA 2
	Goto See
    }
}

ACTOR PhantomLance
{
  Radius 2
  Height 2
  Speed 40
  Damage 14
  Projectile
  +RANDOMIZE
  DeathSound "Phantom/Exp"
  RenderStyle Add
  Alpha 0.97
  States
  {
  Spawn:
  	TNT1 A 0 NoDelay
	SKLX AA 1 BRIGHT A_SpawnItemEx("PhantomBallFX",0,0,0,random(-1,1),random(-1,1),random(-1,1),0,128,0)
    SKLX AA 1 Bright A_SpawnParticle ("White", SPF_FULLBRIGHT | SPF_RELATIVE, random(15,30), random(2,3), frandom(0,360), 0,0,0, frandom(0.2,12.0),frandom(-0.2,0.2),frandom(-1.0,1.0), 0,0,-0.1, 0.98, -1)
	Loop
  Death:
	TNT1 A 0 A_Scream
	TNT1 A 0 A_Quake (1, 12, 0, 1024, "")
	TNT1 AAAAAAAA 0 A_SpawnParticle ("Gray", SPF_FULLBRIGHT | SPF_RELATIVE, random(35,45), random(1,4), frandom(0,360), 0,0,0, frandom(0.2,12.0),frandom(-0.2,0.2),frandom(-6.0,6.0), 0,0,-0.1, 0.98, -1)
    TNT1 AAAAAAAA 0 A_SpawnParticle ("White", SPF_FULLBRIGHT | SPF_RELATIVE, random(35,45), random(1,4), frandom(0,360), 0,0,0, frandom(0.2,12.0),frandom(-0.2,0.2),frandom(-6.0,6.0), 0,0,-0.1, 0.98, -1)
	TNT1 AAAAA 0 A_CustomMissile("ExplosionSmokeSpawner", random(1,8), random(15,-15), random (0, 360), 2, random (0, 160))
    SKU2 ABCDEFGHI 2 BRIGHT
	Stop
  }
}

Actor PhantomBallFX
{   
  Radius 2
  Height 2
  +NoBlockMap
  +NoGravity
  +DontSplash
  +ForceXYBillboard
  RenderStyle Add
  Alpha 0.67
  Scale 0.2
  States
  {
  Spawn:
    TNT1 A 3 Bright
    SKU3 ABCDEFG 1 BRIGHT
	SKU3 GGGGG 1 A_FadeOut
    Stop 
  }
}

actor PhantomMeleePuff
{
  +NOBLOCKMAP
  +NOGRAVITY
  +PUFFONACTORS
  Scale 0.3
  RenderStyle Add
  Alpha 0.95
  seesound "Phantom/Stab"
  states
  {
  Spawn:
    TNT1 A 0
    stop
  Crash:
    TNT1 A 0
    stop
  Melee:
	TNT1 A 0
    stop
  }
}

ACTOR PhantomLordTargetFX
{
  +NOBLOCKMAP
  +NOGRAVITY
  RenderStyle Add
  Alpha 0.95
  States
  {
  Spawn:
    TNT1 A 0 NoDelay
    TNT1 A 0 A_PlaySound("PhantomLord/Warning", 7)
    TNT1 AA 2 Bright { A_CustomMissile("PhantomLordTargetFX2", random(10,40), 0, random (0, 360), 2, random (0, 360)); A_Warp(AAPTR_TRACER, 24, 0, 0, 0, WARPF_NOCHECKPOSITION|WARPF_INTERPOLATE); }
    Stop
  }
}

actor PhantomLordTargetFX2
{ 
    Radius 0
    Height 0 
    Speed 1
	Mass 1
	+FLOAT
	+NOGRAVITY
	+NOINTERACTION
	+BRIGHT
	+NOBLOCKMAP
	+NODAMAGETHRUST
	+CANNOTPUSH
	-SOLID
    PROJECTILE 
	RenderStyle Add
	Alpha 0.95
    States 
    { 
    Spawn: 
        SKU0 A 2 BRIGHT A_SetScale(0.15)
		SKU0 A 2 BRIGHT
		SKU0 A 2 BRIGHT A_SetScale(0.30)
		SKU0 A 2 BRIGHT
		SKU0 A 2 BRIGHT A_SetScale(0.45)
		SKU0 A 2 BRIGHT
		SKU0 A 2 BRIGHT A_SetScale(0.60)
		SKU0 A 2 BRIGHT
		SKU0 A 2 BRIGHT A_SetScale(0.75)
		SKU0 AAAAA 2
        Goto Death 
    Death: 
        SKU0 A 1 BRIGHT A_Fadeout
		SKU0 A 1 BRIGHT A_SetScale(0.60)
		SKU0 A 1 BRIGHT A_Fadeout
		SKU0 A 1 BRIGHT A_SetScale(0.45)
		SKU0 A 1 BRIGHT A_Fadeout
		SKU0 A 1 BRIGHT A_SetScale(0.30)
		SKU0 A 1 BRIGHT A_Fadeout
		SKU0 A 1 BRIGHT A_SetScale(0.15)
        Stop 
    } 
}

ACTOR PhantomRezFX
{
  +NOBLOCKMAP
  +NOGRAVITY
  +ALLOWPARTICLES
  +RANDOMIZE
  +NOCLIP
  +BRIGHT
  RenderStyle Add
  Alpha 0.97
  Scale 0.99
  Mass 5
  +clientsideonly
	States
	{
	    Spawn:
		SPEC EFGHIJ 2
		Goto Death
		Death:
		SPEC JJJJJJ 1 A_FadeOut
		Stop
	}
}

Actor HereticChasmPhantomLord : ChasmPhantomLord Replaces Wizard
{
    Health 250
	Game Heretic
	SeeSound "Phantom/See"
    PainSound "Phantom/Pain"
    DeathSound "Phantom/Death"
	ActiveSound "Phantom/Active"
	States
	{
	See:
        PHW1 ABCDEF 2 A_Chase
		TNT1 A 0 A_PlaySound("Phantom/Fly", 4, 0.40)
		PHW1 GHIJKL 2 A_Chase
        Loop
	Missile:
	    TNT1 A 0
		PHA1 ABC 2 A_FaceTarget
		TNT1 A 0 A_PlaySound("PhantomLord/Charge", 1)
		PHA1 DEFGHIJKL 4 A_FaceTarget
		TNT1 A 0 A_PlaySound("Phantom/Fire", 1)
		PHA1 M 0 A_CustomMissile("HereticPhantomLance",44,0,0)
		PHA1 MNO 4 BRIGHT
		PHA1 PQRSTUVWXY 2
		Goto See
}
}

ACTOR HereticPhantomLance : PhantomLance
{
  Speed 20
  Damage 8
  Game Heretic
}