actor "M79 Thumper" : RGUWeapon
{
  obituary "%k thumped %o with the Thumper."
  inventory.pickupmessage "You got the M79 Thumper. Pop'em!"
  +WEAPON.EXPLOSIVE
  weapon.selectionorder 20
  weapon.ammotype "ThumperClip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "ThumperAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    M79A B 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    M79A CDEFG 2 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
	M79A HIJKLM 2 A_WeaponReady(WRF_ALLOWZOOM)
	M4CD A 0 A_JumpIfInventory("ThumperToken",1,"Reload")
    M79A N 0 A_JumpIfNoAmmo("Reload")
	M4CC F 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    M79A N 0 A_JumpIfInventory("Aiming",1,5)
    M79A N 0 A_JumpIfInventory("Reloading",1,"Reload")
    M79A N 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    M79A N 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M79A N 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+16
    M79B S 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    M79B S 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    M79B S 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    M79B S 0 A_GunFlash("ShowBarrel",GFF_NOEXTCHANGE)
    M79B S 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
  Deselect:
    M79A N 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    M79A N 0 A_TakeInventory("Aiming",1)
    M79A N 0 A_TakeInventory("Reloading",1)
    M79A N 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    M79A N 0 A_ZoomFactor(1.0)
    M79A N 0 A_Lower
    M79A N 1 A_Lower
    Goto Deselect+5
  Select:
    M79A A 0
    M79A A 0 ACS_NamedExecuteAlways("RefXHair",0,0,0,0)
    M79A A 0 A_TakeInventory("Reloading",1)
    M79A A 0 A_Raise
    Goto Select+3
  Fire:
    M79A N 0 A_JumpIfInventory("Aiming",1,"FireAim")
    M79A N 0 A_JumpIfNoAmmo("ReloadStart")
    M79B S 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    M79B S 0 A_PlayWeaponSound("m79/fire")
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,6,6)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,2,0)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,10,0)
    M79E A 2 BRIGHT A_FireCustomMissile("ThumperShell",frandom(-1.50,1.50),1,8,8,0,frandom(-1.00,1.00))
    M79E I 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M79E BC 2 BRIGHT A_GunFlash
    M79E DE 2
    M79B OPQR 2
    M79B A 0 A_JumpIfInventory("ThumperAmmo",1,1)
    Goto Ready+16
    M79B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireAim:
    M79B S 0 A_JumpIfNoAmmo("ReloadStart")
    M79B S 0 A_PlayWeaponSound("m79/fire")
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,0,6)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,-4,0)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,4,0)
    M79B I 2 BRIGHT A_FireCustomMissile("ThumperShell",0,1,0,6)
    M79B I 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M79B JK 2 BRIGHT A_GunFlash
    M79B K 0 A_ZoomFactor(1.0)
    M79B LMNOPQ 2
    M79B R 2 A_TakeInventory("Aiming",1)
    M79B A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    M79B A 0 A_JumpIfInventory("ThumperAmmo",1,1)
    Goto Ready+16
    M79B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  Reload: //AltFire:
    //M79A A 0 A_JumpIfInventory("ThumperAmmo",0,"ReloadPrep")
    M79A A 0 A_JumpIfInventory("ThumperClip",1,2)
    M79A A 0 A_JumpIfInventory("ThumperAmmo",1,"ReloadStart")
    M79A A 0 A_TakeInventory("Reloading",1)
    M79A A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+19
  ReloadStart:
    M79C A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    M79C A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	M79C A 0 A_JumpIfInventory("ThumperToken",1,"Reload2")
    M79C A 3 A_PlaySoundEx("m79/open","SoundSlot5")
    M79C A 0 A_GiveInventory("Reloading",1)
    M79C BCEFGHI 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M79C J 3 A_PlaySoundEx("m79/out","SoundSlot5")
	M79C A 0 A_FireCustomMissile("ARGrenadeCasing",0,0,0,-4)
	M79C A 0 A_GiveInventory("ThumperToken",1)
	M79C KLM 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload2
  Reload2:
    M79C NOPQRS 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    M79C T 3 A_PlayWeaponSound("m79/in")
	M79A A 0 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo
  ReloadAmmo:
    M79C P 0 A_JumpIfInventory("ThumperClip",1,"ReloadEnd")
	M79C P 0 A_TakeInventory("ThumperToken",1)
    M79C P 0 A_JumpIfInventory("ThumperAmmo",1,1)
    Goto ReloadEnd
    M79C P 0 A_GiveInventory("ThumperClip",1)
    M79C P 0 A_TakeInventory("ThumperAmmo",1)
    Goto ReloadAmmo
  ReloadEnd:
    M79C UVWX 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M79C Z 3 //A_WeaponReady(WRF_NOBOB|WRF_NOPRIMARY|WRF_ALLOWZOOM)
    M79D A 3 //A_WeaponReady(WRF_NOBOB|WRF_NOPRIMARY|WRF_ALLOWZOOM)
    M79D B 0 A_TakeInventory("Reloading",1)
    M79D B 3 A_PlaySound("m79/close")
    Goto Ready+16
  Zoom:
  PostReloadAlt:
    M79C A 0 A_JumpIfInventory("ThumperToken",1,"Reload")
    M79B G 0 A_ZoomFactor(1.2)
    M79B F 0 A_GiveInventory("Aiming",1)
	M79B A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    M79B ABCDEFG 2
    Goto AltHold
  ReloadBreak:
    M79B G 0 A_ZoomFactor(1.0)
    M79B GF 2
    M79B F 0 A_TakeInventory("Aiming",1)
    M79B EDCBA 2
    M79B A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  ClearRefire: 
    M79B S 1 A_ClearReFire
	M79B S 0 A_GunFlash("ShowBarrel",GFF_NOEXTCHANGE)
	Goto AltHold
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("ThumperClip",1,1)
	Goto ReloadBreak
    M79B S 0 A_PlayWeaponSound("m79/fire")
	M79C P 0 A_TakeInventory("ThumperClip",1)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,0,6)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,-4,0)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,4,0)
    M79B I 2 BRIGHT A_FireCustomMissile("ThumperShell",0,1,0,6)
    M79B I 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M79B A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    "####" "#" 0 A_JumpIfInventory("ThumperClip",1,1)
	Goto ReloadBreak
	A12C A 0 A_ClearReFire
    Goto AltHold
  AltHold:
    A12C C 0 A_JumpIfInventory("FireHeld",1,"ClearRefire")
    M79B S 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
	M79B S 0 A_GunFlash("ShowBarrel",GFF_NOEXTCHANGE)
	A12C C 0 A_JumpIfInventory("FireHeld",1,"FireAimAltHold")
	A12C C 0 A_JumpIfInventory("Reloading",1,"ReloadBreak")
	U45A L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    U45A L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
	A12C F 0 A_Refire("AltHold")
	A12C C 0 A_JumpIfInventory("Aiming",1,"AltFire2")
	Goto Ready+22
  AltFire:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    M4CD A 0 A_JumpIfInventory("ThumperToken",1,"Reload")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    M79B A 0 A_JumpIfInventory("Reloading",1,1)
    M79B A 0 A_ZoomFactor(1.2)
    M79B A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    M79B AB 2
    M79B B 0 A_GiveInventory("Aiming",1)
    M79B CDEFG 2
    M79B G 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	A12C F 0 A_Refire("AltHold")
    Goto Ready+22
  AltFire2:
    M79B G 0 A_ZoomFactor(1.0)
    M79B GF 2
    M79B F 0 A_TakeInventory("Aiming",1)
    M79B EDCBA 2
    M79B A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto Ready+16
  AltFire3:
    M79B G 0 A_ZoomFactor(1.0)
    M79B GF 2
    M79B F 0 A_TakeInventory("Aiming",1)
    M79B EDCBA 2
    M79B A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	goto DropWeapon
  ReloadStartAim:
    M79B G 0 A_ZoomFactor(1.0)
    M79B GF 2
    M79B F 0 A_TakeInventory("Aiming",1)
    M79B EDCBA 2
    M79B A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+1
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  ShowBarrel:
    M79B T 1
    stop
  Spawn:
    WEAP N 0
    WEAP N 0 A_SpawnItem("ThumperDrop")
    stop
  ReloadStart_SOH:
    M79C A 0 A_JumpIfInventory("ThumperToken",1,"Reload3")
    M79C A 2 A_PlaySoundEx("m79/open","SoundSlot5")
    M79C A 0 A_GiveInventory("Reloading",1)
    M79C BCEFGHI 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M79C J 2 A_PlaySoundEx("m79/out","SoundSlot5")
	M79C A 0 A_FireCustomMissile("ARGrenadeCasing",0,0,0,-4)
    M79C A 0 A_GiveInventory("ThumperToken",1)
	M79C KLM 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload3
  Reload3:
    M79C NOPQRS 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    M79C T 2 A_PlayWeaponSound("m79/in")
	M79A A 0 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    M79C P 0 A_JumpIfInventory("ThumperClip",1,"ReloadEnd_SOH")
	M79C P 0 A_TakeInventory("ThumperToken",1)
    M79C P 0 A_JumpIfInventory("ThumperAmmo",1,1)
    Goto ReloadEnd_SOH
    M79C P 0 A_GiveInventory("ThumperClip",1)
    M79C P 0 A_TakeInventory("ThumperAmmo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    M79C UVWX 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M79C Z 2 //A_WeaponReady(WRF_NOBOB|WRF_NOPRIMARY|WRF_ALLOWZOOM)
    M79D A 2 //A_WeaponReady(WRF_NOBOB|WRF_NOPRIMARY|WRF_ALLOWZOOM)
    M79D B 0 A_TakeInventory("Reloading",1)
    M79D B 2 A_PlaySound("m79/close")
    Goto Ready+16
  FragGrenade:
    U45F A 0 ACS_NamedExecuteAlways("RefSpeak",0,1,0,0)
    U45F A 0 A_ZoomFactor(1.0)
    U45A L 0 A_TakeInventory("Aiming",1)
    U45A L 0 A_TakeInventory("Reloading",1)
    U45F A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	M4CA J 0 A_JumpIfInventory("ThrowingStun",1,"StunGrenade")
	M4CA J 0 A_JumpIfInventory("ThrowingIncd",1,"IncGrenade")
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"FragGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 2
    TNT1 A 15
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 2
    GRNA L 0 A_TakeInventory("GrenadeAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("FragGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  FragGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 1
    TNT1 A 10
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 1
    GRNA L 0 A_TakeInventory("GrenadeAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("FragGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    U45F A 0 A_ZoomFactor(1.0)
    U45A L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    U45A L 0 A_TakeInventory("Aiming",1)
    U45A L 0 A_TakeInventory("Reloading",1)
    U45F A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"KnifeAttack_SOH")
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_Commando")
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",104)
    KNFA DEFGHIJKL 1
    TNT1 A 20
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_Commando:
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",160)
    KNFA DEFGHIJKL 1
    TNT1 A 20
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_SOH:
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_SOH_Commando")
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",104)
    KNFA DEFGHIJKL 1
    TNT1 A 10
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_SOH_Commando:
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",160)
    KNFA DEFGHIJKL 1
    TNT1 A 10
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  Fire_SteadyAim:
    M79B S 0 A_PlayWeaponSound("m79/fire")
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,6,6)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,2,0)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,10,0)
    M79E A 2 BRIGHT A_FireCustomMissile("ThumperShell",frandom(-1.00,1.00),1,6,6,0,frandom(-0.50,0.50))
    M79E I 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M79E BC 2 BRIGHT A_GunFlash
    M79E DE 2
    M79B OPQR 2
    M79B A 0 A_JumpIfInventory("ThumperAmmo",1,1)
    Goto Ready+16
    M79B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  StunGrenade:
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"StunGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 2
    TNT1 A 15
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 2
    GRNA L 0 A_TakeInventory("StunAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("StunGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  IncGrenade:
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"IncGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 2
    TNT1 A 15
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 2
    GRNA L 0 A_TakeInventory("IncdAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("IncGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  StunGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 1
    TNT1 A 10
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 1
    GRNA L 0 A_TakeInventory("StunAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("StunGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  IncGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 1
    TNT1 A 10
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 1
    GRNA L 0 A_TakeInventory("IncdAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("IncGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  DropWeapon:
    M79A MLKJIHGFEDCB 2 A_WeaponReady(WRF_NOPRIMARY)
	M79A A 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CC F 0 A_JumpIfInventory("weapondropper",2,"ThrowWeapon")
    KNFA A 0 ACS_NamedExecuteAlways("RefDropW",0,0,0,0)
	GRNA L 0 A_TakeInventory("weapondropper",1)
	M4CB A 0 A_FireCustomMissile("ThumperDropped",0,0,7,2)
	stop
  ThrowWeapon:
    GRNA IKMN 1
	KNFA B 0 A_PlaySound("knife/swing")
    KNFA A 0 ACS_NamedExecuteAlways("RefDropW",0,0,0,0)
	GRNA L 0 A_TakeInventory("weapondropper",2)
	M4CB A 0 A_FireCustomMissile("ThumperThrown",0,0,7,2)
	stop
  }
}

actor ThumperClip : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 1
    ammo.backpackamount 0
    ammo.backpackmaxamount 1
    +IGNORESKILL
}

actor ThumperAmmo : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 1
    inventory.maxamount 8
    ammo.backpackamount 3
    ammo.backpackmaxamount 12
}

actor ThumperShell
{
  obituary "%k thumped %o with the Thumper."
  radius 4
  height 4
  speed 45
  damage (40)
  PROJECTILE
  -NOGRAVITY
  +NOEXTREMEDEATH
  +FORCERADIUSDMG
  +CANBOUNCEWATER
  +FORCEXYBILLBOARD
  +THRUSPECIES
  species "Player"
  Scale 0.05
  gravity 0.4
  bouncefactor 0.5
  decal RevenantScorch
  DamageType "Explosion"
  ProjectileKickBack 35
  states
  {
  Spawn:
    G69X AAAAA 1 A_SpawnItemEx("FlightSmokePuff",-10,0,0,0,0,0,0,128,0)
    G69X A 0 A_GiveInventory("M203Armed",1)
    G69X A 1 A_SpawnItemEx("FlightSmokePuff",-10,0,0,0,0,0,0,128,0)
    Wait
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
  Death:
    TNT1 A 0 A_JumpIfInventory("M203Armed",1,"DeathArmed")
    TNT1 AA 0 A_Explode(115,16,0)
    TNT1 A 0 A_SpawnItemEx("M203ShellUnarmedDrop",0,0,0,-2,0,2,random(-8,8),0,0)
    TNT1 A 20 A_PlaySoundEx("generic/ricochets","SoundSlot5")
    stop
  DeathArmed:
    TNT1 A 0
    TNT1 A 0 Radius_Quake(2,12,0,8,0)
    TNT1 AA 0 A_Explode(60,180)
    TNT1 AA 0 A_Explode(55,330,0)
    TNT1 A 0 A_SetDamageType("explosionc")
    TNT1 A 0 A_Explode(55,330,0)
    TNT1 AA 0 A_SpawnItemEx("ExplosionMain2")
    TNT1 AAAAAAAAAA 0 A_SpawnItemEx("ImpactSpark2", random(-24,24), random(-24,24), random(-12,18), random(-4,4), random(-4,4), random(-2,3), 0, 128, 0)
    TNT1 AAAAAAAAAA 0 A_SpawnItemEx("ImpactSpark2", random(-24,24), random(-24,24), random(-12,18), random(-4,4), random(-4,4), random(-2,3), 0, 128, 0)
    TNT1 A 10
    TNT1 A 15 A_AlertMonsters(660)
    stop
  }
}

actor "M79 Thumper Incendiary" : "M79 Thumper"
{
  states
  {
  Fire:
    M79A N 0 A_JumpIfInventory("Aiming",1,"FireAim")
    M79A N 0 A_JumpIfNoAmmo("ReloadStart")
    M79B S 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    M79B S 0 A_PlayWeaponSound("m79/fire")
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,6,6)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,2,0)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,10,0)
    M79E A 2 BRIGHT A_FireCustomMissile("IncThumperShell",frandom(-1.50,1.50),1,8,8,0,frandom(-1.00,1.00))
    M79E I 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M79E BC 2 BRIGHT A_GunFlash
    M79E DE 2
    M79B OPQR 2
    M79B A 0 A_JumpIfInventory("ThumperAmmo",1,1)
    Goto Ready+16
    M79B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireAim:
    M79B S 0 A_JumpIfNoAmmo("ReloadStart")
    M79B S 0 A_PlayWeaponSound("m79/fire")
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,0,6)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,-4,0)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,4,0)
    M79B I 2 BRIGHT A_FireCustomMissile("IncThumperShell",0,1,0,6)
    M79B I 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M79B JK 2 BRIGHT A_GunFlash
    M79B K 0 A_ZoomFactor(1.0)
    M79B LMNOPQ 2
    M79B R 2 A_TakeInventory("Aiming",1)
    M79B A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    M79B A 0 A_JumpIfInventory("ThumperAmmo",1,1)
    Goto Ready+16
    M79B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  Fire_SteadyAim:
    M79B S 0 A_PlayWeaponSound("m79/fire")
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,6,6)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,2,0)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,10,0)
    M79E A 2 BRIGHT A_FireCustomMissile("IncThumperShell",frandom(-1.00,1.00),1,6,6,0,frandom(-0.50,0.50))
    M79E I 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M79E BC 2 BRIGHT A_GunFlash
    M79E DE 2
    M79B OPQR 2
    M79B A 0 A_JumpIfInventory("ThumperAmmo",1,1)
    Goto Ready+16
    M79B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("ThumperClip",1,1)
	Goto ReloadBreak
    M79B S 0 A_PlayWeaponSound("m79/fire")
	M79C P 0 A_TakeInventory("ThumperClip",1)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,0,6)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,-4,0)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,4,0)
    M79B I 2 BRIGHT A_FireCustomMissile("IncThumperShell",0,1,0,6)
    M79B I 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M79B A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    "####" "#" 0 A_JumpIfInventory("ThumperClip",1,1)
	Goto ReloadBreak
	A12C A 0 A_ClearReFire
    Goto AltHold
  }
}

actor ThumperInc : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}

actor IncThumperShell : ThumperShell
{
  states
  {
  Spawn:
    G69X AAAAA 1 A_SpawnItemEx("FlightSmokePuff",-10,0,0,0,0,0,0,128,0)
    G69X A 0 A_GiveInventory("M203Armed",1)
    G69X A 1 A_SpawnItemEx("FlightSmokePuff",-10,0,0,0,0,0,0,128,0)
    Wait
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
  Death:
    TNT1 A 0 A_JumpIfInventory("M203Armed",1,"DeathArmed")
    TNT1 AA 0 A_Explode(150,16,0)
    TNT1 A 0 A_SpawnItemEx("M203ShellUnarmedDrop",0,0,0,-2,0,2,random(-8,8),0,0)
    TNT1 A 20 A_PlaySoundEx("generic/ricochets","SoundSlot5")
    stop
  DeathArmed:
    TNT1 A 0
    TNT1 A 0 Radius_Quake(2,11,0,6,0)
    TNT1 A 0 A_Explode(75,180)
    TNT1 A 0 A_Explode(75,330,0)
    TNT1 A 0 A_SetDamageType("explosionc")
    TNT1 A 0 A_Explode(37,330,0)
    TNT1 A 0 A_SpawnItemEx("ExplosionMain2")
    TNT1 AAAAAAAAAAAAAA 0 A_SpawnItemEx("IncGrenadeFire", random(-32,32), random(-32,32), random(0,16), random(-20,20)/10.0, random(-20,20)/10.0, random(4,5), 0, 0, 0)
    TNT1 AAAAAAAAAAAAAA 0 A_SpawnItemEx("IncGrenadeFireLight", random(-32,32), random(-32,32), random(0,16), random(-20,20)/10.0, random(-20,20)/10.0, random(4,5), 0, 128, 0)
    TNT1 AAAAAAAAAAAAAA 0 A_SpawnItemEx("IncGrenadeFireLight", random(-32,32), random(-32,32), random(0,16), random(-20,20)/10.0, random(-20,20)/10.0, random(4,5), 0, 128, 0)
    TNT1 A 10
    TNT1 A 15 A_AlertMonsters(660)
    stop
  }
}

actor "M79 Thumper Stun" : "M79 Thumper"
{
  states
  {
  Fire:
    M79A N 0 A_JumpIfInventory("Aiming",1,"FireAim")
    M79A N 0 A_JumpIfNoAmmo("ReloadStart")
    M79B S 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    M79B S 0 A_PlayWeaponSound("m79/fire")
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,6,6)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,2,0)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,10,0)
    M79E A 2 BRIGHT A_FireCustomMissile("StunThumperShell",frandom(-1.50,1.50),1,8,8,0,frandom(-1.00,1.00))
    M79E I 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M79E BC 2 BRIGHT A_GunFlash
    M79E DE 2
    M79B OPQR 2
    M79B A 0 A_JumpIfInventory("ThumperAmmo",1,1)
    Goto Ready+16
    M79B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireAim:
    M79B S 0 A_JumpIfNoAmmo("ReloadStart")
    M79B S 0 A_PlayWeaponSound("m79/fire")
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,0,6)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,-4,0)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,4,0)
    M79B I 2 BRIGHT A_FireCustomMissile("StunThumperShell",0,1,0,6)
    M79B I 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M79B JK 2 BRIGHT A_GunFlash
    M79B K 0 A_ZoomFactor(1.0)
    M79B LMNOPQ 2
    M79B R 2 A_TakeInventory("Aiming",1)
    M79B A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    M79B A 0 A_JumpIfInventory("ThumperAmmo",1,1)
    Goto Ready+16
    M79B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  Fire_SteadyAim:
    M79B S 0 A_PlayWeaponSound("m79/fire")
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,6,6)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,2,0)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,10,0)
    M79E A 2 BRIGHT A_FireCustomMissile("StunThumperShell",frandom(-1.00,1.00),1,6,6,0,frandom(-0.50,0.50))
    M79E I 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M79E BC 2 BRIGHT A_GunFlash
    M79E DE 2
    M79B OPQR 2
    M79B A 0 A_JumpIfInventory("ThumperAmmo",1,1)
    Goto Ready+16
    M79B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,0,6)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,-4,0)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,4,0)
    M79B I 2 BRIGHT A_FireCustomMissile("StunThumperShell",0,1,0,6)
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("ThumperClip",1,1)
	Goto ReloadBreak
    M79B S 0 A_PlayWeaponSound("m79/fire")
	M79C P 0 A_TakeInventory("ThumperClip",1)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,0,6)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,-4,0)
    M79B S 0 A_FireCustomMissile("WeaponSmokePuffLong",0,0,4,0)
    M79B I 2 BRIGHT A_FireCustomMissile("StunThumperShell",0,1,0,6)
    M79B I 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M79B A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    "####" "#" 0 A_JumpIfInventory("ThumperClip",1,1)
	Goto ReloadBreak
	A12C A 0 A_ClearReFire
    Goto AltHold
  }
}

actor ThumperStun : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}

actor StunThumperShell : ThumperShell
{
  states
  {
  Spawn:
    G69X AAAAA 1 A_SpawnItemEx("FlightSmokePuff",-10,0,0,0,0,0,0,128,0)
    G69X A 0 A_GiveInventory("M203Armed",1)
    G69X A 1 A_SpawnItemEx("FlightSmokePuff",-10,0,0,0,0,0,0,128,0)
    Wait
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
  Death:
    TNT1 A 0 A_JumpIfInventory("M203Armed",1,"DeathArmed")
    TNT1 AA 0 A_Explode(150,16,0)
    TNT1 A 0 A_SpawnItemEx("M203ShellUnarmedDrop",0,0,0,-2,0,2,random(-8,8),0,0)
    TNT1 A 20 A_PlaySoundEx("generic/ricochets","SoundSlot5")
    stop
  DeathArmed:
    TNT1 A 0
    TNT1 A 0 Radius_Quake(3,15,0,6,0)
    TNT1 A 0 A_Explode(38,170)
    TNT1 A 0 A_Explode(37,320,0)
    TNT1 A 0 A_SetDamageType("explosionc")
    TNT1 A 0 A_Explode(19,320,0)
    TNT1 A 0 A_PlaySoundEx("stun/explosion","SoundSlot5")
    TNT1 A 0 A_PlaySoundEx("distant/explosionsmall","SoundSlot6")
    TNT1 A 0 A_SpawnItemEx("StunExplosionMain")
    TNT1 A 0 A_SpawnItemEx("StunGrenadeExplosion",-1,0,0,0,0,0,0,0,0)
    TNT1 A 0 A_SpawnItemEx("StunGrenadeExplosion2",-1,0,0,0,0,0,0,0,0)
    TNT1 A 0 A_SpawnItemEx("StunGrenadeExplosion3",-1,0,0,0,0,0,0,0,0)
    TNT1 A 10
    TNT1 A 15 A_AlertMonsters(1536)
    stop
  }
}

actor ThumperPickup : CustomInventory
{
  inventory.pickupmessage "You got the M79 Thumper. Pop'em!"
  inventory.pickupsound "rpg/in"
  +INVENTORY.AUTOACTIVATE
  //inventory.respawntics 70
  scale 0.13
  States
  {
  Spawn:
    WEAP N -1
    stop
  Pickup:
    WEAP N 0
    WEAP N 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",0,0,0)) == 1, "PickupStay")
    WEAP N 0 A_JumpIfInventory("M79 Thumper",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP N 0 A_JumpIfInventory("M79 Thumper Incendiary",1,"AmmoPickup")
    WEAP N 0 A_JumpIfInventory("M79 Thumper Stun",1,"AmmoPickup")
    WEAP N 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP N 0 A_JumpIfInventory("MaxWeaponsFilled",82,"FailPickup2")
	WEAP N 0 A_GiveInventory("MaxWeaponsFilled",19)
    WEAP N 0 ACS_NamedExecuteWithResult("RefPickU",23,0,0)
    stop
  PickupStay:
    WEAP N 0
    WEAP N 0 A_JumpIfInventory("M79 Thumper",1,"FailPickup") // If the player already has this weapon, they get more ammo for it
    WEAP N 0 A_JumpIfInventory("M79 Thumper Incendiary",1,"FailPickup")
    WEAP N 0 A_JumpIfInventory("M79 Thumper Stun",1,"FailPickup")
    WEAP N 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP N 0 A_JumpIfInventory("MaxWeaponsFilled",82,"FailPickup2")
	WEAP N 0 A_GiveInventory("MaxWeaponsFilled",19)
    WEAP N 0 ACS_NamedExecuteWithResult("RefPickU",23,0,0)
    WEAP N 0 ACS_NamedExecuteWithResult("RefPickC",23,0,0)
    WEAP N 0 A_PlaySound("rpg/in")
    fail
  AmmoPickup:
    WEAP N 0
    WEAP N 0 A_JumpIfInventory("ThumperAmmo",0,"FailPickup")
    WEAP N 0 A_GiveInventory("ThumperAmmo",2)
    stop
  OneManArmy:
    WEAP N 0
	WEAP N 0 A_JumpIfInventory("MaxWeaponsFilled",119,"FailPickup2")
	WEAP N 0 A_GiveInventory("MaxWeaponsFilled",19)
	WEAP N 0 ACS_NamedExecuteWithResult("RefPickU",23,0,0)
	stop
  FailPickup:
    WEAP N 1
    fail
  FailPickup2:
    WEAP N 1
    WEAP N 0 ACS_NamedExecuteAlways("RefSlots",0,34,0,0)
    fail
  }
}

actor ThumperDrop : ThumperPickup
{
  States
  {
  Spawn:
    WEAP N -1
    stop
  Pickup:
    WEAP N 0
    WEAP N 0 A_JumpIfInventory("M79 Thumper",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP N 0 A_JumpIfInventory("M79 Thumper Incendiary",1,"AmmoPickup")
    WEAP N 0 A_JumpIfInventory("M79 Thumper Stun",1,"AmmoPickup")
    WEAP N 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP N 0 A_JumpIfInventory("MaxWeaponsFilled",82,"FailPickup2")
	WEAP N 0 A_GiveInventory("MaxWeaponsFilled",19)
    WEAP N 0 ACS_NamedExecuteWithResult("RefPickU",23,0,0)
    stop
  }
}

actor ThumperDrop2 : ThumperDrop
{
  States
  {
  Spawn:
    WEAP N -1
    stop
  Pickup:
    WEAP N 0
    WEAP N 0 A_JumpIfInventory("M79 Thumper",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP N 0 A_JumpIfInventory("M79 Thumper Incendiary",1,"AmmoPickup")
    WEAP N 0 A_JumpIfInventory("M79 Thumper Stun",1,"AmmoPickup")
    WEAP N 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP N 0 A_JumpIfInventory("MaxWeaponsFilled",82,"FailPickup2")
	WEAP N 0 A_GiveInventory("MaxWeaponsFilled",19)
    WEAP N 0 ACS_NamedExecuteWithResult("RefPickU",23,0,0)
    stop
  AmmoPickup:
    WEAP N 0
    stop
  }
}