ACTOR SwatAA12 : Weapon
{
  Weapon.AmmoUse 1
  Weapon.AmmoGive 8
  Weapon.AmmoType "Shell"
  Inventory.PickupMessage "You got the AA-12 shotgun!"
  Obituary "%o was given Lethal Force by %k's AA-12 shotgun."
  Decal "BulletChip"
  Tag "AA-12"
  AttackSound "AA12/Fire"
  Inventory.RestrictedTo "SwatClass"
  Scale 0.85
  States
  {
  Ready:
    AA12 A 1 A_WeaponReady(WRF_ALLOWZOOM)
    Loop
  Deselect:
    AA12 A 1 A_Lower
	TNT1 A 0 A_Lower
	TNT1 A 0 A_Lower
    Loop
  Select:
    AA12 A 1 A_Raise
	TNT1 A 0 A_Raise
	TNT1 A 0 A_Raise
    Loop
  Fire:
    AA12 B 1 Bright A_FireBullets (6, 6, 10, 12, "BulletPuff",FBF_NoRANDOM|FBF_USEAMMO,8192)
    AA12 B 0 Bright A_GunFlash
    AA12 B 0 Bright A_SetPitch (pitch-0.5)
    AA12 C 1 Bright
    AA12 DA 2
    AA12 A 7 A_ReFire
    Goto Ready
  Flash:
    TNT1 A 4 Bright A_Light1
    TNT1 A 3 Bright A_Light2
    Goto LightDone
  Zoom:
    TNT1 A 0 A_JumpIfInventory("HasSwatGrenades", 1, "CheckAmmo")
    Goto DontThrow
  CheckAmmo:
    TNT1 A 0 A_JumpIfInventory("SwatGrenadeAmmo", 1, "DoThrow")
    Goto DontThrow
  DoThrow:
    TNT1 A 0
    Goto ThrowFrag
	ThrowFrag:
	FGGN BCD 2
	TNT1 A 0 A_TakeInventory("SwatGrenadeAmmo", 1) // ONLY grenade ammo removed
	FGGN E 2 A_PlaySound("weapons/grnpullpin")
	FGGN FGHH 2
	FGGN J 0 A_FireCustomMissile("ThrownGrenade30", 0, 0, 0, 0)
	FGGN J 0 A_PlaySound("weapons/grntoss")
	FGGN JKLMNOPQ 2
	FGGN A 0
	NULL A 12 A_CheckReload
		Goto RaiseAfterThrow
	RaiseAfterThrow:
    AA12 A 1 Offset(0, 60)
    AA12 A 1 Offset(0, 50)
    AA12 A 1 Offset(0, 40)
		Goto Ready
	DontThrow:
		AA12 A 1
		Goto Ready
  Spawn:
    AA12 E -1
    Stop
  }
}
