ACTOR MP40 : BrutalWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Mauser9mm"
	Weapon.AmmoType2 "MP40Ammo"
	Obituary "%o was shot down by %k's MP40."
    AttackSound "None"
    Inventory.PickupSound "CLIPIN"
	Inventory.Pickupmessage "$GOTMP40"
    +WEAPON.NOAUTOAIM
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOALERT
	Weapon.SelectionOrder 1700
	DropItem "MP40Spawner"
	States
	{
	NoAmmo:
		RIFG A 0
		RIFG A 0 A_ZoomFactor(1.0)
		RIFG A 0 A_Takeinventory("Zoomed",1)
		RIFG A 0 A_Takeinventory("ADSmode",1)
		RIFG A 0 A_SetCrosshair(0)
		RIFG A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
		TNT1 A 0 A_PlaySound("weapons/empty", 4)
		NoAmmo2:
		RIFG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
	    RIFG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		RIFG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		RIFG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		RIFG A 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
		RIFG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		MP40 A 5 A_WeaponReady(WRF_ALLOWRELOAD)
		RIFG A 0 A_JumpIfInventory("Reloading",1,"Reload")
		RIFG A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
		TNT1 A 0 A_JumpIfInventory("NoAutoReload", 1, 2)
		RIFG A 0 A_JumpIfInventory("Mauser9mm",1,"Reload")
		RIFG A 0 A_JumpIfInventory("IsRunning",1,"StartSprint")
		Goto Ready3

	SelectAnimation:
        MP40 A 0
        MP40 A 0 A_PlaySound("CLIPIN")
        MP4S AB 1
        TNT1 AAAAAAAA 0
	Ready:
	Ready3:
		MP40 A 0
		MP40 A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		SMGG A 0 A_JumpIfInventory("Zoomed",1,"Ready2")
		SMGG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
        MP40 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        MP40 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        MP40 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		MP40 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		MP40 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		MP40 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		MP40 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
		MP40 A 0 A_JumpIfInventory("StartDualWield",1,"DualWield")
		MP40 A 0 A_JumpIfInventory("IsRunning",1,"StartSprint")
		Loop

	Ready2:
		TNT1 A 0
		MP41 A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		MP40 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
        MP40 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        MP40 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        MP40 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		MP40 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		MP40 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		MP40 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		MP40 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		MP40 A 0 A_JumpIfInventory("StartDualWield",1,"DualWield")
		MP40 A 0 A_JumpIfInventory("IsRunning",1,"StartSprint")
		Loop

	StartSprint:
		MP40 A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		SHTN A 0 A_Takeinventory("Zoomed",1)
        SHTN A 0 A_ZoomFactor(1.0)
		SHTN A 0 A_Takeinventory("ADSmode",1)
		RIFG A 0 A_SetCrosshair(0)
		SHTN A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 ACS_NamedExecuteAlways("BDSprint", 0, 0, 0, 0)//Makes player faster.

	Sprinting:
		M40S A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		M40S A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		M40S A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		M40S A 1 offset(0,38) A_SetPitch(pitch -0.5)
		M40S A 1 offset(3,36) A_SetPitch(pitch -0.5)
		M40S A 1 offset(6,34) A_SetPitch(pitch -0.5)
		M40S A 1 offset(9,32) A_SetPitch(pitch -0.5)
		TNT1 A 0 A_GiveInventory("UsedStamina", 1)
		SMGG A 0 A_WeaponReady(WRF_NOBOB)
		SMGG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SMGG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        SMGG A 0 A_JumpIfInventory("Reloading",1,"Reload")

		M40S A 1 offset(9,34) A_SetPitch(pitch +0.5)
		M40S A 1 offset(6,36) A_SetPitch(pitch +0.5)
		M40S A 1 offset(3,38) A_SetPitch(pitch +0.5)
		M40S A 1 offset(0,38) A_SetPitch(pitch +0.5)
		M40S A 1 offset(-3,36) A_SetPitch(pitch +0.5)
		M40S A 1 offset(-6,34) A_SetPitch(pitch +0.5)
		M40S A 1 offset(-9,32) A_SetPitch(pitch +0.5)
		TNT1 A 0 A_GiveInventory("UsedStamina", 1)
		SMGG A 0 A_WeaponReady(WRF_NOBOB)
		SMGG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SMGG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        SMGG A 0 A_JumpIfInventory("Reloading",1,"Reload")

		PLAY A 0 ACS_NamedExecuteAlways("BDSprint", 0, 0, 0, 0)//Makes player faster.
		SMGG A 0 A_JumpIfInventory("IsRunning", 1, "Sprinting")
		Goto StopSprint

	StopSprint:
		M40S A 0 A_JumpIfInventory("PowerStrength", 1, 2)
		MP40 A 0 A_JumpIfInventory("UsedStamina", 100, "StopSprintTired")
		M40S A 1 ACS_NamedExecuteAlways("BDTacticalSpeed", 0, 0, 0, 0)//Makes player slower.
		Goto Ready

	StopSprintTired:
		M40S A 1 ACS_NamedExecuteAlways("BDTacticalSpeed", 0, 0, 0, 0)//Makes player slower.
		MP40 A 0 A_PlaySound("Tired", 2)
		Goto Ready

	Deselect:
		MP40 A 0 A_Takeinventory("Zoomed",1)
		MP40 A 0 A_TakeInventory("TossGrenade", 1)
        MP40 A 0 A_ZoomFactor(1.0)
		MP40 A 0 A_Takeinventory("ADSmode",1)
		MP40 A 0 A_SetCrosshair(0)
        MP4S BA 1
		TNT1 AAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		Wait

	Select:
		TNT1 A 0
		MP40 A 0 A_Giveinventory("GoSpecial",1)
	    TNT1 A 0 A_TakeInventory("FistsSelected", 1)
		TNT1 A 0 A_TakeInventory("ShotgunSelected", 1)
		TNT1 A 0 A_TakeInventory("MinigunSelected", 1)
		TNT1 A 0 A_TakeInventory("SSGSelected", 1)
		TNT1 A 0 A_TakeInventory("RocketLauncherSelected", 1)
		TNT1 A 0 A_TakeInventory("GrenadeLauncherSelected", 1)
		TNT1 A 0 A_TakeInventory("PlasmaGunSelected", 1)
		TNT1 A 0 A_TakeInventory("RailGunSelected", 1)
		TNT1 A 0 A_TakeInventory("RevenantLauncherSelected", 1)
		TNT1 A 0 A_GiveInventory("SubMachineGunSelected", 1)
		TNT1 A 0 A_TakeInventory("BFG10KSelected", 1)
		TNT1 A 0 A_TakeInventory("BFGSelected", 1)
		TNT1 A 0 A_TakeInventory("FlameCannonSelected", 1)
		TNT1 A 0 A_TakeInventory("SawSelected", 1)
		MP40 A 0 A_Takeinventory("HasBarrel",1)
		MP40 A 0 A_TakeInventory("TossGrenade", 1)
		MP40 A 0 A_TakeInventory("DualMP40",1)
		MP40 A 0 A_GunFLash
		TNT1 A 1 A_Raise
		TNT1 AAAAA 0 A_Raise
		Goto SelectAnimation

    Fire:
	    MP40 A 0
		MP40 A 0 A_JumpIfInventory("MP40Ammo",1,2)
        Goto NoAmmo
		TNT1 AAAA 0
		MP40 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
        MP40 A 0 A_PlaySound("MP40", 1)
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
		MP40 A 0 A_Takeinventory("MP40Ammo",1)
		MP40 A 0 A_Takeinventory("DualMP40Ammo",1)
		MP40 B 1 BRIGHT A_AlertMonsters
		MP40 B 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		MP40 C 1 A_FireBullets (1.0, 1.1, -1, 15, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
		TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,0,0,0,random(-1,1))
		MP40 D 1 A_FireCustomMissile("PistolCaseSpawn",5,0,0,-8)
		TNT1 A 0 A_ZoomFactor(1.0)
		RIFG A 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 2)//tactical mode has muzzle climb
		RIFG A 0 A_SetPitch(pitch-0.2)
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, 2)//Tactical mode skips a frame, fires faster
        MP40 E 1
		MP40 A 1 A_JumpIfInventory("FiredPrimary",1,"Fire")
		Goto Ready3

	Fire2:
        MP40 A 0
        MP40 A 0 A_PlaySound("MP40", 1)
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
		MP40 A 0 A_Takeinventory("MP40Ammo",1)
		MP40 A 0 A_Takeinventory("DualMP40Ammo",1)
		MP41 F 1 BRIGHT A_AlertMonsters
		MP40 B 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		MP41 C 1 A_FireBullets (0.5, 0.6, 1, 15, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(1.29)
		TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,0,0,0,random(-1,1))
        MP41 G 1 A_FireCustomMissile("PistolCaseSpawn",5,0,0,-8)
		TNT1 A 0 A_ZoomFactor(1.3)
		RIFG A 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 2)//tactical mode has muzzle climb
		RIFG A 0 A_SetPitch(pitch-0.1)
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, 2)//Tactical mode skips a frame, fires faster
		MP41 H 1
		MP40 H 0 A_JumpIfInventory("FiredSecondary",1,"HoldAim")//If still pressing alt fire, it means its holding aim
		MP41 A 1 A_JumpIfInventory("FiredPrimary",1,"Fire")
		Goto Ready2

	AltFire:
        MP40 A 0
		MP40 A 0 A_Giveinventory("GoSpecial",1)
		MP40 A 0 A_JumpIfInventory("Zoomed",1,"NoAim")
		MP40 A 0 A_Giveinventory("Zoomed",1)
        MP40 A 0 A_ZoomFactor(1.3)
		MP40 A 0 A_Giveinventory("ADSmode",1)
		MP40 A 0 A_SetCrosshair(41)
        MP4D CB 1
		MP40 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		MP41 A 1
		MP40 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		MP41 A 1
		MP40 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		MP41 A 1
		MP40 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		MP41 A 1
		MP40 A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAim")
        Goto Ready2

	   HoldAim:
	    MP40 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		MP41 A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		MP40 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		MP41 A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		MP40 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		MP41 A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		MP40 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		MP41 A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		MP40 A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAim")

	NoAim:
		MP40 A 0 A_Takeinventory("Zoomed",1)
        MP40 A 0 A_ZoomFactor(1.0)
		MP40 A 0 A_Takeinventory("ADSmode",1)
		MP40 A 0 A_SetCrosshair(0)
		MP4D AB 1
        Goto Ready+6


	Reload:
		MP40 A 0
		MP40 A 1
		MP40 A 0 A_ZoomFactor(1.0)
		MP40 A 0 A_Takeinventory("Reloading",1)
		MP40 A 0 A_Takeinventory("ADSmode",1)
		MP40 A 0 A_Takeinventory("Zoomed",1)
		MP40 A 0 A_SetCrosshair(0)
		MP40 A 0 A_JumpIfInventory("MP40Ammo",32,"Ready")

        MP40 A 0 A_JumpIfInventory("Mauser9mm",1,3)
        Goto Ready
        TNT1 AAA 0

		MP40 A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
		MP40 A 0 A_JumpIfInventory("MP40Unloaded", 1, "PutMag")
		MP40 A 0 A_PlaySound("RELO1")
		MP4R ABCDE 2 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        MP4R F 8 A_FireCustomMissile("EmptyPistolClipSpawn",0,0,0,-20)
	PutMag:
		MP4R F 8
		MP4R ED 2
		MP4R C 2 A_PlaySound("RELO2")
		MP4R BA 2
		MP40 A 0 A_Takeinventory("Reloading",1)
		MP40 A 0 A_Takeinventory("MP40Unloaded",1)

	InsertBullets:
		TNT1 AAAA 0
		MP40 A 0 A_JumpIfInventory("MP40Ammo",32,15)
		MP40 A 0 A_JumpIfInventory("Mauser9mm",1,3)
		Goto Ready+6
        TNT1 AAAAAA 0
		MP40 A 0 A_Giveinventory("MP40Ammo",1)
		MP40 A 0 A_Giveinventory("DualMP40Ammo",1)
		MP40 A 0 A_Takeinventory("Mauser9mm",1)
		Goto InsertBullets

		TNT1 AAAAAAAAAA 0
		MP40 A 1 A_Takeinventory("Reloading",1)
        Goto Ready+6
		TNT1 AAAA 0
		MP40 A 1 A_Takeinventory("Reloading",1)
        Goto Ready+6

	TurboReload:
		TNT1 A 0
		MP40 A 0 A_Takeinventory("Reloading",1)
		MP40 A 0 A_Takeinventory("MP40Unloaded",1)
		Goto InsertBullets

	Unload:
		MP40 A 1 A_WeaponReady
		MP40 A 0 A_ZoomFactor(1.0)
		MP40 A 0 A_Takeinventory("Unloading",1)
		MP40 A 0 A_Takeinventory("ADSmode",1)
		MP40 A 0 A_Takeinventory("Zoomed",1)
		MP40 A 0 A_SetCrosshair(0)
        MP40 A 0 A_JumpIfInventory("MP40Ammo",1,3)
        Goto Ready
        TNT1 AAA 0
		MP40 A 0 A_Takeinventory("Zoomed",1)
		MP40 A 0 A_PlaySound("RELO1")
		MP4R ABCDE 2 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        MP4R F 8

	RemoveBullets:
		TNT1 AAAA 0
		MP40 A 0 A_JumpIfInventory("MP40Ammo",1,3)
		Goto FinishUnload
        TNT1 AAAAAA 0
		MP40 A 0 A_Takeinventory("MP40Ammo",1)
		MP40 A 0 A_Takeinventory("DualMP40Ammo",1)
		MP40 A 0 A_Giveinventory("Mauser9mm",1)
		Goto RemoveBullets

	FInishUnload:
		MP4U ABC 1
		MP40 A 0 A_GiveInventory("MP40Unloaded", 1)
		MP40 A 0 A_Takeinventory("Unloading",1)
		Goto Ready+6

	DualWield:
		MP40 A 1
		MP40 A 0 A_Takeinventory("StartDualWield",1)
		MP40 A 0 A_JumpIfInventory("IsTacticalClass", 1, "NoDual")//Tactical mode cant dual
		MP40 A 0 A_JumpIfInventory("HasDualMP40", 1, "GetDual")
		MP40 A 0 A_Print("You must have two identical weapons to dual wield.")
		Goto Ready

	 GetDual:
		MP40 A 0 A_SetCrosshair(0)
		MP40 A 0 A_Takeinventory("Zoomed",1)
		MP40 A 0 A_Takeinventory("ADSmode",1)
		MP40 A 0 A_TakeInventory("TossGrenade", 1)
		MP40 A 0 A_TakeInventory("Kicking",1)
        MP40 A 0 A_TakeInventory("Taunting",1)
        MP40 A 0 A_TakeInventory("Reloading",1)
		MP40 A 0 A_TakeInventory("Unloading",1)
		MP40 A 0 A_TakeInventory("Salute1", 1)
		MP40 A 0 A_TakeInventory("Salute2", 1)
		MP40 A 0 A_GiveInventory("DualMP40",1)
        MP40 A 0 A_ZoomFactor(1.0)
		MP40 A 0 A_SelectWeapon("DualMP40")
		Goto Ready

	NoDual:
		MP40 A 1
		MP40 A 0 A_Print("You can't dual wield MP40's when playing in Tactical Mode.",1)
		Goto Ready

 	Spawn:
		MP40 I -1
		Stop
	}
}

ACTOR MP40Ammo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 32
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 32
   Inventory.Icon "MP40I0"
}

ACTOR HitlersBuzzsaw : BrutalWeapon
{
	Game Doom
	Weapon.SelectionOrder 600
	Weapon.AmmoUse 1
	Weapon.AmmoGive 50
	Weapon.AmmoType "BuzzsawAmmo"
	Inventory.PickupSound "CBOXPKUP"
	Inventory.PickupMessage "$GOTMG42"
	Obituary "%o was cut in half by %k's MG42"
	+WEAPON.NOAUTOAIM
	DropItem "BuzzsawSpawner"
	Tag "Hitler's Buzzsaw"
	States
	{
	Ready:
	Ready3:
		MP40 A 0 A_JumpIfInventory("BuzzsawAmmo", 1, 1)
		Goto IdleNoAmmo
		TNT1 AAAA 0
		HBUS A 1 A_WeaponReady
		MP40 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        MP40 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        MP40 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		MP40 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		MP40 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		MP40 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
		MP40 A 0 A_JumpIfInventory("IsRunning",1,"StartSprint")
		Loop

	IdleNoAmmo:
		HBUS F 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
		MP40 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        MP40 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        MP40 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		MP40 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		MP40 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		MP40 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		MP40 A 0 A_JumpIfInventory("IsRunning",1,"StartSprintNoAmmo")
		MP40 A 0 A_JumpIfInventory("BuzzsawAmmo", 1, "Ready")
		Loop

	NoAmmo:
		HBUS F 10 A_PlaySound("weapons/empty")
		Goto IdleNoAmmo

	StartSprint:
		HBUS A 1 A_WeaponReady
		SHTN A 0 A_Takeinventory("Zoomed",1)
        SHTN A 0 A_ZoomFactor(1.0)
		SHTN A 0 A_Takeinventory("ADSmode",1)
		RIFG A 0 A_SetCrosshair(0)
		SHTN A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 ACS_NamedExecuteAlways("BDSprint", 0, 0, 0, 0)//Makes player faster.

	Sprinting:
		HBUS A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		HBUS A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		HBUS A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		HBUS A 1 offset(0,38) A_SetPitch(pitch -0.5)
		HBUS A 1 offset(3,36) A_SetPitch(pitch -0.5)
		HBUS A 1 offset(6,34) A_SetPitch(pitch -0.5)
		HBUS A 1 offset(9,32) A_SetPitch(pitch -0.5)
		TNT1 A 0 A_GiveInventory("UsedStamina", 3)
		SMGG A 0 A_WeaponReady(WRF_NOBOB)
		SMGG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SMGG A 0 A_JumpIfInventory("Taunting",1,"Taunt")

		HBUS A 1 offset(9,34) A_SetPitch(pitch +0.5)
		HBUS A 1 offset(6,36) A_SetPitch(pitch +0.5)
		HBUS A 1 offset(3,38) A_SetPitch(pitch +0.5)
		HBUS A 1 offset(0,38) A_SetPitch(pitch +0.5)
		HBUS A 1 offset(-3,36) A_SetPitch(pitch +0.5)
		HBUS A 1 offset(-6,34) A_SetPitch(pitch +0.5)
		HBUS A 1 offset(-9,32) A_SetPitch(pitch +0.5)
		TNT1 A 0 A_GiveInventory("UsedStamina", 3)
		SMGG A 0 A_WeaponReady(WRF_NOBOB)
		SMGG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SMGG A 0 A_JumpIfInventory("Taunting",1,"Taunt")

		PLAY A 0 ACS_NamedExecuteAlways("BDSprint", 0, 0, 0, 0)//Makes player faster.
		SMGG A 0 A_JumpIfInventory("IsRunning", 1, "Sprinting")
		Goto StopSprint

	StopSprint:
		HBUS A 0 A_JumpIfInventory("PowerStrength", 1, 2)
		HBUS A 0 A_JumpIfInventory("UsedStamina", 100, "StopSprintTired")
		HBUS A 1 ACS_NamedExecuteAlways("BDTacticalSpeed", 0, 0, 0, 0)//Makes player slower.
		Goto Ready

	StopSprintTired:
		HBUS A 1 ACS_NamedExecuteAlways("BDTacticalSpeed", 0, 0, 0, 0)//Makes player slower.
		HBUS A 0 A_PlaySound("Tired", 2)
		Goto Ready

	StartSprintNoAmmo:
		HBUS F 1 A_WeaponReady
		SHTN A 0 A_Takeinventory("Zoomed",1)
        SHTN A 0 A_ZoomFactor(1.0)
		SHTN A 0 A_Takeinventory("ADSmode",1)
		RIFG A 0 A_SetCrosshair(0)
		SHTN A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 ACS_NamedExecuteAlways("BDSprint", 0, 0, 0, 0)//Makes player faster.

	SprintingNoAmmo:
		HBUS F 1 offset(-9,34) A_SetPitch(pitch -0.5)
		HBUS F 1 offset(-6,36) A_SetPitch(pitch -0.5)
		HBUS F 1 offset(-3,38) A_SetPitch(pitch -0.5)
		HBUS F 1 offset(0,38) A_SetPitch(pitch -0.5)
		HBUS F 1 offset(3,36) A_SetPitch(pitch -0.5)
		HBUS F 1 offset(6,34) A_SetPitch(pitch -0.5)
		HBUS F 1 offset(9,32) A_SetPitch(pitch -0.5)
		TNT1 A 0 A_GiveInventory("UsedStamina", 3)
		SMGG A 0 A_WeaponReady(WRF_NOBOB)
		SMGG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SMGG A 0 A_JumpIfInventory("Taunting",1,"Taunt")

		HBUS F 1 offset(9,34) A_SetPitch(pitch +0.5)
		HBUS F 1 offset(6,36) A_SetPitch(pitch +0.5)
		HBUS F 1 offset(3,38) A_SetPitch(pitch +0.5)
		HBUS F 1 offset(0,38) A_SetPitch(pitch +0.5)
		HBUS F 1 offset(-3,36) A_SetPitch(pitch +0.5)
		HBUS F 1 offset(-6,34) A_SetPitch(pitch +0.5)
		HBUS F 1 offset(-9,32) A_SetPitch(pitch +0.5)
		TNT1 A 0 A_GiveInventory("UsedStamina", 3)
		SMGG A 0 A_WeaponReady(WRF_NOBOB)
		SMGG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SMGG A 0 A_JumpIfInventory("Taunting",1,"Taunt")

		PLAY A 0 ACS_NamedExecuteAlways("BDSprint", 0, 0, 0, 0)//Makes player faster.
		SMGG A 0 A_JumpIfInventory("IsRunning", 1, "SprintingNoAmmo")
		Goto StopSprintNoAmmo

	StopSprintNoAmmo:
		HBUS F 0 A_JumpIfInventory("PowerStrength", 1, 2)
		HBUS A 0 A_JumpIfInventory("UsedStamina", 100, "StopSprintTiredNoAmmo")
		HBUS F 1 ACS_NamedExecuteAlways("BDTacticalSpeed", 0, 0, 0, 0)//Makes player slower.
		Goto Ready

	StopSprintTiredNoAmmo:
		HBUS F 1 ACS_NamedExecuteAlways("BDTacticalSpeed", 0, 0, 0, 0)//Makes player slower.
		HBUS A 0 A_PlaySound("Tired", 2)
		Goto Ready

	Deselect:
		TNT1 A 0 A_TakeInventory("Unloading", 1)
		TNT1 A 0 A_TakeInventory("Reloading", 1)
		TNT1 A 0 A_TakeInventory("HeavyAutomaticWeapon",1)
		TNT1 A 0 A_TakeInventory("RandomHeadExploder", 1)
		TNT1 AAAAAAAAAAAA 0 A_Lower
		HBUS AAAA 1 A_Lower
		Loop

	Select:
		MGN1 A 0 A_Giveinventory("HeavyAutomaticWeapon",1)
		TNT1 A 0 A_TakeInventory("FistsSelected", 1)
		TNT1 A 0 A_TakeInventory("ShotgunSelected", 1)
		TNT1 A 0 A_GiveInventory("MinigunSelected", 1)
		TNT1 A 0 A_TakeInventory("SSGSelected", 1)
		TNT1 A 0 A_TakeInventory("RocketLauncherSelected", 1)
		TNT1 A 0 A_TakeInventory("GrenadeLauncherSelected", 1)
		TNT1 A 0 A_TakeInventory("PlasmaGunSelected", 1)
		TNT1 A 0 A_TakeInventory("RailGunSelected", 1)
		TNT1 A 0 A_TakeInventory("RevenantLauncherSelected", 1)
		TNT1 A 0 A_TakeInventory("SubMachineGunSelected", 1)
		TNT1 A 0 A_TakeInventory("BFG10KSelected", 1)
		TNT1 A 0 A_TakeInventory("BFGSelected", 1)
		TNT1 A 0 A_TakeInventory("FlameCannonSelected", 1)
		TNT1 A 0 A_TakeInventory("SawSelected", 1)
		MGN1 A 0 A_GiveInventory("RandomHeadExploder", 1)
		MP40 A 0 A_GunFlash
		HBUS AAAA 1 A_Raise
		HUBS A 0 A_PlaySound("CHGNPKUP")
		TNT1 AAAAAAAAAAAA 0 A_Raise
		Goto Ready

	Fire:
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundHMG", random(-1,1), 0, 0, -12, 0, random(-1,1))
		MP40 A 0 A_PlaySound("MP40", 1)
		HBUS B 1 BRIGHT A_FireBullets (2.0, 2.1, -1, 24, "MachinegunBulletPuff", FBF_NORANDOM | FBF_USEAMMO)
		MP40 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
        MP40 A 0 A_FireCustomMissile("DecorativeTracer", random(-2,2), 0, 0, 0, 0, random(-2,2))
		TNT1 A 0 A_FireCustomMissile("Alerter",0,0)
		MP40 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		MP40 A 0 A_FireCustomMissile("50CaseSpawn2",0,0,9,-12)
		MP40 A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		TNT1 A 0 A_ZoomFactor(0.98)
		HBUS A 1
		TNT1 A 0 A_ZoomFactor(1.0)
		RIFG A 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 2)//tactical mode has muzzle climb
		RIFG A 0 A_SetPitch(pitch-0.6)
		CHAG A 0 A_JumpIfInventory("BuzzsawAmmo", 1, 1)
		Goto NoAmmo
		TNT1 AAAA 0
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundHMG", random(-1,1), 0, 0, -12, 0, random(-1,1))
		MP40 A 0 A_PlaySound("MP40", 1)
		HBUS C 1 BRIGHT A_FireBullets (2.0, 2.1, -1, 24, "MachinegunBulletPuff", FBF_NORANDOM | FBF_USEAMMO)
		MP40 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
        MP40 A 0 A_FireCustomMissile("DecorativeTracer", random(-2,2), 0, 0, 0, 0, random(-2,2))
		TNT1 A 0 A_FireCustomMissile("Alerter",0,0)
		MP40 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		MP40 A 0 A_FireCustomMissile("50CaseSpawn2",0,0,9,-12)
		MP40 A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		TNT1 A 0 A_ZoomFactor(0.98)
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, 2)//Tactical mode skips a frame, fires faster
		HBUS A 1
		TNT1 A 0 A_ZoomFactor(1.0)
		RIFG A 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 2)//tactical mode has muzzle climb
		RIFG A 0 A_SetPitch(pitch-0.6)
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		Goto Ready
	Spawn:
		HBUS D -1
		Stop
	}
}