ACTOR BrutalSMG : BrutalWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 40
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Clip1"
	Weapon.AmmoType2 "BDSMGAmmo"
	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.NOALERT
	Scale 0.9
	States
	{
	
	Ready3:
	Ready:
        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("Unloading",1,"Unload")
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Ready2")
		SMGG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("StartDualWield",1,"DualWield")
		Loop
		
	Ready2:
        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("Unloading",1,"Unload")
		SMGA A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("StartDualWield",1,"DualWield")
		Loop	
	
	 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)
        RIFZ ABC 1
        Goto Ready2
       NoAim:
        
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		RIFZ CBA 1
        Goto Ready3
		
	CheckSprint:
		SMGG 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:
		SMGG A 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired")
		
	Sprinting:	
		Sprinting:	
		SMSP A 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", 4)
		TNT1 A 0 offset(-9,32)
		SMSP A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		SMSP A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		SMSP A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		SMSP A 1 offset(0,38) A_SetPitch(pitch -0.5)
		SMSP A 1 offset(3,36) A_SetPitch(pitch -0.5)
		SMSP A 1 offset(6,34) A_SetPitch(pitch -0.5)
		SMSP A 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", 4)
		TNT1 A 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
		SMSP A 1 offset(9,34) A_SetPitch(pitch +0.5)
		SMSP A 1 offset(6,36) A_SetPitch(pitch +0.5)
		SMSP A 1 offset(3,38) A_SetPitch(pitch +0.5)
		SMSP A 1 offset(0,38) A_SetPitch(pitch +0.5)
		SMSP A 1 offset(-3,36) A_SetPitch(pitch +0.5)
		SMSP A 1 offset(-6,34) A_SetPitch(pitch +0.5)
		SMSP A 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:
		SMGG 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)
		SMGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		SMGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		SMGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		SMGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		SMGG A 5 A_WeaponReady
		Goto Ready
	StopSprint:
		SMSP 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	
		
	Deselect:
        SMGS CBA 1
		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 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("CLIPIN")
        SMGS ABC 1
		TNT1 A 0 A_Takeinventory("StartDualWield",1)
        TNT1 A 0 A_GunFlash
		Goto Ready

	
    Fire:
        TNT1 A 0 A_JumpIfInventory("BDSMGAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
		TNT1 A 0 A_ALertMonsters
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
		TNT1 A 0 A_PlaySound("FARSHT", 6)
        TNT1 A 0 A_PlaySound("SMGFIRE")
		TNT1 A 0 A_ZoomFactor(0.98)
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		SMGF A 1 BRIGHT A_FireBullets (3.5, 3.5, 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("BDSMGAmmo",1)
		TNT1 A 0 A_Takeinventory("BDDualSMGAmmo",1)
        SMGF B 1
		TNT1 A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,0,-9)
		SMGF C 1 
		TNT1 A 0 A_ReFire
		SMGG A 1 A_WeaponReady(1)
		SMGG A 7 A_WeaponReady(1)
		Goto Ready3
		
	 Fire2:
		TNT1 A 0 A_PlaySound("FARSHT", 6)
        TNT1 A 0 A_PlaySound("SMGFIRE")
		TNT1 A 0 A_ZoomFactor(1.33)
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		SMGA B 1 BRIGHT A_FireBullets (2, 2, 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("BDSMGAmmo",1)
		TNT1 A 0 A_Takeinventory("BDDualSMGAmmo",1)
        SMGA C 1
		TNT1 A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,0,-9)
		SMGA D 1 
		TNT1 A 0 A_ReFire
		SMGA A 1 A_WeaponReady(1)
		SMGA A 7 A_WeaponReady(1)
		Goto Ready2	
		
		
	NoAmmo:
	SMGG A 1
	Goto Ready
	
    Reload:
		SMGG A 1
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("BDSMGAmmo",41,"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("HasUnloaded", 1, 2)
		RIFR C 0 A_FireCustomMissile("EmptyClipSpawn",-5,0,8,-4)
		TNT1 A 0 A_PlaySound("reload")
        SMGR ABCDEEEFGHIJKKKKKKKKKK 1
        SMGR LMNOPQEEEDCBA 1
		
		TNT1 A 0 A_JumpIfInventory("BDSMGAmmo",1,"InsertBullets2")//40+1 effect
		
	TurboReload:
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
        SMGS BA 0
        Goto InsertBullets
		
	InsertBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("BDSMGAmmo",40,15)
		TNT1 A 0 A_JumpIfInventory("Clip1",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("BDSMGAmmo",1)
		TNT1 A 0 A_Giveinventory("BDDualSMGAmmo",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("BDSMGAmmo",41,15)
		TNT1 A 0 A_JumpIfInventory("Clip1",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("BDSMGAmmo",1)
		TNT1 A 0 A_Giveinventory("BDDualSMGAmmo",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:
		SMGG A 1
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		TNT1 A 0 A_JumpIfInventory("BDSMGAmmo",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("reload")
		TNT1 A 0 A_Giveinventory("HasUnloaded",1)
        SMGR ABCDEEEFGHIJKKKKKKKKKK 1
		
	RemoveBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("BDSMGAmmo",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		TNT1 A 0 A_Takeinventory("BDSMGAmmo",1)
		TNT1 A 0 A_Takeinventory("BDDualSMGAmmo",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
		
		
		
 	Spawn:
		SMGZ A -1
		Stop
		
		
	Steady:
		TNT1 A 1
		Goto Ready	
		
		
	DualWield:
		TNT1 A 1
		TNT1 A 0 A_Takeinventory("StartDualWield",1)
		TNT1 A 0 A_JumpIfInventory("DualSMG", 1, "GetDual")
		TNT1 A 0 A_Print("You must have two identical weapons to dual wield.")
		Goto Ready
		
	 GetDual:	
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_TakeInventory("Kicking",1)
        TNT1 A 0 A_TakeInventory("Taunting",1)
        TNT1 A 0 A_TakeInventory("Reloading",1)
		TNT1 A 0 A_TakeInventory("Unloading",1)
		TNT1 A 0 A_TakeInventory("Salute1", 1)
		TNT1 A 0 A_TakeInventory("Salute2", 1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_SelectWEapon("DualSMG")
		Goto Ready	
	}
}

