//////////////////////////////
// SHADOWCASTER				//
//////////////////////////////
ACTOR Shadowcaster
{
	Obituary "%o was killed by a Shadowcaster."
	Health 80
	Radius 20
	Height 56
	Mass 100
	Speed 39
	PainChance 200
	SeeSound "SHADSEE"
	AttackSound "chainguy/attack"
	ActiveSound "ZSPACT"
	PainSound "SHADPAIN"
	DeathSound "SHADDETH"
	Decal "BulletChip"
	DropItem "Chaingun"
	MONSTER 
	+SOLID
	+SHOOTABLE
	+FLOORCLIP
	States
{
	Spawn:
		ZHRT AB 10 A_Look
	Loop

	See:
		ZHRT AABBCCDD 4 A_Chase
	Loop

	Missile:
		ZHRT E 0 A_Jump(80, "Rifle")
		ZHRT E 0 A_Jump(80, "Vanish")

	Rifle:
		ZHRT E 10 A_FaceTarget
		ZHRT FE 4 Bright A_CPosAttack
		ZHRT F 1
		ZHRT FE 4 Bright A_CPosAttack
		ZHRT F 1
		ZHRT FE 4 Bright A_CPosAttack
		ZHRT F 1
		ZHRT FE 4 Bright A_CPosAttack
		ZHRT F 1
		ZHRT FE 4 Bright A_CPosAttack
		ZHRT F 1
	Goto See

	FirePBalls:
		ZHRT E 6 A_FaceTarget
		ZHRT F 6 A_CustomMissile("PlasmagunProjectile", 32, 0, random(-16, 16))
		ZHRT F 6 A_CustomMissile("PlasmagunProjectile", 32, 0, random(-16, 16))
		ZHRT F 6 A_CustomMissile("PlasmagunProjectile", 32, 0, random(-16, 16))
		ZHRT F 6 A_CustomMissile("PlasmagunProjectile", 32, 0, random(-16, 16))
		ZHRT F 6 A_CustomMissile("PlasmagunProjectile", 32, 0, random(-16, 16))
		ZHRT F 6 A_CustomMissile("PlasmagunProjectile", 32, 0, random(-16, 16))
		ZHRT F 6 A_CustomMissile("PlasmagunProjectile", 32, 0, random(-16, 16))
		ZHRT F 6 A_CustomMissile("PlasmagunProjectile", 32, 0, random(-16, 16))
		ZHRT F 6 A_CustomMissile("PlasmagunProjectile", 32, 0, random(-16, 16))
	Goto See

	Vanish:
		ZHRT A 0
		ZHRT A 0 
		ZHRT A 0 
		ZHRT A 0 A_PlaySound("dune/active")
		ZHRT A 1 A_SetTranslucent(0.8)
		ZHRT AABBCCDDAABBCCDDAABBCCDDAABBCCDD 4 A_Chase("", "")
		ZHRT A 0 A_PlaySound("dune/active")
		ZHRT D 1 A_SetTranslucent(1.0)
		ZHRT A 0
		ZHRT A 0
		ZHRT A 0
	Goto FirePBalls

	Pain:
		ZHRT G 3
		ZHRT G 3 A_Pain
		ZHRT G 0 A_Jump(128, "Vanish")
	Goto Missile

	Death.SmallBullets:
		TNT1 AAA 0 A_CustomMissile("ThickBloodSlatter", 20,  0, random(0, 500), 2, random(0, 190))
		TNT1 AAA 0 A_CustomMissile("UniversalBloodSlatter", 20,  0, random(0, 500), 2, random(0, 190))
		ZHRT H 5
		ZHRT I 5 A_Scream
		ZHRT J 5 A_NoBlocking
		ZHRT K 5
		ZHRT L -1
	Stop
	
	Death:
		TNT1 AAA 0 A_CustomMissile("FlyingBlood", 20,  0, random(0, 360), 2, random(0, 90))
		TNT1 AAA 0 A_CustomMissile("ThickBloodSlatter", 20,  0, random(0, 500), 2, random(0, 190))
		TNT1 AAA 0 A_CustomMissile("UniversalBloodSlatter", 20,  0, random(0, 500), 2, random(0, 190))
		ZHRT H 5
		ZHRT I 5 A_Scream
		ZHRT J 5 A_NoBlocking
		ZHRT K 5
		ZHRT L -1
	Stop

	XDeath:
		ZHRT I 1 A_NoBlocking
		TNT1 A 0 A_Playsound ("BIGDETH", 1, 128, FALSE)
		TNT1 A 0 A_CustomMissile("FunnyFlyingShadowcasterHead", 100,  0, random(0, 360), 2, random(0, 90))
		TNT1 AA 0 A_CustomMissile("XShadowcasterLegDeath", 100,  0, random(0, 360), 2, random(0, 90))
		TNT1 AAA 0 A_CustomMissile("UniversalBloodSlatter", 20,  0, random(0, 500), 2, random(0, 190))
		TNT1 AAA 0 A_CustomMissile("ThickBloodSlatter", 20,  0, random(0, 500), 2, random(0, 190))
		TNT1 AAA 0 A_CustomMissile("FlyingBlood", 20,  0, random(0, 360), 2, random(0, 90))
		TNT1 AAA 0 A_CustomMissile("ThickBloodSlatter", 20,  0, random(0, 500), 2, random(0, 190))
		TNT1 A 0 A_CustomMissile("GoreChunk1", 20,  0, random(0, 360), 2, random(0, 90))
		TNT1 AA 0 A_CustomMissile("XDeathMonster", 20,  0, random(0, 360), 2, random(0, 90))
		TNT1 A 0 A_CustomMissile("XDeathMonster2", 20,  0, random(0, 360), 2, random(0, 90))
		TNT1 AA 0 A_CustomMissile("IntestinalGutsFlying", 20,  0, random(0, 500), 2, random(0, 190))
		TNT1 AA 0 A_CustomMissile("RibsFlying", 20,  0, random(0, 500), 2, random(0, 190))
		TNT1 A 0 A_CustomMissile("OrgansFlying", 20,  0, random(0, 500), 2, random(0, 190))
		TNT1 A 0 A_CustomMissile("TorsoFlying", 20,  0, random(0, 500), 2, random(0, 190))
		TNT1 AA 0 A_CustomMissile("GoreChunk2", 20,  0, random(0, 360), 2, random(0, 90))
		TNT1 AA 0 A_CustomMissile("GoreChunk1", 20,  0, random(0, 360), 2, random(0, 90))
		TNT1 A 0 A_CustomMissile("GoreChunkSuper", 20,  0, random(0, 360), 2, random(0, 90))
		Stop

	Raise:
		ZHRT KJIH 5
	Goto See
	}
}

///////////////////////////////////////
ACTOR FunnyFlyingShadowcasterHead
{
	Radius 8
	Height 8
	Mass 1
	Speed 24
	BounceType Doom
	+NOBLOCKMAP
	+MISSILE
	+NOTELEPORT
	+BOUNCEONWALLS
	+BOUNCEONCEILINGS
	+SKYEXPLODE
	+MOVEWITHSECTOR
	+CLIENTSIDEONLY
	-DONTSPLASH
	+THRUGHOST
	DamageType Blood
	DeathSound "LILGORE3"
	Decal BloodSuperSplatter
	States
{
	Spawn:
		ZHEA ABCD 2 A_CustomMissile ("FlyingBloodTrail", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 A_CustomMissile("UniversalBloodSlatter", 20,  0, random(0, 500), 2, random(0, 190))
	Loop
	
	Death:
		TNT1 A 0 A_SpawnItem("BloodSpot",0,0,0,1)
		TNT1 A 0 A_CustomMissile("ThickBloodSlatter", 20,  0, random(0, 500), 2, random(0, 190))
		TNT1 AA 0 A_CustomMissile("UniversalBloodSlatter", 20,  0, random(0, 500), 2, random(0, 190))
		ZHEA E -1
	Stop
		
	Splash:
		TNT1 A 0
	Stop
	}
}

///////////////////////////////////////
ACTOR XShadowcasterLegDeath
{
	Radius 8
	Height 8
	Mass 1
	Speed 24
	BounceType Doom
	+NOBLOCKMAP
	+MISSILE
	+NOTELEPORT
	+BOUNCEONWALLS
	+SKYEXPLODE
	+BOUNCEONCEILINGS
	+MOVEWITHSECTOR
	+CLIENTSIDEONLY
	-DONTSPLASH
	+THRUGHOST
	DamageType Blood
	DeathSound "LILGORE5"
	Decal BloodSuperSplatter
	States
{
	Spawn:
		ZHLE ABCD 3 A_CustomMissile ("FlyingBloodTrail", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 A_CustomMissile("UniversalBloodSlatter", 20,  0, random(0, 500), 2, random(0, 190))
	Loop
	
	Death:
		TNT1 A 0 A_SpawnItem("BloodSpot",0,0,0,1)
		TNT1 A 0 A_CustomMissile("ThickBloodSlatter", 20,  0, random(0, 500), 2, random(0, 190))
		TNT1 AA 0 A_CustomMissile("UniversalBloodSlatter", 20,  0, random(0, 500), 2, random(0, 190))
		ZHLE D -1
	Stop
		
	Splash:
		TNT1 A 0
	Stop
	}
}