//====================================================================
//
// Brutal DOOM - Mutators
//
// UAC - 9x19mm Compact Sub Machine Gun
// A renovated tactical futuristic version
// based on an actual H&K MP-5 and UMP
//
// -----------------------------
//
// New Sprites by Mike12
// Decorate Script By XV117
//
//====================================================================

ACTOR CompactMG : BrutalWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Clip1"
	Weapon.AmmoType2 "BDCMGAmmo"
	Obituary "%o was perforated by %k's Compact Machine Gun."
    AttackSound "None"
	Weapon.SelectionOrder 1750
    Inventory.PickupSound "CMGSEL"
	Inventory.Pickupmessage "You picked up the Compact Machinegun! (Slot 2)"
    +WEAPON.NOAUTOAIM
    +WEAPON.NOAUTOFIRE
    +FORCEXYBILLBOARD
	+WEAPON.NOALERT
    Scale 0.8
	States
	{

 	Spawn:
	CMGI A 1
	CMGI A -1
	Stop

//====================================================================
// Basic Functions
//====================================================================

	Ready3:
    Ready:
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"ReadyZoomed")
		TNT1 A 0 A_JumpIfInventory("CMGSilencer",1,"ReadySil")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("StartDualWield",1,"SpecialMode")
		TNT1 A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		CMGG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
    	TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		Loop

    ReadySil:
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint_Sil")
		TNT1 A 0 A_JumpIfInventory("StartDualWield",1,"SpecialMode")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		2MGG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
    	TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		Loop
	
	ReadyZoomed:
        TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		TNT1 A 0 A_JumpIfInventory("StartDualWield",1,"SpecialMode")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		CM2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		Loop

//====================================================================
// Select Functions
//====================================================================

	Deselect:
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_TakeInventory("Zoomed", 1)
		TNT1 A 0 A_TakeInventory("ADSMode", 1)
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_JumpIfInventory("CMGSilencer", 1, "DeselectSilencer")
        CMGS DCBA 1
		TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		Wait

	DeselectSilencer:
		TNT1 A 0 A_TakeInventory("CMGSilencer", 1)
        2MGS DCBA 1
		TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		Wait

	Select:
		TNT1 A 0
		TNT1 A 0 A_Takeinventory("StartDualWield",1)
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_Takeinventory("FistsSelected",1)
		TNT1 A 0 A_Takeinventory("SawSelected",1)
		TNT1 A 0 A_Takeinventory("ShotgunSelected",1)
		TNT1 A 0 A_Takeinventory("SSGSelected",1)
		TNT1 A 0 A_Takeinventory("MinigunSelected",1)
		TNT1 A 0 A_Takeinventory("PlasmaGunSelected",1)
		TNT1 A 0 A_Takeinventory("RocketLauncherSelected",1)
		TNT1 A 0 A_Takeinventory("GrenadeLauncherSelected",1)
		TNT1 A 0 A_Takeinventory("BFGSelected",1)
		TNT1 A 0 A_Takeinventory("BFG10kSelected",1)
		TNT1 A 0 A_Takeinventory("RailGunSelected",1)
		TNT1 A 0 A_Giveinventory("SubMachineGunSelected",1)
		TNT1 A 0 A_Takeinventory("RevenantLauncherSelected",1)
		TNT1 A 0 A_Takeinventory("LostSoulSelected",1)
		TNT1 A 0 A_Takeinventory("FlameCannonSelected",1)
		TNT1 A 0 A_Takeinventory("HasBarrel",1)
		TNT1 A 1
		TNT1 A 1 A_Raise
		TNT1 AAAAAAAAAA 0 A_Raise
	Goto SelectAnimation

	SelectAnimation:
	TNT1 A 1
	TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
    TNT1 A 0 A_PlaySound("CMGSEL")
	TNT1 A 0 A_JumpIfInventory("CMGSilencer", 1, "SelectAnimSilencer")
    CMGS ABCD 1
    TNT1 A 0 A_GunFlash
	Goto Ready

	SelectAnimSilencer:
        2MGS ABCD 1
        TNT1 A 0 A_GunFlash
	Goto ReadySil

//====================================================================
// Fire Mechanics
//====================================================================
		
	AltFire:
        TNT1 A 0
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"NoAim")
		TNT1 A 0 A_Giveinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.3)
		TNT1 A 0 A_Giveinventory("ADSmode",1)
        CMGZ ABCD 1
		
		CMGG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		CM2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		CMGG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		CM2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		CMGG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		CM2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		CMGG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		CM2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		CMGG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		CM2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		CMGG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		CM2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		CMGG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		CM2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		
		CMGG A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAim")
        Goto ReadyZoomed
		
	HoldAim:	
		CMGG A 0 A_GiveInventory("ZoomHold",1)
	    CMGG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		CM2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		CMGG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		CM2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		CMGG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		CM2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		CMGG A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAim")
		
	NoAim:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_Takeinventory("ZoomHold",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		CMGZ DCBA 1
        Goto Ready
	
	Fire:
        TNT1 A 0 A_JumpIfInventory("BDCMGAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("CMGSilencer",1,"FireSilenced")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"FireZoomed")
		TNT1 A 0 A_PlaySound("FARSHT", 6)
    	TNT1 A 0 A_PlaySound("CMGFIR", 1)
		TNT1 A 0 A_ZoomFactor(0.98)
		CMGF A 1 BRIGHT A_FireBullets (3, 3, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(1.0)
        RIFF A 0 A_FireCustomMissile("DecorativeTracer", random(-1,1), 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDCMGAmmo",1)
        CMGF B 1
		TNT1 A 0 A_FireCustomMissile("CMGCaseSpawn",5,0,0,-9)
		CMGF C 1 
		CMGG A 0 A_Refire
		Goto Ready
		
	FireZoomed:
    	TNT1 A 0 A_PlaySound("FARSHT", 6)
    	TNT1 A 0 A_PlaySound("CMGFIR", 1)
		TNT1 A 0 A_ZoomFactor(1.33)
		CM2F A 1 BRIGHT A_FireBullets (1.5, 1.5, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(1.3)
        RIFF A 0 A_FireCustomMissile("DecorativeTracer", random(-1,1), 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDCMGAmmo",1)
        CM2F B 1
		TNT1 A 0 A_FireCustomMissile("CMGCaseSpawn",5,0,0,-9)
		CM2F C 1 
		TNT1 A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAim")//If still pressing alt fire, it means its holding aim
        CM2G A 0 A_ReFire("Fire")
		TNT1 A 0 A_JumpIfInventory("ZoomHold", 1, "NoAim")
		Goto ReadyZoomed
	
	FireSilenced:
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"FireZoomedSilenced")
        TNT1 A 0 A_PlaySound("CMGSIL",1)
		TNT1 A 0 A_AlertMonsters(256)
		TNT1 A 0 A_ZoomFactor(0.98)
		2MGF A 1 BRIGHT A_FireBullets (3, 3, -1, 12, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(1.0)
        RIFF A 0 A_FireCustomMissile("DecorativeTracer", random(-1,1), 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDCMGAmmo",1)
        2MGF B 1
		TNT1 A 0 A_FireCustomMissile("CMGCaseSpawn",5,0,0,-9)
		2MGF C 1 
		2MGG A 0 A_Refire("Fire")
		Goto ReadySil
		
	
	FireZoomedSilenced:
        TNT1 A 0 A_PlaySound("CMGSIL",1)
		TNT1 A 0 A_AlertMonsters(256)
		TNT1 A 0 A_ZoomFactor(1.33)
		2M2F A 1 BRIGHT A_FireBullets (1.5, 1.5, -1, 12, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(1.3)
        RIFF A 0 A_FireCustomMissile("DecorativeTracer", random(-1,1), 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDCMGAmmo",1)
        CM2F B 1
		TNT1 A 0 A_FireCustomMissile("CMGCaseSpawn",5,0,0,-9)
		CM2F C 1 
		TNT1 A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAim")//If still pressing alt fire, it means its holding aim
        CM2G A 0 A_ReFire("Fire")
		TNT1 A 0 A_JumpIfInventory("ZoomHold", 1, "NoAim")
		Goto ReadyZoomed

	NoAmmo:
	TNT1 A 0 A_JumpIfInventory("CMGSilencer",1,"NoAmmoSil")
	CMGG A 1
	Goto Ready

	NoAmmoSil:
	2MGG A 1
	Goto ReadySil

//====================================================================
// Reload Mechanics
//====================================================================

    Reload:
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("BDCMGAmmo",36,"Ready")
		TNT1 A 0 A_JumpIfInventory("Clip1",1,3)
		Goto NoAmmo
		TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
		TNT1 A 0 A_JumpIfInventory("BDCMGAmmo",1,"ReloadB")//35+1 effect
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, 2)
		RIFR C 0 A_FireCustomMissile("EmptyPistolClipSpawn",-5,0,8,-4)
		TNT1 A 0 A_Playsound("CMGREL")
		TNT1 A 0 A_JumpIfInventory("CMGSilencer",1,"ReloadSil")
		CMGR ABCDEFGGGGGHHIKLMMNOOPPPPQRSTT 1
		Goto TurboReload

    ReloadSil:
        2MGR ABCDEFGGGGGHHIKLMMNOOPPPPQRSTT 1
    TurboReload:
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
		Goto InsertBullets
		
    InsertBullets:
	TNT1 AAAA 0
	TNT1 A 0 A_JumpIfInventory("BDCMGAmmo",35,15)
	TNT1 A 0 A_JumpIfInventory("Clip1",1,3)
	Goto Ready
        TNT1 AAAAAA 0
	TNT1 A 0 A_Giveinventory("BDCMGAmmo",1)
	TNT1 A 0 A_Takeinventory("Clip1",1)
	Goto InsertBullets
		
	TNT1 AAAAAAAAAA 0
	TNT1 A 0 A_Takeinventory("Reloading",1)
		
	TNT1 A 0 A_Refire
        Goto Ready
	TNT1 AAAA 0
	TNT1 A 0 A_Takeinventory("Reloading",1)
		
	TNT1 A 0 A_Refire
        Goto Ready
	
		
    InsertBullets2:
	TNT1 AAAA 0
	TNT1 A 0 A_JumpIfInventory("BDCMGAmmo",36,15)
	TNT1 A 0 A_JumpIfInventory("Clip1",1,3)
	Goto Ready
        TNT1 AAAAAA 0
	TNT1 A 0 A_Giveinventory("BDCMGAmmo",1)
	TNT1 A 0 A_Takeinventory("Clip1",1)
	Goto InsertBullets2
	TNT1 AAAAAAAAAA 0
	TNT1 A 0 A_Takeinventory("Reloading",1)
	TNT1 A 0 A_Refire
        Goto Ready
	TNT1 AAAA 0
	TNT1 A 0 A_Takeinventory("Reloading",1)
	TNT1 A 0 A_Refire
        Goto Ready

    Unload:
	TNT1 A 0 A_Takeinventory("Unloading",1)
	TNT1 A 0 A_JumpIfInventory("BDCMGAmmo",1,3)
	Goto NoAmmo
        TNT1 AAA 0

	TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
	TNT1 A 0 A_GiveInventory ("Pumping", 1)
	TNT1 A 0 A_Takeinventory("Reloading",1)
	TNT1 A 0 A_PlaySound("CMGUNL")
	TNT1 A 0 A_Giveinventory("HasUnloaded",1)
	TNT1 A 0 A_JumpIfInventory("CMGSilencer",1,"UnloadSil")
        CMGR TTSRQQQOONMLKIHGGGGGGGGFEDCBA 1
	Goto RemoveBullets
    UnloadSil:
        2MGR TTSRQQQOONMLKIHGGGGGGGGFEDCBA 1		
    RemoveBullets:
	TNT1 AAAA 0
	TNT1 A 0 A_JumpIfInventory("BDCMGAmmo",1,3)
	Goto Ready
        TNT1 AAAAAA 0
	TNT1 A 0 A_Takeinventory("BDCMGAmmo",1)
	TNT1 A 0 A_Giveinventory("Clip1",1)
	Goto RemoveBullets
		
	TNT1 AAAAAAAAAA 0
	TNT1 A 0 A_Takeinventory("Reloading",1)
	
	TNT1 A 0 A_Refire
        Goto Ready
	TNT1 AAAA 0
	TNT1 A 0 A_Takeinventory("Reloading",1)
		
	TNT1 A 0 A_Refire
        Goto Ready

    ReloadB:
		TNT1 A 0 A_JumpIfInventory("CMGSilencer",1,"ReloadBSil")
		CMGR TTSRQQQPOO 1
		TNT1 A 0 A_Playsound("CMGREL")
		CMGR ONMLKIGG 1
		RIFR C 0 A_FireCustomMissile("EmptyPistolClipSpawn",-5,0,8,-4)
		CMGR GGGHIKLMMNOOPPPPQRST 1
		Goto InsertBullets2

    ReloadBSil:
		2MGR TTSRQQQPOO 1
		TNT1 A 0 A_Playsound("CMGREL")
		2MGR ONMLKIGG 1
		RIFR C 0 A_FireCustomMissile("EmptyPistolClipSpawn",-5,0,8,-4)
		2MGR GGGHIKLMMNOOPPPPQRST 1
		Goto InsertBullets2
	
//====================================================================
// Attacheable Silencer Functions
//====================================================================

	SpecialMode:
		TNT1 A 0 A_TakeInventory("StartDualWield", 1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		TNT1 A 0 A_JumpIfInventory("SilencerUpgrade", 1, "AttachSilencer")
		Goto NoSilencer
	
	AttachSilencer:
		TNT1 A 0 A_JumpIfInventory("CMGSilencer", 1, "RemoveSilencer")
		TNT1 A 0 A_GiveInventory("CMGSilencer", 1)
		CMGS DCBA 1
		TNT1 A 5
		TNT1 A 0 A_PlaySound("CMGATCH")
		TNT1 A 5
		2MGS ABCD 1
		TNT1 A 0 A_print("Silencer Attached",2)
		Goto ReadySil
		
	RemoveSilencer:
		TNT1 A 0 A_TakeInventory("CMGSilencer", 1)
		TNT1 A 0 A_print("Silencer Detached",2)
		2MGS DCBA 1
		TNT1 A 5
		TNT1 A 0 A_PlaySound("CMGATCH")
		TNT1 A 5
		CMGS ABCD 1
		TNT1 A 0 A_takeinventory("CMGSilencer",1)
		goto Ready

	NoSilencer:
		TNT1 A 0
		TNT1 A 0 A_Print("You need a Tactical Silencer", 2)
		Goto Ready
		
//====================================================================
// Sprinting Functions
//====================================================================

	CheckSprint:
		TNT1 A 0 A_JumpIfInventory("CMGSilencer",1, "CheckSprint_Sil")
		CMGG A 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
		Goto Ready
		
	CheckSprint2:
		TNT1 A 0 A_JumpIfInventory("CMGSilencer",1, "CheckSprint2_Sil")
		CMGG A 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
		Goto Ready
		
	StartSprint:
		TNT1 A 0 A_JumpIfInventory("CMGSilencer",1, "StartSprint_Sil")
		CMGG A 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_TakeInventory("PowerBloodOnVisor", 1)
		TNT1 A 0 A_TakeInventory("PowerBlueBloodOnVisor", 1)
		TNT1 A 0 A_TakeInventory("PowerGreenBloodOnVisor", 1)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired")
		
	Sprinting:	
		TNT1 A 0 A_JumpIfInventory("CMGSilencer",1, "Sprinting_Sil")
		CMGR T 0 offset(-9,32) 
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("UsedStamina", 100, "StopSprintTired")
		PLAY A 0 offset(-9,32) ACS_ExecuteAlways(852, 0, 0, 0, 0)//Makes player faster.
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("PowerStrength", 1, 2)
		TNT1 A 0 offset(-9,32) A_GiveInventory("UsedStamina", 6)
		TNT1 A 0 offset(-9,32)
		CMGR T 1 offset(-9,34) A_SetPitch(pitch -0.5)
		CMGR T 1 offset(-6,36) A_SetPitch(pitch -0.5)
		CMGR T 1 offset(-3,38) A_SetPitch(pitch -0.5)
		CMGR T 1 offset(0,38) A_SetPitch(pitch -0.5)
		CMGR T 1 offset(3,36) A_SetPitch(pitch -0.5)
		CMGR T 1 offset(6,34) A_SetPitch(pitch -0.5)
		CMGR T 1 offset(9,32) A_SetPitch(pitch -0.5)
		TNT1 A 0 offset(9,32) A_WeaponReady(WRF_NOBOB)
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        	TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        	TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 offset(-9,32) A_GiveInventory("UsedStamina", 6)
		TNT1 A 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
		CMGR T 1 offset(9,34) A_SetPitch(pitch +0.5)
		CMGR T 1 offset(6,36) A_SetPitch(pitch +0.5)
		CMGR T 1 offset(3,38) A_SetPitch(pitch +0.5)
		CMGR T 1 offset(0,38) A_SetPitch(pitch +0.5)
		CMGR T 1 offset(-3,36) A_SetPitch(pitch +0.5)
		CMGR T 1 offset(-6,34) A_SetPitch(pitch +0.5)
		CMGR T 1 offset(-9,32) A_SetPitch(pitch +0.5)
		TNT1 A 0 offset(-9,32) A_WeaponReady(WRF_NOBOB)
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("IsRunning", 1, "Sprinting")
		Goto StopSprint
		
		StopSprintTired:
		TNT1 A 0 A_JumpIfInventory("CMGSilencer",1, "StopSprintTired_Sil")
		CMGG A 1
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		TNT1 A 0 A_PlaySound("Tired", 2)
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		CMGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		CMGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		CMGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		CMGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		CMGG A 5 A_WeaponReady
		Goto Ready
		
		StopSprint:
		TNT1 A 0 A_JumpIfInventory("CMGSilencer",1, "StopSprint_Sil")
		CMGG A 1
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired")
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		Goto Ready

//====================================================================
// Silencer Mode Sprinting
//====================================================================

	CheckSprint_Sil:
		2MGG A 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("IsStandingStill", 1, "ReadySil")
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint_Sil")
		Goto ReadySil
		
	CheckSprint2_Sil:
		2MGG A 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("IsStandingStill", 1, "ReadySil")
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint_Sil")
		Goto ReadySil
		
	StartSprint_Sil:
		2MGG A 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_TakeInventory("PowerBloodOnVisor", 1)
		TNT1 A 0 A_TakeInventory("PowerBlueBloodOnVisor", 1)
		TNT1 A 0 A_TakeInventory("PowerGreenBloodOnVisor", 1)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired_Sil")
		
	Sprinting_Sil:	
		2MGR T 0 offset(-9,32) 
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("IsStandingStill", 1, "ReadySil")
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("UsedStamina", 100, "StopSprintTired")
		PLAY A 0 offset(-9,32) ACS_ExecuteAlways(852, 0, 0, 0, 0)//Makes player faster.
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("PowerStrength", 1, 2)
		TNT1 A 0 offset(-9,32) A_GiveInventory("UsedStamina", 6)
		TNT1 A 0 offset(-9,32)
		2MGR T 1 offset(-9,34) A_SetPitch(pitch -0.5)
		2MGR T 1 offset(-6,36) A_SetPitch(pitch -0.5)
		2MGR T 1 offset(-3,38) A_SetPitch(pitch -0.5)
		2MGR T 1 offset(0,38) A_SetPitch(pitch -0.5)
		2MGR T 1 offset(3,36) A_SetPitch(pitch -0.5)
		2MGR T 1 offset(6,34) A_SetPitch(pitch -0.5)
		2MGR T 1 offset(9,32) A_SetPitch(pitch -0.5)
		TNT1 A 0 offset(9,32) A_WeaponReady(WRF_NOBOB)
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 offset(-9,32) A_GiveInventory("UsedStamina", 6)
		TNT1 A 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
		2MGR T 1 offset(9,34) A_SetPitch(pitch +0.5)
		2MGR T 1 offset(6,36) A_SetPitch(pitch +0.5)
		2MGR T 1 offset(3,38) A_SetPitch(pitch +0.5)
		2MGR T 1 offset(0,38) A_SetPitch(pitch +0.5)
		2MGR T 1 offset(-3,36) A_SetPitch(pitch +0.5)
		2MGR T 1 offset(-6,34) A_SetPitch(pitch +0.5)
		2MGR T 1 offset(-9,32) A_SetPitch(pitch +0.5)
		TNT1 A 0 offset(-9,32) A_WeaponReady(WRF_NOBOB)
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("IsRunning", 1, "Sprinting_Sil")
		Goto StopSprint_Sil
		
		StopSprintTired_Sil:
		2MGG A 1
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		TNT1 A 0 A_PlaySound("Tired", 2)
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		2MGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		2MGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		2MGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		2MGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		2MGG A 5 A_WeaponReady
		Goto ReadySil
		
		StopSprint_Sil:
		2MGG A 1
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired_Sil")
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		Goto ReadySil

	}
}

Actor CMGSilencer : Inventory
{
   Inventory.MaxAmount 1
}

ACTOR BDCMGAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 36
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 36
   Inventory.Icon "CMGIA0"
}