//////////////////////////////
// CHAINGUN GUY				//
//////////////////////////////
ACTOR Chaingundude
{
	SpawnID 2
	Health 70
	Radius 20
	Height 56
	Mass 100
	Speed 8
	PainChance 170
	GibHealth 40
	MONSTER 
	+FLOORCLIP
	SeeSound "CHASIT"
	PainSound "ZCPAIN"
	DeathSound "CHADTH"
	ActiveSound "ZSPACT"
	AttackSound "chainguy/attack"
	Obituary "$OB_CHAINGUY"
	Dropitem "Chaingun"
	States
	{
	Spawn:
		CPOS AB 10 A_Look
	Loop
		
	See:
		CPOS AABBCCDD 3 A_Chase
	Loop
		
	Missile:
		CPOS E 10 A_FaceTarget
		CPOS FE 4 BRIGHT A_CPosAttack
		CPOS F 1 A_CPosRefire
	Goto Missile+1
		
	Pain:
		CPOS G 3
		CPOS G 3 A_Pain
	Goto See
	
	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))
		TNT1 AAA 0 A_CustomMissile("FlyingBlood", 20,  0, random(0, 360), 2, random(0, 90))
		CPOS H 5
		CPOS I 5 A_Scream
		CPOS J 5 A_NoBlocking
		CPOS KLM 5
		CPOS N -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))
		CPOS H 5
		CPOS I 5 A_Scream
		CPOS J 5 A_NoBlocking
		CPOS KLM 5
		CPOS N -1
	Stop
	
	XDeath:
		CPOS I 1
		TNT1 AAA 0 A_CustomMissile("FlyingBlood", 20,  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("FunnyFlyingChaingunguyHead", 100,  0, random(0, 360), 2, random(0, 90))
		TNT1 A 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 AAA 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 AA 0 A_CustomMissile("OrgansFlying", 20,  0, random(0, 500), 2, random(0, 190))
		TNT1 AA 0 A_CustomMissile("TorsoFlying", 20,  0, random(0, 500), 2, random(0, 190))
		TNT1 A 0 A_CustomMissile("GoreChunk2", 20,  0, random(0, 360), 2, random(0, 90))
		TNT1 A 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))
		TNT1 A 0 A_Playsound ("BIGDETH", 1, 128, FALSE)
	Stop
		
	Raise:
		POSS K 5
		POSS JIH 5
	Goto See
	}
}

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