// --------------------------------------------------------------------------
//
//	Super Shotgun
//
// --------------------------------------------------------------------------

ACTOR U_SSG : BaseWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive1 2
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "AmmoShell"
	Weapon.AmmoType2 "SSGAmmo"
	Weapon.SelectionOrder 400
	Weapon.Kickback 50
	-WEAPON.CHEATNOTWEAPON
	Inventory.PickupMessage "$GOTSHOTGUN2"
    Inventory.PickupSound "CLIPINSS"
	Obituary "$OB_MPSSHOTGUN"
	Scale 0.9
	tag "Super Shotgun"
	States
	{
	Spawn:
		SGN2 A -1
		Stop

	Select:
		TNT1 A 0 A_JumpIfInventory("IsPlayingAsPurist", 1, "PuristGun")
		TNT1 A 0 A_Giveinventory("SSGSelected",1)
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_Takeinventory("WeapSpecial",1)
		TNT1 A 0 A_Takeinventory("Taunting",1)
		TNT1 A 0 A_Takeinventory("IdleCounter",200)
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1025,2)==0, 2)
		TNT1 A 0 A_Giveinventory("BD21graphics",1)
		TNT1 A 4
		TNT1 A 0 A_Raise
		Wait

	Deselect:
		SSGS FEDCBA 1
		TNT1 A 0 A_TakeInventory("SSGSelected", 1)
		TNT1 A 0 A_TakeInventory("BD21graphics", 1)
		TNT1 A 0 A_Lower
		Wait

	Ready:
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		TNT1 A 0 A_PlaySound("weapons/sshotc")
	Ready1:
		SSGS ABCD 1
		TNT1 A 0 A_PlaySound("CLIPINSS")
		SSGS EF 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
	Ready2:
        TNT1 A 0 A_JumpIfInventory("Kicking",1, "DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1, "TauntR")
		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("Unloading",1,"Unload")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("IdleCounter",200,"PlayerIsIdle")
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 3)
		SSGR A 1 A_WeaponReady
		TNT1 A 0 A_Jump(256,"Ready2")
		SHTZ A 1 A_WeaponReady
		Loop

	PuristGun:
		TNT1 A 0 A_GiveInventory("ClassicSSG", 1)
		TNT1 A 0 A_TakeInventory("SSG", 1)
		Goto Ready

// --------------------------------------------------------------------------
//
//	Fire
//
// --------------------------------------------------------------------------

	Fire:
		TNT1 A 0 A_JumpIfInventory("SSGAmmo", 1, 1) //Check if shell in any barrels
		Goto DryFire //Nope, no shells
		TNT1 A 0 A_JumpIfInventory("SSGAmmo", 2, 1) //Check if shell in both barrels
		Goto AltFire2 //Nope, just shell in left barrel. Go altfire
		//Start
		TNT1 A 0 A_TakeInventory("SSGAmmo", 2)
		TNT1 A 0 A_Recoil(5)
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_FireBullets(0,0,1,15,"shotpuff",0,180)
		//Fire right barrel
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 3)
		SSGF A 1 BRIGHT A_playsound("SGFIRE3", 1, 1.5)
		TNT1 A 0 A_Jump(256,2)
        SHOF A 1 BRIGHT A_playsound("SGFIRE3", 1, 1.5)
		TNT1 A 0 A_FireBullets(10, 6, 10, 7, "ShotgunPuff")
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",-15,0,0,0)
		TNT1 AAAAAA 0 A_FireCustomMissile("Tracer", random(-10,10), 0, -1, -12, 0, random(-5,5))
		TNT1 AAAAAAA 0 A_FireCustomMissile("ShotgunParticles", random(-15,15), 0, -1, -8, 0, random(-10,10))
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,0,30)
		//Fire left barrel
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 3)
		SSGF B 1 BRIGHT A_playsound("SGFIRE2", 5, 2)
		TNT1 A 0 A_Jump(256,2)
        SHOF B 1 BRIGHT A_playsound("SGFIRE2", 5, 2)
		TNT1 A 0 A_FireBullets(10, 6, 10, 7, "ShotgunPuff")
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",15,0,0,0)
		TNT1 AAAAAA 0 A_FireCustomMissile("Tracer", random(-10,10), 0, -1, -12, 0, random(-5,5))
		TNT1 AAAAAAA 0 A_FireCustomMissile("ShotgunParticles", random(-15,15), 0, -1, -8, 0, random(-10,10))
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
		//End stuff
		TNT1 A 0 A_SetPitch(-14.0 + pitch)
        TNT1 A 0 A_FireCustomMissile("ShakeYourAssQuad", 0, 0, 0, 0)
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 18)
        SSGF B 1 BRIGHT A_SetPitch(+1.8 + pitch)
		SSGF C 1 Offset(0,62) A_SetPitch(+1.8 + pitch)
		SSGF D 1 Offset(0,61) A_SetPitch(+1.6 + pitch)
		SSGF E 1 Offset(0,60) A_SetPitch(+1.4 + pitch)
		TNT1 AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 2, 0, 0, 0)
		TNT1 AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, -2, 0, 0, 0)
        SSGF E 1 Offset(0,56) A_SetPitch(+1.0 + pitch)
		SSGF E 1 Offset(0,49) A_SetPitch(+1.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
        SSGF C 1 Offset(0,43) A_SetPitch(+0.8 + pitch)
		SSGF C 1 Offset(0,37) A_SetPitch(+0.8 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
        SSGR AAA 1 A_SetPitch(+0.6 + pitch)
		Goto Reload
        SHOF B 1 BRIGHT A_SetPitch(+1.8 + pitch)
		SHOF C 1 A_SetPitch(+1.8 + pitch)
		SHOF D 1 A_SetPitch(+1.6 + pitch)
		SHOF E 1 A_SetPitch(+1.4 + pitch)
		TNT1 AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 2, 0, 0, 0)
		TNT1 AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, -2, 0, 0, 0)
        SHOF F 1 A_SetPitch(+1.0 + pitch)
		SHOF G 1 A_SetPitch(+1.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
        SHOF H 1 A_SetPitch(+0.8 + pitch)
		SHOF I 1 A_SetPitch(+0.8 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
        SHTZ AAA 1 A_SetPitch(+0.6 + pitch)
		Goto Reload

	AltFire:
		TNT1 A 0 A_JumpIfInventory("SSGAmmo", 1, 1) //Check if shell in any barrels
        Goto DryFire
		//Start
        TNT1 A 0 A_Recoil(2)
        TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_JumpIfInventory("SSGAmmo", 2, 1) //Check if shell in right barrel
		Goto AltFire2
		//Fire right barrel
		TNT1 A 0 A_TakeInventory("SSGAmmo",1)
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 3)
		SSGA A 1 BRIGHT A_PlaySound("SGFIRE3", 1, 0.8)
		TNT1 A 0 A_Jump(256,2)
        SHTU A 1 BRIGHT A_PlaySound("SGFIRE3", 1, 0.8)
		TNT1 A 0 A_FireBullets(7, 5, 10, 7, "ShotgunPuff")
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",15,0,0,0)
        TNT1 AAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, -1, -12, 0, random(-5,5))
		TNT1 AAAAAAA 0 A_FireCustomMissile("ShotgunParticles", random(-15,15), 0, -1, 0, 0, random(-10,10))
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
		//End stuff
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 9)
		SSGA A 2 BRIGHT A_SetPitch(-6.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
		SSGF EE 1 A_SetPitch(+1.5 + pitch)
		TNT1 AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 2, 0, 0, 0)
        SSGR AA 1 A_SetPitch(+1.0 + pitch)
        Goto Ready2
		SHTU A 2 BRIGHT A_SetPitch(-6.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
		SHOF GH 1 A_SetPitch(+1.5 + pitch)
		TNT1 AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 2, 0, 0, 0)
		SHOF I 1 A_SetPitch(+1.0 + pitch)
        SHTZ A 1 A_SetPitch(+1.0 + pitch)
        Goto Ready2

	AltFire2:
		//Fire left barrel
		TNT1 A 0 A_TakeInventory("SSGAmmo",1)
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 3)
        SSGA B 1 BRIGHT A_PlaySound("SGFIRE3", 5, 0.8)
		TNT1 A 0 A_Jump(256,2)
        SHTU B 1 BRIGHT A_PlaySound("SGFIRE3", 1, 0.8)
		TNT1 A 0 A_FireBullets(7, 5, 10, 7, "ShotgunPuff")
		TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",-15,0,0,0)
		TNT1 AAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, -1, -12, 0, random(-5,5))
		TNT1 AAAAAAA 0 A_FireCustomMissile("ShotgunParticles", random(-15,15), 0, -1, 0, 0, random(-10,10))
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,0,30)
		//End stuff
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 10)
		SSGA B 2 BRIGHT A_SetPitch(-6.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
		SSGF EE 1 A_SetPitch(+1.5 + pitch)
		TNT1 AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, -2, 0, 0, 0)
        SSGR AA 1 A_SetPitch(+1.0 + pitch)
		TNT1 A 0 A_Jump(256,9)
		SHTU B 2 BRIGHT A_SetPitch(-6.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
		SHOF GH 1 A_SetPitch(+1.5 + pitch)
		TNT1 AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 2, 0, 0, 0)
		SHOF I 1 A_SetPitch(+1.0 + pitch)
        SHTZ A 1 A_SetPitch(+1.0 + pitch)
		
		//Reload?
		TNT1 A 0 A_JumpIfInventory("AmmoShell",1,1)
		TNT1 A 0 A_GiveInventory("Reloading", 1)
		TNT1 A 0
		Goto Ready2

    DryFire:
        TNT1 A 0 A_PlaySound("weapons/empty2", 2)
		TNT1 A 0 A_JumpIfInventory("AmmoShell", 1, "Reload")
        Goto Ready2

// --------------------------------------------------------------------------
//
//	Reload
//
// --------------------------------------------------------------------------

	Reload:
		//Start stuff
		TNT1 A 0 A_TakeInventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("SSGAmmo", 2, "Ready2") //Check if fully loaded already
		TNT1 A 0 A_JumpIfInventory("AmmoShell", 1, 1) //Check if has any ammo left to reload
		Goto Ready2
		TNT1 A 0 A_JumpIfInventory("SSGAmmo", 1, "ReloadOneBarrel") //Check if still has a shell in left barrel
		TNT1 A 0 A_JumpIfInventory("AmmoShell", 2, "ReloadBothBarrels") //Check if has ammo to reload both barrels
		Goto ReloadOneBarrel

	ReloadBothBarrels:
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1021)==0, "Reload1A")
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1021)==1, "Reload2A")
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1021)==2, "Reload3A")
		Goto Reload1A
		
	ReloadOneBarrel:
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1021)==0, "Reload1B")
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1021)==1, "Reload2B")
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1021)==2, "Reload3B")
		Goto Reload2A

	Reload1A: //Reload 2 barrels
		SSGR B 2 Offset(20,48)
        SSGR B 2 Offset(10,36)
		SSGR BCDEFGHIJ 1
		TNT1 A 0 A_GiveInventory("Pumping", 1)
        TNT1 A 0 A_PlaySound("weapons/sshotc")
		SSGR K 1
        SSGX L 1
		TNT1 A 0 A_JumpIfInventory("HasUnloaded_SSG", 1, 3)
		TNT1 A 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-7)
		TNT1 A 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-15)
		TNT1 A 0 A_TakeInventory("HasUnloaded_SSG", 1)
		SSGR L 10
		SSGR MNO 2
        TNT1 A 0 A_playsound("weapons/sshotl")
		SSGR P 1 Offset(6,36)
		SSGZ P 1 Offset(20,46)
		SSGR Q 1 Offset(30,56)
		SSGR Q 1 Offset(40,71)
		SSGR R 1 Offset(50,86)
		SSGR S 2
		TNT1 A 0 A_GiveInventory("Pumping", 1)
		SSGR U 1 Offset(30,56)
		SSGR U 1 Offset(20,46)
		SSGR V 1 Offset(1,33)
		TNT1 A 0 A_GiveInventory("Pumping", 1)
		TNT1 A 0 A_PlaySound("weapons/sshotc")
		TNT1 A 0 A_TakeInventory("AmmoShell", 2)
		TNT1 A 0 A_GiveInventory("SSGAmmo", 2)
		SSGR WXYZ 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		SSGE DEFG 1
		TNT1 A 0 A_TakeInventory("Reloading",1)
		TNT1 A 0 A_ReFire
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 3)
		SSGR A 2 A_ReFire
		TNT1 A 0 A_Jump(256,"Ready2")
		SHTZ A 2 A_ReFire
        Goto Ready2

	Reload1B: //Reload 1 barrel
		SSGR B 2 Offset(20,48)
        SSGR B 2 Offset(10,36)
		SSGR BCDEFGHIJ 1
		TNT1 A 0 A_GiveInventory("Pumping", 1)
        TNT1 A 0 A_PlaySound("weapons/sshotc")
		SSGR K 1
        SSG7 K 1
		TNT1 A 0 A_JumpIfInventory("HasUnloaded_SSG", 1, 2)
		TNT1 A 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-7)
		TNT1 A 0 A_TakeInventory("HasUnloaded_SSG", 1)
		SSG7 L 6
		SSG7 MNO 2
        TNT1 A 0 A_playsound("weapons/sshotl")
		SSG7 P 1 Offset(6,36)
		SSGZ P 1 Offset(20,46)
		SSGR Q 1 Offset(30,56)
		SSGR Q 1 Offset(40,71)
		SSGR R 1 Offset(50,86)
		SSGR S 2
		TNT1 A 0 A_GiveInventory("Pumping", 1)
		SSGR U 1 Offset(30,56)
		SSGR U 1 Offset(20,46)
		SSGR V 1 Offset(1,33)
		TNT1 A 0 A_GiveInventory("Pumping", 1)
        TNT1 A 0 A_PlaySound("weapons/sshotc")
		TNT1 A 0 A_TakeInventory("AmmoShell", 1)
		TNT1 A 0 A_GiveInventory("SSGAmmo", 1)
        SSGR WXYZ 1
		TNT1 A 0 A_GiveInventory("Pumping", 1)
		SSGE DEFG 1
		TNT1 A 0 A_TakeInventory("Reloading",1)
		TNT1 A 0 A_ReFire
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 3)
		SSGR A 2 A_ReFire
		TNT1 A 0 A_Jump(256,"Ready2")
		SHTZ A 2 A_ReFire
		Goto Ready2

	Reload2A: //Reload 2 barrels
		1SSG B 2 Offset(-20,48)
        1SSG B 2 Offset(-10,36)
		1SSG BCDEFGHIJ 1
		TNT1 A 0 A_GiveInventory("Pumping", 1)
        TNT1 A 0 A_PlaySound("weapons/sshotc")
        1SSG K 1
        1SSX L 1
		TNT1 A 0 A_JumpIfInventory("HasUnloaded_SSG", 1, 3)
		TNT1 A 0 A_FireCustomMissile("SSGCaseSpawner2",0,0,7)
		TNT1 A 0 A_FireCustomMissile("SSGCaseSpawner2",0,0,15)
		TNT1 A 0 A_TakeInventory("HasUnloaded_SSG", 1)
		1SSG L 10
		1SSG MNO 2
        TNT1 A 0 A_playsound("weapons/sshotl")
		1SSG P 1 Offset(-6,36)
		1SSG A 1 Offset(-20,46)
		1SSG Q 1 Offset(-30,56)
		1SSG Q 1 Offset(-40,71)
		1SSG R 1 Offset(-50,86)
		1SSG S 2
		TNT1 A 0 A_GiveInventory("Pumping", 1)
		1SSG U 1 Offset(-30,56)
		1SSG U 1 Offset(-20,46)
		1SSG V 1 Offset(-1,33)
		TNT1 A 0 A_GiveInventory("Pumping", 1)
		TNT1 A 0 A_PlaySound("weapons/sshotc")
		TNT1 A 0 A_TakeInventory("AmmoShell", 2)
		TNT1 A 0 A_GiveInventory("SSGAmmo", 2)
		1SSG WXYZ 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		2SSG DEFG 1
		TNT1 A 0 A_ReFire
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 3)
		SSGR A 2 A_ReFire
		TNT1 A 0 A_Jump(256,"Ready2")
		SHTZ A 2 A_ReFire
        Goto Ready2

	Reload2B: //Reload 1 barrel
		1SSG B 2 Offset(-20,48)
        1SSG B 2 Offset(-10,36)
		1SSG BCDEFGHIJ 1
		TNT1 A 0 A_GiveInventory("Pumping", 1)
        TNT1 A 0 A_PlaySound("weapons/sshotc")
        1SSG K 1
        2SSX L 1
		TNT1 A 0 A_JumpIfInventory("HasUnloaded_SSG", 1, 2)
		TNT1 A 0 A_FireCustomMissile("SSGCaseSpawner2",0,0,15)
		TNT1 A 0 A_TakeInventory("HasUnloaded_SSG", 1)
		2SSG L 6
		2SSG MNO 2
        TNT1 A 0 A_playsound("weapons/sshotl")
		2SSG P 1 Offset(-6,36)
		1SSG A 1 Offset(-20,46)
		1SSG Q 1 Offset(-30,56)
		1SSG Q 1 Offset(-40,71)
		1SSG R 1 Offset(-50,86)
		1SSG S 2
		TNT1 A 0 A_GiveInventory("Pumping", 1)
		1SSG U 1 Offset(-30,56)
		1SSG U 1 Offset(-20,46)
		1SSG V 1 Offset(-1,33)
		TNT1 A 0 A_GiveInventory("Pumping", 1)
		TNT1 A 0 A_PlaySound("weapons/sshotc")
		TNT1 A 0 A_TakeInventory("AmmoShell", 1)
		TNT1 A 0 A_GiveInventory("SSGAmmo", 1)
		1SSG WXYZ 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		2SSG DEFG 1
		TNT1 A 0 A_ReFire
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 3)
		SSGR A 2 A_ReFire
		TNT1 A 0 A_Jump(256,"Ready2")
		SHTZ A 2 A_ReFire
        Goto Ready2

	Reload3A: //Reload 2 barrels
		1SSG B 1 Offset(-20,48)
        1SSG B 1 Offset(-10,36)
		1SSG BHIJ 1
		TNT1 A 0 A_GiveInventory("Pumping", 1)
        TNT1 A 0 A_PlaySound("weapons/sshotc")
        1SSG K 1
        1SSX L 1
		TNT1 A 0 A_JumpIfInventory("HasUnloaded_SSG", 1, 3)
		TNT1 A 0 A_FireCustomMissile("SSGCaseSpawner2",0,0,7)
		TNT1 A 0 A_FireCustomMissile("SSGCaseSpawner2",0,0,15)
		TNT1 A 0 A_TakeInventory("HasUnloaded_SSG", 1)
		
		1SSG L 7
		0SSG ABCDEFGH 1
		0SSG I 1 A_PlaySound("SSGIN")
		0SSG JKLMNOPQR 1
		0SSG S 1 A_PlaySound("SSGIN")
		0SSG TUVWXYZ 1

		TNT1 A 0 A_GiveInventory("Pumping", 1)
		1SSG U 1 Offset(-30,56)
		1SSG U 1 Offset(-20,46)
		1SSG V 1 Offset(-1,33)
		TNT1 A 0 A_GiveInventory("Pumping", 1)
		TNT1 A 0 A_PlaySound("weapons/sshotc")
		TNT1 A 0 A_TakeInventory("AmmoShell", 2)
		TNT1 A 0 A_GiveInventory("SSGAmmo", 2)
		1SSG WXY 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		2SSG FG 1
		TNT1 A 0 A_ReFire
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 3)
		SSGR A 2 A_ReFire
		TNT1 A 0 A_Jump(256,"Ready2")
		SHTZ A 2 A_ReFire
        Goto Ready2

	Reload3B: //Reload 1 barrel
		1SSG B 1 Offset(-20,48)
        1SSG B 1 Offset(-10,36)
		1SSG BHIJ 1
		TNT1 A 0 A_GiveInventory("Pumping", 1)
        TNT1 A 0 A_PlaySound("weapons/sshotc")
        1SSG K 1
        2SSX L 1
		TNT1 A 0 A_JumpIfInventory("HasUnloaded_SSG", 1, 2)
		TNT1 A 0 A_FireCustomMissile("SSGCaseSpawner2",0,0,15)
		TNT1 A 0 A_TakeInventory("HasUnloaded_SSG", 1)

		2SSG L 12
		3SSG ABCDEF 1
		0SSG PQR 1
		0SSG S 1 A_PlaySound("SSGIN")
		0SSG TUVWXYZ 1

		TNT1 A 0 A_GiveInventory("Pumping", 1)
		1SSG U 1 Offset(-30,56)
		1SSG U 1 Offset(-20,46)
		1SSG V 1 Offset(-1,33)
		TNT1 A 0 A_GiveInventory("Pumping", 1)
		TNT1 A 0 A_PlaySound("weapons/sshotc")
		TNT1 A 0 A_TakeInventory("AmmoShell", 1)
		TNT1 A 0 A_GiveInventory("SSGAmmo", 1)
		1SSG WXY 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		2SSG FG 1
		TNT1 A 0 A_ReFire
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 3)
		SSGR A 2 A_ReFire
		TNT1 A 0 A_Jump(256,"Ready2")
		SHTZ A 2 A_ReFire
        Goto Ready2

// --------------------------------------------------------------------------
//
//	Unload
//
// --------------------------------------------------------------------------

	Unload:
		TNT1 A 0 A_Takeinventory("Unloading",1)
        TNT1 A 0 A_JumpIfInventory("SSGAmmo",1,1)
        Goto Ready2
		TNT1 A 0 A_GiveInventory("Pumping", 1)

	UnloadLoop:
		TNT1 A 0 A_JumpIfInventory("SSGAmmo",1,1)
		Goto UnloadDone
		TNT1 A 0 A_Takeinventory("SSGAmmo",1)
		TNT1 A 0 A_Giveinventory("AmmoShell",1)
		Goto UnloadLoop

	UnloadDone:
		SSGR B 2 Offset(20,48)
        SSGR B 2 Offset(10,36)
		SSGR BCDEFGH 1
		TNT1 A 0 A_PlaySound("weapons/sshotc")
		SSGR IJ 1
		SSGR K 2 Offset(10, 36) //original pos
		SSGR K 1 Offset(16, 44)
		SSGR K 1 Offset(22, 50)
		SSGR K 14 Offset(26, 54)
		SSGR K 1 Offset(22, 50)
		SSGR K 1 Offset(16, 44)
		SSGR K 2 Offset(10, 36) //original pos
		TNT1 A 0 A_GiveInventory("HasUnloaded_SSG", 1)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		SSGR U 1 Offset(20,46)
		SSGR V 1 Offset(1,33)
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
        TNT1 A 0 A_PlaySound("weapons/sshotc")
        SSGR WXYZ 1
		TNT1 A 0 A_PlaySound("CLIPINSS")
		TNT1 A 0 A_GiveInventory("Pumping", 1)
        SSGE DEFG 1
		Goto Ready2

// --------------------------------------------------------------------------
//
//	End Stuff
//
// --------------------------------------------------------------------------

	KickFlash:
		SSGR BCDE 1
		SSGE D 8
		SSGR EDCB 1
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 2)
		SSGR A 1
		Stop
		SHTZ A 1
		Stop

	AirKickFlash:
		SSGR BCDE 1
		SSGE D 10
		SSGR EDCB 1
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 2)
		SSGR A 1
		Stop
		SHTZ A 1
		Stop

	TauntFlash:
		SSGR BCDE 1
		SSGE D 35
		SSGR EDCB 1
		TNT1 A 0 A_JumpIfInventory("BD21graphics", 1, 2)
		SSGR A 1
		Stop
		SHTZ A 1
		Stop

	GrenadeFlash:
		SSGS FECA 1
		Stop
	}
}

ACTOR HasUnloaded_SSG : Inventory { Inventory.MaxAmount 1 }