// --------------------------------------------------------------------------
//
// Hexen enemies
//
// --------------------------------------------------------------------------

ACTOR EriAfrit : FireDemon replaces FireDemon
{
	States
	{
	Death.Soul:
	Death.SoulRipper:
		FDMN M 0 A_SpawnItemEx("SoulExplosionSmall", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
		FDMN M 5 A_FaceTarget
		FDMN N 5 A_NoBlocking
		FDMN O 0 A_SpawnItemEx("SoulVaporSmall", 0, 0, 24, 0, 0, 2)
		FDMN O 5 A_FiredSplotch
		Stop
	}
}

ACTOR EriEttin : Ettin replaces Ettin
{
	States
	{
	Death.Soul:
	Death.SoulRipper:
		ETTB A 4
		ETTB B 4 A_NoBlocking
		ETTB B 0 A_SpawnItemEx("SoulExplosionMedium", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
		ETTB C 4 A_SpawnItemEx("EttinMace", 0,0,8.5, random[DropMace](-128,127) * 0.03125, random[DropMace](-128,127) * 0.03125, 10 + random[DropMace](0,255) * 0.015625, 0, SXF_ABSOLUTEVELOCITY)
		ETTB D 4 A_Scream
		ETTB D 0 A_SpawnItemEx("SoulVaporMedium", 0, 0, 24, 0, 0, 3)
		ETTB E 4 A_QueueCorpse
		ETTB FGHIJK 4
		ETTB L -1
		Stop
	}
}

ACTOR EriCentaur : Centaur replaces Centaur
{
	States
	{
	Death.Soul:
	Death.SoulRipper:
		CTXD A 4
		CTXD B 4 A_NoBlocking
		CTXD C 0 A_SpawnItemEx("SoulExplosionMedium", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
		CTXD C 0 A_SpawnItemEx("CentaurSword" , 0, 0, 45, 1 + random[CentaurDrop](-128,127)*0.03125, 1 + random[CentaurDrop](-128,127)*0.03125, 8 + random[CentaurDrop](0,255)*0.015625, 270)
		CTXD C 4 A_SpawnItemEx("CentaurShield", 0, 0, 45, 1 + random[CentaurDrop](-128,127)*0.03125, 1 + random[CentaurDrop](-128,127)*0.03125, 8 + random[CentaurDrop](0,255)*0.015625, 90 )
		CTXD D 3 A_Scream
		CTXD E 0 A_SpawnItemEx("SoulVaporMedium", 0, 0, 24, 0, 0, 3)
		CTXD E 4 A_QueueCorpse
		CTXD F 3
		CTXD G 4
		CTXD H 3
		CTXD I 4
		CTXD J 3
		CTXD K -1
		Stop
	}
}

ACTOR EriCentaurLeader : EriCentaur replaces CentaurLeader
{
	Health 250
	PainChance 96
	Speed 10
	Obituary "$OB_SLAUGHTAUR"
	HitObituary "$OB_SLAUGHTAURHIT"
	States
	{
	Missile:
		CENT E 10 A_FaceTarget
		CENT F 8 Bright A_CustomMissile("CentaurFX", 45, 0, 0, CMF_AIMOFFSET)
		CENT E 10 A_FaceTarget
		CENT F 8 Bright A_CustomMissile("CentaurFX", 45, 0, 0, CMF_AIMOFFSET)
		Goto See
	}
}

ACTOR EriStalker : Serpent replaces Serpent
{
	States
	{
	XDeath:
		SSXD A 4
		SSXD B 0 A_SpawnItemEx("SoulExplosionMedium", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
		SSXD B 4 A_SpawnItemEx("SerpentHead", 0, 0, 45)
		SSXD C 4 A_NoBlocking
		SSXD D 4 A_SpawnItemEx("SoulVaporMedium", 0, 0, 24, 0, 0, 3)
		SSXD E 4
		SSXD FG 3
		SSXD H 3 A_SerpentSpawnGibs
		Stop
	}
}

ACTOR EriStalkerLeader : EriStalker replaces SerpentLeader
{
	Mass 200
	Obituary "$OB_SERPENT"
	States
	{
	Missile:
		SSPT N 5 A_CustomMissile("SerpentFX", 32, 0)
		Goto Dive
	}
}

ACTOR EriSerpentGreen : Demon1 replaces Demon1
{
	States
	{
	Death.Soul:
	Death.SoulRipper:
		DEMN H 6
		DEMN I 0 A_SpawnItemEx("SoulExplosionLarge", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
		DEMN I 0 A_SpawnItemEx("Demon1Chunk1", 0,0,45, frandom[DemonChunks](1,4.984375)*cos(Angle+90), frandom[DemonChunks](1,4.984375)*sin(Angle+90), 8, 90, ChunkFlags)
		DEMN I 0 A_SpawnItemEx("Demon1Chunk2", 0,0,45, frandom[DemonChunks](1,4.984375)*cos(Angle-90), frandom[DemonChunks](1,4.984375)*sin(Angle-90), 8, 270, ChunkFlags)
		DEMN I 0 A_SpawnItemEx("Demon1Chunk3", 0,0,45, frandom[DemonChunks](1,4.984375)*cos(Angle-90), frandom[DemonChunks](1,4.984375)*sin(Angle-90), 8, 270, ChunkFlags)
		DEMN I 0 A_SpawnItemEx("Demon1Chunk4", 0,0,45, frandom[DemonChunks](1,4.984375)*cos(Angle-90), frandom[DemonChunks](1,4.984375)*sin(Angle-90), 8, 270, ChunkFlags)
		DEMN I 6 A_SpawnItemEx("Demon1Chunk5", 0,0,45, frandom[DemonChunks](1,4.984375)*cos(Angle-90), frandom[DemonChunks](1,4.984375)*sin(Angle-90), 8, 270, ChunkFlags)
		DEMN I 0 A_SpawnItemEx("SoulVaporLarge", 0, 0, 24, 0, 0, 4)
		Goto Death+2
	}
}

ACTOR EriSerpentBrown : Demon2 replaces Demon2
{
	States
	{
	Death.Soul:
	Death.SoulRipper:
		DEM2 H 6
		DEM2 I 0 A_SpawnItemEx("SoulExplosionLarge", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
		DEM2 I 0 A_SpawnItemEx("Demon2Chunk1", 0,0,45, frandom[DemonChunks](1,4.984375)*cos(Angle+90), frandom[DemonChunks](1,4.984375)*sin(Angle+90), 8, 90, ChunkFlags)
		DEM2 I 0 A_SpawnItemEx("Demon2Chunk2", 0,0,45, frandom[DemonChunks](1,4.984375)*cos(Angle-90), frandom[DemonChunks](1,4.984375)*sin(Angle-90), 8, 270, ChunkFlags)
		DEM2 I 0 A_SpawnItemEx("Demon2Chunk3", 0,0,45, frandom[DemonChunks](1,4.984375)*cos(Angle-90), frandom[DemonChunks](1,4.984375)*sin(Angle-90), 8, 270, ChunkFlags)
		DEM2 I 0 A_SpawnItemEx("Demon2Chunk4", 0,0,45, frandom[DemonChunks](1,4.984375)*cos(Angle-90), frandom[DemonChunks](1,4.984375)*sin(Angle-90), 8, 270, ChunkFlags)
		DEM2 I 6 A_SpawnItemEx("Demon2Chunk5", 0,0,45, frandom[DemonChunks](1,4.984375)*cos(Angle-90), frandom[DemonChunks](1,4.984375)*sin(Angle-90), 8, 270, ChunkFlags)
		DEM2 I 0 A_SpawnItemEx("SoulVaporLarge", 0, 0, 24, 0, 0, 4)
		Goto Death+2
	}
}

ACTOR EriWendigo : IceGuy replaces IceGuy
{
	States
	{
	Death.Soul:
	Death.SoulRipper:
		ICEY A 0 A_SpawnItemEx("SoulExplosionMedium", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
		ICEY A 0 A_SpawnItemEx("SoulVaporMedium", 0, 0, 24, 0, 0, 3)
		ICEY A 1 A_IceGuyDie
		Stop
	}
}

ACTOR EriBishop : Bishop replaces Bishop
{
	States
	{
	Death.Soul:
	Death.SoulRipper:
		BISH G 6
		BISH H 6 Bright A_Scream
		BISH I 5 Bright A_NoBlocking
		BISH J 4 Bright A_SpawnItemEx("SoulExplosionMedium", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
		BISH K 4 Bright
		BISH L 4 Bright A_SpawnItemEx("SoulVaporMedium", 0, 0, 24, 0, 0, 3)
		BISH M 4 Bright
		BISH N 4 A_SpawnItemEx("BishopPuff", 0,0,40, 0,0,0.5)
		BISH O 4 A_QueueCorpse
		BISH P -1
		Stop
	}
}

ACTOR EriWraith : Wraith replaces Wraith
{
	States
	{
	Death.Soul:
	Death.SoulRipper:
		WRT2 A 5
		WRT2 B 5 A_Scream
		WRT2 C 5 A_SpawnItemEx("SoulExplosionMedium", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
		WRT2 D 5 A_NoBlocking
		WRT2 E 5 A_SpawnItemEx("SoulVaporMedium", 0, 0, 24, 0, 0, 3)
		WRT2 F 5 A_QueueCorpse
		WRT2 G 5
		WRT2 H -1
		Stop
	}
}