class ModWeapon : Weapon {
	Default {
	+WEAPON.AMMO_OPTIONAL
	+WEAPON.NOALERT
	Weapon.BobStyle "Smooth";
	Weapon.BobSpeed 1.5;
	Weapon.BobRangeX 0.30;
	Weapon.BobRangeY 0.40;
	}
	States
	{
	ActualPunch:
		TNT1 A 0 A_JumpIfInventory("PowerStrength", 1, "BerserkPunch");
		TNT1 A 0 A_StartSound("weapons/foley", CHAN_AUTO);
		PUN3 A 1 A_SetPitch(pitch+0.1);
		PUN3 B 1 A_SetPitch(pitch+0.7);
		PUN3 D 1 A_SetPitch(pitch+0.5);
		TNT1 A 0 A_FireProjectile("FistAttack",0,0,0,0);
		PUN3 E 1 A_SetPitch(pitch+0.5);
		PUN3 G 1 A_SetPitch(pitch+0.2);
		PUN3 H 1 A_SetPitch(pitch-0.5);
		PUN3 I 1 A_SetPitch(pitch-0.5);
		PUN3 J 1 A_SetPitch(pitch-0.25);
		PUN3 K 1 A_SetPitch(pitch-0.25);
		PUN3 L 1 A_SetPitch(pitch-0.25);
		TNT1 A 1 A_SetPitch(pitch-0.125);
		TNT1 A 1 A_SetPitch(pitch-0.125);
		TNT1 A 1 A_TakeInventory("Punching", 1);
		TNT1 A 0 A_Jump(256, "PunchDone");
	BerserkPunch:
		TNT1 A 0 A_StartSound("bsrkswing", CHAN_AUTO);
		TNT1 A 0 A_StartSound("weapons/foley", CHAN_AUTO);
		TNT1 A 0 A_JumpIf(GetCvar("led_ZoomEffects")==0, 2);
		TNT1 A 0 A_ZoomFactor(1.04, ZOOM_INSTANT);
		PUN3 A 1 A_SetPitch(pitch+0.2);
		TNT1 A 0 A_JumpIf(GetCvar("led_ZoomEffects")==0, 2);
		TNT1 A 0 A_ZoomFactor(1.03);
		PUN3 B 1 A_SetPitch(pitch+0.9);
		TNT1 A 0 A_JumpIf(GetCvar("led_ZoomEffects")==0, 2);
		TNT1 A 0 A_ZoomFactor(1.02);
		PUN3 D 1 A_SetPitch(pitch+0.7);
		TNT1 A 0 A_JumpIf(GetCvar("led_ZoomEffects")==0, 2);
		TNT1 A 0 A_ZoomFactor(1.01);
		TNT1 A 0 A_FireProjectile("BerserkFistAttack",0,0,-2,7);
		PUN3 E 1 A_SetPitch(pitch+0.7);
		TNT1 A 0 A_JumpIf(GetCvar("led_ZoomEffects")==0, 2);
		TNT1 A 0 A_ZoomFactor(1.00);
		PUN3 G 1 A_SetPitch(pitch+0.4);
		PUN3 H 1 A_SetPitch(pitch-0.8);
		PUN3 I 1 A_SetPitch(pitch-0.8);
		PUN3 J 1 A_SetPitch(pitch-0.35);
		PUN3 K 1 A_SetPitch(pitch-0.35);
		PUN3 L 1 A_SetPitch(pitch-0.35);
		TNT1 A 1 A_SetPitch(pitch-0.125);
		TNT1 A 1 A_SetPitch(pitch-0.125);
		TNT1 A 1 A_TakeInventory("Punching", 1);
		TNT1 A 0 A_Jump(256, "PunchDone");
	}
	action void A_LedPunch()
	{
		if(CountInv("PowerStrength") == 1)
		{
		A_CustomPunch(40, 0, 0, "BerserkPuff");
		}
		else
		{
		A_CustomPunch(4, 0, 0, "FistPuff");
		}
	}
	action void A_FireLedPistol()
	{
		A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE);
		A_GunFlash(); 
		A_StartSound("weapons/pistol/fire", CHAN_WEAPON); 
		A_FireBullets(2.25, 1.5, -1, 7, "BulletPuff", 0); 
		A_AlertMonsters();
	}
	action void A_BurstLedPistol()
	{
		A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE);
		A_GunFlash();
		A_StartSound("weapons/pistol/fire", CHAN_WEAPON);
		A_FireBullets(3.5, 2.75, -1, 7, "BulletPuff", 0);
		A_AlertMonsters();
	}
	action void A_FireLedRifle()
	{
		A_GunFlash();
		A_StartSound("weapons/rifle/fire", CHAN_WEAPON);
		A_FireBullets(2, 2, -1, 7, "BulletPuff", 1);
		A_AlertMonsters();
	}
	action void A_FireLedADSRifle()
	{
		A_StartSound("weapons/rifle/aimfire", CHAN_WEAPON);
		A_FireBullets(1, 1, -1, 7, "BulletPuff", 1);
		A_AlertMonsters();
		A_SetAngle(angle + frandom(-0.25, 0.25));
	}
	action void A_FireLedShotgun()
	{
		if(GetCvar("led_ShotPump") == 0)
		{
			A_GunFlash();
			A_StartSound("weapons/riotgun/fire", CHAN_WEAPON);
			A_FireBullets(4, 4, 7, 6, "BulletPuff", 1);
			A_AlertMonsters();
		}
		else
		{
			A_GunFlash();
			A_StartSound("weapons/riotgun/fire", CHAN_WEAPON);
			A_FireBullets(4, 4, 7, 7, "BulletPuff", 1);
			A_AlertMonsters();
		}
	}
	action void A_FireLedADSShotgun()
	{
		if(GetCvar("led_ShotPump") == 0)
		{
			A_GunFlash("AltFlash");
			A_AlertMonsters();
			A_StartSound("weapons/riotgun/aimfire", CHAN_WEAPON);
			A_FireBullets(2, 2, 7, 6, "BulletPuff", 1);
		}
		else
		{
			A_GunFlash("AltFlash");
			A_AlertMonsters();
			A_StartSound("weapons/riotgun/aimfire", CHAN_WEAPON);
			A_FireBullets(2, 2, 7, 7, "BulletPuff", 1);
		}
	}
	action void A_FireLedSSG()
	{
		A_TakeInventory("DBSGMag", 2);
		A_GunFlash("Flash");
		A_StartSound("weapons/kapow", CHAN_WEAPON);
		A_FireBullets(11, 8, 20, 6, "BulletPuff", 0);
		A_AlertMonsters();
		Radius_Quake(2, 2, 0, 1, 0);
		A_Recoil(0.35);
	}
	action void A_FireLedSSGLeft()
	{
		A_TakeInventory("DBSGMag", 1);
		A_GunFlash("LeftFlash");
		A_StartSound("weapons/dbsg/sfir", CHAN_WEAPON);
		A_FireBullets(6, 5, 9, 6, "BulletPuff", 0);
		A_AlertMonsters();
	}
	action void A_FireLedSSGRight()
	{
		A_TakeInventory("DBSGMag", 1);
		A_GunFlash("RightFlash");
		A_StartSound("weapons/dbsg/sfir", CHAN_WEAPON);
		A_FireBullets(6, 5, 9, 6, "BulletPuff", 0);
		A_AlertMonsters();
	}
	action void A_FireLedMinigun()
	{
		A_GunFlash();
		A_StartSound("weapons/minig/spin",6);
		A_FireBullets(5, 5, 1, 5, "BulletPuff");
		A_AlertMonsters();
	}
	action void A_FireLedRL()
	{
		A_TakeInventory("RocketMag", 1, TIF_NOTAKEINFINITE);
		A_GunFlash();
		A_StartSound("weapons/rocket/fire", CHAN_WEAPON);
		A_FireProjectile("Rocket2", 0, 0, 0, 7);
		A_AlertMonsters();
	}
	action void A_FireLedPLRifle()
	{
		A_TakeInventory("PlasmaMag", 1, TIF_NOTAKEINFINITE);
		A_GunFlash();
		A_StartSound("weapons/prifle/fire", CHAN_WEAPON);
		A_FireProjectile("Plasma", 0, 0, 0, 6, 0, 0);
		A_AlertMonsters();
	}
	action void A_LedPLAltFire()
	{
		if(GetCvar("led_PlasmaAlt") == 0)
		{
			A_TakeInventory("PlasmaMag", 20, TIF_NOTAKEINFINITE);
			A_GunFlash();
			A_StartSound("weapons/prifle/altfire", CHAN_AUTO);
			A_RailAttack(random(250,350), 0, 0, "0F59EF", "grey", RGF_NOPIERCING|RGF_SILENT|RGF_FULLBRIGHT, 1);
			A_AlertMonsters();
		}
		else
		{
			A_TakeInventory("PlasmaMag", 20, TIF_NOTAKEINFINITE);
			A_GunFlash();
			A_StartSound("weapons/prifle/altfire", CHAN_AUTO);
			A_RailAttack(random(150,250), 0, 0, "0F59EF", "grey", RGF_NOPIERCING|RGF_SILENT|RGF_FULLBRIGHT, 1);
			A_AlertMonsters();
		}
	}
}