Actor Pumping : Inventory
{
inventory.maxamount 1
}

Actor ImpactMovesSling : Inventory
{
inventory.maxamount 1
}

Actor UseShotgunStrap : Inventory
{
inventory.maxamount 1
}


Actor ShotgunWasEmpty : Inventory
{
inventory.maxamount 1
}

// --------------------------------------------------------------------------
//
// Shotgun
//
// --------------------------------------------------------------------------

ACTOR Shot_Gun : Shotgun Replaces Shotgun
{
	Game Doom
	SpawnID 27
	Weapon.SelectionOrder 1300
	Weapon.AmmoUse1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive1 4
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Shell"
	Weapon.AmmoType2 "ShotgunAmmo"
	Inventory.PickupMessage "$GOTSHOTGUN"
    Inventory.PickupSound "weapons/sgpump"
	Obituary "$OB_MPSHOTGUN"
    AttackSound "None"
    +WEAPON.NOALERT
    +WEAPON.NOAUTOAIM
	+WEAPON.NOAUTOFIRE
	+FORCEXYBILLBOARD
	+WEAPON.NO_AUTO_SWITCH
	Scale 0.9
	States
	{

    ShakeLeft:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("ImpactMovesSling")
		TNT1 A 0 A_JumpIfInventory("UseShotgunStrap", 1, 2)
		Goto OkToFire
		TNT1 A 0
		SHTI GH 2 A_WeaponReady
		
		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 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		SHTI IJK 2 A_WeaponReady
		TNT1 A 0 A_TakeInventory("ImpactMovesSling")
		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 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		ShakeRight:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("ImpactMovesSling")
		TNT1 A 0 A_JumpIfInventory("UseShotgunStrap", 1, 2)
		Goto OkToFire
		TNT1 A 0
		SHTI ABC 2 A_WeaponReady
	    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 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("ImpactMovesSling", 1, "ShakeLeft")
		SHTI DEF 2 A_WeaponReady
	    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 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("ImpactMovesSling", 1, "ShakeLeft")
	    SHTI GHK 2 A_WeaponReady
		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 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
	    SHTI ABEF 2 A_WeaponReady
		Goto Ready+14
		
	ShakeAiming:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("ImpactMovesSling")
		TNT1 A 0 A_JumpIfInventory("UseShotgunStrap", 1, 2)
		Goto Ready2
		TNT1 A 0
		ST81 ABCBA 2 A_WeaponReady
		TNT1 A 0 A_TakeInventory("ImpactMovesSling")
		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 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		ST81 DEFED 2 A_WeaponReady
	    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 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
	    ST81 AB 2 A_WeaponReady
		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 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
	    ST81 DE 2 A_WeaponReady
		Goto Ready2
		
	Steady:
		TNT1 A 1
		Goto Ready
	Ready:
        TNT1 AAAA 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		TNT1 A 0 A_JumpIfInventory("IsPlayingAsPurist", 1, "PuristGun")
		TNT1 A 0 A_JumpIfInventory("NeverSelectedShotgun",1,"WarmUp")
        TNT1 A 4 A_PlaySound("weapons/sgpump")
		SHTG CBA 0
        SHSS ABCD 1 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ShakeRight
        TNT1 AAAAAAAAAAAAAAA 0
        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 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("ImpactMovesSling", 1, "ShakeLeft")
	OkToFire:
		SHTG A 1 A_WeaponReady
        
		Goto Ready+14
		
	Ready2:
        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 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("ImpactMovesSling", 1, "ShakeAiming")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		SHT8 A 1 A_WeaponReady
		Loop
	
	
	Deselect:
			TNT1 A 0
			TNT1 A 0 A_Takeinventory("Zoomed",1)
			TNT1 A 0 A_TakeInventory("TossGrenade", 1)
			TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_Takeinventory("UseShotgunStrap",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		SHSS DCBA 1
		TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
		TNT1 A 1
		Wait
	
	Select:
		TNT1 A 0 A_Takeinventory("FistsSelected",1)
		TNT1 A 0 A_Takeinventory("SawSelected",1)
		TNT1 A 0 A_Giveinventory("ShotgunSelected",1)
		TNT1 A 0 A_Takeinventory("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 AAAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
		Goto Ready
		
    Fire:
        TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
        TNT1 A 0 A_JumpIfInventory("ShotgunAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("ShotgunWasEmpty", 1, "Pump2")
        //TNT1 AA 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		//TNT1 A 0 A_SetAngle(random(2, -2) + angle)
		//TNT1 A 0 A_SetPitch(random(2, -2) + pitch)
        TNT1 A 0 A_AlertMonsters
        TNT1 A 0 A_PlaySound("weapons/sg", 2)
		RIFF AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 0, 0, 0)
        TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
		//TNT1 AAAAAAAAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles", random(-15,15), 0, -1, 0, 0, random(-10,10))
		TNT1 AAAAA 0 A_FireCustomMissile("Tracer", random(-3,3), 0, -1, -12, 0, random(-5,5))
		//RIFF AAAAAA 0 A_FireCustomMissile("WallPenetrationHitscan", random(-3,3), 0, -1, 0, 0, random(-3,3))
        //TNT1 A 0 ACS_Execute(374, 0, 0, 0, 0)
		//TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("ShotgunAmmo",1)
		SHTG A 0 A_FireBullets (2.7, 2.7, 10, 8, "ShotgunPuff")
		TNT1 A 0 A_SetPitch(-8.0 + pitch)
        SHTF B 1 BRIGHT
		
		
		SHTF C 1 A_SetPitch(+1.0 + pitch)
		
		SHTF DE 1 A_SetPitch(+1.0 + pitch)
		
		
		SHTG A 1 A_SetPitch(+3.0 + pitch)
		SHTG AA 1 A_SetPitch(+1.0 + pitch)
		
		//TNT1 A 0 A_Jump(128, "Pump1")
		Goto Pump1
		
   Pump1:	
   TNT1 A 0 A_GiveInventory ("Pumping", 1)
   
   SHTG BCDEFG 1
   TNT1 A 0 A_FireCustomMissile("ShotCaseSpawn",0,0,-4,-4)
   SHTG H 1 A_PlaySound("weapons/sgpump", 3)
   //TNT1 A 0 A_SetPitch(+1 + pitch)
   SHTG IJ 1
   //TNT1 A 0 A_SetPitch(-1 + pitch)
   SHTG KL 1
   SHTG KJIH 1
   TNT1 A 0 A_Takeinventory("ShotgunWasEmpty",1)
   SHTG GFEDC 1 A_JumpIfInventory("Kicking",1,"DoKick")
   Goto ReadyToFireAgain
   
   
   Pump2:	
   TNT1 A 0 A_GiveInventory ("Pumping", 1)
   TNT1 A 0 A_TakeInventory("Reloading", 1)
	    TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
   SHTG FG 1
   SHTG H 1 A_PlaySound("weapons/sgpump", 3)
   //TNT1 A 0 A_SetPitch(+1 + pitch)
   SHTG IJ 1
   //TNT1 A 0 A_SetPitch(-1 + pitch)
   SHTG KL 1
   SHTG KJIH 1
   TNT1 A 0 A_Takeinventory("ShotgunWasEmpty",1)
   SHTG GFEDC 1 A_JumpIfInventory("Kicking",1,"DoKick")
   Goto ReadyToFireAgain
   
		
	ReadyToFireAgain:	
   //SHTG A 6 <-- Old frame
        SHTG A 1 Offset(10,36) // <-- New frames
        SHTG A 1 Offset(9,40) //
        SHTG A 1 Offset(4,40) //
        SHTG A 1 Offset(0,32) //
        SHTG A 0 A_Refire
        SHTG A 0 //A_Refire
		Goto ShakeLeft
		
	Fire2:
        TNT1 A 0 A_Takeinventory("Reloading",1)
        TNT1 A 0 A_JumpIfInventory("ShotgunAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("ShotgunWasEmpty", 1, "Pump2")
        //TNT1 AA 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
        TNT1 A 0 A_AlertMonsters
		RIFF AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 2, 0, 0)
        TNT1 A 0 A_PlaySound("weapons/sg", 2)
        TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,0,45)
		SHTG A 0 A_FireBullets (1.7, 1.7, 10, 8, "ShotgunPuff")
		//TNT1 AAAAAAAAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles", random(-15,15), 0, -1, 0, 0, random(-10,10))
		TNT1 AAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, -1, 0, 0, random(-5,5))
		TNT1 A 0 A_SetPitch(-12.0 + pitch)
		//TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("ShotgunAmmo",1)
        SHT8 FF 1 BRIGHT A_SetPitch(+2.0 + pitch)
		SHT8 GGAA 1 A_SetPitch(+2.0 + pitch)
TNT1 A 0 A_ZoomFactor(1.0)
        SHT8 ADE 2	
   TNT1 A 0 A_GiveInventory ("Pumping", 1)
   SHTG BCDEFG 1
   TNT1 A 0 A_FireCustomMissile("ShotCaseSpawn",0,0,-4,-4)
   SHTG H 1 A_PlaySound("weapons/sgpump")
   SHTG IJKL 1 
        TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SHTG KJIHGFEDCB 1
TNT1 A 0 A_ZoomFactor(1.2)
SHT8 ED 1
TNT1 A 0 A_Refire
		Goto ShakeAiming
	
	
	
	
	AltFire:
        TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,8)
		TNT1 A 0 A_Giveinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.2)
		TNT1 A 0 A_Giveinventory("ADSmode",1)
        SHT8 E 1
        Goto ShakeAiming
        TNT1 AAAAAA 0
        SHT8 D 1
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
        Goto Ready+12
		
	WarmUp:
	TNT1 A 0
	TNT1 A 0 A_TakeInventory ("NeverSelectedShotgun", 1)
   TNT1 A 0 A_TakeInventory("Reloading", 1)
	    TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
	SHSS EFGHIJKLM 1
   SHTG FG 1
   SHTG H 1 A_PlaySound("weapons/sgpump", 3)
   //TNT1 A 0 A_SetPitch(+1 + pitch)
   SHTG IJ 1
   //TNT1 A 0 A_SetPitch(-1 + pitch)
   SHTG KL 1
   SHTG KJIH 1
   TNT1 A 0 A_Takeinventory("ShotgunWasEmpty",1)
   SHTG GFEDC 1 A_JumpIfInventory("Kicking",1,"DoKick")
   Goto ReadyToFireAgain	
	
	Spawn:
		SHTC 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)
		shki BCD 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        shki H 5
		KICK A 0 A_Takeinventory("Kicking",1)
		shki I 1
		shki GFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Ready+14
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		shki BCD 1
        RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        shki H 5
		KICK A 0 A_Takeinventory("Kicking",1)
		shki I 1
		shki GFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Ready+14
	
	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+14
		
	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+14
	
	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
	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
		
	CheckGrab:
	    TNT1 A 0 
		TNT1 A 0 A_JumpIfTargetInLOS("CheckDistanceGrab")
		Goto Ready+14
	CheckDistanceGrab:
	    TNT1 A 0 
		TNT1 A 0 A_JumpIfCloser(100, "Grab")
		Goto Ready+14
	CheckIfCanGrab:
	    TNT1 A 0 
		TNT1 A 0 A_JumpIfInTargetInventory("CanGrab", 1, "Grab")
		Goto Ready+14	
	Grab:
	    PKUP ABC 2
		TNT1 A 0 A_CustomMissile("PickupProjectile")
		PKUP DEF 2
		Goto Ready


    ReloadWithNoAmmoLeft:
    Reload:
	    TNT1 A 0
	    TNT1 A 0
		TNT1 A 0 A_TakeInventory("Reloading", 1)
	    TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		SHTG A 1 A_WeaponReady
		
		TNT1 A 0 A_JumpIfInventory("ShotgunAmmo",8,"OkToFire")
		TNT1 A 0 A_JumpIfInventory("ShotgunAmmo", 1, "ReloadNormally")
		TNT1 A 0 A_GiveInventory("ShotgunWasEmpty", 1)
	ReloadNormally:	
        TNT1 A 0 A_JumpIfInventory("Shell",1,3)
        Goto Ready+14
        TNT1 AAA 0
		SHTG B 1 //A_PlaySound("weapons/sgpump")
				TNT1 A 0 A_GiveInventory ("Pumping", 1)
		SHTG CDE 1

        TNT1 AAAA 0
        TNT1 A 0 A_JumpIfInventory("Shell",1,2)
        Goto Reload+53
        TNT1 AAAAA 0


		TNT1 A 0 A_GiveInventory ("Pumping", 1)
        TNT1 A 0 A_JumpIfInventory("ShotgunAmmo",8,23)
		//TNT1 A 0 A_JumpIfInventory("Shell",0,23)
        TNT1 A 0
        TNT1 A 0 A_Giveinventory("ShotgunAmmo",1)
		TNT1 A 0 A_Takeinventory("Shell",1)


        SSHR ABC 1
        SSHR D 1 A_PlaySound("insertshell")
        SSHR EFG 1
        SSHR A 1 A_Refire
        TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")


        Goto Reload+18
        TNT1 AAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 AAAAA 0
		TNT1 A 0 A_JumpIfInventory("ShotgunWasEmpty", 1, "Pump2")
		SHTG FEDCBA 1 A_WeaponReady
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 //A_Giveinventory("SGFullReloaded",1)
		Goto ShakeLeft
		
		
	//AltFire:  Slam Fire Mode. Never used
	    TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
        TNT1 A 0 A_JumpIfInventory("ShotgunAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        //TNT1 AA 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		TNT1 A 0 A_SetAngle(random(3, -3) + angle)
		TNT1 A 0 A_SetPitch(random(3, -3) + pitch)
        TNT1 A 0 A_AlertMonsters
        TNT1 A 0 A_PlaySound("weapons/sg", 1)
        TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
		//TNT1 AAAAAAAAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles", random(-15,15), 0, -1, 0, 0, random(-10,10))
		TNT1 AAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, -1, -12, 0, random(-5,5))
        //TNT1 A 0 ACS_Execute(374, 0, 0, 0, 0)
		//TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("ShotgunAmmo",1)
		SHTG A 0 A_FireBullets (2.0, 2.0, 8, 8, "ShotgunPuff")
		TNT1 A 0 A_SetPitch(-8.0 + pitch)
        SHTF B 1 BRIGHT
		
		SHTF C 1 A_SetPitch(+1.0 + pitch)
		
		SHTF DE 1 A_SetPitch(+1.0 + pitch)
		
		
		SHTG A 1 A_SetPitch(+3.0 + pitch)
		SHTG AA 1 A_SetPitch(+1.0 + pitch)
		
		SHSL A 1
        TNT1 A 0 A_PlaySound("weapons/sgpump", 3)
		SHSL BC 1
		TNT1 A 0 A_FireCustomMissile("ShotCaseSpawn",0,0,-4,-4)
		SHSL DEDCBA 1
		SHTG A 1
		TNT1 A 0 A_Refire
		Goto AltFire


      PuristGun:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("ClassicShotgun", 1)
		TNT1 A 0 A_TakeInventory("Shot_Gun", 1)
		TNT1 A 10
		Goto Ready2
		
	TossGrenade:	
		TNT1 A 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.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	
	NoGrenade:
		TNT1 A 0
		TNT1 A 0 A_Print("No Grenades Left.")
		Goto OkToFire	
		
		
	Unload:
		SHTG A 1
		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_GiveInventory("ShotgunWasEmpty", 1)
        TNT1 A 0 A_JumpIfInventory("ShotgunAmmo",1,3)
        Goto OkToFire
        TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		SHTG ABCDEF 1
		
	RemoveBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("ShotgunAmmo",1,3)
		Goto FinishUnload
        TNT1 AAAAAA 0
		TNT1 A 0 A_Takeinventory("ShotgunAmmo",1)
		TNT1 A 0 A_Giveinventory("Shell",1)
		
		SHTG G 1
	   SHTG H 1 A_PlaySound("weapons/sgpump", 3)
	   //TNT1 A 0 A_SetPitch(+1 + pitch)
	   SHTG IJ 1
	   //TNT1 A 0 A_SetPitch(-1 + pitch)
	   SHTG KL 1
	   SHTG KJIH 1
	   TNT1 A 0 A_Giveinventory("ShotgunWasEmpty",1)
	   SHTG GF 1
		Goto RemoveBullets
	
	FInishUnload:
		SHTG EDCBA 1
		TNT1 A 0 A_Takeinventory("Unloading",1)
		Goto OkToFire	
	}
}

ACTOR ShotgunAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 8
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 8
   Inventory.Icon "SHTCA0"
}



