class GoreCaco:cacodemon replaces cacodemon
{

	default
	{
	Bloodcolor "blue";
	BloodType "bluesprayblood";
	}
	
	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:1.0);
	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
	{
	Death.SSG:
		TNT1 A 0 A_JumpIfCloser(128, "XDeath");
		goto death;
	death:
		TNT1 a 0 A_JumpIfHealthLower(-30,"Xdeath");
		TNT1 a 0 a_spawnitemex("DeathController");
	
		HEAD G 8;
		HEAD H 8 a_scream;
		HEAD IJ 8;
		HEAD K 8 a_noblocking;
		HEAD L -1 a_setfloorclip;
	Xdeath:
		TNT1 a 0 a_spawnitemex("CacoGibController");
		
		CACX A 6;
		CACX B 6 a_xscream;
		CACX C 6 a_noblocking;
		CACX D 6;
		CACX EF 6;
		CACX G -1;
		stop;
	}
} 