Actor 2xFireSMG : Inventory
{
Inventory.MaxAmount 1
}

Actor StartAmmoDSMG : Inventory
{
Inventory.MaxAmount 1
}


ACTOR DualSMG : BrutalWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Clip1"
	Weapon.AmmoType2 "BDDualSMGAmmo"
	Obituary "%o was shot down by %k's SMG."
    AttackSound "None"
    Inventory.PickupSound "CLIPIN"
	Inventory.Pickupmessage "You got the SMG!"
    +WEAPON.NOAUTOAIM
    //+WEAPON.NOAUTOFIRE
    +FORCEXYBILLBOARD
	+WEAPON.NO_AUTO_SWITCH
	Scale 0.9
	Tag "Dual SMGs"
	States
	{
	
	NoAmmoOnSecondGun:
		SM2F EF 1
	Ready3:
	Ready:
SM2G A 0 A_JumpIfInventory("HasUnloaded",1,"IdleUnload")

        SM2G A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SM2G A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		SM2G A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		SM2G A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        SM2G A 0 A_JumpIfInventory("Reloading",1,"Reload")
		SM2G A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		SM2G A 0 A_JumpIfInventory("Unloading",1,"Unload")
		SM2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		SM2G A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		SM2G A 0 A_JumpIfInventory("Reloading",1,"Reload")
		SM2G A 0 A_JumpIfInventory("StartDualWield",1,"DualWield")
		Loop
		
	DualWield:
		SM2G A 1
		SM2G A 0 A_Takeinventory("StartDualWield",1)
//	SM2G A 0 A_JumpIfInventory("IsTacticalClass", 1, "NoDual")//Tactical mode cant dual
		SM2G A 0 A_SelectWEapon("CompactMG") //xx
//SM2G A 0 A_SelectWEapon("BrutalSMG")
		Goto Ready	
		
	NoDual:
		SM2G A 1 //RIFG
		SM2G A 0 A_Print("You can't dual wield smgs when playing in Tactical Mode. Real operators never try to look cool in a firefight.")
		Goto Ready	
		
	CheckSprint:
		SM2G A 1 A_WeaponReady(WRF_NOFIRE)
		SM2G A 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		SM2G A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
		Goto Ready
		
	StartSprint:
		SM2G A 1 A_WeaponReady(WRF_NOFIRE)
		SM2G A 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired")
		
	Sprinting:	
		Sprinting:	
		SM2G A 0 offset(-9,32) 
		SM2G A 0 offset(-9,32) A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		SM2G 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.
		SM2G A 0 offset(-9,32) A_JumpIfInventory("PowerStrength", 1, 2)
		SM2G A 0 offset(-9,32) A_GiveInventory("UsedStamina", 6)
		SM2G A 0 offset(-9,32)
		SM2G A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		SM2G A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		SM2G A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		SM2G A 1 offset(0,38) A_SetPitch(pitch -0.5)
		SM2G A 1 offset(3,36) A_SetPitch(pitch -0.5)
		SM2G A 1 offset(6,34) A_SetPitch(pitch -0.5)
		SM2G A 1 offset(9,32) A_SetPitch(pitch -0.5)
		SM2G A 0 offset(9,32) A_WeaponReady(WRF_NOBOB)
		SM2G A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SM2G A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        SM2G A 0 A_JumpIfInventory("Reloading",1,"Reload")
		SM2G A 0 offset(-9,32) A_GiveInventory("UsedStamina", 6)
		SM2G A 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
		SM2G A 1 offset(9,34) A_SetPitch(pitch +0.5)
		SM2G A 1 offset(6,36) A_SetPitch(pitch +0.5)
		SM2G A 1 offset(3,38) A_SetPitch(pitch +0.5)
		SM2G A 1 offset(0,38) A_SetPitch(pitch +0.5)
		SM2G A 1 offset(-3,36) A_SetPitch(pitch +0.5)
		SM2G A 1 offset(-6,34) A_SetPitch(pitch +0.5)
		SM2G A 1 offset(-9,32) A_SetPitch(pitch +0.5)
		SM2G A 0 offset(-9,32) A_WeaponReady(WRF_NOBOB)
		SM2G A 0 offset(-9,32) A_JumpIfInventory("IsRunning", 1, "Sprinting")
		
		Goto StopSprint
	StopSprintTired:
		SM2G A 1
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		SM2G A 0 A_PlaySound("Tired", 2)
		SM2G A 0 A_TakeInventory("UsedStamina", 2)
		SM2G A 5 A_WeaponReady
		SM2G A 0 A_TakeInventory("UsedStamina", 2)
		SM2G A 5 A_WeaponReady
		SM2G A 0 A_TakeInventory("UsedStamina", 2)
		SM2G A 5 A_WeaponReady
		SM2G A 0 A_TakeInventory("UsedStamina", 2)
		SM2G A 5 A_WeaponReady
		SM2G A 0 A_TakeInventory("UsedStamina", 2)
		SM2G A 5 A_WeaponReady
		Goto Ready
	StopSprint:
		SM2G A 1
		SM2G A 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired")
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		Goto Ready	
		
	Deselect:
        SM2S CBA 1

		SMGG A 0 A_TakeInventory("Zoomed", 1)
		SMGG A 0 A_TakeInventory("ADSMode", 1)
		SMGG A 0 A_ZoomFactor(1.0)

		TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
		SM2G A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 1 A_Lower
		Wait
		
	Select:
TNT1 A 0 A_JumpIfInventory("StartAmmoDSMG",1,"Selected")
TNT1 A 0 A_GiveInventory("BDDualSMGAmmo","BDSMGAmmo")
TNT1 A 0 A_GiveInventory("BDDualSMGAmmo",40)
TNT1 A 0 A_GiveInventory("StartAmmoDSMG",1)
	Selected:
		SM2G A 0 A_Takeinventory("FistsSelected",1)
		SM2G A 0 A_Takeinventory("SawSelected",1)
		SM2G A 0 A_Takeinventory("ShotgunSelected",1)
		SM2G A 0 A_Takeinventory("SSGSelected",1)
		SM2G A 0 A_Takeinventory("MinigunSelected",1)
		SM2G A 0 A_Takeinventory("PlasmaGunSelected",1)
		SM2G A 0 A_Takeinventory("RocketLauncherSelected",1)
		SM2G A 0 A_Takeinventory("GrenadeLauncherSelected",1)
		SM2G A 0 A_Takeinventory("BFGSelected",1)
		SM2G A 0 A_Takeinventory("BFG10kSelected",1)
		SM2G A 0 A_Takeinventory("RailGunSelected",1)
		SM2G A 0 A_Takeinventory("SubMachineGunSelected",1)
		SM2G A 0 A_Takeinventory("RevenantLauncherSelected",1)
		SM2G A 0 A_Takeinventory("LostSoulSelected",1)
		SM2G A 0 A_Takeinventory("FlameCannonSelected",1)
		SM2G 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
	    SM2G A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        SM2G A 0 A_PlaySound("CLIPIN")
        SM2S ABC 1
		SM2G A 0 A_Takeinventory("StartDualWield",1)
        SM2G A 0 A_GunFlash
		Goto Ready


	
    Fire:
        SM2G A 0 A_JumpIfInventory("BDDualSMGAmmo",1,2)
        Goto NoAmmo
        TNT1 AAAA 0

//SMGG A 0 A_JumpIfInventory("Zoomed",1,"Fire2") //new
TNT1 A 0 A_Giveinventory("2xFireSMG",1)

		//SM2G A 0 A_PlaySound("FARSHT", 6)
        SM2G A 0 A_PlaySound("SMGFIRE")
		SM2G A 0 A_ZoomFactor(0.99)
		//SM2G A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		SM2F A 1 BRIGHT A_FireBullets (8, 4, -1, 12, "WeakPuff", FBF_NORANDOM)
		SM2G A 0 A_ZoomFactor(1.0)
        RIFF A 0 A_FireCustomMissile("DecorativeTracer", random(-6,3), 0, 5, 0)
		SM2G A 0 A_Takeinventory("BDSMGAmmo",1)
		SM2G A 0 A_Takeinventory("BDDualSMGAmmo",1)
		SM2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,6,-2)
		SM2G A 0 A_SetPitch(-0.05 + pitch) //-0.2
		
		SM2G A 0 A_JumpIfInventory("BDDualSMGAmmo",1,1)
        Goto NoAmmo
		SM2G A 0 A_JumpIfInventory("BDSMGAmmo",1,1)//Checks if single gun is not depleted
        Goto NoAmmoOnSecondGun
		//SM2G A 0 A_PlaySound("FARSHT", 6)
        SM2G A 0 A_PlaySound("SMGFIRE")
		SM2G A 0 A_ZoomFactor(0.99)
		//SM2G A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		SM2F B 1 BRIGHT A_FireBullets (8, 4, -1, 12, "WeakPuff", FBF_NORANDOM)
		SM2G A 0 A_ZoomFactor(1.0)
        RIFF A 0 A_FireCustomMissile("DecorativeTracer", random(-3,6), 0, -5, 0)
		SM2G A 0 A_Takeinventory("BDDualSMGAmmo",1)
        SM2F C 1
		SM2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,-8,-2)
		SM2G A 0 A_SetPitch(-0.05 + pitch) //-0.2
		SM2G A 0 A_ReFire
		SM2G A 1 A_WeaponReady(1)
		SM2G A 7 A_WeaponReady(1)
		Goto Ready3
		
		
	NoAmmo:
RIFG A 0 A_JumpIfInventory("HasUnloaded",1,"IdleUnload") //xx
		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_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("IsRunning",1,"CheckSprint")
		RIFG A 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
		RIFG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		SM2G A 5 A_WeaponReady(WRF_ALLOWRELOAD | WRF_NOFIRE)
		RIFG A 0 A_JumpIfInventory("Reloading",1,"Reload")
		RIFG A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
		TNT1 A 0 A_JumpIfInventory("NoAutoReload", 1, "NoAmmo2")
		RIFG A 0 A_JumpIfInventory("Clip1",1,"Reload")
		RIFG A 0 A_JumpIfInventory("FiredPrimary",1,"NoAmmo2")
		Goto Ready3
		
    Reload:
		SM2G A 0
TNT1 A 0 A_JumpIfInventory("2xFireSMG",1,"2xReload")
goto 1xReload
2xReload:
TNT1 A 0 A_Takeinventory("2xFireSMG",1)

		SM2G A 0 A_Takeinventory("ADSmode",1)
		SM2G A 0 A_Takeinventory("Reloading",1)
		SM2G A 0 A_JumpIfInventory("BDDualSMGAmmo",82,"Ready")

        SM2G A 0 A_JumpIfInventory("Clip1",1,3)
        Goto NoAmmo
        TNT1 AAA 0
		SM2G A 0 A_Takeinventory("Zoomed",1)
        SM2G A 0 A_ZoomFactor(1.0)
		SM2G A 0 A_GiveInventory ("Pumping", 1)
		SM2G A 0 A_Takeinventory("Reloading",1)
		SM2G A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
RIFR C 0 A_JumpIfinventory("HasUnloaded",1,2)
RIFR C 0 A_FireCustomMissile("EmptyClipSpawn",-5,0,8,-4)

RIFR C 0 A_JumpIfinventory("HasUnloaded",1,"HasUnloadedlower")
		SM2S CBA 1
goto nohasunload1
HasUnloadedlower:
SM2G FED 1
nohasunload1:
		TNT1 A 5
		SM2G A 0 A_PlaySound("reload")
RIFR C 0 A_JumpIfinventory("HasUnloaded",1,"ULGo")
        SMGR TSRABCDEEEFGHI 1
ULGo:
SMGR JKKKKKKKKKK 1
        SMGR LMNOPQEEEDCBARST 1
		TNT1 A 5
		
RIFR C 0 A_JumpIfinventory("HasUnloaded",1,2)
RIFR C 0 A_FireCustomMissile("EmptyClipSpawn",-5,0,8,-4)

		SM2G A 0 A_PlaySound("reload")
RIFR C 0 A_JumpIfinventory("HasUnloaded",1,"ULGo2")
        SM2R TSRABCDEEEFGHI 1
ULGo2:
SM2R JKKKKKKKKKK 1
        SM2R LMNOPQEEEDCBARST 1
		TNT1 A 5
		
		SM2S ABC 1
		SM2G A 0 A_JumpIfInventory("BDDualSMGAmmo",1,"InsertBullets2")//80+1 effect
		
	TurboReload:
		SM2G A 0 A_Takeinventory("HasUnloaded",1)
        SM2S BA 0
        Goto InsertBullets
		
	InsertBullets:
TNT1 A 0 A_Giveinventory("2xFireSMG",1)

TNT1 A 0 A_JumpIfInventory("NoMagReload",1,"NoMagReloading")
TNT1 A 0 A_Takeinventory("BDDualSMGAmmo")
NoMagReloading:
InsertBulletsB:

		TNT1 AAAA 0
		SM2G A 0 A_JumpIfInventory("BDDualSMGAmmo",80,15)
		SM2G A 0 A_JumpIfInventory("Clip1",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		SM2G A 0 A_Giveinventory("BDSMGAmmo",1)
		SM2G A 0 A_Giveinventory("BDDualSMGAmmo",1)
		SM2G A 0 A_Takeinventory("Clip1",1)
		Goto InsertBulletsB
		
		TNT1 AAAAAAAAAA 0
		SM2G A 0 A_Takeinventory("Reloading",1)
		
		SM2G A 0 A_Refire
        Goto Ready
		TNT1 AAAA 0
		SM2G A 0 A_Takeinventory("Reloading",1)
		
		SM2G A 0 A_Refire
        Goto Ready
		
	InsertBullets2:
TNT1 A 0 A_JumpIfInventory("NoMagReload",1,"NoMagReloading2")
TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo",2,"Two")
Goto Next2
Two:
TNT1 A 0 A_Takeinventory("BDDualSMGAmmo")
TNT1 A 0 A_Giveinventory("BDDualSMGAmmo",2)
Goto InsertBullets2B
Next2:
TNT1 A 0 A_Takeinventory("BDDualSMGAmmo")
TNT1 A 0 A_Giveinventory("BDDualSMGAmmo",1)
Goto InsertBullets2B

NoMagReloading2:
InsertBullets2B:
		TNT1 AAAA 0
		SM2G A 0 A_JumpIfInventory("BDDualSMGAmmo",82,15)
		SM2G A 0 A_JumpIfInventory("Clip1",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		SM2G A 0 A_Giveinventory("BDSMGAmmo",1)
		SM2G A 0 A_Giveinventory("BDDualSMGAmmo",1)
		SM2G A 0 A_Takeinventory("Clip1",1)
		Goto InsertBullets2B
		
		TNT1 AAAAAAAAAA 0
		SM2G A 0 A_Takeinventory("Reloading",1)
		SM2G A 0 A_Refire
        Goto Ready
		TNT1 AAAA 0
		SM2G A 0 A_Takeinventory("Reloading",1)
		
		SM2G A 0 A_Refire
        Goto Ready	



1xReload:
		SM2G A 1
		SM2G A 0 A_Takeinventory("ADSmode",1)
		SM2G A 0 A_Takeinventory("Reloading",1)
		SM2G A 0 A_JumpIfInventory("BDDualSMGAmmo",82,"Ready")

        SM2G A 0 A_JumpIfInventory("Clip1",1,3)
        Goto NoAmmo
        TNT1 AAA 0
		SM2G A 0 A_Takeinventory("Zoomed",1)
        SM2G A 0 A_ZoomFactor(1.0)
		SM2G A 0 A_GiveInventory ("Pumping", 1)
		SM2G A 0 A_Takeinventory("Reloading",1)
		SM2G A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
RIFR C 0 A_JumpIfinventory("HasUnloaded",1,2)
RIFR C 0 A_FireCustomMissile("EmptyClipSpawn",-5,0,8,-4)

		SM2S CBA 1
		TNT1 A 5

//		SM2G A 0 A_PlaySound("reload")
//        SMGR TSRABCDEEEFGHIJKKKKKKKKKK 1
//        SMGR LMNOPQEEEDCBARST 1
//		TNT1 A 5
//
//RIFR C 0 A_JumpIfinventory("HasUnloaded",1,2)
//RIFR C 0 A_FireCustomMissile("EmptyClipSpawn",-5,0,8,-4)
		
		SM2G A 0 A_PlaySound("reload")
        SM2R TSRABCDEEEFGHIJKKKKKKKKKK 1
        SM2R LMNOPQEEEDCBARST 1
		TNT1 A 5
		
		SM2S ABC 1
		SM2G A 0 A_JumpIfInventory("BDDualSMGAmmo",1,"1xInsertBullets2")//80+1 effect
		
	TurboReload:
		SM2G A 0 A_Takeinventory("HasUnloaded",2)
        SM2S BA 0
        Goto 1xInsertBullets
		
	1xInsertBullets: //unused
TNT1 A 0 A_JumpIfInventory("NoMagReload",1,"1xNoMagReloading")
TNT1 A 0 A_Takeinventory("BDDualSMGAmmo")
TNT1 A 0 A_Giveinventory("BDDualSMGAmmo",42)
1xNoMagReloading:
1xInsertBulletsB:

		TNT1 AAAA 0
		SM2G A 0 A_JumpIfInventory("BDDualSMGAmmo",80,15)
		SM2G A 0 A_JumpIfInventory("Clip1",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		SM2G A 0 A_Giveinventory("BDSMGAmmo",1)
		SM2G A 0 A_Giveinventory("BDDualSMGAmmo",1)
		SM2G A 0 A_Takeinventory("Clip1",1)
		Goto 1xInsertBulletsB
		
		TNT1 AAAAAAAAAA 0
		SM2G A 0 A_Takeinventory("Reloading",1)
		
		SM2G A 0 A_Refire
        Goto Ready
		TNT1 AAAA 0
		SM2G A 0 A_Takeinventory("Reloading",1)
		
		SM2G A 0 A_Refire
        Goto Ready
		
	1xInsertBullets2:
TNT1 A 0 A_JumpIfInventory("NoMagReload",1,"1xNoMagReloading2")
TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo",2,"1xTwo")
Goto 1xNext2
1xTwo:
TNT1 A 0 A_Takeinventory("BDDualSMGAmmo")
TNT1 A 0 A_Giveinventory("BDDualSMGAmmo",42)
Goto 1xInsertBullets2B
1xNext2:
TNT1 A 0 A_Takeinventory("BDDualSMGAmmo")
TNT1 A 0 A_Giveinventory("BDDualSMGAmmo",41)
Goto 1xInsertBullets2B

1xNoMagReloading2:
1xInsertBullets2B:
		TNT1 AAAA 0
		SM2G A 0 A_JumpIfInventory("BDDualSMGAmmo",82,15)
		SM2G A 0 A_JumpIfInventory("Clip1",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		SM2G A 0 A_Giveinventory("BDSMGAmmo",1)
		SM2G A 0 A_Giveinventory("BDDualSMGAmmo",1)
		SM2G A 0 A_Takeinventory("Clip1",1)
		Goto InsertBullets2B
		
		TNT1 AAAAAAAAAA 0
		SM2G A 0 A_Takeinventory("Reloading",1)
		SM2G A 0 A_Refire
        Goto Ready
		TNT1 AAAA 0
		SM2G A 0 A_Takeinventory("Reloading",1)
		
		SM2G A 0 A_Refire
        Goto Ready	




 	 Unload:
TNT1 A 0 A_Giveinventory("2xFireSMG",1)

		SM2G A 1
		SM2G A 0 A_Takeinventory("ADSmode",1)
		SM2G A 0 A_Takeinventory("Unloading",1)
		SM2G A 0 A_JumpIfInventory("BDSMGAmmo",1,3)
		Goto NoAmmo
        TNT1 AAA 0

		SM2G A 0 A_Takeinventory("Zoomed",1)
        SM2G A 0 A_ZoomFactor(1.0)
		SM2G A 0 A_GiveInventory ("Pumping", 1)
		SM2G A 0 A_Takeinventory("Reloading",1)
		SM2G A 0 A_Giveinventory("HasUnloaded",1)

SM2S CBA 1 
		TNT1 A 5
		SM2G A 0 A_PlaySound("reload")
        	SMGR TSRABCDEEEFGHIJKKKKKKKKKK 1 
SMGR UVW 1
		TNT1 A 5
		SM2G A 0 A_PlaySound("reload")
	 	SM2R TSRABCDEEEFGHIJKKKKKKKKKK 1 
SM2R UVW 1
		TNT1 A 5
SM2G DEF 1

	RemoveBullets:
		TNT1 AAAA 0
		SM2G A 0 A_JumpIfInventory("BDDualSMGAmmo",1,3)
		Goto IdleUnload//Ready
        TNT1 AAAAAA 0
		SM2G A 0 A_Takeinventory("BDSMGAmmo",1)
		SM2G A 0 A_Takeinventory("BDDualSMGAmmo",1)
		SM2G A 0 A_Giveinventory("Clip1",1)
		Goto RemoveBullets
		
		TNT1 AAAAAAAAAA 0
		SM2G A 0 A_Takeinventory("Reloading",1)
		
		SM2G A 0 A_Refire
        Goto IdleUnload//Ready
		TNT1 AAAA 0
		SM2G A 0 A_Takeinventory("Reloading",1)
		
		SM2G A 0 A_Refire
        Goto IdleUnload//Ready

IdleUnload:
       // SM2G A 0 A_JumpIfInventory("Kicking",1,"DoKick")
       // SM2G A 0 A_JumpIfInventory("Taunting",1,"Taunt")
	//	SM2G A 0 A_JumpIfInventory("Salute1", 1, "Salute")
	//	SM2G A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        SM2G A 0 A_JumpIfInventory("Reloading",1,"Reloadstart")
//	SM2G A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		SM2G A 0 A_JumpIfInventory("Unloading",1,"UnloadUnloaded")
		SM2G F 1 A_WeaponReady(WRF_ALLOWRELOAD)
		SM2G A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		SM2G A 0 A_JumpIfInventory("Reloading",1,"Reloadstart")
		SM2G A 0 A_JumpIfInventory("StartDualWield",1,"DualWield")
		Loop
	
Unloadunloaded:
SM2G A 0 A_TakeInventory("Unloading",1)
Goto IdleUnload

ReloadStart:
Goto Reload


	Spawn:
		SMGZ A -1
		Stop
		
		
	Steady:
		TNT1 A 1
		Goto Ready



AltFire:

SM2G A 0 A_JumpIfInventory("BDSMGAmmo",1,"AltFiring")//smg empty?
        Goto Fire //NoAmmoOnSecondGun
SM2G A 0 A_JumpIfInventory("BDDualSMGAmmo",1,"AltFiring")
        Goto NoAmmo
AltFiring:
        TNT1 AAAA 0
        SM2G A 0 A_PlaySound("SMGFIRE")
		SM2G A 0 A_ZoomFactor(0.99)

SM2F I 1 BRIGHT A_FireBullets (8, 4, -1, 12, "WeakPuff", FBF_NORANDOM)
		SM2G A 0 A_ZoomFactor(1.0)
        RIFF A 0 A_FireCustomMissile("DecorativeTracer", random(-3,6), 0, -5, 0)
		SM2G A 0 A_Takeinventory("BDDualSMGAmmo",1)
		SM2G A 0 A_Takeinventory("BDSMGAmmo",1)
        SM2F GH 1
		SM2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,-8,-2)
		SM2G A 0 A_SetPitch(-0.05 + pitch) //-0.2
		SM2G A 0 A_ReFire
		SM2G A 1 A_WeaponReady(1)
		SM2G A 7 A_WeaponReady(1)

SM2G A 0 A_JumpIfInventory("BDDualSMGAmmo",1,1)
        Goto NoAmmo
		SM2G A 0 A_JumpIfInventory("BDSMGAmmo",1,1)//Checks if single gun is not depleted
        Goto NoAmmoOnSecondGun

		Goto Ready3
		Goto Ready
		Goto AltFire
		


	Ready2:
        SM2G A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SM2G A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		SM2G A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		SM2G A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        SM2G A 0 A_JumpIfInventory("Reloading",1,"Reload")
		SM2G A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		SM2G A 0 A_JumpIfInventory("Unloading",1,"Unload")
		SM2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		SM2G A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		SM2G A 0 A_JumpIfInventory("Reloading",1,"Reload")
		SM2G A 0 A_JumpIfInventory("StartDualWield",1,"DualWield")
		Loop	




	
	}
}
