// --------------------------------------------------------------------------
//
//	AA12
//
// --------------------------------------------------------------------------

ACTOR U_AssaultShotgun : Weapon replaces AssaultShotgun
{
	Weapon.AmmoUse1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive1 20
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "GreenShell"
	Weapon.AmmoType2 "AssaultShotgunAmmo"
	Weapon.SelectionOrder 1200
	Obituary "%o was shot down by %k's Assault Shotgun."
    AttackSound "None"
    Inventory.PickupSound "CLIPIN"
	Inventory.Pickupmessage "You got the Assault Shotgun!"
    +WEAPON.NOAUTOAIM
    +WEAPON.NOALERT
    +WEAPON.NOAUTOFIRE
	+FORCEXYBILLBOARD
	+WEAPON.NO_AUTO_SWITCH
	+INVENTORY.RESTRICTABSOLUTELY
	INVENTORY.FORBIDDENTO U_Purist
	VisibleToPlayerClass Doomer3
    Scale 0.8
	tag "Assault Shotgun"
	States
	{
 	Spawn:
		A12P A -1
		Stop
		
	PuristGun:
		TNT1 A 0 A_TakeInventory("U_AssaultShotgun", 1)
		Goto Deselect
		
	Select:
		TNT1 A 0 A_JumpIfInventory("IsPlayingAsPurist",1,"PuristGun")
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1010,1)==0, "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 ACS_ExecuteAlways(728, 0, 0, 0, 0)//Check if penetration is on.
		TNT1 A 1 A_Raise
		TNT1 A 0 A_GunFlash
		TNT1 AAAAAAAAA 0 A_Raise
		Goto SelectAnimation
		
	Deselect:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_TakeInventory("SSGSelected", 1)
        TNT1 A 0 A_ZoomFactor(1.0)
		A12S DCBA 1
		TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
		TNT1 A 1
		Wait
	
    Fire:
		TNT1 A 0 A_JumpIfInventory("AssaultShotgunAmmo",1,1)
		Goto Reload
		TNT1 A 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_PlaySound("A12FIR", 1)
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundShotgun", random(-1,1), 0, 0, -12, 0, random(-1,1))
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("AssaultShotgunAmmo",1)
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
		A12F A 1 BRIGHT A_FireBullets (5, 5, 6, 12, "ShotgunPuff")
		TNT1 AAA 0 A_FireCustomMissile("Tracer", random(-6,6), 0, -1, -12, 0, random(-6,6))
		TNT1 AAAA 0 A_FireCustomMissile("ShotgunParticles", random(-10,10), 0, -1, -8, 0, random(-10,10))
		TNT1 A 0 A_SetAngle(angle+frandom(-1, 1))
		TNT1 A 0 A_ZoomFactor(0.9)
		TNT1 A 0 A_SetPitch(-5.0 + pitch)
		A12F B 1 A_SetPitch(+0.9 + pitch)
		TNT1 A 0 A_ZoomFactor(1.0)
		A12F C 1 A_SetPitch(+0.9 + pitch)
		TNT1 A 0 A_FireCustomMissile("AutoShotCaseSpawn",5,0,6,-14)
		A12F DEF 1 A_SetPitch(+0.9 + pitch)
		A12G A 2
		A12G A 1 A_Refire
		Goto Ready
		
	 Fire2: //Aiming Down the Sights
		A12A E 1 BRIGHT A_FireBullets (4, 4, 6, 12, "ShotgunPuff")
		TNT1 AAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, -1, -12, 0, random(-5,5))
		TNT1 AAAA 0 A_FireCustomMissile("ShotgunParticles", random(-9,9), 0, -1, -8, 0, random(-9,9))
		TNT1 A 0 A_SetAngle(angle+frandom(-0.8, 0.8))
		TNT1 A 0 A_ZoomFactor(1.2)
		TNT1 A 0 A_SetPitch(-4.1 + pitch)
		A12A F 1 A_SetPitch(+0.8 + pitch)
		TNT1 A 0 A_ZoomFactor(1.3)
		A12A G 1 A_SetPitch(+0.8 + pitch)
		TNT1 A 0 A_FireCustomMissile("AutoShotCaseSpawn",5,0,6,-14)
		A12A DDD 1 A_SetPitch(+0.8 + pitch)
		A12A D 2
		A12A D 1 A_Refire
		Goto Ready2	

	AltFire:
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"ZoomOut")
		TNT1 A 0 A_Giveinventory("Zoomed",1)
		TNT1 A 0 A_Giveinventory("ADSmode",1)
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_ZoomFactor(1.5)
		A12A ABC 1
		TNT1 A 0 A_SetCrosshair(41)
		Goto Ready2
		
	ZoomOut:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_SetCrosshair(0)
		A12A CBA 1
		Goto Ready3

    Reload:
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, "PutMag")
		A12G A 1 A_WeaponReady
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_JumpIfInventory("AssaultShotgunAmmo",20,"Ready")
        TNT1 A 0 A_JumpIfInventory("GreenShell",1,1)
        Goto NoAmmo
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("TurboReload", 1, "InsertBullets")
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, "PutMag")
		A12S DCBA 1
		A12R EFGHIIIIIJKLM 1
		TNT1 A 0 A_PlaySound("AACL", 1)
		A12R NNNNNNNOPQRRQPPPPPPPPP 1
		A12R STUVWWWWWWWWWW 1
		TNT1 A 0 A_PlaySound("Reload", 1)
		TNT1 A 0 A_Giveinventory("HasUnloaded",1)
		A12R XYZ 1
		A12E A 1
		
	PutMag:
		A12E BBBB 5 A_JumpIfInventory("Kicking",1,"DoKick")
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		A12R ZYX 1
		A12R WWWWWWWWW 1
		A12S ABCD 1
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
		
	InsertBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("AssaultShotgunAmmo",20,15)
		TNT1 A 0 A_JumpIfInventory("GreenShell",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("AssaultShotgunAmmo",1)
		TNT1 A 0 A_Takeinventory("GreenShell",1)
		Goto InsertBullets
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Refire
        Goto Ready
		TNT1 AAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Refire
        Goto Ready
			
	Unload:
		A12G 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("AssaultShotgunAmmo",1,3)
        Goto NoAmmo
        TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		A12S DCBA 1 A_JumpIfInventory("Kicking",1,"DoKick")
		TNT1 AAAAA 1 A_JumpIfInventory("Kicking",1,"DoKick")
		A12R EFGHIJKLM 1
		TNT1 A 0 A_PlaySound("CLIPIN", 1)
		A12R NOPQRRQPPP 1
		A12R STUVWWWW 1
        TNT1 A 0 A_PlaySound("Reload")
		A12R XYZ 1
		A12E A 1
		A12E B 5
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		
	RemoveBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("AssaultShotgunAmmo",1,3)
		Goto FinishUnload
        TNT1 AAAAAA 0
		TNT1 A 0 A_Takeinventory("AssaultShotgunAmmo",1)
		TNT1 A 0 A_Giveinventory("GreenShell",1)
		Goto RemoveBullets
	
	FinishUnload:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("DryFire")
		TNT1 A 0 A_GiveInventory("HasUnloaded", 1)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		Goto ReadyNoFuckingAMmo
	
	SelectAnimation:
        TNT1 AA 1 A_JumpIfInventory("GoFatality", 1, "Steady")
        TNT1 A 0 A_PlaySound("CLIPIN")
        A12S ABCD 1
        TNT1 AAAAAAAA 0
        TNT1 A 0 //A_JumpIfInventory("AssaultShotgunAmmo",1,2)
        //Goto Reload
        TNT1 AAAA 0

	Ready:
	Ready3:
        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, "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("IsRunning",1,"CheckSprint")
		A12G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		Loop
		
	Ready2:
        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, "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("IsRunning",1,"CheckSprint")
		A12A D 1 A_WeaponReady(WRF_ALLOWRELOAD)
		Loop	
	
	 ReadyNoFuckingAmmo:
		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, "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")
		A12E A 1 A_WeaponReady
		Loop
					
	NoAim:
		TNT1 A 0 A_SetCrosshair(0)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		A12A CBA 1
        Goto Ready3
	
	NoAmmo:
		A12G A 1 A_PlaySound("weapons/empty")
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		Goto Ready

	CheckSprint:
		A12G A 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
		Goto Ready3
		
	CheckSprint2:
		RI2G A 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
		Goto Ready2	
		
	StartSprint:
		A12G A 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired")
		
	Sprinting:	
		A1SP A 0 offset(-9,32) 
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("UsedStamina", 100, "StopSprintTired")
		PLAY A 0 offset(-9,32) ACS_ExecuteAlways(852, 0, 0, 0, 0)//Makes player faster.
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("PowerStrength", 1, 2)
		TNT1 A 0 offset(-9,32) A_GiveInventory("UsedStamina", 6)
		TNT1 A 0 offset(-9,32)
		A1SP A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		A1SP A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		A1SP A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		A1SP A 1 offset(0,38) A_SetPitch(pitch -0.5)
		A1SP A 1 offset(3,36) A_SetPitch(pitch -0.5)
		A1SP A 1 offset(6,34) A_SetPitch(pitch -0.5)
		A1SP A 1 offset(9,32) A_SetPitch(pitch -0.5)
		TNT1 A 0 offset(9,32) A_WeaponReady(WRF_NOBOB)
		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 offset(-9,32) A_GiveInventory("UsedStamina", 6)
		TNT1 A 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
		A1SP A 1 offset(9,34) A_SetPitch(pitch +0.5)
		A1SP A 1 offset(6,36) A_SetPitch(pitch +0.5)
		A1SP A 1 offset(3,38) A_SetPitch(pitch +0.5)
		A1SP A 1 offset(0,38) A_SetPitch(pitch +0.5)
		A1SP A 1 offset(-3,36) A_SetPitch(pitch +0.5)
		A1SP A 1 offset(-6,34) A_SetPitch(pitch +0.5)
		A1SP A 1 offset(-9,32) A_SetPitch(pitch +0.5)
		TNT1 A 0 offset(-9,32) A_WeaponReady(WRF_NOBOB)
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("IsRunning", 1, "Sprinting")
		Goto StopSprint
		
	StopSprintTired:
		A12G A 1
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		TNT1 A 0 A_PlaySound("Tired", 2)
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		A12G A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		A12G A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		A12G A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		A12G A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		A12G A 5 A_WeaponReady
		Goto Ready3
		
	StopSprint:
		A1SP A 1
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired")
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		Goto Ready3
		
		
// --------------------------------------------------------------------------
//
//	Temporary stuff
//
// --------------------------------------------------------------------------
	
	Steady:
		TNT1 A 1
		Goto Ready
	
	DoKick:
		TNT1 A 0 A_JumpIf (momZ > 0, "AirKick")
		TNT1 A 0 A_JumpIf (momZ < 0, "AirKick")
		TNT1 A 0 A_JumpIf (pitch > 32, "LowKickChecker1")
		Goto InitializeNormalKick
		
	LowKickChecker1:
	    TNT1 A 0 A_JumpIf (pitch > 90, "InitializeNormalKick")
		TNT1 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)
		KICK BCD 1
		TNT1 A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        KICK H 5
		TNT1 A 0 A_Takeinventory("Kicking",1)
		KICK IGFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		TNT1 A 0 A_Jump(256,"Ready")
		Goto Ready

    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KICK BCD 1
        TNT1 A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        KICK H 5
		TNT1 A 0 A_Takeinventory("Kicking",1)
		KICK IGFEDCBA 1
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		TNT1 A 0 A_Jump(256,"Ready")
		Goto Ready
	
	AirKick:
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        TNT1 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")
		TNT1 A 0 A_Jump(256,"Ready")
		Goto Ready
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        TNT1 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")
		TNT1 A 0 A_Jump(256,"Ready")
		Goto Ready

    Taunt:
		TNT1 A 0 A_JumpIfInventory("RealismMode", 1, "CheckGrab")
		TNT1 A 5
		TNT1 A 5 A_PlaySound("FUCK", 2)
		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 BCD 1 A_AlertMonsters
		FUCK E 15 A_Takeinventory("Taunting",1)
        FUCK DCBA 1
		TNT1 A 10
		TNT1 A 0 A_Jump(256,"Ready")
		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)
		TNT1 A 0 A_Jump(256,"Ready1")
		Goto Ready
		
	CheckGrab:
	    TNT1 A 0 
		TNT1 A 0 A_JumpIfTargetInLOS("CheckDistanceGrab")
		TNT1 A 0 A_Jump(256,"Ready1")
		Goto Ready
	CheckDistanceGrab:
	    TNT1 A 0 
		TNT1 A 0 A_JumpIfCloser(100, "Grab")
		TNT1 A 0 A_Jump(256,"Ready1")
		Goto Ready
	CheckIfCanGrab:
	    TNT1 A 0 
		TNT1 A 0 A_JumpIfInTargetInventory("CanGrab", 1, "Grab")
		TNT1 A 0 A_Jump(256,"Ready1")
		Goto Ready
	Grab:
	    PKUP ABC 2
		PKUP DEF 2
		TNT1 A 0 A_Jump(256,"Ready1")
		Goto Ready
		
	TossGrenade:
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_JumpIfInventory("GrenadeAmmo", 1, 1)
		Goto NoGrenade
		TNT1 A 8
		GRHO ABC 1
		GRTH ABCD 1
		TNT1 A 0 A_GiveInventory("FiredGrenade", 1)
		TNT1 A 0 A_PlaySound ("GRNPIN")
		GRTH EEFG 1
		TNT1 A 1
		TNT1 A 0 A_PlaySound ("GRNTOSS")
		GRTH HIJ 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 KLMN 1
		TNT1 A 1 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_Jump(256,"Ready1")
		Goto Ready

	NoGrenade:
		TNT1 A 0 A_Print("No Grenades Left.")
		TNT1 A 0 A_Jump(256,"Ready")
		Goto Ready
		
	Ready1:
		TNT1 A 0
		Goto Ready
	}
}