class CircleJerkBase : SquareMonster
{
	Default
	{
		BloodColor "00 00 ff";
		SeeSound "circlejerk/see";
		PainSound "circlejerk/pain";
		DeathSound "circlejerk/death";
	}
}

class KnifeJerk : CircleJerkBase
{
	Default
	{
		Health 50;
		Obituary "$OB_CIRCLEJERK";
		Speed 10;
		FastSpeed 16;
		PainChance 160;
		SeeSound "circlejerk/knife/see";
		PainSound "circlejerk/knife/pain";
		DeathSound "circlejerk/knife/death";
	}
	States
	{
	Spawn:
		CIRJ A 5 A_Look();
		Loop;
	See:
		CIRJ ABCD 2 A_Chase();
		Loop;
	Melee:
		CIRJ E 0 A_FaceTarget();
		CIRJ E 10 A_PlaySound("circlejerk/swing");
		CIRJ F 10 A_CustomMeleeAttack(random(2,8)*4, "circlejerk/melee", "none");
		Goto See;
	Pain:
		CIRJ G 5;
		CIRJ G 5 A_Pain();
		Goto See;
	Death:
		CIRJ G 2 A_Scream();
		CIRJ G 2 A_SpawnItem("GibSpawnerCircleJerk");
		CIRJ GG 0 A_SpawnItemEx("GibEye", random[SquareGibRandom](-32,32), random[SquareGibRandom](-4,4), random[SquareGibRandom](4,12), random[SquareGibRandom](-4,4), random[SquareGibRandom](-4,4), random[SquareGibRandom](0,8), 0);
		LEGS A 18 A_NoBlocking();
		Stop;
	}
}

class PaintJerk : CircleJerkBase
{
	Default
	{
		Health 70;
		Obituary "$OB_PAINTJERK";
		Speed 10;
		FastSpeed 18;
		DropItem 'AmmoCase';
		PainChance 160;
		SeeSound "circlejerk/paint/see";
		PainSound "circlejerk/paint/pain";
		DeathSound "circlejerk/paint/death";
	}
	States
	{
	Spawn:
		CIRG A 5 A_Look();
		Loop;
	See:
		CIRG ABCD 3 A_Chase();
		Loop;
	Missile:
		CIRG E 10 A_FaceTarget();
		CIRG F 4 Bright A_SpawnProjectile("PaintJerkBall", 24);
		Goto See;
	Pain:
		CIRG G 5;
		CIRG G 5 A_Pain();
		Goto See;
	Death:
		CIRG G 2 A_Scream();
		CIRG G 2 A_SpawnItem("GibSpawnerCircleJerk");
		CIRG GG 0 A_SpawnItemEx("GibEye", random[SquareGibRandom](-32,32), random[SquareGibRandom](-4,4), random[SquareGibRandom](4,12), random[SquareGibRandom](-4,4), random[SquareGibRandom](-4,4), random[SquareGibRandom](0,8), 0);
		LEGS A 0 A_Stop();
		LEGS A 18 A_NoBlocking();
		Stop;
	}
}

class CannonJerk : CircleJerkBase
{
	Default
	{
		Health 90;
		Height 56;
		Obituary "$OB_CANNONJERK";
		Speed 8;
		FastSpeed 16;
		PainChance 160;
		SeeSound "circlejerk/cannon/see";
		PainSound "circlejerk/cannon/pain";
		DeathSound "circlejerk/cannon/death";
	}
	States
	{
	Spawn:
		CIRC A 5 A_Look();
		Loop;
	See:
		CIRC ABCD 3 A_Chase();
		Loop;
	Missile:
		CIRC E 10 A_FaceTarget();
	MissileLoop:
		CIRC F 4 Bright A_SpawnProjectile("CannonBall", 24);
		CIRC G 20;
		CIRC E 5 A_MonsterRefire(30, "See");
		Loop;
	Pain:
		CIRC H 5;
		CIRC H 5 A_Pain();
		Goto See;
	Death:
		CIRC H 2 A_Scream();
		CIRC H 2 A_SpawnItem("GibSpawnerCircleJerk");
		CIRC H 0 A_SpawnItemEx("GibHardHat", random[SquareGibRandom](-32,32), random[SquareGibRandom](-4,4), random[SquareGibRandom](4,12), random[SquareGibRandom](-4,4), random[SquareGibRandom](-4,4), random[SquareGibRandom](0,8), 0);
		CIRC HH 0 A_SpawnItemEx("GibEye", random[SquareGibRandom](-32,32), random[SquareGibRandom](-4,4), random[SquareGibRandom](4,12), random[SquareGibRandom](-4,4), random[SquareGibRandom](-4,4), random[SquareGibRandom](0,8), 0);
		LEGS A 0 A_Stop();
		LEGS A 18 A_NoBlocking();
		Stop;
	}
}

class OoziJerk : CircleJerkBase
{
	Default
	{
		Health 70;
		Height 56;
		Obituary "$OB_OOZIJERK";
		Speed 7;
		FastSpeed 16;
		DropItem 'AmmoCase';
		PainChance 160;
		AttackSound "weapons/oozi";
		SeeSound "circlejerk/oozi/see";
		PainSound "circlejerk/oozi/pain";
		DeathSound "circlejerk/oozi/death";
		+NOTARGET;
	}
	States
	{
	Spawn:
		CIRO A 5 A_Look();
		Loop;
	See:
		CIRO ABCD 2 A_Chase();
		Loop;
	Missile:
		CIRO E 0 A_PlaySound("circlejerk/oozi/attack", CHAN_ITEM);
		CIRO EEEE 5 A_FaceTarget();
	MissileLoop:
		CIRO G 2 Bright A_CustomBulletAttack(8, 2, 1, 3, "CircleJerkOozePuff");
		CIRO F 2 Bright A_FaceTarget();
		CIRO G 2 Bright A_CustomBulletAttack(8, 2, 1, 3, "CircleJerkOozePuff");
		CIRO F 2 Bright A_FaceTarget();
		CIRO G 2 Bright A_CustomBulletAttack(8, 2, 1, 3, "CircleJerkOozePuff");
		CIRO F 2 Bright A_FaceTarget();
		CIRO G 2 Bright A_CustomBulletAttack(8, 2, 1, 3, "CircleJerkOozePuff");
		CIRO F 2 Bright A_FaceTarget();
		CIRO E 5 A_SentinelRefire();
		Loop;
	Pain:
		CIRO H 5;
		CIRO H 5 A_Pain();
		Goto See;
	Death:
		CIRO H 2 A_Scream();
		CIRO H 2 A_SpawnItem("GibSpawnerCircleJerk");
		CIRO HH 0 A_SpawnItemEx("GibEye", random[SquareGibRandom](-32,32), random[SquareGibRandom](-4,4), random[SquareGibRandom](4,12), random[SquareGibRandom](-4,4), random[SquareGibRandom](-4,4), random[SquareGibRandom](0,8), 0);
		LEGS A 0 A_Stop();
		LEGS A 18 A_NoBlocking();
		Stop;
	}
}

class EliteOoziJerk : CircleJerkBase
{
	Default
	{
		Health 140;
		Height 56;
		Obituary "$OB_ELITEOOZIJERK";
		Speed 7;
		FastSpeed 16;
		DropItem 'AmmoCase';
		PainChance 160;
		AttackSound "weapons/oozi";
		SeeSound "circlejerk/oozi/see";
		PainSound "circlejerk/oozi/pain";
		DeathSound "circlejerk/oozi/death";
		+NOTARGET;
	}
	States
	{
	Spawn:
		CRO2 A 5 A_Look();
		Loop;
	See:
		CRO2 ABCD 2 A_Chase();
		Loop;
	Missile:
		CRO2 E 0 A_PlaySound("circlejerk/oozi/attack", CHAN_ITEM);
		CRO2 EEEE 5 A_FaceTarget();
	MissileLoop:
		CRO2 G 2 Bright A_CustomBulletAttack(8, 2, 2, 3, "CircleJerkOozePuff");
		CRO2 F 2 Bright A_FaceTarget();
		CRO2 G 2 Bright A_CustomBulletAttack(8, 2, 2, 3, "CircleJerkOozePuff");
		CRO2 F 2 Bright A_FaceTarget();
		CRO2 G 2 Bright A_CustomBulletAttack(8, 2, 2, 3, "CircleJerkOozePuff");
		CRO2 F 2 Bright A_FaceTarget();
		CRO2 G 2 Bright A_CustomBulletAttack(8, 2, 2, 3, "CircleJerkOozePuff");
		CRO2 F 2 Bright A_FaceTarget();
		CRO2 E 5 A_SentinelRefire();
		Loop;
	Pain:
		CRO2 H 5;
		CRO2 H 5 A_Pain();
		Goto See;
	Death:
		CRO2 H 2 A_Scream();
		CRO2 H 2 A_SpawnItem("GibSpawnerCircleJerk");
		CRO2 HH 0 A_SpawnItemEx("GibEye", random[SquareGibRandom](-32,32), random[SquareGibRandom](-4,4), random[SquareGibRandom](4,12), random[SquareGibRandom](-4,4), random[SquareGibRandom](-4,4), random[SquareGibRandom](0,8), 0);
		LEGS A 0 A_JumpIf(args[0] == 1, "DeathItem1");
		LEGS A 0 A_JumpIf(args[0] == 2, "DeathItem2");
		LEGS A 0 A_JumpIf(args[0] == 3, "DeathItem3");
		Goto DeathEnd;
	DeathEnd:
		LEGS A 0 A_Stop();
		LEGS A 18 A_NoBlocking();
		Stop;
	}
}

class CircleJerkOozePuff : SquareActor
{
	Default
	{
		+CLIENTSIDEONLY;
		+NOGRAVITY;
		+NOBLOCKMAP;
		+NOCLIP;
		+PUFFONACTORS;
		Decal 'PaintSplat_Green';
		Translation "192:207=112:127";
	}
	States
	{
	Spawn:
	Frames:
		TNT1 A 0;
		TNT1 A 0 A_PlaySound("weapons/painthit");
		BLOB A 1;
		BLOB BCDEFG 2;
		Stop;
	}
}
