//------------------------------------------------------------------------------
actor Demon1 31
{
	game Hexen
	SpawnID 3
	Health 250
	Radius 32
	Height 64
	Mass 220
	Speed 13
	PainChance 50
	SeeSound "DemonSight"
	ActiveSound "DemonActive"
	AttackSound "DemonAttack"
	PainSound "DemonPain"
	DeathSound "DemonDeath"
	Obituary "$ob_demon1"
	Monster
	+FloorClip
	+Telestomp
	states
	{
	Spawn:
		DEMN AA 10 A_Look
		Loop
	See:
		DEMN ABCD 4 A_Chase
		Loop
	Melee:
		DEMN E 6 A_FaceTarget
		DEMN F 8 A_FaceTarget
		DEMN G 6 A_CustomMeleeAttack(random(1, 8) * 2)
		Goto See
	Missile:
		DEMN E 5 A_FaceTarget
		DEMN F 6 A_FaceTarget
		DEMN G 5 A_CustomMissile("Demon1FX1", 62, 0)
		Goto See
	Pain:
		DEMN E 4
		DEMN E 4 A_Pain
		Goto See
	Death:
		DEMN HI 6
		DEMN J 6 A_Scream
		DEMN K 6 A_NoBlocking
		DEMN L 6 A_QueueCorpse
		DEMN MNO 6
		DEMN P -1
		Stop
	XDeath:
		DEMN H 6
		DEMN I 0 A_SpawnItemEx("Demon1Chunk1", 0, 0, 45, random(0, 255) * 0.015625 + 1,
			random(0, 255) * 0.015625 + 1, 8, 90, SXF_TRANSFERTRANSLATION)
		DEMN I 0 A_SpawnItemEx("Demon1Chunk2", 0, 0, 45, random(0, 255) * 0.015625 + 1,
			random(0, 255) * 0.015625 + 1, 8, 270, SXF_TRANSFERTRANSLATION)
		DEMN I 0 A_SpawnItemEx("Demon1Chunk3", 0, 0, 45, random(0, 255) * 0.015625 + 1,
			random(0, 255) * 0.015625 + 1, 8, 270, SXF_TRANSFERTRANSLATION)
		DEMN I 0 A_SpawnItemEx("Demon1Chunk4", 0, 0, 45, random(0, 255) * 0.015625 + 1,
			random(0, 255) * 0.015625 + 1, 8, 270, SXF_TRANSFERTRANSLATION)
		DEMN I 6 A_SpawnItemEx("Demon1Chunk5", 0, 0, 45, random(0, 255) * 0.015625 + 1,
			random(0, 255) * 0.015625 + 1, 8, 270, SXF_TRANSFERTRANSLATION)
		DEMN J 6 A_Scream
		DEMN K 6 A_NoBlocking
		DEMN L 6 A_QueueCorpse
		DEMN MNO 6
		DEMN P -1
		Stop
	Ice:
		DEMN Q 5 A_FreezeDeath
		DEMN Q 1 A_FreezeDeathChunks
		Wait
	}
}

//------------------------------------------------------------------------------
actor Demon1FX1
{
	Radius 10
	Height 6
	Speed 15
	Damage 5
	RenderStyle Add
	DamageType "Fire"
	SeeSound "DemonMissileFire"
	DeathSound "DemonMissileExplode"
	Projectile
	+SpawnSoundSource
	states
	{
	Spawn:
		DMFX ABC 4 Bright
		Loop
	Death:
		DMFX DE 4 Bright
		DMFX FGH 3 Bright
		Stop
	}
}

//------------------------------------------------------------------------------
actor DemonChunk
{
	Radius 5
	Height 5
	+Missile
	+NoBlockmap
	+DropOff
	+NoTeleport
	+Corpse
	+FloorClip
}

//------------------------------------------------------------------------------
actor Demon1Chunk1 : DemonChunk
{
	states
	{
	Spawn:
		DEMA A 4
		DEMA A 10 A_QueueCorpse
		DEMA A 20
		Wait
	Death:
		DEMA A -1
		Stop
	}
}

//------------------------------------------------------------------------------
actor Demon1Chunk2 : DemonChunk
{
	states
	{
	Spawn:
		DEMB A 4
		DEMB A 10 A_QueueCorpse
		DEMB A 20
		Wait
	Death:
		DEMB A -1
		Stop
	}
}

//------------------------------------------------------------------------------
actor Demon1Chunk3 : DemonChunk
{
	states
	{
	Spawn:
		DEMC A 4
		DEMC A 10 A_QueueCorpse
		DEMC A 20
		Wait
	Death:
		DEMC A -1
		Stop
	}
}

//------------------------------------------------------------------------------
actor Demon1Chunk4 : DemonChunk
{
	states
	{
	Spawn:
		DEMD A 4
		DEMD A 10 A_QueueCorpse
		DEMD A 20
		Wait
	Death:
		DEMD A -1
		Stop
	}
}

//------------------------------------------------------------------------------
actor Demon1Chunk5 : DemonChunk
{
	states
	{
	Spawn:
		DEME A 4
		DEME A 10 A_QueueCorpse
		DEME A 20
		Wait
	Death:
		DEME A -1
		Stop
	}
}

//------------------------------------------------------------------------------
actor Demon2 : Demon1 8080
{
	game Hexen
	Obituary "$ob_demon2"
	states
	{
	Spawn:
		DEM2 AA 10 A_Look
		Loop
	See:
		DEM2 ABCD 4 A_Chase
		Loop
	Melee:
		DEM2 E 6 A_FaceTarget
		DEM2 F 8 A_FaceTarget
		DEM2 G 6 A_CustomMeleeAttack(random(1, 8) * 2)
		Goto See
	Missile:
		DEM2 E 5 A_FaceTarget
		DEM2 F 6 A_FaceTarget
		DEM2 G 5 A_CustomMissile(Demon2FX1, 62, 0)
		Goto See
	Pain:
		DEM2 E 4
		DEM2 E 4 A_Pain
		Goto See
	Death:
		DEM2 HI 6
		DEM2 J 6 A_Scream
		DEM2 K 6 A_NoBlocking
		DEM2 L 6 A_QueueCorpse
		DEM2 MNO 6
		DEM2 P -1
		Stop
	XDeath:
		DEM2 H 6
		DEM2 I 0 A_SpawnItemEx("Demon2Chunk1", 0, 0, 45, random(0, 255) * 0.015625 + 1,
			random(0, 255) * 0.015625 + 1, 8, 90, SXF_TRANSFERTRANSLATION)
		DEM2 I 0 A_SpawnItemEx("Demon2Chunk2", 0, 0, 45, random(0, 255) * 0.015625 + 1,
			random(0, 255) * 0.015625 + 1, 8, 270, SXF_TRANSFERTRANSLATION)
		DEM2 I 0 A_SpawnItemEx("Demon2Chunk3", 0, 0, 45, random(0, 255) * 0.015625 + 1,
			random(0, 255) * 0.015625 + 1, 8, 270, SXF_TRANSFERTRANSLATION)
		DEM2 I 0 A_SpawnItemEx("Demon2Chunk4", 0, 0, 45, random(0, 255) * 0.015625 + 1,
			random(0, 255) * 0.015625 + 1, 8, 270, SXF_TRANSFERTRANSLATION)
		DEM2 I 6 A_SpawnItemEx("Demon2Chunk5", 0, 0, 45, random(0, 255) * 0.015625 + 1,
			random(0, 255) * 0.015625 + 1, 8, 270, SXF_TRANSFERTRANSLATION)
		DEM2 J 6 A_Scream
		DEM2 K 6 A_NoBlocking
		DEM2 L 6 A_QueueCorpse
		DEM2 MNO 6
		DEM2 P -1
		Stop
	}
}

//------------------------------------------------------------------------------
actor Demon2FX1
{
	Radius 10
	Height 6
	Speed 15
	Damage 5
	RenderStyle Add
	DamageType "Fire"
	SeeSound "DemonMissileFire"
	DeathSound "DemonMissileExplode"
	Projectile
	+SpawnSoundSource
	states
	{
	Spawn:
		D2FX ABCDEF 4 Bright
		Loop
	Death:
		D2FX GHIJ 4 Bright
		D2FX KL 3 Bright
		Stop
	}
}

//------------------------------------------------------------------------------
actor Demon2Chunk1 : DemonChunk
{
	states
	{
	Spawn:
		DMBA A 4
		DMBA A 10 A_QueueCorpse
		DMBA A 20
		Wait
	Death:
		DMBA A -1
		Stop
	}
}

//------------------------------------------------------------------------------
actor Demon2Chunk2 : DemonChunk
{
	states
	{
	Spawn:
		DMBB A 4
		DMBB A 10 A_QueueCorpse
		DMBB A 20
		Wait
	Death:
		DMBB A -1
		Stop
	}
}

//------------------------------------------------------------------------------
actor Demon2Chunk3 : DemonChunk
{
	states
	{
	Spawn:
		DMBC A 4
		DMBC A 10 A_QueueCorpse
		DMBC A 20
		Wait
	Death:
		DMBC A -1
		Stop
	}
}

//------------------------------------------------------------------------------
actor Demon2Chunk4 : DemonChunk
{
	states
	{
	Spawn:
		DMBD A 4
		DMBD A 10 A_QueueCorpse
		DMBD A 20
		Wait
	Death:
		DMBD A -1
		Stop
	}
}

//------------------------------------------------------------------------------
actor Demon2Chunk5 : DemonChunk
{
	states
	{
	Spawn:
		DMBE A 4
		DMBE A 10 A_QueueCorpse
		DMBE A 20
		Wait
	Death:
		DMBE A -1
		Stop
	}
}

//------------------------------------------------------------------------------
actor Demon1Mash : Demon1
{
	game Hexen
	SpawnID 100
	RenderStyle Translucent
	Alpha 0.4
	+NoBlood
	+Blasted
	-Telestomp
	+NoIceDeath
	states
	{
	Death:
	XDeath:
	Ice:
		Stop
	}
}

//------------------------------------------------------------------------------
actor Demon2Mash : Demon2
{
	game Hexen
	SpawnID 101
	RenderStyle Translucent
	Alpha 0.4
	+NoBlood
	+Blasted
	-Telestomp
	+NoIceDeath
	states
	{
	Death:
	XDeath:
	Ice:
		Stop
	}
}
