ACTOR SSGAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 2
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 2
   Inventory.Icon "0"
}


// --------------------------------------------------------------------------
//
// Super Shotgun
//
// --------------------------------------------------------------------------
ACTOR SSG : BDWeapon Replaces SuperShotgun
{
	Game Doom
	SpawnID 33
    Weapon.Kickback 50
	Weapon.SelectionOrder 400
	Weapon.AmmoGive1 4
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Shell2"
	Weapon.AmmoType2 "SSGAmmo"
	Weapon.AmmoUse1 0
	Weapon.AmmoUse2 0
    +WEAPON.NOAUTOAIM
	+WEAPON.NOAUTOFIRE
	+WEAPON.NO_AUTO_SWITCH
	+FORCEXYBILLBOARD
	Inventory.PickupMessage "$GOTSHOTGUN2"
	Obituary "$OB_MPSSHOTGUN"
    Inventory.PickupSound "CLIPINSS"
	Scale 0.9
	States
	{
	meatshield:
	    TNT1 A 0 SetPlayerProperty(0,1,0)
		PUNG BCD 1
        TNT1 A 0 A_PlaySound("skeleton/swing")
		PUNG A 0 A_FireCustomMissile("MeleeStrikegrab", 0, 0, 0, -9)
		PUNG E 1
		PUNG DCB 1
        PUNG AA 1
		TNT1 A 0 A_Refire("meatshield")
		tnt1 a 0 A_weaponready
		TNT1 A 0 A_TakeInventory("Salute1",1)
		TNT1 A 0 A_TakeInventory("Salute2",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+1
	Steady:
	TNT1 A 1
	Goto Ready+1
	lowhealth:
		tnt1 a 0 A_jumpifhealthlower(30,2)
		tnt1 a 4
		loop
		tnt1 a 0
		blsc a 4
		loop
	lowhealth:
		tnt1 a 0 A_jumpifhealthlower(30,2)
		tnt1 a 4
		loop
		tnt1 a 0
		blsc a 4
		loop
	Ready:
		tnt1 a 0 //A_gunflash("lowhealth")
		tnt1 a 0
		tnt1 a 0 //A_gunflash("lowhealth")
		tnt1 a 0
	TNT1 A 0 A_selectweapon("Impshield")
		TNT1 A 0 A_selectweapon("ZMANshield")
		TNT1 A 0 A_selectweapon("SGUYshield")
        TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		TNT1 A 0 A_JumpIfInventory("IsPlayingAsPurist", 1, "PuristGun")
        SHT5 ABCD 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        TNT1 AAA 0
        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, "MeatShield")
		TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		
        TNT1 AAA 0
		SHT2 A 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")		
		goto Ready+12
		
	Deselect:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		SHT5 DCBA 1
		TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
		TNT1 A 1
		Wait
	Select:
		TNT1 A 0 A_Takeinventory("FistsSelected",1)
		TNT1 A 0 A_JumpIfInventory("IsPlayingAsPurist", 1, "PuristGun")
		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 AAAAAAAAAAAA 0 A_Raise
		SHT2 U 1 Offset(20,46)
		SHT2 V 1 Offset(1,33)
        
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
        TNT1 A 0 A_PlaySound("weapons/sshotc")
        SHT2 WX 1
		SHT2 YZ 1
		TNT1 A 0 A_PlaySound("CLIPINSS")
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
        SHO9 DE 1
		SHO9 FG 1
		Goto Ready+1
		
    NoAmmo:
        SHT2 A 4 A_PlaySound("weapons/empty", 2)
		TNT1 A 0 A_TakeInventory("SSGAlt",1)
		TNT1 A 0 A_JumpIfInventory("Shell2", 1, "Reload")
        goto Ready+12
	 Fire:
		TNT1 A 0 A_TakeInventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("SSGAlt",1,"AltFire")
		TNT1 A 0 A_JumpIfInventory("SSGAmmo", 2, 1)
		Goto NoAmmo
		//TNT1 A 0 A_JumpIfInventory("SSGAmmo", 2, 1)
		//Goto AltFire
		tnt1 a 0 A_firebullets(random(1.0,15),random(1.0,15),random(0,6),random(10,25),"SSGWad")
		TNT1 A 0 A_TakeInventory("SSGAmmo", 2)
		TNT1 A 0 A_FireBullets (4, 3, random(2,4), random(12,26), "shotpuff",0,random(120,220))
		tnt1 a 0 A_quake(60,3,0,1,"none")
		tnt1 a 0 A_quake(5,7,0,1,"none")
		TNT1 A 0 A_Recoil(5)
        SHO9 A 1 BRIGHT A_playsound("SSHFIRE", 5)
		SHO9 A 0 BRIGHT A_playsound("SSHFIRE", 4)
		SHO9 A 0 BRIGHT A_playsound("weapons/sg", 3)
		SHO9 A 0 BRIGHT A_playsound("weapons/sg", 2)
		TNT1 AAAAAA 0 A_FireCustomMissile("Tracer", random(-10,10), 0, 0, -16, 0, random(-5,5))
		
		 TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",15,0,0,0)
		 TNT1 AA 0 A_FireCustomMissile("YellowFlareSpawn",-15,0,0,0)
		 TNT1 A 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
			SHO9 B 1 BRIGHT
		TNT1 A 0 A_FireBullets (5, 4, random(6,8),random(12,16), "ShotgunPuff")
		TNT1 A 0 A_FireBullets (5, 4, random(6,8),random(12,16), "ShotgunPuff")
		TNT1 A 0 A_SetPitch(-30.0 + pitch)
        TNT1 A 0 A_FireCustomMissile("ShakeYourAssQuad", 0, 0, 0, 0)
        SHO9 B 1 BRIGHT A_SetPitch(+8.0 + pitch)
      SHO8 C 1 Offset(0,62)
	  TNT1 A 0 A_SetPitch(+8.0 + pitch)
      SHO8 D 1 Offset(0,61)
	  TNT1 A 0 A_SetPitch(+2.0 + pitch)
      SHO8 E 1 Offset(0,60)
	  TNT1 A 0 A_SetPitch(+2.0 + pitch)
		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_TakeInventory("SSGAlt",1)
      TNT1 A 0 A_TakeInventory("Reloading",1)
      //TNT1 A 0 A_JumpIfInventory("Shell2",0,"NoAmmo")
        SHO8 E 2 Offset(0,56) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		TNT1 A 0 A_SetPitch(+2.0 + pitch)
        SHO8 C 0 Offset(0,42) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		TNT1 A 0 A_SetPitch(+2.0 + pitch)
        SHT2 A 3 A_SetPitch(+2.0 + pitch)
		TNT1 A 0 A_SetPitch(+2.0 + pitch)
		Goto Reload
		
		
		
		
		
	Reload:	
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("SSGAlt", 1, "Reload2")//Check if still has a shell on left barrel
		TNT1 A 0 A_JumpIfInventory("SSGAmmo", 2, "Ready")//Check if still has a shell on left barrel
		TNT1 A 0 A_JumpIfInventory("Shell2", 1, 1)//Check if has any ammo left to reload
		Goto Ready+1
		TNT1 A 0 A_JumpIfInventory("Shell2", 2, 1)//Check if has ammo to reload 2 shells
		Goto Reload2
		//Reload 2 barrels
		SHT2 B 1 Offset(20,48) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
        SHT2 B 1 Offset(10,36) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SHT2 BCDEF 1
		SHT2 GH 1
		SHT2 IJ 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
        
        TNT1 A 0 A_PlaySound("SSG/open")
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, 3)
		TNT1 AA 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-10)
        SHT2 K 1
		SHT2 L 5
		SHT2 MMNNOO 1 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_playsound("weapons/sshotl")
		  SHT2 P 1 Offset(10,36)
		  SHT2 P 1 Offset(20,46)
		  SHT2 Q 1 Offset(30,56)
		  SHT2 Q 1 Offset(40,66)
		  SHT2 R 1 Offset(50,76)
		  SHT2 S 1
		  TNT1 A 0 A_GiveInventory ("Pumping", 1)
			
		SHT2 T 1 Offset(30,56)
		SHT2 U 1 Offset(20,46)
		SHT2 V 1 Offset(1,33)
			
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_PlaySound("weapons/sshotc")
		TNT1 A 0 A_TakeInventory("Shell2", 2)
		TNT1 A 0 A_GiveInventory("SSGAmmo", 2)
			
			SHT2 WX 1
			SHT2 YZ 1
		  TNT1 A 0 A_GiveInventory ("Pumping", 1)
		  TNT1 A 0 A_TakeInventory("SSGAlt",1)
			SHO9 DE 1
			SHO9 FG 1
		  TNT1 A 0 A_ReFire
		 SHT2 A 1
        goto Ready+12
		

AltFire:
		TNT1 A 0 A_TakeInventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("SSGAmmo",1,3)
        Goto NoAmmo
        TNT1 AAAAA 0
		tnt1 a 0 A_quake(5,7,0,1,"none")
		TNT1 A 0 A_JumpIfInventory("SSGAlt",1,"AltFire2")


		TNT1 A 0 A_TakeInventory("SSGAmmo",1)
		TNT1 A 0 A_GiveInventory("SSGAlt",1)
        TNT1 A 0 A_Recoil(2)
        TNT1 A 0 A_ALertMonsters
		RIFF AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 2, 0, 0, 0)
        SHTA A 1 BRIGHT A_PlaySound("weapons/sg",1,0.8)
		SHO9 A 0 BRIGHT A_playsound("SSHFIRE", 4,0.7)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
        SHTA AB 1 BRIGHT A_FireBullets (5, 4, random(7,8),random(12,18), "ShotgunPuff")
        TNT1 AAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, 1, -16, 0, random(-5,5))
	TNT1 A 0 A_SetPitch(-7.0 + pitch)
		//TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
		SHO8 EE 0 A_SetPitch(+1.0 + pitch)
        SHT2 AA 2 A_SetPitch(+1.0 + pitch)
        TNT1 A 0
        goto Ready+12

AltFire2:
		TNT1 A 0 A_TakeInventory("SSGAmmo", 1)
        TNT1 A 0 A_Recoil(2)
        TNT1 A 0 A_ALertMonsters
		RIFF AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, -2, 0, 0, 0)
        SHTB AB 0 BRIGHT A_PlaySound("weapons/sg",1,0.8)
		SHO9 A 0 BRIGHT A_playsound("SSHFIRE", 4,0.7)
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
        SHTB AB 1 BRIGHT A_FireBullets (5, 4, random(7,8),random(12,18), "ShotgunPuff")
        TNT1 AAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, -1, -16, 0, random(-5,5))
		 TNT1 A 0 A_SetPitch(-4.0 + pitch)
		//TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
        SHT2 AA 2 BRIGHT A_SetPitch(+1.0 + pitch)
		SHO8 EE 0 A_SetPitch(+1.0 + pitch)
		
		TNT1 A 0 A_TakeInventory("SSGAlt", 1)
		TNT1 A 0 A_JumpIfInventory("Shell2",1,1)
		TNT1 A 0 A_GiveInventory("Reloading", 1)
		Goto Ready+1
        
	Reload2:
		
		TNT1 A 0 A_TakeInventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("Shell2",1,1)
		Goto NoAmmo
		TNT1 A 0 A_TakeInventory("SSGAlt",1)
		
		SHT2 B 2 Offset(20,48) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		TNT1 A 0 
	    TNT1 A 0 
        SHT2 B 2 Offset(10,36) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		TNT1 A 0 
	    TNT1 A 0 
		SHT2 BCDEF 1
		TNT1 A 0 
	    TNT1 A 0 
		SHT2 GH 1
		TNT1 A 0 
	    TNT1 A 0 
		SHT2 IJ 1
		TNT1 A 0
	    TNT1 A 0
		
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
        
        TNT1 A 0 A_PlaySound("SSG/open")
		TNT1 A 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-10)
        SHT2 K 2
		SHT7 L 10
		SHT7 MMNNOO 1 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_playsound("weapons/sshotl")
		SHT7 P 1 Offset(10,36)
		SHT7 P 1 Offset(20,46)
		SHT2 Q 1 Offset(30,56)
		SHT2 Q 1 Offset(40,66)
		SHT2 R 1 Offset(50,76)
		TNT1 A 0
		SHT2 S 2
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
        
		SHT2 T 1 Offset(30,56)
		SHT2 U 1 Offset(20,46)
		SHT2 V 1 Offset(1,33)
        
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
        TNT1 A 0 A_PlaySound("weapons/sshotc")
		TNT1 A 0 A_TakeInventory("Shell2", 1)
		TNT1 A 0 A_GiveInventory("SSGAmmo", 1)
        SHT2 WX 1
		SHT2 YZ 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		SHO9 DE 1
		SHO9 FG 1
		TNT1 A 0 A_ReFire
		SHT2 A 2
		
	  goto Ready+12

	Spawn:
		SGN2 A -1
		Stop
	
    DoKick:
	    TNT1 A 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		NULL A 0 A_JumpIf (pitch > 32, "LowKickChecker1")
		Goto InitializeNormalKick
		
		LowKickChecker1:
		TNT1 A 0
	    NULL A 0 A_JumpIf (pitch > 90, "InitializeNormalKick")
		RIFF A 0 A_FireCustomMissile("KickAttackDetectDowned", 0, 0, 0, 0)
		
		InitializeNOrmalKick:
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		SSKI BCD 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        SSKI H 5
		KICK A 0 A_Takeinventory("Kicking",1)
		SSKI I 1
		SSKI GFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		goto Ready+12
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		SSKI BCD 1
        RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        SSKI H 5
		KICK A 0 A_Takeinventory("Kicking",1)
		SSKI I 1
		SSKI GFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		goto Ready+12
	
	AirKick:
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        RIFF A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
        KICK O 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		goto Ready+12
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        RIFF A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        KICK O 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		goto Ready+12
	
	Taunt:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("Taunting",1)
		TNT1 A 0 A_JumpIfInventory("RealismMode", 1, "CheckGrab")
        TNT1 A 10
		FUCK A 1
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 0, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", -9, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 9, 0, -1, 0)
        FUCK B 1 A_PlaySound("FUCK", 2)
        FUCK CD 1 A_AlertMonsters
		FUCK E 15 A_Takeinventory("Taunting",1)
        FUCK DCBA 1
        TNT1 A 10
		Goto Ready+1
	Salute:
	    TNT1 A 0 SetPlayerProperty(0,1,0)
		TNT1 A 0 A_ALertMonsters
		SALU ABCDEDCDEDCDEDCBA 4
		TNT1 A 0 A_TakeInventory("Salute1",1)
		TNT1 A 0 A_TakeInventory("Salute2",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+1
		
	CheckGrab:
	    TNT1 A 0 
		TNT1 A 0 A_JumpIfTargetInLOS("CheckDistanceGrab")
		goto Ready+12
	CheckDistanceGrab:
	    TNT1 A 0 
		TNT1 A 0 A_JumpIfCloser(100, "Grab")
		goto Ready+12
	CheckIfCanGrab:
	    TNT1 A 0 
		TNT1 A 0 A_JumpIfInTargetInventory("CanGrab", 1, "Grab")
		goto Ready+12	
	Grab:
	    PKUP ABC 2
		TNT1 A 0 A_CustomMissile("PickupProjectile")
		PKUP DEF 2
		Goto Ready+1
		
	PuristGun:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("ClassicSSG", 1)
		TNT1 A 0 A_TakeInventory("SSG", 1)
		TNT1 A 0 A_selectweapon("ClassicSSG")
		TNT1 A 10
		Goto Ready+1
		
	TossGrenade:	
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_JumpIfInventory("GrenadeAmmo", 1, 1)
		Goto NoGrenade
		GRTH ABCD 1
		TNT1 A 0 A_GiveInventory("FiredGrenade", 1)
		TNT1 A 0 A_PLaySound ("GRNPIN")
		GRTH EEFG 1
		TNT1 A 0 A_PLaySound ("GRNTOSS")
		GRTH HI 1
		TNT1 A 0 A_TakeInventory("GrenadeAmmo", 1)
		TNT1 A 0 A_FireCustomMissile("HandGrenade", random(-2,2), 0, 0, 0, 0, 0)
	    TNT1 A 0 A_TakeInventory("FiredGrenade", 1)
		GRTH JKLM 1
		TNT1 A 1 
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		Goto Ready+1	
	NoGrenade:
		TNT1 A 0
		TNT1 A 0 A_Print("No Grenades Left.")
		goto Ready+12	
		
	
	Unload:
		SHT5 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("SSGAmmo",1,3)
        Goto Ready+1
        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("SSGAmmo",1,3)
		Goto FinishUnload
        TNT1 AAAAAA 0
		TNT1 A 0 A_Takeinventory("SSGAmmo",1)
		TNT1 A 0 A_Giveinventory("Shell2",1)
		Goto RemoveBullets
	
	FInishUnload:
		SHT2 B 2 Offset(20,48) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
        SHT2 B 2 Offset(10,36) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SHT2 BCDEF 1
		SHT2 GH 1
		TNT1 A 0 A_PlaySound("weapons/sshotc")
		SHT2 IJ 1
        SHT2 K 2
		TNT1 A 20
		TNT1 A 0 A_GiveInventory("HasUnloaded", 1)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		SHT2 U 1 Offset(20,46)
		SHT2 V 1 Offset(1,33)
        
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
        TNT1 A 0 A_PlaySound("weapons/sshotc")
        SHT2 WX 1
		SHT2 YZ 1
		TNT1 A 0 A_PlaySound("CLIPINSS")
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
        SHO9 DE 1
		SHO9 FG 1
		Goto Ready+1
		Goto Ready+1
	
	}
}
