
class Beretta : DoomWeapon
{
 	Default
	{
		Weapon.SelectionOrder 26;
		Weapon.AmmoUse 1;
		Weapon.AmmoGive 20;
		Weapon.SlotNumber 2;
		Weapon.AmmoType "Clip";
		Obituary "$OB_MPPISTOL";
		+WEAPON.WIMPY_WEAPON;
		+WEAPON.NOALERT
		Inventory.Pickupmessage "$PICKUP_PISTOL_DROPPED";
		Tag "$TAGPISTOL";
	}
	States
	{
	Ready:
		BERT A 1 A_WeaponReady;
		Loop;
	Deselect:
		BERT A 1 A_Lower;
		Loop;
	Select:
		BERT A 1 A_Raise;
		Loop;
	Fire:
		BERT A 2;
		BERT B 2 A_FireBullets (5.6, 0, 1, 5, "BulletPuff");
		BERT C 2 A_PlaySound("weapons/pistol", CHAN_WEAPON);
		BERT C 2 A_GunFlash;
		Goto Ready;
 	Spawn:
		PIST A -1;
		Stop;
	}
}
class AK47 : DoomWeapon
{
 	Default
	{
		Weapon.SelectionOrder 28;
		Weapon.AmmoUse 1;
		Weapon.AmmoGive 120;
		Weapon.SlotNumber 4;
		Weapon.AmmoType "Cell";
		Obituary "$OB_MPPISTOL";
		Inventory.Pickupmessage "picked up AK74SU";
		Tag "AK47";
	}
	States
	{
	Ready:
		AKSU A 1 A_WeaponReady;
		Loop;
	Deselect:
		AKSU A 1 A_Lower;
		Loop;
	Select:
		AKSU A 1 A_Raise;
		Loop;
	Fire:
		AKSU A 1;
		AKSU B 1 A_FireBullets (5.6, 0, 1, 10, "BulletPuff");
		AKSU B 1 A_PlaySound("weapons/ak", CHAN_WEAPON);
		AKSU A 1 A_GunFlash;
		Goto Ready;
 	Spawn:
		AKIC A -1;
		Stop;
	}
}

class NewFist : Fist replaces FWeapFist
{
    Default
    {
		Weapon.SelectionOrder 3700;
		Weapon.Kickback 100;
		Obituary "$OB_MPFIST";
		Tag "$TAG_FIST";
		+WEAPON.WIMPY_WEAPON
		+WEAPON.MELEEWEAPON
		+WEAPON.NOAUTOSWITCHTO
    }

    States
    {
	Ready:
		TNT1 A 1 A_WeaponReady;
		Loop;
    Fire:
        PUNH A 4;
        PUNH B 3
        {
            FTranslatedLineTarget t;
            double ang = angle + Random2() * (5.625 / 256);
	
            double pitch = AimLineAttack(ang, 64, null, 0., ALF_CHECK3D);
            LineAttack(ang, 64, pitch, 3, 'Melee', "BulletPuff", LAF_ISMELEEATTACK, t);

            // Turn to face the hit actor.
            if (t.linetarget)
            {
                angle = t.angleFromSource;
            }
        }
        PUNH C 4 A_PlaySound("punch2/attack");
        PUNH D 4 A_ReFire;
        Goto Ready;
    }
}

