actor "PP-2000" : RGUWeapon
{
  obituary "%k gattered %o with the PP-2000."
  inventory.pickupmessage "You got the PP-2000 automatic pistol."
  //attacksound "ump45/fire6"
  weapon.selectionorder 16
  weapon.ammotype "PP2000Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "PP2000Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    P20A A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    P20A BC 2 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
	P20A DEFGH 2 A_WeaponReady(WRF_ALLOWZOOM)
	G18A I 0 A_JumpIfInventory("PP2000Token",1,"Reload")
    P20A I 0 A_JumpIfNoAmmo("Reload")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    P20A I 0 A_JumpIfInventory("Aiming",1,5)
    P20A I 0 A_JumpIfInventory("Reloading",1,"Reload")
    P20A I 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    P20A I 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20A I 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+12
    P20C E 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    P20C E 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    P20C E 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    P20C E 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+18
  Deselect:
    P20A I 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    P20A I 0 A_TakeInventory("Aiming",1)
    P20A I 0 A_TakeInventory("Reloading",1)
    P20A I 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    P20A I 0 A_ZoomFactor(1.0)
    P20A I 0 A_Lower
    P20A I 1 A_Lower
    Goto Deselect+5
  Select:
    P20A A 0 A_Raise
    Loop
  Fire:
    P20B A 0 A_JumpIfInventory("Aiming",1,"FireAim")
    P20B A 0 A_JumpIfNoAmmo("ReloadStart")
    P20B A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    P20B A 0 A_PlayWeaponSound("pp2000/fire")
    P20B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,11,3)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    P20B A 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	P20B A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,13,36-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P20B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P20B A 0 A_JumpIfInventory("PP2000Clip",3,2)
    P20B A 0 A_PlaySound("m9/lock")
    P20B A 0 A_JumpIfNoAmmo("FireEmpty")
    P20B B 1 BRIGHT A_GunFlash
    P20B C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    P20B C 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20B D 1 A_ReFire
    Goto Ready+12
    P20B C 0 A_JumpIfNoAmmo("ReloadStart")
    P20B D 1 A_ReFire
    Goto Ready+12
  Hold:
    P20B A 0 A_JumpIfInventory("Aiming",1,"HoldAim")
    P20B A 0 A_JumpIfNoAmmo("ReloadStart")
    P20B A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    P20B A 0 A_PlayWeaponSound("pp2000/fire")
    P20B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,11,3)
    P20B A 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-9.00,9.00), 1, 0, 4, 0, frandom(-9.00,9.00))
	P20B A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,13,36-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P20B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P20B A 0 A_JumpIfInventory("PP2000Clip",3,2)
    P20B A 0 A_PlaySound("m9/lock")
    P20B A 0 A_JumpIfNoAmmo("FireEmpty")
    P20B B 1 BRIGHT A_GunFlash
    P20B C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    P20B C 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20B D 1 A_ReFire
    Goto Ready+12
    P20B C 0 A_JumpIfNoAmmo("ReloadStart")
    P20B D 1 A_ReFire
    Goto Ready+12
  FireEmpty:
    P20B B 1 BRIGHT A_GunFlash
    P20B C 1
    P20B D 1 A_GiveInventory("PP2000Bolt",1)
    P20B D 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20B D 0 A_ReFire
    Goto Ready+12
    P20B D 0 A_JumpIfNoAmmo("ReloadStart")
    P20B D 0 A_ReFire
    Goto Ready+12
  FireAim:
    P20C F 0 A_PlayWeaponSound("pp2000/fire")
    P20C F 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,6)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    P20C F 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-1.40,1.40), 1, 0, 4, 0, frandom(-1.40,1.40))
	P20C F 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,3,40-(Sin(Pitch)*28),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P20C F 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P20C F 0 A_JumpIfInventory("PP2000Clip",3,2)
    P20C F 0 A_PlaySound("m9/lock")
    P20C F 0 A_JumpIfNoAmmo("FireAimEmpty")
    P20C G 1 BRIGHT A_GunFlash
    P20C H 1
    P20C H 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20C I 1 A_ReFire
    Goto Ready+18
    P20C H 0 A_JumpIfNoAmmo("ReloadStart")
    P20C I 1 A_ReFire
    Goto Ready+18
  HoldAim:
    P20C F 0 A_PlayWeaponSound("pp2000/fire")
    P20C F 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,6)
    P20C F 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-4.20,4.20), 1, 0, 4, 0, frandom(-4.20,4.20))
	P20C F 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,3,40-(Sin(Pitch)*28),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P20C F 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P20C F 0 A_JumpIfInventory("PP2000Clip",3,2)
    P20C F 0 A_PlaySound("m9/lock")
    P20C F 0 A_JumpIfNoAmmo("FireAimEmpty")
    P20C G 1 BRIGHT A_GunFlash
    P20C H 1
    P20C H 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20C I 1 A_ReFire
    Goto Ready+18
    P20C H 0 A_JumpIfNoAmmo("ReloadStart")
    P20C I 1 A_ReFire
    Goto Ready+18
  FireAimEmpty:
    P20C G 1 BRIGHT A_GunFlash
    P20C H 1
    P20C I 1 A_GiveInventory("PP2000Bolt",1)
    P20C I 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20C I 0 A_ReFire
    Goto Ready+18
    P20C I 0 A_JumpIfNoAmmo("ReloadStart")
    P20C I 0 A_Refire
    Goto Ready+18
  Reload: //AltFire:
    P20C A 0 A_JumpIfInventory("PP2000Clip",20,2)
    P20C A 0 A_JumpIfInventory("PP2000Ammo",1,"ReloadStart")
    P20C A 0 A_TakeInventory("Reloading",1)
    P20C A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+15
  ReloadStart:
    P20D A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    P20D A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    P20D A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	P20D A 0 A_JumpIfInventory("PP2000Token",1,"Reload2")
    P20D A 3 A_PlaySoundEx("pp2000/clipout","SoundSlot5")
    P20D BCDEFGH 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	P20D H 0 A_FireCustomMissile("PistolEmptyMagSpawner",0,0,0,1)
	P20D H 0 A_GiveInventory("PP2000Token",1)
	goto Reload2
  Reload2:
    P20D IJKLM 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    P20D N 3 A_PlaySoundEx("pp2000/clipin","SoundSlot5")
    P20D O 3 A_TakeInventory("Reloading",1)
    P20D PQ 4
    Goto ReloadAmmo
  ReloadAmmo:
    P20D Q 0 A_JumpIfInventory("PP2000Clip",20,"ReloadEnd")
	P20D Q 0 A_TakeInventory("PP2000Token",1)
    P20D Q 0 A_JumpIfInventory("PP2000Ammo",1,1)
    Goto ReloadEnd
    P20D Q 0 A_GiveInventory("PP2000Clip",1)
    P20D Q 0 A_TakeInventory("PP2000Ammo",1)
    Goto ReloadAmmo
  ReloadEnd:
    P20D A 0 A_JumpIfInventory("PP2000Bolt",1,"ReloadEndBolt")
    P20D RST 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20D UV 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	TNT1 A 0 A_ClearReFire
	TNT1 A 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+12
  ReloadEndBolt:
    P20D Z 0 A_TakeInventory("PP2000Bolt",2)
    P20D WXY 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20D Z 3 A_PlaySoundEx("pp2000/bolt","SoundSlot5")
    P20E ABCDEFGH 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	TNT1 A 0 A_ClearReFire
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+12
  Zoom:
  PostReloadAlt:
    G18A I 0 A_JumpIfInventory("PP2000Token",1,"Reload")
    TNT1 A 0 A_GiveInventory("Aiming",1)
	P20C A 0 A_ZoomFactor(1.15)
	P20C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	P20C ABCDE 1
    Goto AltHold
  AltFireHoldAim:
    "####" "#" 0 A_JumpIfInventory("PP2000Clip",1,1)
	Goto Reload
    P20C F 0 A_PlayWeaponSound("pp2000/fire")
	GRNA L 0 A_TakeInventory("PP2000Clip",1)
    P20C F 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,6)
	"####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    P20C F 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-4.20,4.20), 1, 0, 4, 0, frandom(-4.20,4.20))
	P20C F 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,3,40-(Sin(Pitch)*28),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P20C F 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P20C F 0 A_JumpIfInventory("PP2000Clip",3,2)
    P20C F 0 A_PlaySound("m9/lock")
    P20C G 1 BRIGHT A_GunFlash
    "####" "#" 0 A_JumpIfInventory("PP2000Clip",1,1)
	Goto Reload
    P20C I 1 A_ReFire
    Goto Ready+18
  AltHold:
    P20C E 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
	M4CA C 0 A_JumpIfInventory("FireHeld",1,"AltFireHoldAim")
	M4CA C 0 A_JumpIfInventory("Reloading",1,"Reload")
	U45A L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    U45A L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
	M4CA F 0 A_Refire("AltHold")
	M4CA C 0 A_JumpIfInventory("Aiming",1,"AltFire2")
	Goto Ready+18
  AltFire:
    GRNA L 0 A_TakeInventory("weapondropper",2)
	G18A I 0 A_JumpIfInventory("PP2000Token",1,"Reload")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    P20C A 0 A_ZoomFactor(1.15)
    P20C A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    P20C AB 1
    P20C B 0 A_GiveInventory("Aiming",1)
    P20C CDE 1
    P20C E 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    P20C E 0 A_Refire
    Goto Ready+18
  AltFire2:
    P20C E 0 A_ZoomFactor(1.0)
    P20C ED 1
    P20C D 0 A_TakeInventory("Aiming",1)
    P20C CBA 1
	P20A IIII 1
    P20C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+12
  AltFire3:
    P20C E 0 A_ZoomFactor(1.0)
    P20C ED 1
    P20C D 0 A_TakeInventory("Aiming",1)
    P20C CBA 1
    P20C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	goto DropWeapon
  ReloadStartAim:
    P20C E 0 A_ZoomFactor(1.0)
    P20C ED 1
    P20C D 0 A_TakeInventory("Aiming",1)
    P20C CBA 1
    P20C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+2
  ReloadStart_SOH:
    P20D A 0 A_JumpIfInventory("PP2000Token",1,"Reload3")
    P20D A 2 A_PlaySoundEx("pp2000/clipout","SoundSlot5")
    P20D BCDEFGH 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	P20D H 0 A_FireCustomMissile("PistolEmptyMagSpawner",0,0,0,1)
	P20D H 0 A_GiveInventory("PP2000Token",1)
	goto Reload3
  Reload3:
    P20D IJKLM 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    P20D N 2 A_PlaySoundEx("pp2000/clipin","SoundSlot5")
    P20D O 2 A_TakeInventory("Reloading",1)
    P20D PQ 3
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    P20D Q 0 A_JumpIfInventory("PP2000Clip",20,"ReloadEnd_SOH")
	P20D Q 0 A_TakeInventory("PP2000Token",1)
    P20D Q 0 A_JumpIfInventory("PP2000Ammo",1,1)
    Goto ReloadEnd_SOH
    P20D Q 0 A_GiveInventory("PP2000Clip",1)
    P20D Q 0 A_TakeInventory("PP2000Ammo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    P20D A 0 A_JumpIfInventory("PP2000Bolt",1,"ReloadEndBolt_SOH")
    P20D RST 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20D UV 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	TNT1 A 0 A_ClearReFire
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+12
  ReloadEndBolt_SOH:
    P20D Z 0 A_TakeInventory("PP2000Bolt",2)
    P20D WXY 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20D Z 2 A_PlaySoundEx("pp2000/boltsoh","SoundSlot5")
    P20E ABCDEFGH 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	TNT1 A 0 A_ClearReFire
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+12
  Fire_SteadyAim:
    P20B A 0 A_PlayWeaponSound("pp2000/fire")
    P20B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,11,3)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    P20B A 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-5.00,5.00))
	P20B A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,13,36-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P20B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P20B A 0 A_JumpIfInventory("PP2000Clip",3,2)
    P20B A 0 A_PlaySound("m9/lock")
    P20B A 0 A_JumpIfNoAmmo("FireEmpty")
    P20B B 1 BRIGHT A_GunFlash
    P20B C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    P20B C 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20B D 1 A_ReFire
    Goto Ready+12
    P20B C 0 A_JumpIfNoAmmo("ReloadStart")
    P20B D 1 A_ReFire
    Goto Ready+12
  Hold_SteadyAim:
    P20B A 0 A_PlayWeaponSound("pp2000/fire")
    P20B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,11,3)
    P20B A 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	P20B A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,13,36-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P20B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P20B A 0 A_JumpIfInventory("PP2000Clip",3,2)
    P20B A 0 A_PlaySound("m9/lock")
    P20B A 0 A_JumpIfNoAmmo("FireEmpty")
    P20B B 1 BRIGHT A_GunFlash
    P20B C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    P20B C 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20B D 1 A_ReFire
    Goto Ready+12
    P20B C 0 A_JumpIfNoAmmo("ReloadStart")
    P20B D 1 A_ReFire
    Goto Ready+12
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  Spawn:
    WEAP R 0
    WEAP R 0 A_SpawnItem("PP2000Drop")
    stop
  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
  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:
    P20A HGFEDCBA 2 A_WeaponReady(WRF_NOPRIMARY)
    P20A 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("PP2000Dropped",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("PP2000Thrown",0,0,7,2)
	stop
  }
}

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

actor PP2000Bolt : Inventory
{
    inventory.amount 0
    inventory.maxamount 2
}
actor "PP-2000 Ex Mags" : "PP-2000"
{
  obituary "%k gattered %o with the PP-2000."
  inventory.pickupmessage "You got the PP-2000 automatic pistol."
  //attacksound "ump45/fire6"
  weapon.selectionorder 16
  weapon.ammotype "PP2000Clip2"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "PP2000Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    P20A A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    P20A BC 2 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
	P20A DEFGH 2 A_WeaponReady(WRF_ALLOWZOOM)
	G18A I 0 A_JumpIfInventory("PP2000Token",1,"Reload")
    P20A I 0 A_JumpIfNoAmmo("Reload")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    P20A I 0 A_JumpIfInventory("Aiming",1,5)
    P20A I 0 A_JumpIfInventory("Reloading",1,"Reload")
    P20A I 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    P20A I 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20A I 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+12
    P20C E 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    P20C E 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    P20C E 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    P20C E 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+18
  Fire:
    P20B A 0 A_JumpIfInventory("Aiming",1,"FireAim")
    P20B A 0 A_JumpIfNoAmmo("ReloadStart")
    P20B A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    P20B A 0 A_PlayWeaponSound("pp2000/fire")
    P20B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,11,3)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    P20B A 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	P20B A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,13,36-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P20B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P20B A 0 A_JumpIfInventory("PP2000Clip2",3,2)
    P20B A 0 A_PlaySound("m9/lock")
    P20B A 0 A_JumpIfNoAmmo("FireEmpty")
    P20B B 1 BRIGHT A_GunFlash
    P20B C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    P20B C 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20B D 1 A_ReFire
    Goto Ready+12
    P20B C 0 A_JumpIfNoAmmo("ReloadStart")
    P20B D 1 A_ReFire
    Goto Ready+12
  Hold:
    P20B A 0 A_JumpIfInventory("Aiming",1,"HoldAim")
    P20B A 0 A_JumpIfNoAmmo("ReloadStart")
    P20B A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    P20B A 0 A_PlayWeaponSound("pp2000/fire")
    P20B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,11,3)
    P20B A 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-9.00,9.00), 1, 0, 4, 0, frandom(-9.00,9.00))
	P20B A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,13,36-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P20B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P20B A 0 A_JumpIfInventory("PP2000Clip2",3,2)
    P20B A 0 A_PlaySound("m9/lock")
    P20B A 0 A_JumpIfNoAmmo("FireEmpty")
    P20B B 1 BRIGHT A_GunFlash
    P20B C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    P20B C 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20B D 1 A_ReFire
    Goto Ready+12
    P20B C 0 A_JumpIfNoAmmo("ReloadStart")
    P20B D 1 A_ReFire
    Goto Ready+12
  FireAim:
    P20C F 0 A_PlayWeaponSound("pp2000/fire")
    P20C F 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,6)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    P20C F 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-1.40,1.40), 1, 0, 4, 0, frandom(-1.40,1.40))
	P20C F 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,3,40-(Sin(Pitch)*28),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P20C F 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P20C F 0 A_JumpIfInventory("PP2000Clip2",3,2)
    P20C F 0 A_PlaySound("m9/lock")
    P20C F 0 A_JumpIfNoAmmo("FireAimEmpty")
    P20C G 1 BRIGHT A_GunFlash
    P20C H 1
    P20C H 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20C I 1 A_ReFire
    Goto Ready+18
    P20C H 0 A_JumpIfNoAmmo("ReloadStart")
    P20C I 1 A_ReFire
    Goto Ready+18
  HoldAim:
    P20C F 0 A_PlayWeaponSound("pp2000/fire")
    P20C F 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,6)
    P20C F 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-4.20,4.20), 1, 0, 4, 0, frandom(-4.20,4.20))
	P20C F 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,3,40-(Sin(Pitch)*28),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P20C F 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P20C F 0 A_JumpIfInventory("PP2000Clip2",3,2)
    P20C F 0 A_PlaySound("m9/lock")
    P20C F 0 A_JumpIfNoAmmo("FireAimEmpty")
    P20C G 1 BRIGHT A_GunFlash
    P20C H 1
    P20C H 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20C I 1 A_ReFire
    Goto Ready+18
    P20C H 0 A_JumpIfNoAmmo("ReloadStart")
    P20C I 1 A_ReFire
    Goto Ready+18
  Fire_SteadyAim:
    P20B A 0 A_PlayWeaponSound("pp2000/fire")
    P20B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,11,3)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    P20B A 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-5.00,5.00))
	P20B A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,13,36-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P20B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P20B A 0 A_JumpIfInventory("PP2000Clip2",3,2)
    P20B A 0 A_PlaySound("m9/lock")
    P20B A 0 A_JumpIfNoAmmo("FireEmpty")
    P20B B 1 BRIGHT A_GunFlash
    P20B C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    P20B C 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20B D 1 A_ReFire
    Goto Ready+12
    P20B C 0 A_JumpIfNoAmmo("ReloadStart")
    P20B D 1 A_ReFire
    Goto Ready+12
  Hold_SteadyAim:
    P20B A 0 A_PlayWeaponSound("pp2000/fire")
    P20B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,11,3)
    P20B A 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	P20B A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,13,36-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P20B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P20B A 0 A_JumpIfInventory("PP2000Clip2",3,2)
    P20B A 0 A_PlaySound("m9/lock")
    P20B A 0 A_JumpIfNoAmmo("FireEmpty")
    P20B B 1 BRIGHT A_GunFlash
    P20B C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    P20B C 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20B D 1 A_ReFire
    Goto Ready+12
    P20B C 0 A_JumpIfNoAmmo("ReloadStart")
    P20B D 1 A_ReFire
    Goto Ready+12
  Reload: //AltFire:
    P20C A 0 A_JumpIfInventory("PP2000Clip2",30,2)
    P20C A 0 A_JumpIfInventory("PP2000Ammo",1,"ReloadStart")
    P20C A 0 A_TakeInventory("Reloading",1)
    P20C A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+15
  ReloadStart:
    P20D A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    P20D A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    P20D A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	P20D A 0 A_JumpIfInventory("PP2000Token",1,"Reload2")
    P20D A 3 A_PlaySoundEx("pp2000/clipout","SoundSlot5")
    P20D BCDEFGH 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	P20D H 0 A_FireCustomMissile("PistolExtEmptyMagSpawner",0,0,0,1)
	P20D H 0 A_GiveInventory("PP2000Token",1)
	goto Reload2
  Reload2:
    P20D IJKLM 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    P20D N 3 A_PlaySoundEx("pp2000/clipin","SoundSlot5")
    P20D O 3 A_TakeInventory("Reloading",1)
    P20D PQ 4
    Goto ReloadAmmo
  ReloadAmmo:
    P20D Q 0 A_JumpIfInventory("PP2000Clip2",30,"ReloadEnd")
	P20D Q 0 A_TakeInventory("PP2000Token",1)
    P20D Q 0 A_JumpIfInventory("PP2000Ammo",1,1)
    Goto ReloadEnd
    P20D Q 0 A_GiveInventory("PP2000Clip2",1)
    P20D Q 0 A_TakeInventory("PP2000Ammo",1)
    Goto ReloadAmmo
  ReloadEnd:
    P20D A 0 A_JumpIfInventory("PP2000Bolt",1,"ReloadEndBolt")
    P20D RST 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20D UV 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    P20D V 0 A_ReFire
    Goto Ready+12
  ReloadEndBolt:
    P20D Z 0 A_TakeInventory("PP2000Bolt",2)
    P20D WXY 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20D Z 3 A_PlaySoundEx("pp2000/bolt","SoundSlot5")
    P20E ABCDEFGH 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    P20D V 0 A_ReFire
    Goto Ready+12
  ReloadStartAim:
    P20C E 0 A_ZoomFactor(1.0)
    P20C ED 1
    P20C D 0 A_TakeInventory("Aiming",1)
    P20C CBA 1
    P20C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+2
  ReloadStart_SOH:
    P20D A 0 A_JumpIfInventory("PP2000Token",1,"Reload3")
    P20D A 2 A_PlaySoundEx("pp2000/clipout","SoundSlot5")
    P20D BCDEFGH 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	P20D H 0 A_FireCustomMissile("PistolExtEmptyMagSpawner",0,0,0,1)
	P20D H 0 A_GiveInventory("PP2000Token",1)
	goto Reload3
  Reload3:
    P20D IJKLM 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    P20D N 2 A_PlaySoundEx("pp2000/clipin","SoundSlot5")
    P20D O 2 A_TakeInventory("Reloading",1)
    P20D PQ 3
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    P20D Q 0 A_JumpIfInventory("PP2000Clip2",30,"ReloadEnd_SOH")
	P20D Q 0 A_TakeInventory("PP2000Token",1)
    P20D Q 0 A_JumpIfInventory("PP2000Ammo",1,1)
    Goto ReloadEnd_SOH
    P20D Q 0 A_GiveInventory("PP2000Clip2",1)
    P20D Q 0 A_TakeInventory("PP2000Ammo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    P20D A 0 A_JumpIfInventory("PP2000Bolt",1,"ReloadEndBolt_SOH")
    P20D RST 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20D UV 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    P20D V 0 A_ReFire
    Goto Ready+12
  ReloadEndBolt_SOH:
    P20D Z 0 A_TakeInventory("PP2000Bolt",2)
    P20D WXY 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20D Z 2 A_PlaySoundEx("pp2000/boltsoh","SoundSlot5")
    P20E ABCDEFGH 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    P20D V 0 A_ReFire
    Goto Ready+12
  PostReloadAlt:
    G18A I 0 A_JumpIfInventory("PP2000Token",1,"Reload")
    TNT1 A 0 A_GiveInventory("Aiming",1)
	P20C A 0 A_ZoomFactor(1.15)
	P20C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	P20C ABCDE 1
    Goto AltHold
  AltFireHoldAim:
    "####" "#" 0 A_JumpIfInventory("PP2000Clip2",1,1)
	Goto Reload
    P20C F 0 A_PlayWeaponSound("pp2000/fire")
	GRNA L 0 A_TakeInventory("PP2000Clip2",1)
    P20C F 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,6)
	"####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    P20C F 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-4.20,4.20), 1, 0, 4, 0, frandom(-4.20,4.20))
	P20C F 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,3,40-(Sin(Pitch)*28),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P20C F 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P20C F 0 A_JumpIfInventory("PP2000Clip2",3,2)
    P20C F 0 A_PlaySound("m9/lock")
    P20C G 1 BRIGHT A_GunFlash
    "####" "#" 0 A_JumpIfInventory("PP2000Clip2",1,1)
	Goto Reload
    P20C I 1 A_ReFire
    Goto Ready+18
  }
}

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

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

actor "PP-2000 Akimbo" : RGUWeapon
{
  obituary "%k gattered %o with akimbo PP2000s."
  inventory.pickupmessage "You got the PP-2000 automatic pistol."
  //attacksound "ump45/fire6"
  weapon.selectionorder 16
  weapon.ammotype "PP2000Clip3"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "PP2000Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    P22A A 2 A_PlaySoundEx("weapon/draw","SoundSlot5")
    P22A BCDEFGHI 2 A_WeaponReady(WRF_NOFIRE)
	G18A I 0 A_JumpIfInventory("PP2000Token",1,"Reload")
    P22A J 0 A_JumpIfNoAmmo("Reload")
    G18A I 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    P22A J 0 A_JumpIfInventory("Reloading",1,"Reload")
    P22A J 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    P22A J 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22A J 1 A_WeaponReady(WRF_ALLOWRELOAD)
    Goto Ready+11
  Deselect:
    P22A J 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    P22A J 0 A_TakeInventory("Aiming",1)
    P22A J 0 A_TakeInventory("Reloading",1)
    P22A J 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    P22A J 0 A_Lower
    P22A J 1 A_Lower
    Goto Deselect+4
  Select:
    P22A A 0 A_Raise
    Loop
  Fire:
    P22B A 0 A_JumpIfNoAmmo("ReloadStart")
    P22B A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    P22B A 0 A_PlayWeaponSound("pP2000/fire")
    P22B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,3)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    P22B A 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-8.00,8.00), 1, 0, 4, 0, frandom(-8.00,8.00))
	P22B A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,19,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P22B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P22B A 0 BRIGHT A_GunFlash
    P22B A 0 A_GiveInventory("FireSwitch",1)
    P22B A 0 A_JumpIfNoAmmo("FireEmpty")
    P22B A 0 A_PlayWeaponSound("pP2000/fireak")
    P22B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,-12,4)
    P22B C 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-8.00,8.00), 1, 0, 4, 0, frandom(-8.00,8.00))
	P22B C 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,-19,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(-3,-6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P22B C 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P22B A 0 BRIGHT A_GunFlash
    P22B C 0 A_TakeInventory("FireSwitch",1)
    TNT1 A 0 A_JumpIfInventory("PP2000Clip3",6,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    P22B C 0 A_JumpIfNoAmmo("FireEmpty")
	P22B D 1
    P22B D 0 A_JumpIfInventory("PP2000Ammo",1,3)
    P22B GH 1 A_ReFire
    Goto Ready+11
    P22B D 0 A_JumpIfNoAmmo("ReloadStart")
    P22B GH 1 A_ReFire
    Goto Ready+11
  Hold:
	P22B E 0 A_JumpIfNoAmmo("ReloadStart")
    P22B E 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    P22B E 0 A_PlayWeaponSound("pP2000/fireak")
    P22B E 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,3)
    P22B E 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-10.00,10.00), 1, 0, 4, 0, frandom(-10.00,10.00))
	P22B A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,19,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P22B E 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P22B E 0 BRIGHT A_GunFlash
    P22B E 0 A_GiveInventory("FireSwitch",1)
    P22B E 0 A_JumpIfNoAmmo("FireEmpty")
    P22B E 0 A_PlayWeaponSound("pP2000/fireak")
    P22B E 0 A_FireCustomMissile("WeaponSmokePuff",0,0,-12,4)
    P22B C 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-10.00,10.00), 1, 0, 4, 0, frandom(-10.00,10.00))
	P22B C 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,-19,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(-3,-6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P22B C 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P22B E 0 BRIGHT A_GunFlash
    P22B C 0 A_TakeInventory("FireSwitch",1)
    TNT1 A 0 A_JumpIfInventory("PP2000Clip3",6,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    P22B C 0 A_JumpIfNoAmmo("FireEmpty")
    P22B D 1
    P22B D 0 A_JumpIfInventory("PP2000Ammo",1,3)
    P22B GH 1 A_ReFire
    Goto Ready+11
    P22B D 0 A_JumpIfNoAmmo("ReloadStart")
    P22B GH 1 A_ReFire
    Goto Ready+11
  FireEmpty:
    P22B DG 1
    P22B H 1 A_GiveInventory("PP2000Bolt",2)
    P22B H 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P22B H 0 A_ReFire
    Goto Ready+11
    P22B H 0 A_JumpIfNoAmmo("ReloadStart")
    P22B H 0 A_ReFire
    Goto Ready+11
  Reload:
    P22C A 0 A_JumpIfInventory("PP2000Clip3",40,2)
    P22C A 0 A_JumpIfInventory("PP2000Ammo",1,"ReloadStart")
    P22C A 0 A_TakeInventory("Reloading",1)
    Goto Ready+14
  ReloadStart:
    P22D B 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    P22D B 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	P20D A 0 A_JumpIfInventory("PP2000Token",1,"Reload2")
    P22D B 3 A_PlaySoundEx("pP2000/clipoutsoh","SoundSlot5")
	P22D C 3 A_PlaySoundEx("pP2000/clipout","SoundSlot7")
	P20D H 0 A_FireCustomMissile("PistolEmptyMagSpawner",0,0,0,1)
    P22D DEFGH 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	P20D H 0 A_FireCustomMissile("PistolEmptyMagSpawner",0,0,0,1)
	P20D H 0 A_GiveInventory("PP2000Token",1)
    P22D IJ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload2
  Reload2:
    P22D KLM 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    P22D N 3 A_PlaySoundEx("pP2000/clipin","SoundSlot5")
    P22D O 3 A_TakeInventory("Reloading",1)
    P22D PQ 3
    Goto ReloadAmmo
  ReloadStart2:
    P22D XYZ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    P22E A 3 A_PlaySoundEx("pP2000/clipin","SoundSlot5")
    P22E B 3 A_TakeInventory("Reloading",1)
    P22E C 3
    Goto ReloadAmmo2
  ReloadAmmo:
    P22D Q 0 A_JumpIfInventory("PP2000Clip3",20,"ReloadEnd")
	P20D Q 0 A_TakeInventory("PP2000Token",1)
    P22D Q 0 A_JumpIfInventory("PP2000Ammo",1,1)
    Goto ReloadEnd
    P22D Q 0 A_GiveInventory("PP2000Clip3",1)
    P22D Q 0 A_TakeInventory("PP2000Ammo",1)
    Goto ReloadAmmo
  ReloadAmmo2:
    P22E C 0 A_JumpIfInventory("PP2000Clip3",40,"ReloadEnd2")
	P20D Q 0 A_TakeInventory("PP2000Token",1)
    P22E C 0 A_JumpIfInventory("PP2000Ammo",1,1)
    Goto ReloadEnd2
    P22E C 0 A_GiveInventory("PP2000Clip3",1)
    P22E C 0 A_TakeInventory("PP2000Ammo",1)
    Goto ReloadAmmo2
  ReloadEnd:
    P22D A 0 A_JumpIfInventory("PP2000Bolt",2,"ReloadEndBolt")
    P22D RSTUV 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadStart2
  ReloadEnd2:
    P22E A 0 A_JumpIfInventory("PP2000Bolt",1,"ReloadEndBolt2")
    P22E EFG 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22E HIJ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    P22E J 0 A_ReFire
    Goto Ready+11
  ReloadEndBolt:
    P22F Z 0 A_TakeInventory("PP2000Bolt",1)
    P22F ABD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22F E 3 A_PlaySoundEx("pP2000/bolt","SoundSlot5")
    P22F FGHIJKL 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadStart2
  ReloadEndBolt2:
    P22F Z 0 A_TakeInventory("PP2000Bolt",1)
    P22F MNP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22F Q 3 A_PlaySoundEx("pP2000/bolt","SoundSlot5")
    P22F RSTUVWXY 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto Ready+11
  ReloadStart_SOH:
    P20D A 0 A_JumpIfInventory("PP2000Token",1,"Reload3")
    P22D B 2 A_PlaySoundEx("pP2000/clipoutsoh","SoundSlot5")
	P22D C 2 A_PlaySoundEx("pP2000/clipout","SoundSlot7")
	P20D H 0 A_FireCustomMissile("PistolEmptyMagSpawner",0,0,0,1)
    P22D DEFGH 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	P20D H 0 A_FireCustomMissile("PistolEmptyMagSpawner",0,0,0,1)
    P20D H 0 A_GiveInventory("PP2000Token",1)
    P22D IJ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload3
  Reload3:
    P22D KLM 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    P22D N 2 A_PlaySoundEx("pP2000/clipin","SoundSlot5")
    P22D O 2 A_TakeInventory("Reloading",1)
    P22D PQ 2
    Goto ReloadAmmo_SOH
  ReloadStart2_SOH:
    P22D XYZ 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    P22E A 2 A_PlaySoundEx("pP2000/clipin","SoundSlot5")
    P22E B 2 A_TakeInventory("Reloading",1)
    P22E C 2
    Goto ReloadAmmo2_SOH
  ReloadAmmo_SOH:
    P22D Q 0 A_JumpIfInventory("PP2000Clip3",20,"ReloadEnd_SOH")
	P20D Q 0 A_TakeInventory("PP2000Token",1)
    P22D Q 0 A_JumpIfInventory("PP2000Ammo",1,1)
    Goto ReloadEnd_SOH
    P22D Q 0 A_GiveInventory("PP2000Clip3",1)
    P22D Q 0 A_TakeInventory("PP2000Ammo",1)
    Goto ReloadAmmo_SOH
  ReloadAmmo2_SOH:
    P22E C 0 A_JumpIfInventory("PP2000Clip3",40,"ReloadEnd2_SOH")
	P20D Q 0 A_TakeInventory("PP2000Token",1)
    P22E C 0 A_JumpIfInventory("PP2000Ammo",1,1)
    Goto ReloadEnd2_SOH
    P22E C 0 A_GiveInventory("PP2000Clip3",1)
    P22E C 0 A_TakeInventory("PP2000Ammo",1)
    Goto ReloadAmmo2_SOH
  ReloadEnd_SOH:
    P22D A 0 A_JumpIfInventory("PP2000Bolt",2,"ReloadEndBolt_SOH")
    P22D RSTUV 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadStart2_SOH
  ReloadEnd2_SOH:
    P22E A 0 A_JumpIfInventory("PP2000Bolt",1,"ReloadEndBolt2_SOH")
    P22E EFG 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22E HIJ 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    P22E J 0 A_ReFire
    Goto Ready+11
  ReloadEndBolt_SOH:
    P22F Z 0 A_TakeInventory("PP2000Bolt",1)
    P22F ABD 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22F E 2 A_PlaySoundEx("pP2000/boltsoh","SoundSlot5")
    P22F FGHIJKL 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadStart2_SOH
  ReloadEndBolt2_SOH:
    P22F Z 0 A_TakeInventory("PP2000Bolt",1)
    P22F MNP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22F Q 2 A_PlaySoundEx("pP2000/boltsoh","SoundSlot5")
    P22F RSTUVWXY 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto Ready+11
  Fire_SteadyAim:
    P22B A 0 A_PlayWeaponSound("pP2000/fire")
    P22B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,3)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    P22B A 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-6.00,6.00))
	P22B A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,19,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P22B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P22B A 0 BRIGHT A_GunFlash
    P22B A 0 A_GiveInventory("FireSwitch",1)
    P22B A 0 A_JumpIfNoAmmo("FireEmpty")
    P22B A 0 A_PlayWeaponSound("pP2000/fireak")
    P22B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,-12,4)
    P22B C 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-6.00,6.00))
	P22B C 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,-19,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(-3,-6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P22B C 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P22B A 0 BRIGHT A_GunFlash
    P22B C 0 A_TakeInventory("FireSwitch",1)
    TNT1 A 0 A_JumpIfInventory("PP2000Clip3",6,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    P22B C 0 A_JumpIfNoAmmo("FireEmpty")
	P22B D 1
    P22B D 0 A_JumpIfInventory("PP2000Ammo",1,3)
    P22B GH 1 A_ReFire
    Goto Ready+11
    P22B D 0 A_JumpIfNoAmmo("ReloadStart")
    P22B GH 1 A_ReFire
    Goto Ready+11
  Hold_SteadyAim:
    P22B E 0 A_PlayWeaponSound("pP2000/fireak")
    P22B E 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,3)
    P22B E 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-8.00,8.00), 1, 0, 4, 0, frandom(-8.00,8.00))
	P22B A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,19,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P22B E 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P22B E 0 BRIGHT A_GunFlash
    P22B E 0 A_GiveInventory("FireSwitch",1)
    P22B E 0 A_JumpIfNoAmmo("FireEmpty")
    P22B E 0 A_PlayWeaponSound("pP2000/fireak")
    P22B E 0 A_FireCustomMissile("WeaponSmokePuff",0,0,-12,4)
    P22B C 1 BRIGHT A_FireCustomMissile("HHCBP2000", frandom(-8.00,8.00), 1, 0, 4, 0, frandom(-8.00,8.00))
	P22B C 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,-19,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(-3,-6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    P22B C 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    P22B E 0 BRIGHT A_GunFlash
    P22B C 0 A_TakeInventory("FireSwitch",1)
    TNT1 A 0 A_JumpIfInventory("PP2000Clip3",6,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    P22B C 0 A_JumpIfNoAmmo("FireEmpty")
    P22B D 1
    P22B D 0 A_JumpIfInventory("PP2000Ammo",1,3)
    P22B GH 1 A_ReFire
    Goto Ready+11
    P22B D 0 A_JumpIfNoAmmo("ReloadStart")
    P22B GH 1 A_ReFire
    Goto Ready+11
  AltFire:
    P22A J 1 A_WeaponReady(WRF_NOSECONDARY)
    Goto Ready+11
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  Spawn:
    WEAP R 0
    WEAP R 0 A_SpawnItemEx("PP2000Drop")
    stop
  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
    Goto Ready+2
  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
    Goto Ready+2
  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)
    Goto Ready+2
  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)
    Goto Ready+2
  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)
    Goto Ready+2
  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)
    Goto Ready+2
  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
    Goto Ready+2
  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
    Goto Ready+2
  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
    Goto Ready+2
  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
    Goto Ready+2
  DropWeapon:
    P22A IHGFEDCBA 2 A_WeaponReady(WRF_NOPRIMARY)
    P22A 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("PP2000Dropped",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("PP2000Thrown",0,0,7,2)
  }
}

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

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

actor PP2000Pickup : CustomInventory
{
  inventory.pickupmessage "You got the PP-2000 automatic pistol."
  inventory.pickupsound "deagle/bolt"
  +INVENTORY.AUTOACTIVATE
  //inventory.respawntics 70
  scale 0.10
  States
  {
  Spawn:
    WEAP R -1
    stop
  Pickup:
    WEAP R 0
    WEAP R 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",0,0,0)) == 1, "PickupStay")
    WEAP R 0 A_JumpIfInventory("PP-2000",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP R 0 A_JumpIfInventory("PP-2000 Ex Mags",1,"AmmoPickup")
    WEAP R 0 A_JumpIfInventory("PP-2000 Akimbo",1,"AmmoPickup")
    WEAP R 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP R 0 A_JumpIfInventory("MaxWeaponsFilled",92,"FailPickup2")
	WEAP R 0 A_GiveInventory("MaxWeaponsFilled",9)
    WEAP R 0 ACS_NamedExecuteWithResult("RefPickU",16,0,0)
    stop
  PickupStay:
    WEAP R 0
    WEAP R 0 A_JumpIfInventory("PP-2000",1,"FailPickup") // If the player already has this weapon, they get more ammo for it
    WEAP R 0 A_JumpIfInventory("PP-2000 Ex Mags",1,"FailPickup")
    WEAP R 0 A_JumpIfInventory("PP-2000 Akimbo",1,"FailPickup")
    WEAP R 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP R 0 A_JumpIfInventory("MaxWeaponsFilled",92,"FailPickup2")
	WEAP R 0 A_GiveInventory("MaxWeaponsFilled",9)
    WEAP R 0 ACS_NamedExecuteWithResult("RefPickU",16,0,0)
    WEAP R 0 ACS_NamedExecuteWithResult("RefPickC",16,0,0)
    WEAP R 0 A_PlaySound("deagle/bolt")
    fail
  AmmoPickup:
    WEAP R 0
    WEAP R 0 A_JumpIfInventory("PP2000Ammo",0,"FailPickup")
    WEAP R 0 A_GiveInventory("PP2000Ammo",20)
    stop
  OneManArmy:
    WEAP R 0
	WEAP R 0 A_JumpIfInventory("MaxWeaponsFilled",127,"FailPickup2")
	WEAP R 0 A_GiveInventory("MaxWeaponsFilled",9)
	WEAP R 0 ACS_NamedExecuteWithResult("RefPickU",16,0,0)
	stop
  FailPickup:
    WEAP R 1
    fail
  FailPickup2:
    WEAP R 1
    WEAP R 0 ACS_NamedExecuteAlways("RefSlots",0,5,0,0)
    fail
  }
}

actor PP2000Drop : PP2000Pickup
{
  States
  {
  Spawn:
    WEAP R -1
    stop
  Pickup:
    WEAP R 0
    WEAP R 0 A_JumpIfInventory("PP-2000",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP R 0 A_JumpIfInventory("PP-2000 Ex Mags",1,"AmmoPickup")
    WEAP R 0 A_JumpIfInventory("PP-2000 Akimbo",1,"AmmoPickup")
    WEAP R 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP R 0 A_JumpIfInventory("MaxWeaponsFilled",92,"FailPickup2")
	WEAP R 0 A_GiveInventory("MaxWeaponsFilled",9)
    WEAP R 0 ACS_NamedExecuteWithResult("RefPickU",16,0,0)
    stop
  }
}

actor PP2000Drop2 : PP2000Drop
{
  States
  {
  Spawn:
    WEAP R -1
    stop
  Pickup:
    WEAP R 0
    WEAP R 0 A_JumpIfInventory("PP-2000",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP R 0 A_JumpIfInventory("PP-2000 Ex Mags",1,"AmmoPickup")
    WEAP R 0 A_JumpIfInventory("PP-2000 Akimbo",1,"AmmoPickup")
    WEAP R 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP R 0 A_JumpIfInventory("MaxWeaponsFilled",92,"FailPickup2")
	WEAP R 0 A_GiveInventory("MaxWeaponsFilled",9)
    WEAP R 0 ACS_NamedExecuteWithResult("RefPickU",16,0,0)
    stop
  AmmoPickup:
    WEAP R 0
    stop
  }
}

actor HHCBP2000 : HHBullet
{
  damage (random(13,19))
  Speed 300
  States
  {
  Spawn:
    TNT1 A 10
    TNT1 A 5 A_ScaleVelocity(0.67)
    stop
  Death:
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
    stop
  XDeath:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 5 A_PlaySound("generic/ricochets")
    stop
  Crash:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff_2", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
    stop
  }
}