actor "UMP45" : RGUWeapon
{
  obituary "%k gattered %o down with the UMP45."
  inventory.pickupmessage "UMP45"  
  //attacksound "ump45/fire6"
  weapon.selectionorder 11
  weapon.ammotype "UMP45Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "UMP45Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    U46A A 2 //A_PlayWeaponSound("m9/select")
    U46A BCDEFGHIJK 2 A_WeaponReady(WRF_NOPRIMARY)
    U46A K 0 A_JumpIfNoAmmo("Reload")
    U46A K 0 A_JumpIfInventory("Aiming",1,5)
    U46A K 0 A_JumpIfInventory("Reloading",1,"Reload")
    U46A K 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    U46A K 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46A K 1 A_WeaponReady
    goto Ready+11
    U46F F 0 A_JumpIfInventory("Reloading",1,"Reload")    
    U46F F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    U46F F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46F F 1 A_WeaponReady(WRF_NOBOB)
    goto Ready+17
  Deselect:
    U46A K 0 A_TakeInventory("Aiming",1)
    U46A K 0 ACS_ExecuteAlways(602,0,0,0,0)
    SPSA L 0 A_TakeInventory("Reloading",1)
    INTA L 0 A_ZoomFactor(1.0)
    U46A K 0 A_Lower
    U46A K 1 A_Lower
    goto Deselect+2
  Select:
    U46A A 0 A_Raise
	U46A A 0 ACS_ExecuteAlways(602,0,0,0,0)
	TNT1 F 0 A_GiveInventory("InCombatCrosshair", 35)
    loop
  Fire:	
    U46A A 0 A_JumpIfInventory("Aiming",1,"FireAim")
    U46A K 0 A_JumpIfNoAmmo("ReloadStart")
    U46B A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    U46B A 0 A_PlayWeaponSound("ump45/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    U46B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,0)
    U46B A 1 BRIGHT A_FireBullets (9.0, 9.0, -1, 9, "HHBulletPuff", 1, 6000)
    U46B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    U46B A 0 //A_JumpIfNoAmmo("FireEmpty")
    U46B B 1 BRIGHT A_GunFlash
    U46B C 1
    U46A K 1
    U46B A 0 A_JumpIfInventory("UMP45Ammo",1,2)
    U46B A 0 A_ReFire
    goto Ready+11
    U46B A 0 A_JumpIfNoAmmo("ReloadStart")
    U46B A 0 A_ReFire
    goto Ready+11
  Hold:
    U46A A 0 A_JumpIfInventory("Aiming",1,"HoldAim")
    U46A K 0 A_JumpIfNoAmmo("ReloadStart")
    U46B A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    U46B A 0 A_PlayWeaponSound("ump45/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    U46B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,0)
    U46B A 1 BRIGHT A_FireBullets (13.5, 13.5, -1, 9, "HHBulletPuff", 1, 6000)
    U46B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    U46B A 0 //A_JumpIfNoAmmo("FireEmpty")
    U46B B 1 BRIGHT A_GunFlash
    U46B C 1
    U46A K 1
    U46B A 0 A_JumpIfInventory("UMP45Ammo",1,2)
    U46B A 0 A_ReFire
    goto Ready+11
    U46B A 0 A_JumpIfNoAmmo("ReloadStart")
    U46B A 0 A_ReFire
    goto Ready+11
  FireAim:
    U46F A 0 A_PlayWeaponSound("ump45/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    U46F A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,3)
    U46F G 1 BRIGHT A_FireBullets (2.5, 2.5, -1, 9, "HHBulletPuff", 1, 6000)
    U46F G 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    U46F G 0 //A_JumpIfNoAmmo("FireEmpty")
    U46F H 1 BRIGHT A_GunFlash
    U46F I 1
    U46F F 1
    U46F A 0 A_JumpIfInventory("UMP45Ammo",1,2)
    U46F A 0 A_ReFire
    goto Ready+17
    U46F A 0 A_JumpIfNoAmmo("ReloadStart")
    U46F A 0 A_ReFire
    goto Ready+17
  HoldAim:
    U46F A 0 A_PlayWeaponSound("ump45/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    U46F A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,3)
    U46F G 1 BRIGHT A_FireBullets (7.0, 7.0, -1, 9, "HHBulletPuff", 1, 6000)
    U46F G 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    U46F G 0 //A_JumpIfNoAmmo("FireEmpty")
    U46F H 1 BRIGHT A_GunFlash
    U46F I 1
    U46F F 1
    U46F A 0 A_JumpIfInventory("UMP45Ammo",1,2)
    U46F A 0 A_ReFire
    goto Ready+17
    U46F A 0 A_JumpIfNoAmmo("ReloadStart")
    U46F A 0 A_ReFire
    goto Ready+17
  Reload: //AltFire:
    U46C A 0 A_JumpIfInventory("UMP45Ammo",1,"ReloadStart")
    U46C A 0 A_TakeInventory("Reloading",1)
    goto Ready+14
  ReloadStart:
  	TNT1 A 0 ACS_ExecuteAlways(652,0,0,0,0) // Shout "Reloading" 
    U46C A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    U46C A 2 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    U46C BCDE 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46C F 3 A_PlaySoundEx("ump45/clipout","SoundSlot5")
    U46C GHIJKL 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46C MOPQR 3 A_WeaponReady(WRF_NOFIRE)
    U46C S 3 A_TakeInventory("Reloading",1)
    U46C T 3 A_PlayWeaponSound("ump45/clipin")
    goto ReloadAmmo
  ReloadAmmo:
    U46C P 0 A_GiveInventory("UMP45Clip",1)
    U46C P 0 A_TakeInventory("UMP45Ammo",1)
    U46C P 0 A_JumpIfInventory("UMP45Clip",32,"ReloadEnd")
    U46C P 0 A_JumpIfInventory("UMP45Ammo",1,"ReloadAmmo")
    goto ReloadEnd
  ReloadEnd:
    U46C UVWXYZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46D AB 3 A_WeaponReady(WRF_NOFIRE)
    U46D B 0 A_ReFire
    goto Ready+11
  AltFire:
    U46F A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    U45F A 0 A_ZoomFactor(1.2)
    U46F ABCDEF 1
    U46F G 0 A_GiveInventory("Aiming",1)
    U46F G 0 ACS_ExecuteAlways(602,0,0,0,0)
    U46F G 0 A_Refire
    goto Ready+17
  AltFire2:
    U45F A 0 A_ZoomFactor(1.0)
    U46F FEDCBA 1
    U46F A 0 A_TakeInventory("Aiming",1)
    U46F A 0 ACS_ExecuteAlways(602,0,0,0,0)
    U46F G 0 A_Refire
    goto Ready+11
  AltHold:
    U46A K 1 A_JumpIfInventory("Aiming",1,"AltHoldAim")
    U46A K 1 A_ReFire
    goto Ready+11
  AltHoldAim:
    U46F F 1
    U46F F 1 A_ReFire
    goto Ready+17
  ReloadStartAim:
    U45F A 0 A_ZoomFactor(1.0)
    U46F FEDCBA 1
    U46F A 0 A_TakeInventory("Aiming",1)
    U46F A 0 ACS_ExecuteAlways(602,0,0,0,0)
    goto ReloadStart+1
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  Spawn:
    WEAP O 15
    TNT1 A 0 A_SpawnItemEx("UMP45Pickup")
    stop
  Fire_SteadyAim:
    U46B A 0 A_PlayWeaponSound("ump45/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    U46B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,0)
    U46B A 1 BRIGHT A_FireBullets (6.0, 6.0, -1, 9, "HHBulletPuff", 1, 6000)
    U46B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    U46B A 0 //A_JumpIfNoAmmo("FireEmpty")
    U46B B 1 BRIGHT A_GunFlash
    U46B C 1
    U46A K 1
    U46B A 0 A_JumpIfInventory("UMP45Ammo",1,2)
    U46B A 0 A_ReFire
    goto Ready+11
    U46B A 0 A_JumpIfNoAmmo("ReloadStart")
    U46B A 0 A_ReFire
    goto Ready+11
  Hold_SteadyAim:
    U46B A 0 A_PlayWeaponSound("ump45/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    U46B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,0)
    U46B A 1 BRIGHT A_FireBullets (8.91, 8.91, -1, 9, "HHBulletPuff", 1, 6000)
    U46B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    U46B A 0 //A_JumpIfNoAmmo("FireEmpty")
    U46B B 1 BRIGHT A_GunFlash
    U46B C 1
    U46A K 1
    U46B A 0 A_JumpIfInventory("UMP45Ammo",1,2)
    U46B A 0 A_ReFire
    goto Ready+11
    U46B A 0 A_JumpIfNoAmmo("ReloadStart")
    U46B A 0 A_ReFire
    goto Ready+11
  ReloadStart_SOH:
    U46C A 2 
    U46C BCDE 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46C F 2 A_PlaySoundEx("ump45/clipout","SoundSlot5")
    U46C GHIJKLMOPQR 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46C S 2 A_TakeInventory("Reloading",1)
    U46C T 2 A_PlayWeaponSound("ump45/clipin")
    goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    U46C P 0 A_GiveInventory("UMP45Clip",1)
    U46C P 0 A_TakeInventory("UMP45Ammo",1)
    U46C P 0 A_JumpIfInventory("UMP45Clip",32,"ReloadEnd_SOH")
    U46C P 0 A_JumpIfInventory("UMP45Ammo",1,"ReloadAmmo_SOH")
    goto ReloadEnd_SOH
  ReloadEnd_SOH:
    U46C UVWXYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46D AB 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46D B 0 A_ReFire
    goto Ready+11
  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 UMP45Clip : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 32
    ammo.backpackamount 0
    ammo.backpackmaxamount 32
    +IGNORESKILL
}

actor "UMP45 Ex Mags" : "UMP45"
{
  obituary "%k gattered %o down with the UMP45."
  inventory.pickupmessage "UMP45"  
  //attacksound "ump45/fire6"
  weapon.selectionorder 11
  weapon.ammotype "UMP45Clip2"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "UMP45Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Reload: //AltFire:
    U46C A 0 A_JumpIfInventory("UMP45Ammo",1,"ReloadStart")
    U46C A 0 A_TakeInventory("Reloading",1)
    goto Ready+14
  ReloadStart:
  	TNT1 A 0 ACS_ExecuteAlways(652,0,0,0,0) // Shout "Reloading" 
    U46C A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    U46C A 2 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    U46C BCDE 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46C F 3 A_PlaySoundEx("ump45/clipout","SoundSlot5")
    U46C GHIJKL 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46C MOPQR 3 A_WeaponReady(WRF_NOFIRE)
    U46C S 3 A_TakeInventory("Reloading",1)
    U46C T 3 A_PlayWeaponSound("ump45/clipin")
    goto ReloadAmmo
  ReloadAmmo:
    U46C P 0 A_GiveInventory("UMP45Clip2",1)
    U46C P 0 A_TakeInventory("UMP45Ammo",1)
    U46C P 0 A_JumpIfInventory("UMP45Clip2",48,"ReloadEnd")
    U46C P 0 A_JumpIfInventory("UMP45Ammo",1,"ReloadAmmo")
    goto ReloadEnd
  ReloadEnd:
    U46C UVWXYZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46D AB 3 A_WeaponReady(WRF_NOFIRE)
    U46D B 0 A_ReFire
    goto Ready+11
  ReloadStart_SOH:
    U46C A 2 
    U46C BCDE 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46C F 2 A_PlaySoundEx("ump45/clipout","SoundSlot5")
    U46C GHIJKLMOPQR 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46C S 2 A_TakeInventory("Reloading",1)
    U46C T 2 A_PlayWeaponSound("ump45/clipin")
    goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    U46C P 0 A_GiveInventory("UMP45Clip2",1)
    U46C P 0 A_TakeInventory("UMP45Ammo",1)
    U46C P 0 A_JumpIfInventory("UMP45Clip2",48,"ReloadEnd_SOH")
    U46C P 0 A_JumpIfInventory("UMP45Ammo",1,"ReloadAmmo_SOH")
    goto ReloadEnd_SOH
  ReloadEnd_SOH:
    U46C UVWXYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46D AB 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    U46D B 0 A_ReFire
    goto Ready+11
  ReloadStartAim:
    U45F A 0 A_ZoomFactor(1.0)
    U46F FEDCBA 1
    U46F A 0 A_TakeInventory("Aiming",1)
    U46F A 0 ACS_ExecuteAlways(602,0,0,0,0)
    goto ReloadStart+1
  }
}

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

actor UMP45ExMags : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}
actor "UMP45 Rapid Fire" : "UMP45"
{
  obituary "%k gattered %o down with the UMP45."
  inventory.pickupmessage "UMP45"  
  //attacksound "ump45/fire6"
  weapon.selectionorder 11
  weapon.ammotype "UMP45Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "UMP45Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Fire:	
    U46A A 0 A_JumpIfInventory("Aiming",1,"FireAim")
    U46A K 0 A_JumpIfNoAmmo("ReloadStart")
    U46B A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    U46B A 0 A_PlayWeaponSound("ump45/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    U46B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,0)
    U46B A 1 BRIGHT A_FireBullets (9.0, 9.0, -1, 9, "HHBulletPuff", 1, 6000)
    U46B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    U46B A 0 //A_JumpIfNoAmmo("FireEmpty")
    U46B B 1 BRIGHT A_GunFlash
    U46B C 1
    U46B A 0 A_JumpIfInventory("UMP45Ammo",1,2)
    U46B A 0 A_ReFire
    goto Ready+11
    U46B A 0 A_JumpIfNoAmmo("ReloadStart")
    U46B A 0 A_ReFire
    goto Ready+11
  Hold:
    U46A A 0 A_JumpIfInventory("Aiming",1,"HoldAim")
    U46A K 0 A_JumpIfNoAmmo("ReloadStart")
    U46B A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    U46B A 0 A_PlayWeaponSound("ump45/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    U46B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,0)
    U46B A 1 BRIGHT A_FireBullets (6.0, 6.0, -1, 9, "HHBulletPuff", 1, 6000)
    U46B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    U46B A 0 //A_JumpIfNoAmmo("FireEmpty")
    U46B B 1 BRIGHT A_GunFlash
    U46B C 1
    U46B A 0 A_JumpIfInventory("UMP45Ammo",1,2)
    U46B A 0 A_ReFire
    goto Ready+11
    U46B A 0 A_JumpIfNoAmmo("ReloadStart")
    U46B A 0 A_ReFire
    goto Ready+11
  FireAim:
    U46F A 0 A_PlayWeaponSound("ump45/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    U46F A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,3)
    U46F G 1 BRIGHT A_FireBullets (2.5, 2.5, -1, 9, "HHBulletPuff", 1, 6000)
    U46F G 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    U46F G 0 //A_JumpIfNoAmmo("FireEmpty")
    U46F H 1 BRIGHT A_GunFlash
    U46F I 1
    U46F A 0 A_JumpIfInventory("UMP45Ammo",1,2)
    U46F A 0 A_ReFire
    goto Ready+17
    U46F A 0 A_JumpIfNoAmmo("ReloadStart")
    U46F A 0 A_ReFire
    goto Ready+17
  HoldAim:
    U46F A 0 A_PlayWeaponSound("ump45/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    U46F A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,3)
    U46F G 1 BRIGHT A_FireBullets (7.0, 7.0, -1, 9, "HHBulletPuff", 1, 6000)
    U46F G 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    U46F G 0 //A_JumpIfNoAmmo("FireEmpty")
    U46F H 1 BRIGHT A_GunFlash
    U46F I 1
    U46F A 0 A_JumpIfInventory("UMP45Ammo",1,2)
    U46F A 0 A_ReFire
    goto Ready+17
    U46F A 0 A_JumpIfNoAmmo("ReloadStart")
    U46F A 0 A_ReFire
    goto Ready+17
  Fire_SteadyAim:
    U46B A 0 A_PlayWeaponSound("ump45/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    U46B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,0)
    U46B A 1 BRIGHT A_FireBullets (9.0, 9.0, -1, 9, "HHBulletPuff", 1, 6000)
    U46B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    U46B A 0 //A_JumpIfNoAmmo("FireEmpty")
    U46B B 1 BRIGHT A_GunFlash
    U46B C 1
    U46B A 0 A_JumpIfInventory("UMP45Ammo",1,2)
    U46B A 0 A_ReFire
    goto Ready+11
    U46B A 0 A_JumpIfNoAmmo("ReloadStart")
    U46B A 0 A_ReFire
    goto Ready+11
  Hold_SteadyAim:
    U46B A 0 A_PlayWeaponSound("ump45/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    U46B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,12,0)
    U46B A 1 BRIGHT A_FireBullets (6.0, 6.0, -1, 9, "HHBulletPuff", 1, 6000)
    U46B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    U46B A 0 //A_JumpIfNoAmmo("FireEmpty")
    U46B B 1 BRIGHT A_GunFlash
    U46B C 1
    U46B A 0 A_JumpIfInventory("UMP45Ammo",1,2)
    U46B A 0 A_ReFire
    goto Ready+11
    U46B A 0 A_JumpIfNoAmmo("ReloadStart")
    U46B A 0 A_ReFire
    goto Ready+11
  }
}

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

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