class Strongman : SquareMonster
{
	Default
	{
		Health 400;
		Radius 31;
		Height 56;
		Mass 400;
		Speed 16;
		FastSpeed 20;

		PainChance 24;
		ReactionTime 128;
		MeleeRange 80;
		Gravity 0.4;

		MaxTargetRange 1024;

		Damage 8; // Punch
		+STRIFEDAMAGE;
		+DONTBLAST;
		+QUICKTORETALIATE;
		+MISSILEMORE;

		BloodColor "ff 80 00";
		Obituary "$OB_STRONGMAN";

		SeeSound "strongman/sight";
		PainSound "strongman/pain";
		DeathSound "strongman/death";
	}
	States
	{
	Spawn:
		STRN A 10 A_Look();
		Loop;
	See:
		STRN BBCCDDEE 2 A_Chase();
		Loop;
	Melee:
		STRN F 0 A_FaceTarget();
		STRN F 5;
		STRN G 0 A_FaceTarget();
		STRN G 0 A_JumpIfCloser(96, "MeleeLaunch");
		STRN G 15;
		Goto See;
	MeleeLaunch:
		STRN G 0 A_Jump (128, "MeleeLaunchAlt");
		STRN G 0 A_PlaySound("strongman/ready", CHAN_VOICE);
		STRN G 0 A_Blast(BF_DONTWARN | BF_NOIMPACTDAMAGE, 255, 96, 20);
		STRN G 15 A_VileAttack("blank", 0, 0, 0, 1.0);
		STRN G 0 ThrustThingZ(0, 8, 0, 1);
		STRN G 0 A_SpawnItemEx("StrongmanDashDust", -20);
		Goto DashPunch;
	MeleeLaunchAlt:
		STRN G 0 A_PlaySound("strongman/toss", CHAN_VOICE);
		STRN G 15 A_VileAttack("blank", 0, 0, 0, 2.25);
		Goto See;
	Missile:
		STRN H 0 A_JumpIfCloser(320, "DashPunch");
		// Fall through
	GrappleHook:
		STRN L 0 A_PlaySound("strongman/grapple", CHAN_VOICE);
		STRN J 0 A_PlaySound("strongman/grapple/whirl", CHAN_ITEM);
		STRN J 0 A_FaceTarget();
		STRN JKJKJKJK 1;
		STRN J 0 A_FaceTarget();
		STRN JKJKJKJK 1;
		STRN L 0 A_FaceTarget();
		STRN JKJK 1;
		STRN L 0 A_StopSound(CHAN_ITEM);
		STRN L 0 A_FaceTarget();
		STRN L 16 A_SpawnProjectile("StrongmanGrappleHook", 28);
		Goto See;
	DashPunch:
		STRN F 0 { self.bNoPain = true; }
		STRN HH 5 A_FaceTarget();
		STRN I 0 A_PlaySound("strongman/charge", CHAN_VOICE);
		STRN I 0 A_Recoil(-40);
		STRN I 0 A_JumpIfCloser(80, "BlastPunch");
		STRN I 4 A_SpawnItemEx("StrongmanDashDust", -20);
		STRN I 0 A_JumpIfCloser(80, "BlastPunch");
		STRN I 4 A_SpawnItemEx("StrongmanDashDust", -20);
		STRN I 0 A_JumpIfCloser(80, "BlastPunch");
		STRN I 4 A_SpawnItemEx("StrongmanDashDust", -20);
		STRN I 0 A_JumpIfCloser(80, "BlastPunch");
		STRN I 4 A_SpawnItemEx("StrongmanDashDust", -20);
		STRN I 0 A_JumpIfCloser(80, "BlastPunch");
		STRN I 4 A_SpawnItemEx("StrongmanDashDust", -20);
		STRN I 0 A_JumpIfCloser(80, "BlastPunch");
		STRN I 0 { self.bNoPain = false; }
		STRN I 0 A_Stop();
		Goto See;
	BlastPunch:
		STRN I 0 A_CustomMeleeAttack(random(20, 40), "strongman/punch");
		STRN I 0 A_Blast(BF_DONTWARN | BF_NOIMPACTDAMAGE, 255, 128, 30);
		STRN I 0 { self.bNoPain = false; }
		STRN I 0 A_Stop();
		Goto See;
	Pain:
		STRN M 0 A_StopSound(CHAN_ITEM);
		STRN M 3 A_Stop();
		STRN M 3 A_Pain();
		STRN M 0 A_CheckSight("See");
		STRN H 0 A_Jump(128, "Missile");
		Goto See;
	Death:
		STRN M 0 A_Stop();
		STRN M 0 A_StopSound(CHAN_ITEM);
		STRN M 0 A_NoBlocking();
		STRN M 0 A_SpawnItem("GibSpawnerStrongman", 0, 16);
		STRN MM 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);
		STRN M 10 A_Scream();
		LEGS B 8;
		Stop;
	}
}

class StrongmanDashDust : SmokePuff
{
	Default
	{
		Scale 0.4;
	}
}
