CLASS darkzombie : zombieman
{ 
	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);
		}

	default
		{
		painchance 140;
		Speed 9;
		+MissileMore;
		OBITUARY "%o was killed by A Zombie Marine!";
		}
		
    states
    {
    Spawn:
        UDM2 AB 10 A_Look;
        Loop;
    See:
        UDM2 AABBCCDD 3 A_Chase;
        Loop;
    Missile:
	    TNT1 A 0 A_Jump(70,"SpecialAttack") ;
        UDM2 E 12 A_FaceTarget;
        UDM2 F 6 BRIGHT A_CustomBulletAttack(7, 3, 1, 6, "Bulletpuff");
        UDM2 E 6 A_FaceTarget;
        Goto See;
	SpecialAttack:
	    UDM2 E 12 A_FaceTarget;
		UDM2 F random(3,6) Bright A_CustomBulletAttack(7, 3, 1, 6, "Bulletpuff");
		UDM2 E 4 A_FaceTarget;
		UDM2 F random(3,7) Bright A_CustomBulletAttack(11, 5, 1, 6, "Bulletpuff");
		UDM2 E 4 A_FaceTarget;
		UDM2 F random(3,5) Bright A_CustomBulletAttack(11, 5, 1, 6, "Bulletpuff");
		UDM2 E 6;
		Goto See;
    Pain:
        UDM2 G 5;
        UDM2 G 3 A_Pain;
        Goto See;
	Death.SSG:
		TNT1 A 0 A_JumpIfCloser(128, "XDeath");
		goto death;
    Death:
        UDM2 H 5;
        UDM2 I 5 A_Scream;
        UDM2 J 5 A_Fall;
        UDM2 KL 5;
        UDM2 L -1;
        Stop;	
    xDeath:
		POSS M 5;
		TNT1 a 0 a_spawnitemex("gibcontroller");
		POSS N 5 A_XScream;
		POSS O 5 A_NoBlocking;
		POSS PQRST 5;
		POSS U -1;
		Stop;
    Raise:
        UDM2 LKJIH 5;
        Goto See;
    }
}