//===========================================================================
//
// Cacodemon
//
//===========================================================================
ACTOR Cacodemon1 Replaces Cacodemon
{
	Game Doom
	SpawnID 19
	Health 400
	Radius 31
	Height 56
	Mass 400
	Speed 8
	PainChance 128
	Monster
	+FLOAT +NOGRAVITY
	SeeSound "caco/sight"
	PainSound "caco/pain"
	DeathSound "caco/death"
	ActiveSound "caco/active"
	Obituary "$OB_CACO"
	HitObituary "$OB_CACOHIT"
	Bloodtype "BlueBlood"
	BloodColor "DarkBlue"
	States
	{
	Spawn:
		HEAD A 10 A_Look
		Loop
	See:
		HEAD A 3 A_Chase
		Loop
	Missile:
		HEAD B 5 A_FaceTarget
		HEAD C 5 A_FaceTarget
		HEAD D 5 BRIGHT A_HeadAttack
		Goto See
	Pain:
		HEAD E 3
		HEAD E 3 A_Pain
		HEAD F 6
		Goto See
	Death2:
		TNT1 A 0
		TNT1 A 0 A_Jump(160, "XDeath")
		HEAD G 8 A_NoBlocking
		TNT1 A 0 A_CustomMissile("CeilingBloodCheckerBlue", 50,  0, random(0, 360), 2, random(60, 90))
		TNT1 A 0 A_CustomMissile("XDeath1bBlue", 30,  0, random(0, 360), 2, random(10, 45))
		HEAD H 6 A_Scream
		HEAD I 6
		HEAD J 6
		HEAD K 6
		HEAD LLL 6 A_SetScale(scalex+0.03, scaley-0.1)
		TNT1 A 0 A_CustomMissile("XDeath1Blue", 20,  0, random(0, 360), 2, random(10, 45))
		HEAD L -1 A_SetFloorClip
		Stop

	Death:
		CCD2 A  0
		TNT1 AA 0 A_CustomMissile("XDeath1bblue", 40,  0, random(0, 360), 2, random(45, 50))
		TNT1 AA 0 A_CustomMissile("XDeath2blue", 30,  0, random(0, 360), 2, random(45, 50))
		TNT1 AA 0 A_CustomMissile("XDeath3blue", 30,  0, random(0, 360), 2, random(45, 50))
		TNT1 A 0 A_CustomMissile("XDeath2bblue", 30,  0, random(0, 360), 2, random(45, 50))
		TNT1 A 0 A_CustomMissile("XDeath3bblue", 30,  0, random(0, 360), 2, random(45, 50))
		TNT1 AAAAAAAAA 0 A_CustomMissile("FlyingBloodParticleBigblue", 50,  0, random(0, 360), 2, random(10, 45))
		CCD2 A  0 A_Scream
		CCD2 A  0
		CCD2 A  0 A_NoBlocking
		CCD2 ABCDEFG 4
		TNT1 A 0 A_CustomMissile("XDeath1Blue", 20,  0, random(0, 360), 2, random(10, 45))
		CCD2 H -1 A_SetFloorClip   
		Stop

	Death.Plasma:
		CCD2 A  0
		TNT1 AA 0 A_CustomMissile("XDeath1bblue", 40,  0, random(0, 360), 2, random(45, 50))
		TNT1 AA 0 A_CustomMissile("XDeath2blue", 30,  0, random(0, 360), 2, random(45, 50))
		TNT1 AA 0 A_CustomMissile("XDeath3blue", 30,  0, random(0, 360), 2, random(45, 50))
		TNT1 A 0 A_CustomMissile("XDeath2bblue", 30,  0, random(0, 360), 2, random(45, 50))
		TNT1 A 0 A_CustomMissile("XDeath3bblue", 30,  0, random(0, 360), 2, random(45, 50))
		TNT1 AAAAAAAAA 0 A_CustomMissile("FlyingBloodParticleBigblue", 50,  0, random(0, 360), 2, random(10, 45))
		CCD3 A  0 A_Scream
		CCD3 A  0
		CCD3 A  0 A_NoBlocking
		CCD3 ABCDEFG 4
		TNT1 A 0 A_SpawnItem("SmokePillar")
		TNT1 A 0 A_CustomMissile("XDeath1Blue", 20,  0, random(0, 360), 2, random(10, 45))
		CCD3 H -1 A_SetFloorClip   
		Stop

	Raise:
		HEAD L 8 A_UnSetFloorClip
		HEAD KJIHG 8
		Goto See
	Crush:
		TNT1 AAAAAAAAAA 0 A_CustomMissile("FlyingBloodParticleCrushedBlue", 0,  0, random(0, 360), 2, random(0, 90))
		TNT1 AA 0 A_CustomMissile("XDeath2Blue", 50,  0, random(0, 360), 2, random(10, 45))
		TNT1 AA 0 A_CustomMissile("XDeath3Blue", 50,  0, random(0, 360), 2, random(10, 45))
		CRSH E 1
		CRSH E -1
		Stop
	}
}

//===========================================================================
//
// Cacodemon plasma ball
//
//===========================================================================
ACTOR CacodemonBall1 Replaces CacodemonBall
{
	Game Doom
	SpawnID 126
	Radius 2
	Height 2
	Speed 10
	FastSpeed 20
	Damage (random (28, 32))
	Projectile 
	+RANDOMIZE
	Alpha 1
	SeeSound "caco/attack"
	DeathSound "caco/shotx"
	States
	{
	Spawn:
		BAL2 AB 4 BRIGHT
		Loop
	Death:
		BAL2 CDE 6 BRIGHT
		Stop
	}
}
