Actor SwatRPG7 : Weapon
{
//$Category Weapons
//$Title RPG7
 Game Doom
  Tag "RPG-7"
  Weapon.AmmoType "SWATRPG7Rockets"
  Weapon.AmmoGive 3
  Weapon.AmmoUse1 1
  Inventory.PickupMessage "You got the RPG-7!"
  Inventory.PickupSound "Misc/W_PkUp"
  Inventory.RestrictedTo "SwatClass"
  Weapon.SelectionOrder 2630
  Weapon.Kickback 300
  States
  {
  Select:
    HSML A 1 A_Raise
	TNT1 A 0 A_Raise
	TNT1 A 0 A_Raise
    Loop
  Deselect:
    HSML A 1 A_Lower
	TNT1 A 0 A_Lower
	TNT1 A 0 A_Lower
    Loop
  Ready:
    HSML A 1 A_WeaponReady(WRF_ALLOWZOOM)
    Loop
  Fire:
    HSML B 0 Bright A_GunFlash
    HSML B 0 Bright A_PlaySound("Weapons/RPG7Fire")
    HSML B 3 Bright A_FireCustomMissile("RPG7Rocket", 0, 1, 0, 0)
	HSML B 0 A_Recoil(4)
    HSML C 3
	HSML D 3
    HSML A 35 A_CheckReload
    HSML A 0 A_Refire
	goto Ready
	  Flash:
    TNT1 A 2 A_Light1
    TNT1 A 2 A_Light2
    TNT1 A 0 A_Light0
    Stop
	Spawn:
    HSGN A -1
    Loop
  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:
    HSML A 1 Offset(0, 50)
    HSML A 1 Offset(0, 40)
    HSML A 1 Offset(0, 30)
		Goto Ready
	DontThrow:
		HSML A 1
		Goto Ready
	}
}
actor RPG7Rocket
{
  Game Doom
  Radius 11
  Height 8
  Speed 50
  Damage 25
  Projectile

  +RANDOMIZE
  +DEHEXPLOSION
  +ROCKETTRAIL
  +SCREENSEEKER
  DeathSound "RPG7Boom/Explode"
  Decal Scorch
  Obituary "%o got blown up by %k's RPG-7."
  SelfObituary "%o got blown up by %p own rocket."
  States
  {
  Spawn:
    HRKT A 1 bright
	HRKT A 0 A_SpawnItemEx ("RPG7Trail", -21, 0, 0, 1)
    loop
  Death:
    TNT1 A 0 A_SetScale(5, -5)
    FX08 A 6 bright A_Explode(500,500)
    FX08 BCDEFGH 4 bright
    stop
  }
}
Actor RPG7Trail
{
  Projectile
  +NoClip
  RenderStyle Add
  Alpha 0.4
  States
  {
  Spawn:
    FX04 ABCDE 1 Bright
    Stop
  }
}

Actor SWATRPG7Rockets : Ammo
{
//$Category Ammunition
//$Title RPG7Rockets
Inventory.Amount 1
Inventory.MaxAmount 10
ammo.backpackamount 1
ammo.backpackmaxamount 20
Inventory.PickupSound "misc/i_pkup"
Inventory.PickupMessage "Picked up an RPG-7 Rocket."
}