Actor chokeRAD : ADSMode
{
inventory.maxamount 1
}
ACTOR auto_ShotgunAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 16
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 16
   Inventory.Icon "none"
}
ACTOR Auto_ShotGun : BDWeapon 16000
{
	Game Doom
	SpawnID 27
	Weapon.SelectionOrder 1300
	Weapon.AmmoUse1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive1 4
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Shell2"
	Weapon.AmmoType2 "auto_ShotgunAmmo"
	Inventory.PickupMessage "$GOTSHOTGUN"
    Inventory.PickupSound "weapons/sgpump"
	Obituary "$OB_MPSHOTGUN"
    AttackSound "None"
    +WEAPON.NOALERT
    +WEAPON.NOAUTOAIM
	+WEAPON.NOAUTOFIRE
	+WEAPON.NO_AUTO_SWITCH
	+FORCEXYBILLBOARD
	yScale 0.8
	xscale 1.0
	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
		
	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 AAAA 0 A_JumpIfInventory("GoFatality", 1,0)
		TNT1 A 0 A_JumpIfInventory("IsPlayingAsPurist", 1, "PuristGun")
		TNT1 A 0
        TNT1 A 0 A_PlaySound("Shotty/select")
		SHTG CBA 0
        ASHS DEFGHIJ 1 A_JumpIfInventory("GoFatality", 1, "Ready")
        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, "MeatShield")
		TNT1 A 0
	A_ready:
	TNT1 A 0 A_selectweapon("Impshield")
		TNT1 A 0 A_selectweapon("ZMANshield")
		TNT1 A 0 A_selectweapon("SGUYshield")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		ASHG a 1 A_weaponready
		tnt1 a 0 A_jumpifinventory("chokeRAD",1, "ready2")
		goto Ready+19
	altfire:
		tnt1 a 0 A_print("choke radius 1/2",2)
		tnt1 a 0 A_jumpifinventory("chokeRAD",1, "lowerchoke")
		tnt1 a 0 A_Giveinventory("chokeRAD",1)
		tnt1 a 0 A_jumpifinventory("chokeRAD",1, "ready2")
	lowerchoke:
		AS8G C 1 A_print("choke radius 1/1",2)
		AS8G B 1
		AS8G A 1
		tnt1 a 0 A_takeinventory("chokeRAD",1)
		goto Ready+19
	ready2:
		AS8G A 1
		AS8G B 1
		AS8G C 1
		tnt1 a 0
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "MeatShield")
		TNT1 A 0 A_selectweapon("Impshield")
		TNT1 A 0 A_selectweapon("ZMANshield")
		TNT1 A 0 A_selectweapon("SGUYshield")
		TNT1 A 0 A_JumpIfInventory("auto_ShotgunAmmo",1,2)
        Goto Reload
		tnt1 a 0 A_weaponready
		TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		ASH8 A 1 A_weaponready
		goto ready2 +4
	Fire2:
        TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
        TNT1 A 0 A_JumpIfInventory("auto_ShotgunAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("ShotgunWasEmpty", 1, "ready")
        //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("SGFIR2", 1,1.0)
		TNT1 A 0 A_PlaySound("SGFIR2", 2,0.5)
		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 AAAAAAAA 0 A_FireCustomMissile("Tracer", random(-3,3), 0, 0, -16, 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("auto_ShotgunAmmo",1)
		TNT1 A 0 A_SetPitch(-1.0 + pitch)
		tnt1 a 0 radius_quake(4,2,0,0,0)
		ttn1 a 0 A_recoil(0.5)
		ASF8 A 1 bright A_FireBullets (5.0, 5.0,random(6,10), 9, "ShotgunPuff")
		TNT1 A 0 A_SetPitch(-5.0 + pitch)
		ASF8 B 1 bright A_SetPitch(+1.0 + pitch)
		ASF8 C 1 A_SetPitch(+1.0 + pitch)
		ASF8 D 1 A_SetPitch(+1.0 + pitch)
		ASF8 E 1 A_SetPitch(+1.0 + pitch)
		ASH8 A 2
		tnt1 a 0 a_refire
		Goto ready2 +4
	Deselect:
			TNT1 A 0
			TNT1 A 0 A_Takeinventory("Zoomed",1)
			TNT1 A 0 A_TakeInventory("TossGrenade", 1)
			TNT1 A 0 A_Takeinventory("chokeRAD",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+1
		
    Fire:
	tnt1 a 0 A_jumpifinventory("chokeRAD",1, "fire2")
        TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
        TNT1 A 0 A_JumpIfInventory("auto_ShotgunAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
		//TNT1 A 0 A_JumpIfInventory("ShotgunWasEmpty", 1, "ready")
        //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_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
        TNT1 A 0 A_AlertMonsters
        TNT1 A 0 A_PlaySound("SGFIR2", 1,1.5)
		TNT1 A 0 A_PlaySound("SGFIRe", 2,1.0)
		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 AAAAAAAA 0 A_FireCustomMissile("Tracer", random(-3,3), 0, 0, -16, 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("auto_ShotgunAmmo",1)
		TNT1 A 0 A_SetPitch(-0.5 + pitch)
		ASHF A 1 bright A_FireBullets (7.0, 7.0,random(6,10), 9, "ShotgunPuff")
		TNT1 A 0 A_SetPitch(-5.0 + pitch)
		ASHF B 1 bright A_SetPitch(+1.0 + pitch)
		ASHF C 1 A_SetPitch(+1.0 + pitch)
		ASHF D 1 A_SetPitch(+1.0 + pitch)
		ASHG a 1 A_SetPitch(+2.0 + pitch)
		ASHG a 2
		tnt1 a 0 A_refire
		goto Ready+19
		
	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
		
	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:
		AUSC A -1
		Stop
    	
    DoKick:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_takeinventory("reloading",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("chokeRAD",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)
		ASHK BCD 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        ASHK H 5
		KICK A 0 A_Takeinventory("Kicking",1)
		ASHK I 1
		ASHK GFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1,0)
		goto Ready+19
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		ASHK BCD 1
        RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        ASHK H 5
		KICK A 0 A_Takeinventory("Kicking",1)
		ASHK I 1
		ASHK GFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1,0)
		goto Ready+19
	
	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,0)
		goto Ready+19
		
	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,0)
		goto Ready+19
	
	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+15
	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+19
	CheckDistanceGrab:
	    TNT1 A 0 
		TNT1 A 0 A_JumpIfCloser(100, "Grab")
		goto Ready+19
	CheckIfCanGrab:
	    TNT1 A 0 
		TNT1 A 0 A_JumpIfInTargetInventory("CanGrab", 1, "Grab")
		goto Ready+19	
	Grab:
	    PKUP ABC 2
		TNT1 A 0 A_CustomMissile("PickupProjectile")
		PKUP DEF 2
		Goto Ready+1


    ReloadWithNoAmmoLeft:
    Reload:
		ashg a 1 A_jumpifinventory("auto_ShotgunAmmo",16,3)
		tnt1 a 0 A_weaponready
	TNT1 A 0 A_JumpIfInventory("Shell2",1,2)
		tnt1 a 0
        Goto A_ready
	    TNT1 A 0
		TNT1 A 0 A_TakeInventory("Reloading", 1)
		ashr abefij 1 A_weaponready
	ReloadNormally:
	ashr K 3 A_weaponready
	TNT1 A 0 A_JumpIfInventory("Shell2",1,2)
        Goto reload_end
		tnt1 a 0 A_weaponready
		tnt1 a 0 A_takeinventory("shell2",1)
		ashr a 0 A_giveinventory("auto_ShotgunAmmo",1)
		ashr MNO 1 A_weaponready
		tnt1 a 0 A_playsound("Shell/load",2)
		tnt1 a 0 A_playsound("Shell/load",3)
		ashr PQ 1 A_weaponready
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		ashr a 0 A_jumpifinventory("auto_ShotgunAmmo",16,"reload_end")
		goto ReloadNormally
	reload_end:
		ashr jhgedba 1 A_weaponready
		tnt1 a 0 A_jumpifinventory("chokeRAD",1,"ready2")
		goto Ready+19
      PuristGun:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("ClassicShotgun", 1)
		TNT1 A 0 A_TakeInventory("Shot_Gun", 1)
		TNT1 A 0 A_SelectWeapon("ClassicShotgun")
		TNT1 A 10
		goto Ready+19
		
	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+1	
	NoGrenade:
		TNT1 A 0
		TNT1 A 0 A_Print("No Grenades Left.")
		goto Ready+19
	}
}