
// *** MODIFIED BY CHEBMASTER
// I mark most important places modified by me with //***Che -- unless I forget to.


ACTOR SSG : BrutalWeapon
{
	Game Doom
	SpawnID 33
	Weapon.Kickback 50
	Weapon.SelectionOrder 400
	Weapon.AmmoGive1 4
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "AmmoShell"
	Weapon.AmmoType2 "SSGAmmo"
	Weapon.AmmoUse1 0
	Weapon.AmmoUse2 0
    +WEAPON.NOAUTOAIM
	+WEAPON.NOAUTOFIRE
	+FORCEXYBILLBOARD
	Inventory.PickupMessage "$GOTSHOTGUN2"
	Obituary "$OB_MPSSHOTGUN"
    Inventory.PickupSound "CLIPINSS"
	Scale 0.9
	Tag "Super Shotgun"
	
	// Stoopid Cheb! This has to be declared IN THE PLAYER PAWN CLASS AS WELL!
	//***Che
	//var int user_alerter_cooldown;
	// P.S. uservars WONT WORK from a weapon. Like, at all. 
	// FFFffffuuuu-----
	
	States
	{
	
		//***Che disabling player weapons for cutscenes and for the evacuation center
		//  offset(0,0) means "keep previous"
		HoldFire:
			SSRU A 1 offset(-9,32) A_WeaponReady(WRF_NOBOB | WRF_NOFIRE | WRF_ALLOWRELOAD)
			SSRU A 0 offset(-9,32) A_JumpIfInventory("Taunting",1,"Taunt")
			SSRU A 0 offset(-9,32) A_JumpIfInventory("Salute1", 1, "Salute")
			SSRU A 0 offset(-9,32) A_JumpIfInventory("Salute2", 1, "Salute")
			SSRU A 0 offset(-9,32) A_JumpIfInventory("Reloading",1,"Reload")
			SSRU A 0 offset(-9,32) A_JumpIfInventory("IsRunning",1,"CheckSprint")
			SSRU A 0 offset(-9,32) A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire")
			Goto Ready

			
		SelectAnimation:    
		Ready:
		Ready3:
			TNT1 A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire")
			SHTZ A 1 A_WeaponReady(WRF_ALLOWRELOAD)
			SHTZ A 0 A_JumpIfInventory("Kicking",1,"DoKick")
			SHTZ A 0 A_JumpIfInventory("Taunting",1,"Taunt")
			SHTZ A 0 A_JumpIfInventory("Salute1", 1, "Salute")
			SHTZ A 0 A_JumpIfInventory("Salute2", 1, "Salute")
			SHTZ A 0 A_JumpIfInventory("Reloading",1,"Reload")
			SHTZ A 0 A_JumpIfInventory("Unloading",1,"Unload")
			SHTZ A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")	
			SHTZ A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
			
			//***Che as I can surmise from observations, weapons use player's inventory
			//  (not documented on the wiki)
			
			// skip alerters if the player is invisible
			SHTZ A 0 A_JumpIfInventory("PowerInvisibility",1,"Ready")
			
			TNT1 A 0 A_GiveInventory("AlerterCooldown", 1) //A_SetUserVar("user_alerter_cooldown", user_alerter_cooldown + 1)
			TNT1 A 0 A_JumpIfInventory("AlerterCooldown", 10, 1)//A_JumpIf(user_alerter_cooldown > 30, 1)
			Loop
			TNT1 A 0 A_TakeInventory("AlerterCooldown", 30)//A_SetUserVar("user_alerter_cooldown", 0)
			TNT1 A 0 A_FireCustomMissile("SuperShotgunAlerter")
			Loop
			
			
		CheckSprint:
			SHTZ A 1 A_WeaponReady(WRF_NOFIRE)
			SHTZ A 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
			SHTZ A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
			Goto Ready
			
		StartSprint:
			SHTZ A 1 A_WeaponReady(WRF_NOFIRE)
			SHTZ A 0 A_Takeinventory("Zoomed",1)
			SHTZ A 0 A_Takeinventory("ADSmode",1)
			SHTZ A 0 A_ZoomFactor(1.0)
			SHTZ A 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired")
			
		Sprinting:	
			SSRU A 0 offset(-9,32) 
			SHTZ A 0 offset(-9,32) A_JumpIfInventory("IsStandingStill", 1, "Ready3")
			SHTZ 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.
			SHTZ A 0 offset(-9,32) A_JumpIfInventory("PowerStrength", 1, 2)
			SHTZ A 0 offset(-9,32) A_GiveInventory("UsedStamina", 6)
			SHTZ A 0 offset(-9,32)
			SSRU A 1 offset(-9,34) A_SetPitch(pitch -0.5)
			SSRU A 1 offset(-6,36) A_SetPitch(pitch -0.5)
			SSRU A 1 offset(-3,38) A_SetPitch(pitch -0.5)
			SSRU A 1 offset(0,38) A_SetPitch(pitch -0.5)
			SSRU A 1 offset(3,36) A_SetPitch(pitch -0.5)
			SSRU A 1 offset(6,34) A_SetPitch(pitch -0.5)
			SSRU A 1 offset(9,32) A_SetPitch(pitch -0.5)
			SHTZ A 0 offset(9,32) A_WeaponReady(WRF_NOBOB)
			SHTZ A 0 A_JumpIfInventory("Kicking",1,"DoKick")
			SHTZ A 0 A_JumpIfInventory("Taunting",1,"Taunt")
			SHTZ A 0 A_JumpIfInventory("Reloading",1,"Reload")
			SHTZ A 0 offset(-9,32) A_GiveInventory("UsedStamina", 6)
			SHTZ A 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
			SSRU A 1 offset(9,34) A_SetPitch(pitch +0.5)
			SSRU A 1 offset(6,36) A_SetPitch(pitch +0.5)
			SSRU A 1 offset(3,38) A_SetPitch(pitch +0.5)
			SSRU A 1 offset(0,38) A_SetPitch(pitch +0.5)
			SSRU A 1 offset(-3,36) A_SetPitch(pitch +0.5)
			SSRU A 1 offset(-6,34) A_SetPitch(pitch +0.5)
			SSRU A 1 offset(-9,32) A_SetPitch(pitch +0.5)
			SHTZ A 0 offset(-9,32) A_WeaponReady(WRF_NOBOB)
			SHTZ A 0 offset(-9,32) A_JumpIfInventory("IsRunning", 1, "Sprinting")
			
			Goto StopSprint
		StopSprintTired:
			SHTZ A 1
			PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
			SHTZ A 0 A_PlaySound("Tired", 2)
			SHTZ A 0 A_TakeInventory("UsedStamina", 2)
			SHTZ A 5 A_WeaponReady
			SHTZ A 0 A_TakeInventory("UsedStamina", 2)
			SHTZ A 5 A_WeaponReady
			SHTZ A 0 A_TakeInventory("UsedStamina", 2)
			SHTZ A 5 A_WeaponReady
			SHTZ A 0 A_TakeInventory("UsedStamina", 2)
			SHTZ A 5 A_WeaponReady
			SHTZ A 0 A_TakeInventory("UsedStamina", 2)
			SHTZ A 5 A_WeaponReady
			Goto Ready
		StopSprint:
			SSRU A 1
			SHTZ A 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired")
			PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
			Goto Ready
			
		PuristGun:
			TNT1 A 1
			SHTZ A 0 A_GiveInventory("ClassicSSG", 1)
			SHTZ A 0 A_TakeInventory("SSG", 1)
			TNT1 A 10
			Goto Ready
			
		Deselect:
			SHTZ A 0 A_Takeinventory("Zoomed",1)
			SHTZ A 0 A_ZoomFactor(1.0)
			SHTZ A 0 A_TakeInventory("TossGrenade", 1)
			SHT5 DCBA 1
			TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
			TNT1 A 1 A_Lower
			Wait
		Select:
			SHTZ A 0 A_Giveinventory("GoSpecial",1)
			SHTZ A 0 A_Takeinventory("FistsSelected",1)
			SHTZ A 0 A_Takeinventory("sawSelected",1)
			SHTZ A 0 A_Takeinventory("ShotgunSelected",1)
			SHTZ A 0 A_Giveinventory("SSGSelected",1)
			SHTZ A 0 A_Takeinventory("MinigunSelected",1)
			SHTZ A 0 A_Takeinventory("PlasmaGunSelected",1)
			SHTZ A 0 A_Takeinventory("RocketLauncherSelected",1)
			SHTZ A 0 A_Takeinventory("GrenadeLauncherSelected",1)
			SHTZ A 0 A_Takeinventory("BFGSelected",1)
			SHTZ A 0 A_Takeinventory("BFG10kSelected",1)
			SHTZ A 0 A_Takeinventory("RailGunSelected",1)
			SHTZ A 0 A_Takeinventory("SubMachineGunSelected",1)
			SHTZ A 0 A_Takeinventory("RevenantLauncherSelected",1)
	
		//***Che
			"----" A 0 A_Takeinventory("UnmakerSelected",1)
			"----" A 0 A_Takeinventory("MG42Selected",1) //***Che
			"----" A 0 A_Takeinventory("AxeSelected",1) //***Che
			
			"----" A 0 A_Takeinventory("DragonslayerSelected",1) //***Che
	
			SHTZ A 0 A_Takeinventory("LostSoulSelected",1)
			SHTZ A 0 A_Takeinventory("FlameCannonSelected",1)
			SHTZ A 0 A_Takeinventory("HasBarrel",1) 
			SHTZ A 0 A_TakeInventory("TossGrenade", 1)
			TNT1 AAAAAAAAAAAA 0 A_Raise
			SHTZ A 0 A_GunFlash
			SHTZ A 0 A_JumpIfInventory("SSGAmmo", 1, 1)
			Goto RaiseReloading
			SHT5 ABCD 1
			SHTZ A 0 A_PlaySound("weapons/sshotc")
			Goto Ready
			
		RaiseReloading:
			SHTZ A 0
			SHTZ A 0 A_JumpIfInventory("AmmoShell", 2, 1)
			Goto RaiseNoAmmo
			SHTZ M 1 Offset(0,38)
			SHTZ N 1 Offset(0,36)
			SHTZ O 1 Offset(0,34)
			SHTZ A 0 A_playsound("weapons/sshotl")
			SHTZ P 1 Offset(10,36)
			  SHTZ P 1 Offset(20,46)
			  SHTZ Q 1 Offset(30,56)
			  SHTZ Q 1 Offset(40,66)
			  SHTZ R 1 Offset(50,76)
			  SHTZ S 1
			  SHTZ A 0 A_GiveInventory ("Pumping", 1)
				
			SHTZ T 1 Offset(30,56)
			SHTZ U 1 Offset(20,46)
			SHTZ V 1 Offset(1,33)
				
			SHTZ A 0 A_GiveInventory ("Pumping", 1)
			SHTZ A 0 A_PlaySound("weapons/sshotc")
			SHTZ A 0 A_TakeInventory("AmmoShell", 2)
			SHTZ A 0 A_GiveInventory("SSGAmmo", 2)
			SHTZ A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
				
				SHTZ WX 1
				SHTZ YZ 1
			  SHTZ A 0 A_GiveInventory ("Pumping", 1)
			  SHTZ A 0 A_TakeInventory("SSGAlt",1)
				SHO9 DE 1
				SHO9 FG 1
			  SHTZ A 0 A_ReFire
			 SHTZ A 2
			Goto Ready
			
			
		RaiseNoAmmo:	
			SHT5 ABCD 1
			SHTZ A 0 A_PlaySound("weapons/sshotc")
			Goto Ready

		NoAmmo:
			SHTZ A 0
			SHTZ A 0 A_ZoomFactor(1.0)
			SHTZ A 0 A_Takeinventory("Zoomed",1)
			SHTZ A 0 A_Takeinventory("ADSmode",1)
			TNT1 A 0 A_PlaySound("weapons/empty", 4)
			NoAmmo2:
			SHTZ A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
			SHTZ A 0 A_JumpIfInventory("Taunting",1,"Taunt")
			SHTZ A 0 A_JumpIfInventory("Salute1", 1, "Salute")
			SHTZ A 0 A_JumpIfInventory("Salute2", 1, "Salute")
			SHTZ A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
			SHTZ A 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
			SHTZ A 0 A_JumpIfInventory("Kicking",1,"DoKick")
			SHTZ A 5 A_WeaponReady(WRF_ALLOWRELOAD | WRF_NOFIRE)
			SHTZ A 0 A_JumpIfInventory("Reloading",1,"Reload")
			TNT1 A 0 A_JumpIfInventory("NoAutoReload", 1, "NoAmmo2")
			SHTZ A 0 A_JumpIfInventory("AmmoShell",1,"Reload")
			SHTZ A 0 A_JumpIfInventory("FiredPrimary",1,"NoAmmo2")
			Goto Ready3
			
		Fire:
			//***Che
			"----" A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire")
			"----" A 0 A_GiveInventory ("PlayerIsFighting", 150) //***Che encourages the follower NPCs to get da fug out of your line of fire	
			SHTZ A 0 A_TakeInventory("Reloading",1)
			//***Che may give up to extra 1 s delay
			TNT1 A 0 A_TakeInventory("AlerterCooldown", 30) //	A_SetUserVar("user_alerter_cooldown", random(-35, 30))
			TNT1 A 0 A_GiveInventory("AlerterCooldown", random(1, 20))
			SHTZ A 0 A_JumpIfInventory("SSGAlt",1,"AltFire")
			SHTZ A 0 A_JumpIfInventory("SSGAmmo", 2, 1)
			Goto NoAmmo
			//SHTZ A 0 A_JumpIfInventory("SSGAmmo", 2, 1)
			//Goto AltFire
			
			TNT1 A 0 A_GiveInventory ("PlayerIsFighting", 150) //***Che encourages the follower NPCs to get da fug out of your line of fire
			SHTZ A 0 A_TakeInventory("SSGAmmo", 2)
			SHTZ A 0 A_ZoomFactor(1.6)
			SHTZ A 0 A_JumpIfInventory("PowerStrength", 1, 2)
			SHTZ A 0 A_Recoil(5)
			SHTZ A 0
			"----" A 0 A_JumpIfInventory("QPowerQuadDamage", 1, 2)
			"----" A 0 A_JumpIf(true, 2)
			"----" A 0 A_PlaySound("quaddamage/echo", CHAN_7)					
			SHTZ A 0 A_FireCustomMissile("DistantFireSoundSSG", random(-1,1), 0, 0, -12, 0, random(-1,1))
			SHO9 A 0 A_firebullets (0,0,1,40,"shotpuff",FBF_NORANDOM,300)
			SHO9 A 0 BRIGHT A_playsound("SSHFIRE", 5)
			TNT1 AAAAAAAAAAA 0 A_FireCustomMissile("DecorativeTracer", random(-10,10), 0, 0, -12, 0, random(-5,5))
			TNT1 AAAAAAAAAAAAAAAAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles", random(-19,19), 0, -1, 0, 0, random(-9,9))
			TNT1 AAAAAAAAAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles2", random(-19,19), 0, -1, 0, 0, random(-9,9))
			SHTZ A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
			SHOF A 1 BRIGHT
			SHTZ A 0 A_FireBullets (10, 1, 9, 13, "ShotgunPuff", FBF_NORANDOM)
			SHTZ A 0 A_FireBullets (6, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
			
			SHTZ A 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 3)//Tactical Mode deals extra damage
			SHTN A 0 A_FireBullets (11, 3, 10, 13, "ShotgunPuff2", FBF_NORANDOM)
			SHTZ A 0 A_SetPitch(pitch-20)
			TNT1 AA 0
			SHTZ A 0 A_SetPitch(pitch-12)
			SHOF B 1 BRIGHT
			SHTZ A 0 A_ZoomFactor(1.00)
			//SHTZ AA 0 A_FireCustomMissile("GunFireSmokE", 0, 0, 2, 0, 0, 0)
			//SHTZ AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, -2, 0, 0, 0)
			SHTZ A 0 A_TakeInventory("SSGAlt",1)
			SHTZ A 0 A_TakeInventory("Reloading",1)
		
			SHOF CDEFGI 1 A_SetPitch(pitch+2)
			
			SHTZ A 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 15)//Tactical Mode takes more time
			SHTZ AAAAAAAAAA 1 A_SetPitch(pitch+0.5)
			SHTZ AA 1 A_WeaponReady(WRF_NOFIRE | WRF_NOBOB)
			SHTZ AAA 1 A_JumpIfInventory("Reloading",1,"Reload")
			SHTZ A 0 A_JumpIfInventory("Kicking",1,"DoKick")
			SHTZ A 0 A_JumpIfInventory("Taunting",1,"Taunt")
			SHTZ A 0 A_JumpIfInventory("Salute1", 1, "Salute")
			SHTZ A 0 A_JumpIfInventory("Salute2", 1, "Salute")
			SHTZ A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")	
			SHTZ A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
			SHTZ A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOBOB)
			Goto NoAmmo2
			
			
			
			
			
		Reload:	
			SHTZ A 0
			
			SHTZ A 0 A_TakeInventory("Reloading",1)
			
			
			SHTZ A 0 A_JumpIfInventory("SSGAlt", 1, "Reload2")//Check if still has a shell on left barrel
			
			SHTZ A 0 A_JumpIfInventory("SSGAmmo", 2, "Ready")//Check if still has a shell on left barrel
			
			
			SHTZ A 0 A_JumpIfInventory("AmmoShell", 1, 1)//Check if has any ammo left to reload
			Goto Ready
			
			
			SHTZ A 0 A_JumpIfInventory("AmmoShell", 2, 1)//Check if has ammo to reload 2 shells
			Goto Reload2
			
		
			
			
			//Reload 2 barrels
			
			SHTZ B 2 Offset(20,48) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
			SHTZ B 2 Offset(10,36) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
			SHTZ BCDEF 1
			SHTZ GH 1
			SHTZ IJ 1
			SHTZ A 0 A_GiveInventory ("Pumping", 1)
			
			SHTZ A 0 A_PlaySound("weapons/sshotc")
			SHTZ A 0 A_JumpIfInventory("HasUnloaded", 1, 3)
			TNT1 AA 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-10, -20)
			SHTZ K 2
			SHTZ L 2
			SHTZ MNOO 1
			SHTZ A 0 A_playsound("weapons/sshotl")
			  SHTZ P 1 Offset(10,36)
			  SHTZ P 1 Offset(20,46)
			  SHTZ Q 1 Offset(30,56)
			  SHTZ Q 1 Offset(40,66)
			  SHTZ R 1 Offset(50,76)
			  SHTZ S 1
			  SHTZ A 0 A_GiveInventory ("Pumping", 1)
				
			SHTZ T 1 Offset(30,56)
			SHTZ U 1 Offset(20,46)
			SHTZ V 1 Offset(1,33)
				
			SHTZ A 0 A_GiveInventory ("Pumping", 1)
			SHTZ A 0 A_PlaySound("weapons/sshotc")
			SHTZ A 0 A_TakeInventory("AmmoShell", 2)
			SHTZ A 0 A_GiveInventory("SSGAmmo", 2)
			SHTZ A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
				
				SHTZ WX 1
				SHTZ YZ 1
			  SHTZ A 0 A_GiveInventory ("Pumping", 1)
			  SHTZ A 0 A_TakeInventory("SSGAlt",1)
				SHO9 DE 1
				SHO9 FG 1
			  SHTZ A 0 A_ReFire
			 SHTZ A 2
			TNT1 A 0 A_GiveInventory("AlerterCooldown", 10)  
			Goto Ready
			

		AltFire:
			SHTZ A 0 A_TakeInventory("Reloading",1)
			SHTZ A 0 A_JumpIfInventory("SSGAmmo",1,3)
			Goto NoAmmo
			TNT1 AAAAA 0
			
			TNT1 A 0 A_GiveInventory ("PlayerIsFighting", 100) //***Che encourages the follower NPCs to get da fug out of your line of fire

			"----" A 0 A_JumpIfInventory("QPowerQuadDamage", 1, 2)
			"----" A 0 A_JumpIf(true, 2)
			"----" A 0 A_PlaySound("quaddamage/echo", CHAN_7)
			
			SHTZ A 0 A_JumpIfInventory("SSGAlt",1,"AltFire2")


			SHTZ A 0 A_TakeInventory("SSGAmmo",1)
			SHTZ A 0 A_GiveInventory("SSGAlt",1)
					
			SHTZ A 0 A_ALertMonsters
			//SHTZ AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 2, 0, 0, 0)
			TNT1 AAAAAAAAAAAAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles", random(-12,12), 0, -1, 0, 0, random(-9,9))
			TNT1 AAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles2", random(-12,12), 0, -1, 0, 0, random(-9,9))
			SHTU A 1 BRIGHT A_PlaySound("weapons/sg")
			SHTZ A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
			SHTZ A 0 A_FireCustomMissile("DistantFireSoundShotgun", random(-1,1), 0, 0, -12, 0, random(-1,1))
			SHTU A 1 BRIGHT A_FireBullets (5, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
			
			SHTZ A 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 3)//Tactical Mode deals extra damage
			SHTN A 0 A_FireBullets (6, 3, 5, 13, "ShotgunPuff2", FBF_NORANDOM)
			SHTZ A 0 A_SetPitch(pitch-7)
			SHTZ A 0
			
			TNT1 AAAAA 0 A_FireCustomMissile("DecorativeTracer", random(-5,5), 0, 0, -12, 0, random(-5,5))
			SHTZ A 0 A_SetPitch(-5.0 + pitch)
			SHOF EFGHI 1 A_SetPitch(+1.0 + pitch)
			SHTZ A 0
			Goto Ready

		AltFire2:
			SHTZ A 0 A_TakeInventory("SSGAmmo", 1)
			SHTZ A 0 A_ALertMonsters
			//SHTZ AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, -2, 0, 0, 0)
			TNT1 AAAAAAAAAAAAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles", random(-12,12), 0, -1, 0, 0, random(-9,9))
			TNT1 AAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles2", random(-12,12), 0, -1, 0, 0, random(-9,9))
			SHTU B 1 BRIGHT A_PlaySound("weapons/sg")
			SHTZ A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
			SHTZ A 0 A_FireCustomMissile("DistantFireSoundShotgun", random(-1,1), 0, 0, -12, 0, random(-1,1))
			SHTU B 1 BRIGHT A_FireBullets (5, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
			
			
			SHTZ A 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 3)//Tactical Mode deals extra damage
			SHTN A 0 A_FireBullets (6, 3, 5, 13, "ShotgunPuff2", FBF_NORANDOM)
			SHTZ A 0 A_SetPitch(pitch-7)
			SHTZ A 0
			
			TNT1 AAAAA 0 A_FireCustomMissile("DecorativeTracer", random(-5,5), 0, 0, -12, 0, random(-5,5))
			 SHTZ A 0 A_SetPitch(-4.0 + pitch)
			SHOF EFGHI 1 A_SetPitch(+1.0 + pitch)
			
			SHTZ A 0 A_TakeInventory("SSGAlt", 1)
			TNT1 A 0 A_JumpIfInventory("NoAutoReload", 1, "NoAmmo")
			Goto Reload
			TNT1 AA 0
			Goto Ready
			
		Reload2:
			SHTZ A 0 A_TakeInventory("Reloading",1)
			SHTZ A 0 A_JumpIfInventory("AmmoShell",1,1)
			Goto NoAmmo
			SHTZ A 0 A_TakeInventory("SSGAlt",1)
			
			SHTZ B 2 Offset(20,48) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
			SHTZ A 0 
			SHTZ A 0 
			SHTZ B 2 Offset(10,36) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
			SHTZ A 0 
			SHTZ A 0 
			SHTZ BCDEF 1
			SHTZ A 0 
			SHTZ A 0 
			SHTZ GH 1
			SHTZ A 0 
			SHTZ A 0 
			SHTZ IJ 1
			SHTZ A 0
			SHTZ A 0
			
			SHTZ A 0 A_GiveInventory ("Pumping", 1)
			
			SHTZ A 0 A_PlaySound("weapons/sshotc")
			SHTZ A 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-10, -20)
			SHTZ K 2
			SHT7 L 2
			SHT7 MNOO 1
			SHTZ A 0 A_playsound("weapons/sshotl")
			SHT7 P 1 Offset(10,36)
			SHT7 P 1 Offset(20,46)
			SHTZ Q 1 Offset(30,56)
			SHTZ Q 1 Offset(40,66)
			SHTZ R 1 Offset(50,76)
			SHTZ A 0
			SHTZ S 1
			SHTZ A 0 A_GiveInventory ("Pumping", 1)
			
			SHTZ T 1 Offset(30,56)
			SHTZ U 1 Offset(20,46)
			SHTZ V 1 Offset(1,33)
			
			SHTZ A 0 A_GiveInventory ("Pumping", 1)
			SHTZ A 0 A_PlaySound("weapons/sshotc")
			SHTZ A 0 A_TakeInventory("AmmoShell", 1)
			SHTZ A 0 A_GiveInventory("SSGAmmo", 1)
			SHTZ WX 1
			SHTZ YZ 1
			SHTZ A 0 A_GiveInventory ("Pumping", 1)
			SHO9 DE 1
			SHO9 FG 1
			SHTZ A 0 A_ReFire
			SHTZ A 2
			
		  Goto Ready

		Spawn:
			SGN2 A -1
			Stop
		
		
			
		
		Unload:
			SHTZ A 1 A_WeaponReady
			SHTZ A 0 A_ZoomFactor(1.0)
			SHTZ A 0 A_Takeinventory("Unloading",1)
			SHTZ A 0 A_Takeinventory("ADSmode",1)
			SHTZ A 0 A_Takeinventory("Zoomed",1)
			SHTZ A 0 A_JumpIfInventory("SSGAmmo",1,3)
			Goto Ready
			TNT1 AAA 0
			SHTZ A 0 A_Takeinventory("Zoomed",1)
			SHTZ A 0 A_GiveInventory ("Pumping", 1)
			SHTZ A 0 A_Takeinventory("Unloading",1)
			
		RemoveBullets:
			TNT1 AAAA 0
			SHTZ A 0 A_JumpIfInventory("SSGAmmo",1,3)
			Goto FinishUnload
			TNT1 AAAAAA 0
			SHTZ A 0 A_Takeinventory("SSGAmmo",1)
			SHTZ A 0 A_Giveinventory("AmmoShell",1)
			Goto RemoveBullets
		
		FInishUnload:
			SHTZ B 2 Offset(20,48) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
			SHTZ B 2 Offset(10,36) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
			SHTZ BCDEF 1
			SHTZ GH 1
			SHTZ A 0 A_PlaySound("weapons/sshotc")
			SHTZ IJ 1
			SHTZ K 2
			TNT1 A 20
			SHTZ A 0 A_GiveInventory("HasUnloaded", 1)
			SHTZ A 0 A_Takeinventory("Unloading",1)
			SHTZ U 1 Offset(20,46)
			SHTZ V 1 Offset(1,33)
			
			SHTZ A 0 A_GiveInventory ("Pumping", 1)
			SHTZ A 0 A_PlaySound("weapons/sshotc")
			SHTZ WX 1
			SHTZ YZ 1
			SHTZ A 0 A_PlaySound("CLIPINSS")
			SHTZ A 0 A_GiveInventory ("Pumping", 1)
			SHO9 DE 1
			SHO9 FG 1
			Goto Ready
	}
}
