actor "PP2000" : RGUWeapon
{
  obituary "%k gattered %o with the PP2000."
  inventory.pickupmessage "PP2000"  
  //attacksound "ump45/fire6"
  weapon.selectionorder 15
  weapon.ammotype "PP2000Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "PP2000Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    P20A A 2 //A_PlayWeaponSound("m9/select")
    P20A BCDEFGH 2 A_WeaponReady(WRF_NOPRIMARY)
    P20A I 0 A_JumpIfNoAmmo("Reload")
    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
    goto Ready+8
    P20C E 0 A_JumpIfInventory("Reloading",1,"Reload")    
    P20C E 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    P20C E 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20C E 1 A_WeaponReady(WRF_NOBOB)
    goto Ready+14
  Deselect:
    P20A K 0 A_TakeInventory("Aiming",1)
    P20A K 0 ACS_ExecuteAlways(602,0,0,0,0)
    P20A L 0 A_TakeInventory("Reloading",1)
    P20A L 0 A_ZoomFactor(1.0)
    P20A K 0 A_Lower
    P20A I 1 A_Lower
    goto Deselect+2
  Select:
    P20A A 0 A_Raise
	P20A A 0 ACS_ExecuteAlways(602,0,0,0,0)
	TNT1 F 0 A_GiveInventory("InCombatCrosshair", 35)
    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")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    P20B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,3)
    P20B A 1 BRIGHT A_FireBullets (10.0, 10.0, -1, 11, "HHBulletPuff", 1, 6000)
    P20B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    P20B A 0 A_JumpIfNoAmmo("FireEmpty")
    P20B BC 1 BRIGHT A_GunFlash
    P20B A 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20B D 1 A_ReFire
    goto Ready+8
    P20B A 0 A_JumpIfNoAmmo("ReloadStart")
    P20B D 1 A_ReFire
    goto Ready+8
  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")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    P20B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,3)
    P20B A 1 BRIGHT A_FireBullets (20.0, 20.0, -1, 11, "HHBulletPuff", 1, 6000)
    P20B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    P20B A 0 A_JumpIfNoAmmo("FireEmpty")
    P20B BC 1 BRIGHT A_GunFlash
    P20B A 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20B D 1 A_ReFire
    goto Ready+8
    P20B A 0 A_JumpIfNoAmmo("ReloadStart")
    P20B D 1 A_ReFire
    goto Ready+8
  FireEmpty:
    P20B B 1 BRIGHT A_GunFlash
    P20B CD 1 A_GiveInventory("PP2000Bolt",1)
    P20B A 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20B A 0 A_ReFire
    goto Ready+8
    P20B A 0 A_JumpIfNoAmmo("ReloadStart")
    P20B CD 1 A_ReFire
    goto Ready+8
  FireAim:
    P20C F 0 A_PlayWeaponSound("pp2000/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    P20C F 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,6)
    P20C F 1 BRIGHT A_FireBullets (3, 3, -1, 11, "HHBulletPuff", 1, 6000)
    P20C F 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    P20C F 0 A_JumpIfNoAmmo("FireAimEmpty")
    P20C GH 1 BRIGHT A_GunFlash
    P20C H 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20C I 1 A_ReFire
    goto Ready+14
    P20C A 0 A_JumpIfNoAmmo("ReloadStart")
    P20C I 1 A_ReFire
    goto Ready+14
  HoldAim:
    P20C G 0 A_PlayWeaponSound("pp2000/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    P20C G 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,6)
    P20C F 1 BRIGHT A_FireBullets (9, 9, -1, 11, "HHBulletPuff", 1, 6000)
    P20C G 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    P20C G 0 A_JumpIfNoAmmo("FireAimEmpty")
    P20C GH 1 BRIGHT A_GunFlash
    P20C H 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20C I 1 A_ReFire
    goto Ready+14
    P20C A 0 A_JumpIfNoAmmo("ReloadStart")
    P20C I 1 A_ReFire
    goto Ready+14
  FireAimEmpty:
    P20C GH 1 BRIGHT A_GunFlash
    P20C I 1 A_GiveInventory("PP2000Bolt",1)
    P20C A 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20C A 0 A_ReFire
    goto Ready+14
    P20C A 0 A_JumpIfNoAmmo("ReloadStart")
    P20C I 0 A_ReFire
    goto Ready+14
  Reload: //AltFire:
    P20C A 0 A_JumpIfInventory("PP2000Ammo",1,"ReloadStart")
    P20C A 0 A_TakeInventory("Reloading",1)
    goto Ready+11
  ReloadStart:
  	TNT1 A 0 ACS_ExecuteAlways(652,0,0,0,0) // Shout "Reloading" 
    P20D A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    P20D A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    P20D A 3 A_PlaySoundEx("pp2000/clipout","SoundSlot5")
    P20D BCDEFGH 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20D IJKLMN 3 A_WeaponReady(WRF_NOFIRE)
    P20D O 3 A_PlaySoundEx("pp2000/clipin","SoundSlot5")
    P20D PQ 3 A_TakeInventory("Reloading",1)
    goto ReloadAmmo
  ReloadAmmo:
    P20D Z 0 A_GiveInventory("PP2000Clip",1)
    P20D Z 0 A_TakeInventory("PP2000Ammo",1)
    P20D Z 0 A_JumpIfInventory("PP2000Clip",20,"ReloadEnd")
    P20D Z 0 A_JumpIfInventory("PP2000Ammo",1,"ReloadAmmo")
    goto ReloadEnd
  ReloadEnd:
    P20D A 0 A_JumpIfInventory("PP2000Bolt",1,"ReloadEndBolt") 
    P20D RST 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20D UV 3 A_WeaponReady(WRF_NOFIRE)
    P20D V 0 A_ReFire
    goto Ready+8  
  ReloadEndBolt:
    P20D Z 0 A_TakeInventory("PP2000Bolt",1)
    P20D WXYZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20E A 3 A_PlaySoundEx("pp2000/bolt","SoundSlot5")
    P20E BCDEFGH 3 A_WeaponReady(WRF_NOFIRE)
    P20D V 0 A_ReFire
    goto Ready+8  
  AltFire:
    P20C A 0 A_ZoomFactor(1.2)
    P20C A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    P20C ABCDE 1
    P20C F 0 A_GiveInventory("Aiming",1)
    P20C F 0 ACS_ExecuteAlways(602,0,0,0,0)
    P20C F 0 A_Refire
    goto Ready+14
  AltFire2:
    P20C A 0 A_ZoomFactor(1.0)
    P20C EDCBA 1
    P20C A 0 A_TakeInventory("Aiming",1)
    P20C A 0 ACS_ExecuteAlways(602,0,0,0,0)
    P20C G 0 A_Refire
    goto Ready+8
  AltHold:
    P20A I 1 A_JumpIfInventory("Aiming",1,"AltHoldAim")
    P20A I 1 A_ReFire
    goto Ready+8
  AltHoldAim:
    P20C E 1
    P20C E 1 A_ReFire
    goto Ready+14
  ReloadStartAim:
    P20C A 0 A_ZoomFactor(1.0)
    P20C EDCBA 1
    P20C A 0 A_TakeInventory("Aiming",1)
    P20C A 0 ACS_ExecuteAlways(602,0,0,0,0)
    goto ReloadStart+1
  ReloadStart_SOH:
    P20D A 2 A_PlaySoundEx("pp2000/clipout","SoundSlot5")
    P20D BCDEFGH 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20D IJKLMN 2 A_WeaponReady(WRF_NOFIRE)
    P20D O 2 A_PlaySoundEx("pp2000/clipin","SoundSlot5")
    P20D PQ 2 A_TakeInventory("Reloading",1)
    goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    P20D Z 0 A_GiveInventory("PP2000Clip",1)
    P20D Z 0 A_TakeInventory("PP2000Ammo",1)
    P20D Z 0 A_JumpIfInventory("PP2000Clip",20,"ReloadEnd_SOH")
    P20D Z 0 A_JumpIfInventory("PP2000Ammo",1,"ReloadAmmo_SOH")
    goto ReloadEnd_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_NOFIRE)
    P20D V 0 A_ReFire
    goto Ready+8  
  ReloadEndBolt_SOH:
    P20D Z 0 A_TakeInventory("PP2000Bolt",1)
    P20D WXYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20E A 2 A_PlaySoundEx("pp2000/bolt","SoundSlot5")
    P20E BCDEFGH 2 A_WeaponReady(WRF_NOFIRE)
    P20D V 0 A_ReFire
    goto Ready+8  
  Fire_SteadyAim:
    P20B A 0 A_PlayWeaponSound("pp2000/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    P20B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,3)
    P20B A 1 BRIGHT A_FireBullets (6.6, 6.6, -1, 11, "HHBulletPuff", 1, 6000)
    P20B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    P20B A 0 A_JumpIfNoAmmo("FireEmpty")
    P20B BC 1 BRIGHT A_GunFlash
    P20B A 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20B D 1 A_ReFire
    goto Ready+8
    P20B A 0 A_JumpIfNoAmmo("ReloadStart")
    P20B D 1 A_ReFire
    goto Ready+8
  Hold_SteadyAim:
    P20B A 0 A_PlayWeaponSound("pp2000/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    P20B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,3)
    P20B A 1 BRIGHT A_FireBullets (13.2, 13.2, -1, 11, "HHBulletPuff", 1, 6000)
    P20B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    P20B A 0 A_JumpIfNoAmmo("FireEmpty")
    P20B BC 1 BRIGHT A_GunFlash
    P20B A 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P20B D 1 A_ReFire
    goto Ready+8
    P20B A 0 A_JumpIfNoAmmo("ReloadStart")
    P20B D 1 A_ReFire
    goto Ready+8
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  Spawn:
    WEAP R 15
    WEAP R 0 A_SpawnItemEx("PP2000Pickup")
    stop
  FragGrenade:
    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_ExecuteAlways(602,0,0,0,0)
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"FragGrenade_SOH")
    GRNA A 2 A_PlaySound("grenade/pinpull")
    GRNA BCDEFGH 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("FragGrenadeAmmo",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",0,0,0,16)
    GRNA MN 2 
    goto Ready+1
  FragGrenade_SOH:
    GRNA A 1 A_PlaySound("grenade/pinpull")
    GRNA BCDEFGH 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("FragGrenadeAmmo",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",0,0,0,16)
    GRNA MN 1 
    goto Ready+1
  KnifeAttack:
    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_ExecuteAlways(602,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_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",96)
    KNFA FGHIJKL 1 
    TNT1 A 20
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_Commando:
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",160)
    KNFA FGHIJKL 1 
    TNT1 A 20
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_SOH:
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_SOH_Commando")
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",96)
    KNFA FGHIJKL 1 
    TNT1 A 10
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_SOH_Commando:
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",160)
    KNFA FGHIJKL 1 
    TNT1 A 10
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  }
}

actor "PP2000 Akimbo" : RGUWeapon //The akimbo version.
{
  obituary "%k gattered %o with the PP2000."
  inventory.pickupmessage "PP2000 Akimbo"  
  //attacksound "ump45/fire6"
  weapon.selectionorder 15
  weapon.ammotype "PP2200Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "PP2000Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    P22A A 2 //A_PlayWeaponSound("m9/select")
    P22A BCDEFGHI 2 A_WeaponReady(WRF_NOPRIMARY)
    P22A J 0 A_JumpIfNoAmmo("Reload")
    P22A J 0 A_JumpIfInventory("Aiming",1,5)
    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
    goto Ready+9
    P22C E 0 A_JumpIfInventory("Reloading",1,"Reload")    
    P22C E 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    P22C E 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22C E 1 A_WeaponReady(WRF_NOBOB)
    goto Ready+14
  Deselect:
    P22A K 0 A_TakeInventory("Aiming",1)
    P22A K 0 ACS_ExecuteAlways(602,0,0,0,0)
    P22A L 0 A_TakeInventory("Reloading",1)
    P22A L 0 A_ZoomFactor(1.0)
    P22A K 0 A_Lower
    P22A I 1 A_Lower
    goto Deselect+2
  Select:
    P22A A 0 A_Raise
	P22A A 0 ACS_ExecuteAlways(602,0,0,0,0)
	TNT1 F 0 A_GiveInventory("InCombatCrosshair", 35)
    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")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    P22B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,3)
    P22B A 1 BRIGHT A_FireBullets (10.0, 10.0, -1, 11, "HHBulletPuff", 1, 6000)
    P22B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    P22B A 0 A_JumpIfNoAmmo("FireEmpty")
    P22B B 1 BRIGHT A_GunFlash
    P22B C 0 A_PlayWeaponSound("pP2000/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    P22B C 0 A_FireCustomMissile("WeaponSmokePuff",0,0,-12,3)
    P22B C 1 BRIGHT A_FireBullets (10.0, 10.0, -1, 11, "HHBulletPuff", 1, 6000)
    P22B C 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    P22B C 0 A_JumpIfNoAmmo("FireEmpty")
	P22B D 1 BRIGHT A_GunFlash
    P22B A 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P22B GH 1 A_ReFire
    goto Ready+9
    P22B A 0 A_JumpIfNoAmmo("ReloadStart")
	P22B G 1
    P22B H 1 A_ReFire
    goto Ready+9
  Hold:
	P22B E 0 A_JumpIfNoAmmo("ReloadStart")
    P22B E 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    P22B E 0 A_PlayWeaponSound("pP2000/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    P22B E 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,3)
    P22B E 1 BRIGHT A_FireBullets (20.0, 20.0, -1, 11, "HHBulletPuff", 1, 6000)
    P22B E 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    P22B E 0 A_JumpIfNoAmmo("FireEmpty")
    P22B F 1 BRIGHT A_GunFlash
    P22B F 0 A_PlayWeaponSound("pP2000/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    P22B F 0 A_FireCustomMissile("WeaponSmokePuff",0,0,-12,3)
    P22B C 1 BRIGHT A_FireBullets (20.0, 20.0, -1, 11, "HHBulletPuff", 1, 6000)
    P22B C 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    P22B C 0 A_JumpIfNoAmmo("FireEmpty")
    P22B D 1 BRIGHT A_GunFlash
    P22B D 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P22B GH 1 A_ReFire
    goto Ready+9
    P22B A 0 A_JumpIfNoAmmo("ReloadStart")
	P22B G 1
    P22B H 1 A_ReFire
    goto Ready+9
  FireEmpty:
    P22B B 1 BRIGHT A_GunFlash
    P22B GH 1 A_GiveInventory("PP2000Bolt",2)
    P22B A 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P22B A 0 A_ReFire
    goto Ready+9
    P22B A 0 A_JumpIfNoAmmo("ReloadStart")
    P22B GH 1 A_ReFire
    goto Ready+9
	
  Reload:
    P22C A 0 A_JumpIfInventory("PP2000Ammo",1,"ReloadStart")
    P22C A 0 A_TakeInventory("Reloading",1)
    goto Ready+12
  ReloadStart:
  	TNT1 A 0 ACS_ExecuteAlways(652,0,0,0,0) // Shout "Reloading" 
    P22D A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    P22D A 3 A_PlaySoundEx("pP2000/clipout","SoundSlot5")
	P22D B 3 A_PlaySoundEx("pP2000/clipout","SoundSlot5")
    P22D CDEFGH 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22D IJKLMN 3 A_WeaponReady(WRF_NOFIRE)
    P22D O 3 A_PlaySoundEx("pP2000/clipin","SoundSlot5")
    P22D PQ 3 A_TakeInventory("Reloading",1)
    goto ReloadAmmo
  ReloadStart2:
    P22D WXYZ 3 A_WeaponReady(WRF_NOFIRE)
    P22E A 3 A_WeaponReady(WRF_NOFIRE)
    P22E B 3 A_PlaySoundEx("pP2000/clipin","SoundSlot5")
    P22E CD 3 A_TakeInventory("Reloading",1)
    goto ReloadAmmo2
  ReloadAmmo:
    P22D Z 0 A_GiveInventory("PP2200Clip",1)
    P22D Z 0 A_TakeInventory("PP2000Ammo",1)
    P22D Z 0 A_JumpIfInventory("PP2200Clip",20,"ReloadEnd")
    P22D Z 0 A_JumpIfInventory("PP2000Ammo",1,"ReloadAmmo")
    goto ReloadEnd
  ReloadAmmo2:
    P22D Z 0 A_GiveInventory("PP2200Clip",1)
    P22D Z 0 A_TakeInventory("PP2000Ammo",1)
    P22D Z 0 A_JumpIfInventory("PP2200Clip",40,"ReloadEnd2")
    P22D Z 0 A_JumpIfInventory("PP2000Ammo",1,"ReloadAmmo2")
    goto ReloadEnd2
  ReloadEnd:
    P22D A 0 A_JumpIfInventory("PP2000Bolt",2,"ReloadEndBolt")
    P22D RSTUV 3 A_WeaponReady(WRF_NOFIRE)
    goto ReloadStart2
  ReloadEnd2:
    P22E A 0 A_JumpIfInventory("PP2000Bolt",1,"ReloadEndBolt2")
    P22E EFG 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22E HI 3 A_WeaponReady(WRF_NOFIRE)
    P22E J 0 A_ReFire
    goto Ready+9
  ReloadEndBolt:
    P22F Z 0 A_TakeInventory("PP2000Bolt",1)
    P22F ABCD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22F E 3 A_PlaySoundEx("pP2000/bolt","SoundSlot5")
    P22F FGHIJKL 3 A_WeaponReady(WRF_NOFIRE)
    goto ReloadStart2
  ReloadEndBolt2:
    P22F Z 0 A_TakeInventory("PP2000Bolt",1)
    P22F MNOP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22F Q 3 A_PlaySoundEx("pP2000/bolt","SoundSlot5")
    P22F RSTUVWXY 3 A_WeaponReady(WRF_NOFIRE)
    goto Ready+9 
  ReloadStart_SOH:
    P22D A 2 A_PlaySoundEx("pP2000/clipout","SoundSlot5")
	P22D B 2 A_PlaySoundEx("pP2000/clipout","SoundSlot5")
    P22D CDEFGH 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22D IJKLMN 2 A_WeaponReady(WRF_NOFIRE)
    P22D O 2 A_PlaySoundEx("pP2000/clipin","SoundSlot5")
    P22D PQ 2 A_TakeInventory("Reloading",1)
    goto ReloadAmmo_SOH
  ReloadStart2_SOH:
    P22D WXYZ 2 A_WeaponReady(WRF_NOFIRE)
    P22E A 2 A_WeaponReady(WRF_NOFIRE)
    P22E B 2 A_PlaySoundEx("pP2000/clipin","SoundSlot5")
    P22E CD 2 A_TakeInventory("Reloading",1)
    goto ReloadAmmo2_SOH
  ReloadAmmo_SOH:
    P22D Z 0 A_GiveInventory("PP2200Clip",1)
    P22D Z 0 A_TakeInventory("PP2000Ammo",1)
    P22D Z 0 A_JumpIfInventory("PP2200Clip",20,"ReloadEnd_SOH")
    P22D Z 0 A_JumpIfInventory("PP2000Ammo",1,"ReloadAmmo_SOH")
    goto ReloadEnd_SOH
  ReloadAmmo2_SOH:
    P22D Z 0 A_GiveInventory("PP2200Clip",1)
    P22D Z 0 A_TakeInventory("PP2000Ammo",1)
    P22D Z 0 A_JumpIfInventory("PP2200Clip",40,"ReloadEnd2_SOH")
    P22D Z 0 A_JumpIfInventory("PP2000Ammo",1,"ReloadAmmo2_SOH")
    goto ReloadEnd2_SOH
  ReloadEnd_SOH:
    P22D A 0 A_JumpIfInventory("PP2000Bolt",2,"ReloadEndBolt_SOH")
    P22D RSTUV 2 A_WeaponReady(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 HI 2 A_WeaponReady(WRF_NOFIRE)
    P22E J 0 A_ReFire
    goto Ready+9
  ReloadEndBolt_SOH:
    P22F Z 0 A_TakeInventory("PP2000Bolt",1)
    P22F ABCD 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22F E 2 A_PlaySoundEx("pP2000/bolt","SoundSlot5")
    P22F FGHIJKL 2 A_WeaponReady(WRF_NOFIRE)
    goto ReloadStart2_SOH
  ReloadEndBolt2_SOH:
    P22F Z 0 A_TakeInventory("PP2000Bolt",1)
    P22F MNOP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P22F Q 2 A_PlaySoundEx("pP2000/bolt","SoundSlot5")
    P22F RSTUVWXY 2 A_WeaponReady(WRF_NOFIRE)
    goto Ready+9 
  Fire_SteadyAim:
    P22B A 0 A_PlayWeaponSound("pP2000/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    P22B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,3)
    P22B A 1 BRIGHT A_FireBullets (6.6, 6.6, -1, 11, "HHBulletPuff", 1, 6000)
    P22B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    P22B A 0 A_JumpIfNoAmmo("FireEmpty")
    P22B B 1 BRIGHT A_GunFlash
    P22B C 0 A_PlayWeaponSound("pP2000/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    P22B C 0 A_FireCustomMissile("WeaponSmokePuff",0,0,-12,3)
    P22B C 1 BRIGHT A_FireBullets (6.6, 6.6, -1, 11, "HHBulletPuff", 1, 6000)
    P22B C 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    P22B C 0 A_JumpIfNoAmmo("FireEmpty")
	P22B D 1 BRIGHT A_GunFlash
    P22B A 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P22B GH 1 A_ReFire
    goto Ready+9
    P22B A 0 A_JumpIfNoAmmo("ReloadStart")
	P22B G 1
    P22B H 1 A_ReFire
    goto Ready+9
  Hold_SteadyAim:
    P22B E 0 A_PlayWeaponSound("pP2000/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    P22B E 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,3)
    P22B E 1 BRIGHT A_FireBullets (6.6, 6.6, -1, 11, "HHBulletPuff", 1, 6000)
    P22B E 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    P22B E 0 A_JumpIfNoAmmo("FireEmpty")
    P22B F 1 BRIGHT A_GunFlash
    P22B F 0 A_PlayWeaponSound("pP2000/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    P22B F 0 A_FireCustomMissile("WeaponSmokePuff",0,0,-12,3)
    P22B C 1 BRIGHT A_FireBullets (6.6, 6.6, -1, 11, "HHBulletPuff", 1, 6000)
    P22B C 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    P22B C 0 A_JumpIfNoAmmo("FireEmpty")
    P22B D 1 BRIGHT A_GunFlash
    P22B D 0 A_JumpIfInventory("PP2000Ammo",1,2)
    P22B GH 1 A_ReFire
    goto Ready+9
    P22B A 0 A_JumpIfNoAmmo("ReloadStart")
	P22B G 1
    P22B H 1 A_ReFire
    goto Ready+9
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  Spawn:
    WEAP R 15
    WEAP R 0 A_SpawnItemEx("PP2000Pickup")
    stop
  FragGrenade:
    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_ExecuteAlways(602,0,0,0,0)
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"FragGrenade_SOH")
    GRNA A 2 A_PlaySound("grenade/pinpull")
    GRNA BCDEFGH 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("FragGrenadeAmmo",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",0,0,0,16)
    GRNA MN 2 
    goto Ready+1
  FragGrenade_SOH:
    GRNA A 1 A_PlaySound("grenade/pinpull")
    GRNA BCDEFGH 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("FragGrenadeAmmo",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",0,0,0,16)
    GRNA MN 1 
    goto Ready+1
  KnifeAttack:
    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_ExecuteAlways(602,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_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",96)
    KNFA FGHIJKL 1 
    TNT1 A 20
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_Commando:
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",160)
    KNFA FGHIJKL 1 
    TNT1 A 20
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_SOH:
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_SOH_Commando")
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",96)
    KNFA FGHIJKL 1 
    TNT1 A 10
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_SOH_Commando:
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",160)
    KNFA FGHIJKL 1 
    TNT1 A 10
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  }
}

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 1
}
actor "PP2000 Ex Mags" : "PP2000"
{
  obituary "%k gattered %o with the PP2000."
  inventory.pickupmessage "PP2000"  
  //attacksound "ump45/fire6"
  weapon.selectionorder 15
  weapon.ammotype "PP2000Clip2"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "PP2000Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Reload: //AltFire:
    P20C A 0 A_JumpIfInventory("PP2000Ammo",1,"ReloadStart")
    P20C A 0 A_TakeInventory("Reloading",1)
    goto Ready+11
  ReloadStart:
  	TNT1 A 0 ACS_ExecuteAlways(652,0,0,0,0) // Shout "Reloading" 
    P20D A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    P20D A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    P20D A 3 A_PlaySoundEx("pp2000/clipout","SoundSlot5")
    P20D BCDEFGH 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20D IJKLMN 3 A_WeaponReady(WRF_NOFIRE)
    P20D O 3 A_PlaySoundEx("pp2000/clipin","SoundSlot5")
    P20D PQ 3 A_TakeInventory("Reloading",1)
    goto ReloadAmmo
  ReloadAmmo:
    P20D Z 0 A_GiveInventory("PP2000Clip2",1)
    P20D Z 0 A_TakeInventory("PP2000Ammo",1)
    P20D Z 0 A_JumpIfInventory("PP2000Clip2",30,"ReloadEnd")
    P20D Z 0 A_JumpIfInventory("PP2000Ammo",1,"ReloadAmmo")
    goto ReloadEnd
  ReloadEnd:
    P20D A 0 A_JumpIfInventory("PP2000Bolt",1,"ReloadEndBolt") 
    P20D RST 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20D UV 3 A_WeaponReady(WRF_NOFIRE)
    P20D V 0 A_ReFire
    goto Ready+8  
  ReloadEndBolt:
    P20D Z 0 A_TakeInventory("PP2000Bolt",1)
    P20D WXYZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20E A 3 A_PlaySoundEx("pp2000/bolt","SoundSlot5")
    P20E BCDEFGH 3 A_WeaponReady(WRF_NOFIRE)
    P20D V 0 A_ReFire
    goto Ready+8  
  ReloadStartAim:
    P20C A 0 A_ZoomFactor(1.0)
    P20C EDCBA 1
    P20C A 0 A_TakeInventory("Aiming",1)
    P20C A 0 ACS_ExecuteAlways(602,0,0,0,0)
    goto ReloadStart+1
  ReloadStart_SOH:
    P20D A 2 A_PlaySoundEx("pp2000/clipout","SoundSlot5")
    P20D BCDEFGH 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20D IJKLMN 2 A_WeaponReady(WRF_NOFIRE)
    P20D O 2 A_PlaySoundEx("pp2000/clipin","SoundSlot5")
    P20D PQ 2 A_TakeInventory("Reloading",1)
    goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    P20D Z 0 A_GiveInventory("PP2000Clip2",1)
    P20D Z 0 A_TakeInventory("PP2000Ammo",1)
    P20D Z 0 A_JumpIfInventory("PP2000Clip2",30,"ReloadEnd_SOH")
    P20D Z 0 A_JumpIfInventory("PP2000Ammo",1,"ReloadAmmo_SOH")
    goto ReloadEnd_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_NOFIRE)
    P20D V 0 A_ReFire
    goto Ready+8  
  ReloadEndBolt_SOH:
    P20D Z 0 A_TakeInventory("PP2000Bolt",1)
    P20D WXYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    P20E A 2 A_PlaySoundEx("pp2000/bolt","SoundSlot5")
    P20E BCDEFGH 2 A_WeaponReady(WRF_NOFIRE)
    P20D V 0 A_ReFire
    goto Ready+8  

  }
}


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

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 PP2000Akimbo : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}


actor PP2000Pickup : CustomInventory
{
  inventory.pickupmessage "PP2000"  
  inventory.pickupsound "misc/w_pkup"
  +INVENTORY.AUTOACTIVATE
  inventory.respawntics 35
  scale 0.15
  States
  {
  Spawn:
    WEAP R -1
    stop
  Pickup:
    JDGP A 0
    JDGP A 0 A_JumpIfInventory("PP2000",1,"FailPickup") // If the player already has this weapon, they get more ammo for it
    JDGP A 0 A_JumpIfInventory("PP2000 Ex Mags",1,"FailPickup")
    JDGP A 0 A_JumpIfInventory("MaxWeaponsFilled",0,"FailPickup2")
    BKPK A 0 ACS_ExecuteWithResult(618,16,0,0)
    stop
  AmmoPickup:
    JDGP A 0
    JDGP A 0 A_JumpIfInventory("PP2000Ammo",0,"FailPickup")
    JDGP A 0 A_GiveInventory("PP2000Ammo",20)
    stop
  FailPickup:
    WEAP R 1
    fail
  FailPickup2:
    WEAP R 1 
    BKPK A 0 ACS_ExecuteAlways(620,0,2,0,0)
    fail
  }
}
