class GoreChainguy:chaingunguy replaces chaingunguy
{

	default
	{
	Dropitem "ChainDummy";
	}

	override int DamageMobj(
    Actor inflictor, Actor source, int damage,
    Name mod, int flags = 0, double angle = 0)
	
	{
    if(inflictor is "XtremePlasmaBall")source.A_PlaySound("gore/sizzle",CHAN_AUTO,attenuation:0.8);
    else
	if(inflictor is "XtremeRocket")source.A_PlaySound("gore/snap",CHAN_AUTO,attenuation:0.8);
	else
	if(source is "PlayerPawn")source.A_PlaySound("gore/hitmarker",CHAN_AUTO,attenuation:0.8);

	return super.damagemobj
	(inflictor,source,damage,
    mod,flags,angle);
	}
		
	States
		{
		Spawn:
			TNT1 a 0;
			TNT1 a 0 a_giveinventory("scream",1);
			CPOS ab 10 a_look;
			goto spawn+2;
			
		See:
			TNT1 a 0 a_jumpifinventory("scream",1,"ScreamSee");		
			CPOS AABBCCDD 3 A_Chase;
			Loop;
			
		ScreamSee:
			CPOC AABBCCDD 3 A_chase;
			TNT1 a 0 a_takeinventory("scream",1);
			goto see;
			
		Death.SSG:
			TNT1 A 0 A_JumpIfCloser(128, "XDeath");
			goto death;
		Death:
			TNT1 a 0 a_spawnitemex("DeathController");
			TNT1 a 0 a_jump(100,"death2");
				
			CPOS H 5;
			CPOS I 5 A_Scream;
			CPOS J 5 A_NoBlocking;
			CPOS KLM 5;
			CPOS N -1;
			Stop;
			
		Death2:
			CGDE A 5;
			CGDE B 5 A_Scream;
			CGDE C 5 A_NoBlocking;
			CGDE DEF 5;
			CGDE G -1;
			stop;
			
		XDeath:
			CPOS O 5; 
				TNT1 a 0 a_spawnitemex("gibcontroller");
			CPOS P 5 A_XScream;
			CPOS Q 5 A_NoBlocking;
			CPOS RS 5;
			CPOS T -1;
			Stop;
			
		Death.Massacre:
			CPOS O 5; 
			CPOS P 5 A_XScream;
			CPOS Q 5 A_NoBlocking;
			CPOS RS 5;
			CPOS T -1;
			Stop;
		}
} 