// =============================================================================
//
// Brutal DOOM - Mutators
//
// 4 is better than 2, then Quad-Shotgun is 
// better than Super Shotgun
//
// -----------------------------
//
// Sprites from Insanity Brutality
// Decorate Scrip by XV117
//
// =============================================================================

ACTOR Quad_Shotgun : BrutalWeapon
{
	Game Doom
	SpawnID 33
	Weapon.SelectionOrder 400
	Weapon.AmmoGive1 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "AmmoShell"
	Weapon.AmmoType2 "QuadShotgunAmmo"
	Weapon.AmmoUse1 0
	Weapon.AmmoUse2 0
    +WEAPON.NOAUTOAIM
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOALERT
	+WEAPON.NO_AUTO_SWITCH
	Weapon.SlotNumber 3
  	Inventory.Pickupmessage "You got a Quad-Barreled Super Shotgun!"
  	Obituary "%o got pwned by %k's Quad-Shotgun"
	tag "Quad Shotgun"
  	Inventory.PickupSound "CLIPINSS"
	Scale 1
	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("StartDualWield", 1, "ChangeFireMode")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")	
		TNT1 A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")	
		TNT1 A 0 A_ZoomFactor(1.0)
		QSGG A 1 A_WeaponReady
		Loop
		
	Deselect:
		QSGS DCBA 1
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
		TNT1 A 0 A_Takeinventory("StartDualWield",1)
		TNT1 A 0 A_TakeInventory("SlugMode",1)
		TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		Wait
		
	Select:
		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_Giveinventory("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_Takeinventory("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 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		TNT1 A 1 A_Raise
		TNT1 A 0 A_GunFlash
		TNT1 AAAAAAAAAA 0 A_Raise
		Goto SelectAnimation
	SelectAnimation:		
        TNT1 AAAA 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		QSGR U 1 Offset(20,46)
		QSGR V 1 Offset(1,33)        
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
        TNT1 A 0 A_PlaySound("weapons/sshotc",7)
        QSGR WX 1
		QSGR YZ 1
		TNT1 A 0 A_PlaySound("weapons/sshotl",6)
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
        QHO9 DE 1
		QHO9 FG 1
		Goto Ready
		
    NoAmmo:
        QSGG A 4 A_PlaySound("weapons/empty", 2)
		TNT1 A 0 A_TakeInventory("SSGAlt",1)
		TNT1 A 0 A_JumpIfInventory("AmmoShell", 1, "Reload")
        Goto Ready
		
// Recoil Detection

	QuadRecoil:
        QST2 B 1 BRIGHT 		
		TNT1 A 0 A_Setpitch(pitch-16)
		TNT1 A 0 A_ZoomFactor(0.92)
		QST2 C 1 Offset(0,62)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.93)
		QSGG A 1 Offset(0,61)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.94)
		QSGG A 1 Offset(0,60)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.95)
        QSGG A 1 Offset(0,56)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.96)
        QSGG A 1 Offset(0,42)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.97)
		QSGG A 1 Offset(0,32)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.98)
		QSGG A 1 Offset(0,32)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.99)
		QSGG A 1 Offset(0,32)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(1.0)
        QSGG A 0 A_Refire
		Goto Reload
		
	TripleRecoil:
        QST2 B 1 BRIGHT
		TNT1 A 0 A_Setpitch(pitch-12)
		TNT1 A 0 A_ZoomFactor(0.94)
		QST2 C 1 //Offset(0,62) 
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.95)
		QSGG A 1 Offset(0,61)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.96)
		QSGG A 1 Offset(0,60)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.97)
        QSGG A 1 Offset(0,56)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.98)
        QSGG A 1 Offset(0,42)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.99)
		QSGG A 1 Offset(0,32)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(1.0)
		QSGG AA 1 Offset(0,32)
        QSGG A 0 A_Refire
		Goto Ready
		
	DoubleRecoil:
        QST2 B 1 BRIGHT
		TNT1 A 0 A_Setpitch(pitch-8)
		TNT1 A 0 A_ZoomFactor(0.96)
		QST2 C 1 //Offset(0,60)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.97)
		QSGG A 1 Offset(0,55)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.98)
		QSGG A 1 Offset(0,50)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.99)
		QSGG A 1 Offset(0,45)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(1.0)
		QSGG A 1 Offset(0,35)
		QSGG AAA 1 Offset(0,32)
        QSGG A 0 A_Refire("Fire21")
		Goto Ready
		
	RecoilOne:
		TNT1 A 0 A_Setpitch(pitch-4)
		TNT1 A 0 A_ZoomFactor(0.98)
		QSGG A 1 Offset(0,60)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(0.99)
		QSGG A 1 Offset(0,55)
		TNT1 A 0 A_Setpitch(pitch+2)
		TNT1 A 0 A_ZoomFactor(1.0)
		QSGG A 1 Offset(0,50)
		QSGG A 1 Offset(0,45)
		QSGG A 1 Offset(0,35)
		QSGG AAA 1 Offset(0,32)
        QSGG A 0 A_Refire("Fire1")
		Goto Ready

// End of Recoil Detection

	 Fire:
		TNT1 A 0 A_TakeInventory("Reloading",1)
		TNT1 A 0 A_JumpIfinventory("QSGFireIndicator", 1, "Fire3")
		Goto Fire4
	Fire4:
		TNT1 A 0 A_JumpIfInventory("QuadShotgunAmmo", 4, 4)
		TNT1 A 0 A_JumpIfinventory("QuadShotgunAmmo", 3, "Fire3")
		TNT1 A 0 A_JumpIfinventory("QuadShotgunAmmo", 2, "Fire2")
		TNT1 A 0 A_JumpIfinventory("QuadShotgunAmmo", 1, "Fire1")
		Goto Reload
		TNT1 AAAAAA 0
		
		TNT1 A 0 A_JumpIfInventory("SlugMode",1,"SlugFire4")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 4)
		TNT1 A 0 A_Recoil(10)
		QS2F A 0 A_firebullets (0,0,1,60,"shotpuff")
        QS1F A 1 BRIGHT A_playsound("DSQSGFIR", 7)
		TNT1 AAAAAAAAAAA 0 A_FireCustomMissile("Tracer", random(-10,10), 0, -1, -12, 0, random(-5,5))
		TNT1 AAAAAAAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, 1, -6, 0, random(-10,10))
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",15,0,0,0)
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",-15,0,0,0)
		RIFF AA 0 A_FireCustomMissile("GunFireSmokE", 0, 0, 2, 0, 0, 0)
		RIFF AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, -2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
		TNT1 A 0 A_FireBullets (12, 12, 20, 7, "ShotgunPuff", FBF_NORANDOM)
		TNT1 A 0 A_FireBullets (12, 12, 20, 7, "ShotgunPuff", FBF_NORANDOM)
        TNT1 A 0 A_FireCustomMissile("ShakeYourAssQuad", 0, 0, 0, 0)
		QS1F B 1 BRIGHT
		Goto QuadRecoil
		
	SlugFire4:
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 4)
		TNT1 A 0 A_Recoil(10)
        QS1F A 1 BRIGHT A_playsound("SlugQSG4", 7)
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",15,0,0,0)
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",-15,0,0,0)
		RIFF AA 0 A_FireCustomMissile("GunFireSmokE", 0, 0, 2, 0, 0, 0)
		RIFF AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, -2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
		TNT1 A 0 A_FireBullets (2, 2, 4, 120, "ShotgunPuff", FBF_NORANDOM, 2195)
        TNT1 A 0 A_FireCustomMissile("ShakeYourAssQuad", 0, 0, 0, 0)
		QS1F B 1 BRIGHT
		Goto QuadRecoil
		
	Fire3:
		TNT1 A 0 A_JumpIfInventory("QuadShotgunAmmo", 3, 3)
		TNT1 A 0 A_JumpIfinventory("QuadShotgunAmmo", 2, "Fire2")
		TNT1 A 0 A_JumpIfinventory("QuadShotgunAmmo", 1, "Fire1")
		Goto Reload
		TNT1 AAAAAA 0
		
		TNT1 A 0 A_JumpIfInventory("SlugMode",1,"SlugFire3")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 3)
		TNT1 A 0 A_GiveInventory("QSGFireDummy1", 3)
		TNT1 A 0 A_Recoil(7.5)
        QS2F A 1 BRIGHT A_playsound("SSHFIRE", 7)
		TNT1 AAAAAA 0 A_FireCustomMissile("Tracer", random(-10,10), 0, -1, -12, 0, random(-5,5))
		TNT1 AAAAAAAAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, 1, -6, 0, random(-10,10))
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",15,0,0,0)
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",-15,0,0,0)
		RIFF AA 0 A_FireCustomMissile("GunFireSmokE", 0, 0, 2, 0, 0, 0)
		RIFF AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, -2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
        TNT1 A 0 A_FireBullets (5, 3, 9, 7, "ShotgunPuff", FBF_NORANDOM)
		TNT1 A 0 A_FireBullets (12, 12, 20, 7, "ShotgunPuff", FBF_NORANDOM)
        TNT1 A 0 A_FireCustomMissile("ShakeYourAssQuad", 0, 0, 0, 0)
		QS2F B 1 BRIGHT
		Goto TripleRecoil

	SlugFire3:
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 3)
		TNT1 A 0 A_GiveInventory("QSGFireDummy1", 3)
		TNT1 A 0 A_Recoil(7.5)
        QS2F A 1 BRIGHT A_playsound("SlugQSG3", 7)
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",15,0,0,0)
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",-15,0,0,0)
		RIFF AA 0 A_FireCustomMissile("GunFireSmokE", 0, 0, 2, 0, 0, 0)
		RIFF AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, -2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
        TNT1 A 0 A_FireBullets (2, 2, 3, 120, "ShotgunPuff", FBF_NORANDOM, 2195)
        TNT1 A 0 A_FireCustomMissile("ShakeYourAssQuad", 0, 0, 0, 0)
		QS2F B 1 BRIGHT
		Goto TripleRecoil

	AltFire:
	Fire2:
		TNT1 A 0 A_JumpIfinventory("QSGFireIndicator", 1, "Fire1")
		TNT1 A 0 A_JumpIfInventory("QuadShotgunAmmo", 2, 2)
		TNT1 A 0 A_JumpIfinventory("QuadShotgunAmmo", 1, "Fire1")
		Goto Reload
		TNT1 AAAAAA 0
		
		TNT1 A 0 A_JumpIfInventory("SlugMode",1,"SlugFire2")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_JumpIfInventory("QSGFireDummy2", 1, "Fire21")
		TNT1 A 0 A_JumpIfInventory("QSGFireDummy1", 2, "Fire21")
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 2)
		TNT1 A 0 A_Recoil(5)
		TNT1 A 0 A_GiveInventory("QSGFireDummy2", 1)
		QS2F A 0 A_firebullets (0,0,1,30,"shotpuff")
        QS3F A 1 BRIGHT A_playsound("SSHFIRE", 7)
		TNT1 A 0 A_playsound("weapons/sg", 6)
		TNT1 AAAAAAAAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, 1, -6, 0, random(-10,10))
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",15,0,0,0)
		RIFF AA 0 A_FireCustomMissile("GunFireSmokE", 0, 0, 2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
		TNT1 A 0 A_FireBullets (7, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		TNT1 A 0 A_FireBullets (7, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		//TNT1 A 0 A_FireBullets (12, 12, 20, 7, "ShotgunPuff")
        TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
		QS4F A 1 BRIGHT
		Goto DoubleRecoil
		
	SlugFire2:
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_JumpIfInventory("QSGFireDummy2", 1, "Fire21")
		TNT1 A 0 A_JumpIfInventory("QSGFireDummy1", 2, "Fire21")
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 2)
		TNT1 A 0 A_Recoil(5)
		TNT1 A 0 A_GiveInventory("QSGFireDummy2", 1)
        QS3F A 1 BRIGHT A_playsound("SlugSSG", 7)
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",15,0,0,0)
		RIFF AA 0 A_FireCustomMissile("GunFireSmokE", 0, 0, 2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
		TNT1 A 0 A_FireBullets (2, 2, 2, 120, "ShotgunPuff", FBF_NORANDOM, 2195)
        TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
		QS4F A 1 BRIGHT
		Goto DoubleRecoil
		
	Fire21:
		TNT1 A 0 A_JumpIfInventory("QuadShotgunAmmo", 2, 2)
		TNT1 A 0 A_JumpIfinventory("QuadShotgunAmmo", 1, "Fire1")
		Goto Reload
		TNT1 AAAAAA 0
		
		TNT1 A 0 A_JumpIfInventory("SlugMode",1,"SlugFire21")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_TakeInventory("QSGFireDummy1", 3)
		TNT1 A 0 A_TakeInventory("QSGFireDummy2", 3)
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 2)
		TNT1 A 0 A_Recoil(5)
		QS2F A 0 A_firebullets (0,0,1,30,"shotpuff")
        QS3F C 1 BRIGHT A_playsound("SSHFIRE", 5)
		TNT1 AAAAAAAAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, -1, -6, 0, random(-10,10))
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",-15,0,0,0)
		RIFF AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, -2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
		TNT1 A 0 A_FireBullets (7, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		TNT1 A 0 A_FireBullets (7, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		//TNT1 A 0 A_FireBullets (12, 12, 20, 7, "ShotgunPuff")
        TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
		QS4F B 1 BRIGHT
		Goto DoubleRecoil
		
	SlugFire21:
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_TakeInventory("QSGFireDummy1", 3)
		TNT1 A 0 A_TakeInventory("QSGFireDummy2", 3)
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 2)
		TNT1 A 0 A_Recoil(5)
        QS3F C 1 BRIGHT A_playsound("SlugSSG", 5)
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",-15,0,0,0)
		RIFF AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, -2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
		TNT1 A 0 A_FireBullets (2, 2, 2, 120, "ShotgunPuff", FBF_NORANDOM, 2195)
        TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
		QS4F B 1 BRIGHT
		Goto DoubleRecoil
		
	Fire1:
		TNT1 A 0 A_JumpIfInventory("QuadShotgunAmmo", 1, 2)
		Goto Reload
		TNT1 AAAAAA 0
		
		TNT1 A 0 A_JumpIfInventory("SlugMode",1,"SlugFire1")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_JumpIfInventory("QSGFireDummy1", 3, "Fire14")
		TNT1 A 0 A_JumpIfInventory("QSGFireDummy1", 2, "Fire13")
		TNT1 A 0 A_JumpIfInventory("QSGFireDummy1", 1, "Fire12")
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 1)
		TNT1 A 0 A_GiveInventory("QSGFireDummy1", 1)
		QS2F A 0 A_firebullets (0,0,1,15,"shotpuff")
        QS3F A 1 BRIGHT A_playsound("weapons/sg", 7)
		TNT1 AAAAAAAAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, 1, -6, 0, random(-10,10))
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",15,0,0,0)
		RIFF A 0 A_FireCustomMissile("GunFireSmokE", 0, 0, 2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
        TNT1 A 0 A_FireBullets (5, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
        TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
        QSGG A 1 BRIGHT Offset(0,50)
		Goto RecoilOne
		
	SlugFire1:
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_JumpIfInventory("QSGFireDummy1", 3, "Fire14")
		TNT1 A 0 A_JumpIfInventory("QSGFireDummy1", 2, "Fire13")
		TNT1 A 0 A_JumpIfInventory("QSGFireDummy1", 1, "Fire12")
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 1)
		TNT1 A 0 A_GiveInventory("QSGFireDummy1", 1)
        QS3F A 1 BRIGHT A_playsound("SlugShot", 7)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",15,0,0,0)
		RIFF A 0 A_FireCustomMissile("GunFireSmokE", 0, 0, 2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
        TNT1 A 0 A_FireBullets (2, 2, -1, 120, "ShotgunPuff", FBF_NORANDOM, 2195)
        TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
        QSGG A 1 BRIGHT Offset(0,50)
		Goto RecoilOne
		
	Fire12:
		TNT1 A 0 A_JumpIfInventory("QuadShotgunAmmo", 1, 1)
		Goto Reload
		TNT1 AAAAAA 0
		
		TNT1 A 0 A_JumpIfInventory("SlugMode",1,"SlugFire12")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_GiveInventory("QSGFireDummy1", 1)
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 1)
		QS2F A 0 A_firebullets (0,0,1,15,"shotpuff")
        QS3F B 1 BRIGHT A_playsound("weapons/sg", 6)
		TNT1 AAAAAAAAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, 1, -6, 0, random(-10,10))
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",15,0,0,0)
		RIFF A 0 A_FireCustomMissile("GunFireSmokE", 0, 0, 2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
        TNT1 A 0 A_FireBullets (5, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		//TNT1 A 0 A_FireBullets (12, 12, 10, 7, "ShotgunPuff")
        TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
        QSGG A 1 BRIGHT Offset(0,50)
		Goto RecoilOne
		
	SlugFire12:
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_GiveInventory("QSGFireDummy1", 1)
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 1)
        QS3F B 1 BRIGHT A_playsound("SlugShot", 6)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",15,0,0,0)
		RIFF A 0 A_FireCustomMissile("GunFireSmokE", 0, 0, 2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
        TNT1 A 0 A_FireBullets (2, 2, -1, 120, "ShotgunPuff", FBF_NORANDOM, 2195)
        TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
        QSGG A 1 BRIGHT Offset(0,50)
		Goto RecoilOne
		
	Fire13:
		TNT1 A 0 A_JumpIfInventory("QuadShotgunAmmo", 1, 1)
		Goto Reload
		TNT1 AAAAAA 0
		
		TNT1 A 0 A_JumpIfInventory("SlugMode",1,"SlugFire13")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 1)
		TNT1 A 0 A_GiveInventory("QSGFireDummy1", 1)
		QS2F A 0 A_firebullets (0,0,1,15,"shotpuff")
        QS3F C 1 BRIGHT A_playsound("weapons/sg", 5)
		TNT1 AAAAAAAAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, -1, -6, 0, random(-10,10))
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",-15,0,0,0)
		RIFF A 0 A_FireCustomMissile("GunFireSmokE", 0, 0, -2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
		//TNT1 A 0 A_FireBullets (12, 12, 10, 7, "ShotgunPuff")
        TNT1 A 0 A_FireBullets (5, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
        TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
        QSGG A 1 BRIGHT Offset(0,50)
		Goto RecoilOne
		
	SlugFire13:
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 1)
		TNT1 A 0 A_GiveInventory("QSGFireDummy1", 1)
        QS3F C 1 BRIGHT A_playsound("Slugshot", 5)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",-15,0,0,0)
		RIFF A 0 A_FireCustomMissile("GunFireSmokE", 0, 0, -2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
        TNT1 A 0 A_FireBullets (2, 2, -1, 120, "ShotgunPuff", FBF_NORANDOM, 2195)
        TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
        QSGG A 1 BRIGHT Offset(0,50)
		Goto RecoilOne
		
	Fire14:
		TNT1 A 0 A_JumpIfInventory("QuadShotgunAmmo", 1, 1)
		Goto Reload
		TNT1 AAAAAA 0
		
		TNT1 A 0 A_JumpIfInventory("SlugMode",1,"SlugFire14")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 1)
		TNT1 A 0 A_TakeInventory("QSGFireDummy1", 3)
		QS2F A 0 A_firebullets (0,0,1,15,"shotpuff")
        QS3F D 1 BRIGHT A_playsound("weapons/sg", 7)
		TNT1 AAAAAAAAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, -1, -6, 0, random(-10,10))
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",-15,0,0,0)
		RIFF A 0 A_FireCustomMissile("GunFireSmokE", 0, 0, -2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
        TNT1 A 0 A_FireBullets (5, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		//TNT1 A 0 A_FireBullets (12, 12, 10, 7, "ShotgunPuff")
        TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
        QSGG A 1 BRIGHT Offset(0,50)
		Goto RecoilOne
		
	SlugFire14:
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_TakeInventory("QuadShotgunAmmo", 1)
		TNT1 A 0 A_TakeInventory("QSGFireDummy1", 3)
        QS3F D 1 BRIGHT A_playsound("SlugShot", 7)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",-15,0,0,0)
		RIFF A 0 A_FireCustomMissile("GunFireSmokE", 0, 0, -2, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
        TNT1 A 0 A_FireBullets (2, 2, -1, 120, "ShotgunPuff", FBF_NORANDOM, 2195)
        TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
        QSGG A 1 BRIGHT Offset(0,50)
		Goto RecoilOne
	
	ChangeFireMode:
		TNT1 A 0 A_TakeInventory("StartDualWield", 1)
		TNT1 A 0 A_PlaySound("CLIPINSS",1)
		TNT1 A 0 A_JumpIfinventory("QSGFireIndicator", 1, "Use2Barrel")
	Use1Barrel:
		TNT1 A 0
		TNT1 A 0 A_Print("Triple Shot/Single Shot")
		TNT1 A 0 A_Giveinventory("QSGFireIndicator", 1)
		Goto Ready
	Use2Barrel:
		TNT1 A 0
		TNT1 A 0 A_Print("Quad Shot/Double Shot")
		TNT1 A 0 A_Takeinventory("QSGFireIndicator", 1)
		Goto Ready
		
	Reload:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("QuadShotgunAmmo", 4, 1)//Check if still has a shell on left barrel
		Goto Reload+4
		TNT1 A 0 A_JumpIfInventory("SlugRoundsUpgrade", 1, "ChangeShell")
		Goto NoUpgrades
		TNT1 A 0 A_JumpIfInventory("AmmoShell", 1, 2)
		Goto NoAmmo
		TNT1 AAAAA 0
		
		TNT1 A 0 A_TakeInventory("QSGFireDummy1", 3)
		TNT1 A 0 A_TakeInventory("QSGFireDummy2", 3)
		QSGR BCDEF 1
		QSGR GH 1
		QSGR IJ 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
        TNT1 A 0 A_PlaySound("weapons/sshotc",4)
		QSGR K 1 //Here comes the extensive edgyness
		TNT1 A 0 A_JumpIfInventory("QuadShotgunAmmo", 3, "Load1Shells")
		TNT1 A 0 A_JumpIfInventory("QuadShotgunAmmo", 2, "Load2Shells")
		TNT1 A 0 A_JumpIfInventory("QuadShotgunAmmo", 1, "Load3Shells")
	Load4Shells:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("SlugMode",1,"SlugLoad4Shells")
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, 5)
		TNT1 AAAA 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-10)
		QS4R L 12
		QS4R MMNNOOPP 1
		Goto FillShells
	SlugLoad4Shells:
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, 5)
		TNT1 AAAA 0 A_FireCustomMissile("SlugCaseSpawn",0,0,-10)
		QS4R L 12
		QS4R QQRRSSTT 1
		Goto FillShells
		
	Load3Shells:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("SlugMode",1,"SlugLoad3Shells")
		TNT1 AAA 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-10)
		QS3R L 11
		QS3R MMNNOOPP 1
		Goto FillShells
	SlugLoad3Shells:
		TNT1 AAA 0 A_FireCustomMissile("SlugCaseSpawn",0,0,-10)
		QS3R L 11
		QS3R QQRRSSTT 1
		Goto FillShells
		
	Load2Shells:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("SlugMode",1,"SlugLoad2Shells")
		TNT1 AA 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-10)
		QS2R L 10
		QS2R MMNNOOPP 1
		Goto FillShells
	SlugLoad2Shells:
		TNT1 AA 0 A_FireCustomMissile("SlugCaseSpawn",0,0,-10)
		QS2R L 10
		QS2R QQRRSSTT 1
		Goto FillShells
		
	Load1Shells:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("SlugMode",1,"SlugLoad1Shells")
		TNT1 A 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-10)
		QS1R L 9
		QS1R MMNNOOPP 1
		Goto FillShells
	SlugLoad1Shells:
		TNT1 A 0 A_FireCustomMissile("SlugCaseSpawn",0,0,-10)
		QS1R L 9
		QS1R MMQQRRSS 1
		Goto FillShells
		
	FillShells:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("QuadShotgunAmmo",4,"FinishReload")
		TNT1 A 0 A_JumpIfInventory("AmmoShell",1,3)
		Goto FinishReload
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("QuadShotgunAmmo",1)
		TNT1 A 0 A_Takeinventory("AmmoShell",1,TIF_NOTAKEINFINITE)
		Goto FillShells
	
	FinishReload:
		TNT1 A 0
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
        TNT1 A 0 A_playsound("weapons/sshotl",5)
		QSGR QQRS 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		QSGR TUV 1
		
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_PlaySound("weapons/sshotc",4)
		
		QSGR WXYZ 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		QHO9 DE 1
		QHO9 FG 1
		TNT1 A 0 A_ReFire
		QSGG A 2
        Goto Ready

	ChangeShell:
		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("SlugRoundsUpgrade", 1, "SlugMode")
		Goto NoUpgrades

	NoUpgrades:
		TNT1 A 0 A_Print("You need the Slug Shells Upgrade for Alt-Fire mode.", 2)
		QSGG A 3
		Goto Ready

	SlugMode:
		QSGR BCDEFGHIJ 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
        TNT1 A 0 A_PlaySound("weapons/sshotc",4)
		QSGR K 1
		TNT1 A 0 A_JumpIfInventory("SlugMode", 1, "BuckShotMode")
		QS4R L 12
		QS4R QQRRSSTT 1  
		TNT1 A 0 A_GiveInventory("SlugMode", 1)
		TNT1 A 0 A_Print("Slug Shells Loaded", 2)
		TNT1 A 0
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
        TNT1 A 0 A_playsound("weapons/sshotl",5)
		QSGR QQRS 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		QSGR TUV 1
		
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_PlaySound("weapons/sshotc",4)
		
		QSGR WXYZ 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		QHO9 DE 1
		QHO9 FG 1
		TNT1 A 0 A_ReFire
		QSGG A 2
        Goto Ready
		
	BuckShotMode:
		QS4R L 12
		QS4R MMNNOOPP 1 
		TNT1 A 0 A_TakeInventory("SlugMode", 1)
		TNT1 A 0 A_Print("Buckshot Shells Loaded", 2)
		TNT1 A 0
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
        TNT1 A 0 A_playsound("weapons/sshotl",5)
		QSGR QQRS 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		QSGR TUV 1
		
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_PlaySound("weapons/sshotc",4)
		
		QSGR WXYZ 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		QHO9 DE 1
		QHO9 FG 1
		TNT1 A 0 A_ReFire
		QSGG A 2
        Goto Ready

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

	Spawn:
		QGN2 A -1
		Stop
		
// Tactical Sprinting
		
	CheckSprint:
		QSGG 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:
		QSGG A 1 A_WeaponReady(WRF_NOFIRE)
		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("UsedStamina", 40, "StopSprintTired")
		
	Sprinting:	
		QSGR I 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)
		QSGR I 1 offset(-9,34) A_SetPitch(pitch -0.5)
		QSGR I 1 offset(-6,36) A_SetPitch(pitch -0.5)
		QSGR I 1 offset(-3,38) A_SetPitch(pitch -0.5)
		QSGR I 1 offset(0,38) A_SetPitch(pitch -0.5)
		QSGR I 1 offset(3,36) A_SetPitch(pitch -0.5)
		QSGR I 1 offset(6,34) A_SetPitch(pitch -0.5)
		QSGR I 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)
		QSGR I 1 offset(9,34) A_SetPitch(pitch +0.5)
		QSGR I 1 offset(6,36) A_SetPitch(pitch +0.5)
		QSGR I 1 offset(3,38) A_SetPitch(pitch +0.5)
		QSGR I 1 offset(0,38) A_SetPitch(pitch +0.5)
		QSGR I 1 offset(-3,36) A_SetPitch(pitch +0.5)
		QSGR I 1 offset(-6,34) A_SetPitch(pitch +0.5)
		QSGR I 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:
		QSGG 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)
		QSGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		QSGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		QSGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		QSGG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		QSGG A 5 A_WeaponReady
		Goto Ready
	StopSprint:
		QSGR I 1
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired")
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		Goto Ready
		
	}
}
ACTOR QuadShotgunAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 4
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 4
   Inventory.Icon "QGN2A0"
}

Actor QSGFireIndicator : Inventory {inventory.maxamount 1}
Actor QSGFireDummy1 : Inventory {inventory.maxamount 3}
Actor QSGFireDummy2 : Inventory {inventory.maxamount 1}
