// --------------------------------------------------------------------------
//
//	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("SwitchFlashlight",1)
		TNT1 A 0 A_Takeinventory("Taunting",1)
		TNT1 A 0 A_Takeinventory("IdleCounter",200)
		TNT1 A 0 ACS_NamedExecuteAlways("TE_WeaponSprites")
		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",2)
		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_GunFlash
	Ready3:
		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",2,4)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,2)
		SSGA A 1 A_WeaponReady
		Loop
		SHTZ A 1 A_WeaponReady
		Loop
		SSGB A 1 A_WeaponReady
		Loop

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

	Fire:
		TNT1 A 0 A_Jump(192,2) //25% chanse that bots will use secondary fire
		TNT1 A 0 A_JumpIfInventory("PlayerIsABot",1,"AltFire")
		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)
		TNT1 A 0 A_ZoomFactor(0.98)
		//-------------------------- Fire right barrel --------------------------
		TNT1 A 0 A_JumpIfInventory("BD21graphics",2,6)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,3)
		//BD20b sprites
		SSGA D 1 A_playsound("SGFIRE3",1,1.5)
		TNT1 A 0 A_Jump(256,4)
		//BD21 sprites
		SHOF A 1 BRIGHT A_playsound("SGFIRE3",1,1.5)
		TNT1 A 0 A_Jump(256,2)
		//New sprites
		SSGB D 1 A_playsound("SGFIRE3",1,1.5)
		TNT1 A 0 A_FireBullets(10,6,10,8,"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",2,6)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,3)
		//BD20b sprites
		SSGA E 1 A_playsound("SGFIRE2",5,2)
		TNT1 A 0 A_Jump(256,4)
		//BD21 sprites
		SHOF B 1 BRIGHT A_playsound("SGFIRE2",5,2)
		TNT1 A 0 A_Jump(256,2)
		//New sprites
		SSGB E 1 A_playsound("SGFIRE3",1,1.5)
		TNT1 A 0 A_FireBullets(10,6,10,8,"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_FireCustomMissile("DistantFireSoundShotgun",random(-1,1),0,0,-12,0,random(-1,1))
		TNT1 A 0 A_ZoomFactor(1.00)
		TNT1 A 0 A_SetPitch(-14.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssQuad",0,0,0,0)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",2,36)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,18)
		//BD20b sprites
		SSGA E 1 Offset(0,42) A_SetPitch(+1.8 + pitch)
		SSGA F 1 A_SetPitch(+1.8 + pitch)
		SSGA G 1 A_SetPitch(+1.6 + pitch)
		SSGA H 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)
		SSGA I 1 A_SetPitch(+1.2 + pitch)
		SSGA J 1 A_SetPitch(+1.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SSGA K 1 A_SetPitch(+0.8 + pitch)
		SSGA L 1 A_SetPitch(+0.6 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SSGA AAA 1 A_SetPitch(+0.6 + pitch)
		Goto Reload
		//BD21 sprites
		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.2 + 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.6 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SHTZ AAA 1 A_SetPitch(+0.6 + pitch)
		Goto Reload
		//New sprites
		SSGB E 1 Offset(0,42) A_SetPitch(+1.8 + pitch)
		SSGB F 1 A_SetPitch(+1.8 + pitch)
		SSGB G 1 A_SetPitch(+1.6 + pitch)
		SSGB H 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)
		SSGB I 1 A_SetPitch(+1.2 + pitch)
		SSGB J 1 A_SetPitch(+1.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SSGB K 1 A_SetPitch(+0.8 + pitch)
		SSGB L 1 A_SetPitch(+0.6 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SSGB 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",2,6)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,3)
		//BD20b sprites
		SSGA B 1 A_PlaySound("SGFIRE3",1,0.8)
		TNT1 A 0 A_Jump(256,4)
		//BD21 sprites
		SHTU A 1 BRIGHT A_PlaySound("SGFIRE3",1,0.8)
		TNT1 A 0 A_Jump(256,2)
		//New sprites
		SSGB B 1 A_PlaySound("SGFIRE3",1,0.8)
		TNT1 A 0 A_FireBullets(7,5,10,8,"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_FireCustomMissile("DistantFireSoundShotgun",random(-1,1),0,0,-12,0,random(-1,1))
		TNT1 A 0 A_JumpIfInventory("BD21graphics",2,22)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,11)
		//BD20b sprites
		SSGA B 1 A_SetPitch(-7.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss",0,0,0,0)
		SSGA IJK 1 A_SetPitch(+1.4 + pitch)
		TNT1 AA 0 A_FireCustomMissile("GunFireSmoke",0,0,2,0,0,0)
		SSGA L 1 A_SetPitch(+1.1 + pitch)
		SSGA A 1 A_SetPitch(+0.7 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		Goto Ready2
		//BD21 sprites
		SHTU A 1 BRIGHT A_SetPitch(-7.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss",0,0,0,0)
		SHOF FGH 1 A_SetPitch(+1.4 + pitch)
		TNT1 AA 0 A_FireCustomMissile("GunFireSmoke",0,0,2,0,0,0)
		SHOF I 1 A_SetPitch(+1.1 + pitch)
		SHTZ A 1 A_SetPitch(+0.7 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		Goto Ready2
		//New sprites
		SSGB B 1 A_SetPitch(-7.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss",0,0,0,0)
		SSGB IJK 1 A_SetPitch(+1.4 + pitch)
		TNT1 AA 0 A_FireCustomMissile("GunFireSmoke",0,0,2,0,0,0)
		SSGB L 1 A_SetPitch(+1.1 + pitch)
		SSGB A 1 A_SetPitch(+0.7 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		Goto Ready2

	AltFire2:
		//Fire right barrel
		TNT1 A 0 A_TakeInventory("SSGAmmo",1)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",2,6)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,3)
		//BD20b sprites
		SSGA C 1 A_PlaySound("SGFIRE3",1,0.8)
		TNT1 A 0 A_Jump(256,4)
		//BD21 sprites
		SHTU B 1 BRIGHT A_PlaySound("SGFIRE3",1,0.8)
		TNT1 A 0 A_Jump(256,2)
		//New sprites
		SSGB C 1 A_PlaySound("SGFIRE3",1,0.8)
		TNT1 A 0 A_FireBullets(7,5,10,8,"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_FireCustomMissile("DistantFireSoundShotgun",random(-1,1),0,0,-12,0,random(-1,1))
		TNT1 A 0 A_JumpIfInventory("BD21graphics",2,22)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,11)
		//BD20b sprites
		SSGA C 1 A_SetPitch(-7.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss",0,0,0,0)
		SSGA IJK 1 A_SetPitch(+1.4 + pitch)
		TNT1 AA 0 A_FireCustomMissile("GunFireSmoke",0,0,-2,0,0,0)
		SSGA L 1 A_SetPitch(+1.1 + pitch)
		SSGA A 1 A_SetPitch(+0.7 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		Goto Reload
		//BD21 sprites
		SHTU C 1 BRIGHT A_SetPitch(-7.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss",0,0,0,0)
		SHOF FGH 1 A_SetPitch(+1.4 + pitch)
		TNT1 AA 0 A_FireCustomMissile("GunFireSmoke",0,0,-2,0,0,0)
		SHOF I 1 A_SetPitch(+1.1 + pitch)
		SHTZ A 1 A_SetPitch(+0.7 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		Goto Reload
		//New sprites
		SSGB C 1 A_SetPitch(-7.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss",0,0,0,0)
		SSGB IJK 1 A_SetPitch(+1.4 + pitch)
		TNT1 AA 0 A_FireCustomMissile("GunFireSmoke",0,0,-2,0,0,0)
		SSGB L 1 A_SetPitch(+1.1 + pitch)
		SSGB A 1 A_SetPitch(+0.7 + pitch)
		TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		Goto Reload

// --------------------------------------------------------------------------
//
//	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")//Vanilla animation
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1021)==1,"Reload2A")//Mirrored 
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1021)==2,"Reload3A")//New
		Goto Reload1A
		
	ReloadOneBarrel:
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1021)==0,"Reload1B")//Vanilla animation
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1021)==1,"Reload2B")//Mirrored animation
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1021)==2,"Reload3B")//New animation
		Goto Reload1B

	Reload1A: //Reload 2 barrels vanilla animation
		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_JumpIfInventory("BD21graphics",2,4)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,2)
		SSGA A 2 A_ReFire
		Goto Ready2
		SHTZ A 2 A_ReFire
		Goto Ready2
		SSGB A 2 A_ReFire
		Goto Ready2

	Reload1B: //Reload 1 barrel vanilla animation
		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_JumpIfInventory("BD21graphics",2,4)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,2)
		SSGA A 2 A_ReFire
		Goto Ready2
		SHTZ A 2 A_ReFire
		Goto Ready2
		SSGB A 2 A_ReFire
		Goto Ready2

	Reload2A: //Reload 2 barrels mirrored animation
		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_JumpIfInventory("BD21graphics",2,4)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,2)
		SSGA A 2 A_ReFire
		Goto Ready2
		SHTZ A 2 A_ReFire
		Goto Ready2
		SSGB A 2 A_ReFire
		Goto Ready2

	Reload2B: //Reload 1 barrel mirrored animation
		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_JumpIfInventory("BD21graphics",2,4)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,2)
		SSGA A 2 A_ReFire
		Goto Ready2
		SHTZ A 2 A_ReFire
		Goto Ready2
		SSGB A 2 A_ReFire
		Goto Ready2

	Reload3A: //Reload 2 barrels new animation
		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_JumpIfInventory("BD21graphics",2,4)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,2)
		SSGA A 2 A_ReFire
		Goto Ready2
		SHTZ A 2 A_ReFire
		Goto Ready2
		SSGB A 2 A_ReFire
		Goto Ready2

	Reload3B: //Reload 1 barrel new animation
		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_JumpIfInventory("BD21graphics",2,4)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,2)
		SSGA A 2 A_ReFire
		Goto Ready2
		SHTZ A 2 A_ReFire
		Goto Ready2
		SSGB 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

// --------------------------------------------------------------------------
//
//	Misc.
//
// --------------------------------------------------------------------------

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

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

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

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

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

	AirKickFlash:
		SSGR BCDE 1
		SSGE D 10
		SSGR EDCB 1
		TNT1 A 0 A_JumpIfInventory("BD21graphics",2,4)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,2)
		SSGA A 1
		Stop
		SHTZ A 1
		Stop
		SSGB A 1
		Stop
		
	SlideKickStartFlash:
		SSGR BCDE 1
		SSGE D 15
		Stop
	
	SlideKickEndFlash:
		SSGE D 2
		SSGR EDCB 2
		TNT1 A 0 A_JumpIfInventory("BD21graphics",2,4)
		TNT1 A 0 A_JumpIfInventory("BD21graphics",1,2)
		SSGA A 1
		Stop
		SHTZ A 1
		Stop
		SSGB A 1
		Stop

	GrenadeFlash:
		SSGS FEDCBA 1
		Stop
	}
}

ACTOR HasUnloaded_SSG : Inventory { Inventory.MaxAmount 1 }