actor "Mini-UZI" : RGUWeapon
{
  obituary "%k sprayed %o with the Mini-UZI."
  inventory.pickupmessage "Mini-UZI"  
  //attacksound "ump45/fire6"
  weapon.selectionorder 13
  weapon.ammotype "MiniUziClip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "MiniUziAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    UZIA A 2 //A_PlayWeaponSound("m9/select")
    UZIA BCDEFGHIJKL 2 A_WeaponReady(WRF_NOPRIMARY)
    UZIA L 0 A_JumpIfNoAmmo("Reload")
    UZIA L 0 A_JumpIfInventory("Aiming",1,5)
    UZIA L 0 A_JumpIfInventory("Reloading",1,"Reload")
    UZIA L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    UZIA L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIA L 1 A_WeaponReady
    goto Ready+12
    UZIF F 0 A_JumpIfInventory("Reloading",1,"Reload")    
    UZIF F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    UZIF F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIF F 1 A_WeaponReady(WRF_NOBOB)
    goto Ready+18
  Deselect:
    UZIA K 0 A_TakeInventory("Aiming",1)
    UZIA K 0 ACS_ExecuteAlways(602,0,0,0,0)
    SPSA L 0 A_TakeInventory("Reloading",1)
    INTA L 0 A_ZoomFactor(1.0)
    UZIA K 0 A_Lower
    UZIA K 1 A_Lower
    goto Deselect+2
  Select:
    UZIA A 0 A_Raise
	UZIA A 0 ACS_ExecuteAlways(602,0,0,0,0)
	TNT1 F 0 A_GiveInventory("InCombatCrosshair", 35)
    loop
  Fire:	
    UZIA A 0 A_JumpIfInventory("Aiming",1,"FireAim")
    UZIA K 0 A_JumpIfNoAmmo("ReloadStart")
    UZIB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    UZIB A 0 A_PlayWeaponSound("uzi/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    UZIB A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,13,0)
    UZIB A 1 BRIGHT A_FireBullets (8.0, 8.0, -1, 7, "HHBulletPuff", 1, 6000)
    UZIB B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    UZIB A 0 A_JumpIfNoAmmo("FireEmpty")
    UZIB B 1 BRIGHT A_GunFlash
    UZIB C 0
    UZIB A 0 A_JumpIfInventory("MiniUziAmmo",1,2)
    UZIB A 0 A_ReFire
    goto Ready+12
    UZIB A 0 A_JumpIfNoAmmo("ReloadStart")
    UZIB A 0 A_ReFire
    goto Ready+12
  Hold:
    UZIB A 0 A_JumpIfInventory("Aiming",1,"HoldAim")
    UZIB A 0 A_JumpIfNoAmmo("ReloadStart")
    UZIB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    UZIB A 0 A_PlayWeaponSound("uzi/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    UZIB A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,13,0)
    UZIB A 1 BRIGHT A_FireBullets (12.0, 12.0, -1, 7, "HHBulletPuff", 1, 6000)
    UZIB B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    UZIB A 0 A_JumpIfNoAmmo("FireEmpty")
    UZIB B 1 BRIGHT A_GunFlash
    UZIB C 0
    UZIB A 0 A_JumpIfInventory("MiniUziAmmo",1,2)
    UZIB A 0 A_ReFire
    goto Ready+12
    UZIB A 0 A_JumpIfNoAmmo("ReloadStart")
    UZIB A 0 A_ReFire
    goto Ready+12
  FireEmpty:
    UZIB B 1 BRIGHT A_GunFlash
    UZIB C 1 A_GiveInventory("MiniUziBolt",1)
    UZIB A 0 A_JumpIfInventory("MiniUziAmmo",1,2)
    UZIB A 0 A_ReFire
    goto Ready+12
    UZIB A 0 A_JumpIfNoAmmo("ReloadStart")
    UZIB A 0 A_ReFire
    goto Ready+12
  FireAim:
    UZIF A 0 A_PlayWeaponSound("uzi/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    UZIF A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,3)
    UZIF G 1 BRIGHT A_FireBullets (1.5, 1.5, -1, 7, "HHBulletPuff", 1, 6000)
    UZIF G 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    UZIF G 0 A_JumpIfNoAmmo("FireAimEmpty")
    UZIF H 1 BRIGHT A_GunFlash
    UZIF I 0
    UZIF A 0 A_JumpIfInventory("MiniUziAmmo",1,2)
    UZIF A 0 A_ReFire
    goto Ready+18
    UZIF A 0 A_JumpIfNoAmmo("ReloadStart")
    UZIF A 0 A_ReFire
    goto Ready+18
  HoldAim:
    UZIF A 0 A_PlayWeaponSound("uzi/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    UZIF A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,3)
    UZIF G 1 BRIGHT A_FireBullets (5.0, 5.0, -1, 7, "HHBulletPuff", 1, 6000)
    UZIF G 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    UZIF G 0 A_JumpIfNoAmmo("FireAimEmpty")
    UZIF H 1 BRIGHT A_GunFlash
    UZIF I 0
    UZIF A 0 A_JumpIfInventory("MiniUziAmmo",1,2)
    UZIF A 0 A_ReFire
    goto Ready+18
    UZIF A 0 A_JumpIfNoAmmo("ReloadStart")
    UZIF A 0 A_ReFire
    goto Ready+18
  FireAimEmpty:
    UZIF H 1 BRIGHT A_GunFlash
    UZIF I 1 A_GiveInventory("MiniUziBolt",1)
    UZIF A 0 A_JumpIfInventory("MiniUziAmmo",1,2)
    UZIF A 0 A_ReFire
    goto Ready+18
    UZIF A 0 A_JumpIfNoAmmo("ReloadStart")
    UZIF A 0 A_ReFire
    goto Ready+18
  Reload: //AltFire:
    UZIC A 0 A_JumpIfInventory("MiniUziAmmo",1,"ReloadStart")
    UZIC A 0 A_TakeInventory("Reloading",1)
    goto Ready+15
  ReloadStart:
  	TNT1 A 0 ACS_ExecuteAlways(652,0,0,0,0) // Shout "Reloading" 
    UZIC A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    UZIC A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    UZIC BCDEF 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIC G 3 A_PlaySoundEx("uzi/clipout","SoundSlot5")
    UZIC HIJKLMN 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIC OPQRSTU 3 A_WeaponReady(WRF_NOFIRE)
    UZIC V 3 A_TakeInventory("Reloading",1)
    UZIC W 3 A_PlayWeaponSound("uzi/clipin")
    goto ReloadAmmo
  ReloadAmmo:
    UZIC P 0 A_GiveInventory("MiniUziClip",1)
    UZIC P 0 A_TakeInventory("MiniUziAmmo",1)
    UZIC P 0 A_JumpIfInventory("MiniUziClip",32,"ReloadEnd")
    UZIC P 0 A_JumpIfInventory("MiniUziAmmo",1,"ReloadAmmo")
    goto ReloadEnd
  ReloadEnd:
    UZIC XYZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID AB 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID Q 3 A_JumpIfInventory("MiniUziBolt",1,"ReloadEndBolt")
    UZID RP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID P 0 A_ReFire
    goto Ready+12
  ReloadEndBolt:
    UZID C 3 A_TakeInventory("MiniUziBolt",1)
    UZID DE 3 A_WeaponReady(WRF_NOFIRE)
    UZID F 3 A_PlayWeaponSound("uzi/bolt")
    UZID GHIJKLMNOP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID B 0 A_ReFire
    goto Ready+12
  AltFire:
    U45F A 0 A_ZoomFactor(1.2)
    UZIF A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    UZIF ABCDEF 1
    UZIF G 0 A_GiveInventory("Aiming",1)
    UZIF G 0 ACS_ExecuteAlways(602,0,0,0,0)
    UZIF G 0 A_Refire
    goto Ready+18
  AltFire2:
    U45F A 0 A_ZoomFactor(1.0)
    UZIF FEDCBA 1
    UZIF A 0 A_TakeInventory("Aiming",1)
    UZIF A 0 ACS_ExecuteAlways(602,0,0,0,0)
    UZIF G 0 A_Refire
    goto Ready+12
  AltHold:
    UZIA L 1 A_JumpIfInventory("Aiming",1,"AltHoldAim")
    UZIA L 1 A_ReFire
    goto Ready+12
  AltHoldAim:
    UZIF F 1
    UZIF F 1 A_ReFire
    goto Ready+18
  ReloadStartAim:
    U45F A 0 A_ZoomFactor(1.0)
    UZIF FEDCBA 1
    UZIF A 0 A_TakeInventory("Aiming",1)
    UZIF 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 K 15
    WEAP K 0 A_SpawnItemEx("MiniUziPickup")
    stop
  Fire_SteadyAim:
    UZIB A 0 A_PlayWeaponSound("uzi/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    UZIB A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,13,0)
    UZIB A 1 BRIGHT A_FireBullets (5.28, 5.28, -1, 7, "HHBulletPuff", 1, 6000)
    UZIB B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    UZIB A 0 A_JumpIfNoAmmo("FireEmpty")
    UZIB B 1 BRIGHT A_GunFlash
    UZIB C 0
    UZIB A 0 A_JumpIfInventory("MiniUziAmmo",1,2)
    VECB A 0 A_ReFire
    goto Ready+12
    UZIB A 0 A_JumpIfNoAmmo("ReloadStart")
    UZIB A 0 A_ReFire
    goto Ready+12
  Hold_SteadyAim:
    UZIB A 0 A_PlayWeaponSound("uzi/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    UZIB A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,13,0)
    UZIB A 1 BRIGHT A_FireBullets (7.92, 7.92, -1, 7, "HHBulletPuff", 1, 6000)
    UZIB B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    UZIB A 0 A_JumpIfNoAmmo("FireEmpty")
    UZIB B 1 BRIGHT A_GunFlash
    UZIB C 0
    UZIB A 0 A_JumpIfInventory("MiniUziAmmo",1,2)
    UZIB A 0 A_ReFire
    goto Ready+12
    UZIB A 0 A_JumpIfNoAmmo("ReloadStart")
    UZIB A 0 A_ReFire
    goto Ready+12
  ReloadStart_SOH:
    UZIC A 2 
    UZIC BCDEF 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIC G 2 A_PlaySoundEx("uzi/clipout","SoundSlot5")
    UZIC HIJKLMNOPQRSTU 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIC V 2 A_TakeInventory("Reloading",1)
    UZIC W 2 A_PlayWeaponSound("uzi/clipin")
    goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    UZIC P 0 A_GiveInventory("MiniUziClip",1)
    UZIC P 0 A_TakeInventory("MiniUziAmmo",1)
    UZIC P 0 A_JumpIfInventory("MiniUziClip",32,"ReloadEnd_SOH")
    UZIC P 0 A_JumpIfInventory("MiniUziAmmo",1,"ReloadAmmo_SOH")
    goto ReloadEnd_SOH
  ReloadEnd_SOH:
    UZIC XYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID AB 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID Q 2 A_JumpIfInventory("MiniUziBolt",1,"ReloadEndBolt_SOH")
    UZID RP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID P 0 A_ReFire
    goto Ready+12
  ReloadEndBolt_SOH:
    UZID C 2 A_TakeInventory("MiniUziBolt",1)
    UZID DE 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID F 2 A_PlayWeaponSound("uzi/bolt")
    UZID GHIJKLMNOP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID B 0 A_ReFire
    goto Ready+12
  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 MiniUziClip : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 32
    ammo.backpackamount 0
    ammo.backpackmaxamount 32
    +IGNORESKILL
}

actor MiniUziBolt : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}
actor "Mini-UZI Ex Mags" : "Mini-UZI"
{
  obituary "%k sprayed %o with the Mini-UZI."
  inventory.pickupmessage "Mini-UZI"  
  //attacksound "ump45/fire6"
  weapon.selectionorder 13
  weapon.ammotype "MiniUziClip2"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "MiniUziAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Reload: //AltFire:
    UZIC A 0 A_JumpIfInventory("MiniUziAmmo",1,"ReloadStart")
    UZIC A 0 A_TakeInventory("Reloading",1)
    goto Ready+15
  ReloadStart:
  	TNT1 A 0 ACS_ExecuteAlways(652,0,0,0,0) // Shout "Reloading" 
    UZIC A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    UZIC A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    UZIC BCDEF 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIC G 3 A_PlaySoundEx("uzi/clipout","SoundSlot5")
    UZIC HIJKLMN 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIC OPQRSTU 3 A_WeaponReady(WRF_NOFIRE)
    UZIC V 3 A_TakeInventory("Reloading",1)
    UZIC W 3 A_PlayWeaponSound("uzi/clipin")
    goto ReloadAmmo
  ReloadAmmo:
    UZIC P 0 A_GiveInventory("MiniUziClip2",1)
    UZIC P 0 A_TakeInventory("MiniUziAmmo",1)
    UZIC P 0 A_JumpIfInventory("MiniUziClip2",48,"ReloadEnd")
    UZIC P 0 A_JumpIfInventory("MiniUziAmmo",1,"ReloadAmmo")
    goto ReloadEnd
  ReloadEnd:
    UZIC XYZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID AB 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID Q 3 A_JumpIfInventory("MiniUziBolt",1,"ReloadEndBolt")
    UZID RP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID P 0 A_ReFire
    goto Ready+12
  ReloadEndBolt:
    UZID C 3 A_TakeInventory("MiniUziBolt",1)
    UZID DE 3 A_WeaponReady(WRF_NOFIRE)
    UZID F 3 A_PlayWeaponSound("uzi/bolt")
    UZID GHIJKLMNOP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID B 0 A_ReFire
    goto Ready+12
  ReloadStart_SOH:
    UZIC A 2 
    UZIC BCDEF 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIC G 2 A_PlaySoundEx("uzi/clipout","SoundSlot5")
    UZIC HIJKLMNOPQRSTU 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIC V 2 A_TakeInventory("Reloading",1)
    UZIC W 2 A_PlayWeaponSound("uzi/clipin")
    goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    UZIC P 0 A_GiveInventory("MiniUziClip2",1)
    UZIC P 0 A_TakeInventory("MiniUziAmmo",1)
    UZIC P 0 A_JumpIfInventory("MiniUziClip2",48,"ReloadEnd_SOH")
    UZIC P 0 A_JumpIfInventory("MiniUziAmmo",1,"ReloadAmmo_SOH")
    goto ReloadEnd_SOH
  ReloadEnd_SOH:
    UZIC XYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID AB 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID Q 2 A_JumpIfInventory("MiniUziBolt",1,"ReloadEndBolt_SOH")
    UZID RP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID P 0 A_ReFire
    goto Ready+12
  ReloadEndBolt_SOH:
    UZID C 2 A_TakeInventory("MiniUziBolt",1)
    UZID DE 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID F 2 A_PlayWeaponSound("uzi/bolt")
    UZID GHIJKLMNOP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZID B 0 A_ReFire
    goto Ready+12
  ReloadStartAim:
    U45F A 0 A_ZoomFactor(1.0)
    UZIF FEDCBA 1
    UZIF A 0 A_TakeInventory("Aiming",1)
    UZIF A 0 ACS_ExecuteAlways(602,0,0,0,0)
    goto ReloadStart+1
  }
}

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

actor MiniUziExMags : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}
actor "Mini-UZI Akimbo" : RGUWeapon
{
  obituary "%k sprayed %o with the Mini-UZI."
  inventory.pickupmessage "Mini-UZI"  
  //attacksound "ump45/fire6"
  weapon.selectionorder 13
  weapon.ammotype "MiniUziClip3"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "MiniUziAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    UZIG A 2 //A_PlayWeaponSound("m9/select")
    UZIG BCDEFGHIJKK 2 A_WeaponReady(WRF_NOPRIMARY)
    UZIG L 0 A_JumpIfNoAmmo("Reload")
    UZIG L 0 A_JumpIfInventory("Aiming",1,5)
    UZIG L 0 A_JumpIfInventory("Reloading",1,"Reload")
    UZIG L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    UZIG L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIG K 1 A_WeaponReady
    goto Ready+12
  Deselect:
    UZIG K 0 A_TakeInventory("Aiming",1)
    UZIG K 0 ACS_ExecuteAlways(602,0,0,0,0)
    UZIG L 0 A_TakeInventory("Reloading",1)
    UZIG L 0 A_ZoomFactor(1.0)
    UZIG K 0 A_Lower
    UZIG K 1 A_Lower
    goto Deselect+2
  Select:
    UZIG A 0 A_Raise
	UZIG A 0 ACS_ExecuteAlways(602,0,0,0,0)
	TNT1 F 0 A_GiveInventory("InCombatCrosshair", 35)
    loop
  Fire:	
    UZIG K 0 A_JumpIfNoAmmo("ReloadStart")
    UZIG A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    UZIH A 0 A_PlayWeaponSound("uzi/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    UZIH A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,18,-3)
    UZIH A 1 BRIGHT A_FireBullets (7.0, 7.0, -1, 8, "HHBulletPuff", 1, 6000)
    UZIH BB 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    UZIH A 0 A_JumpIfNoAmmo("FireEmpty")
    UZIH A 0 A_PlaySoundEx("uzi/fire","SoundSlot5")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    UZIH A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,-20,0)
    UZIH B 1 BRIGHT A_FireBullets (7.0, 7.0, -1, 7, "HHBulletPuff", 1, 6000)
    UZIH A 0 A_JumpIfNoAmmo("FireEmpty")
    UZIH C 0 A_GunFlash
    UZIH A 0 A_JumpIfInventory("MiniUziAmmo",1,3)
    UZIH CD 1 A_ReFire
    goto Ready+12
    UZIH A 0 A_JumpIfNoAmmo("ReloadStart")
    UZIH CD 1 A_ReFire
    goto Ready+12
  Hold:
    UZIG K 0 A_JumpIfNoAmmo("ReloadStart")
    UZIG A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    UZIH A 0 A_PlayWeaponSound("uzi/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    UZIH A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,18,-3)
    UZIH A 1 BRIGHT A_FireBullets (12.0, 12.0, -1, 8, "HHBulletPuff", 1, 6000)
    UZIH BB 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    UZIH A 0 A_JumpIfNoAmmo("FireEmpty")
    UZIH A 0 A_PlaySoundEx("uzi/fire","SoundSlot5")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    UZIH A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,-20,0)
    UZIH B 1 BRIGHT A_FireBullets (12.0, 12.0, -1, 7, "HHBulletPuff", 1, 6000)
    UZIH A 0 A_JumpIfNoAmmo("FireEmpty")
    UZIH C 0 A_GunFlash
    UZIH A 0 A_JumpIfInventory("MiniUziAmmo",1,3)
    UZIH CD 1 A_ReFire
    goto Ready+12
    UZIH A 0 A_JumpIfNoAmmo("ReloadStart")
    UZIH CD 1 A_ReFire
    goto Ready+12
  FireEmpty:
    UZIH B 1 BRIGHT A_GunFlash
    UZIH CD 1 A_GiveInventory("MiniUziBolt",1)
    UZIH A 0 A_JumpIfInventory("MiniUziAmmo",1,2)
    UZIH A 0 A_ReFire
    goto Ready+12
    UZIH A 0 A_JumpIfNoAmmo("ReloadStart")
    UZIH A 0 A_ReFire
    goto Ready+12
  Reload: //AltFire:
    UZIJ A 0 A_JumpIfInventory("MiniUziAmmo",1,"ReloadStart")
    UZIJ A 0 A_TakeInventory("Reloading",1)
    goto Ready+15
  ReloadStart:
  	TNT1 A 0 ACS_ExecuteAlways(652,0,0,0,0) // Shout "Reloading" 
    UZIJ A 0 
    UZIJ A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    UZIJ BCDEF 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIJ G 3 A_PlaySoundEx("uzi/clipout","SoundSlot5")
    UZIJ HIJKLMN 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIJ OPQRSTU 3 A_WeaponReady(WRF_NOFIRE)
    UZIJ V 3 A_TakeInventory("Reloading",1)
    UZIJ W 3 A_PlayWeaponSound("uzi/clipin")
    goto ReloadAmmo
  ReloadAmmo:
    UZIJ P 0 A_GiveInventory("MiniUziClip3",1)
    UZIJ P 0 A_TakeInventory("MiniUziAmmo",1)
    UZIJ P 0 A_JumpIfInventory("MiniUziClip3",64,"ReloadEnd")
    UZIJ P 0 A_JumpIfInventory("MiniUziAmmo",1,"ReloadAmmo")
    goto ReloadEnd
  ReloadEnd:
    UZIG A 3 A_JumpIfInventory("MiniUziBolt",1,"ReloadEndBolt")
    UZIG BCDEF 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIG GHIJK 3 A_WeaponReady(WRF_NOFIRE)
    UZIG P 0 A_ReFire
    goto Ready+12
  ReloadEndBolt:
    UZIJ W 3 A_TakeInventory("MiniUziBolt",1)
    UZIJ WW 3 A_WeaponReady(WRF_NOFIRE)
    UZIG A 3 A_PlayWeaponSound("uzi/bolt")
    UZIG BCDEF 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIG GHIJK 3 A_WeaponReady(WRF_NOFIRE)
    UZID B 0 A_ReFire
    goto Ready+12
  AltFire:
    UZIG K 5
    goto Ready+12
  ReloadStart_SOH:
    UZIJ A 2 
    UZIJ BCDEF 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIJ G 2 A_PlaySoundEx("uzi/clipout","SoundSlot5")
    UZIJ HIJKLMN 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIJ OPQRSTU 2 A_WeaponReady(WRF_NOFIRE)
    UZIJ V 2 A_TakeInventory("Reloading",1)
    UZIJ W 2 A_PlayWeaponSound("uzi/clipin")
    goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    UZIJ P 0 A_GiveInventory("MiniUziClip3",1)
    UZIJ P 0 A_TakeInventory("MiniUziAmmo",1)
    UZIJ P 0 A_JumpIfInventory("MiniUziClip3",64,"ReloadEnd_SOH")
    UZIJ P 0 A_JumpIfInventory("MiniUziAmmo",1,"ReloadAmmo_SOH")
    goto ReloadEnd_SOH
  ReloadEnd_SOH:
    UZIG A 2 A_JumpIfInventory("MiniUziBolt",1,"ReloadEndBolt_SOH")
    UZIG BCDEF 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIG GHIJK 2 A_WeaponReady(WRF_NOFIRE)
    UZIG P 0 A_ReFire
    goto Ready+12
  ReloadEndBolt_SOH:
    UZIJ W 3 A_TakeInventory("MiniUziBolt",1)
    UZIJ WW 3 A_WeaponReady(WRF_NOFIRE)
    UZIG A 3 A_PlayWeaponSound("uzi/bolt")
    UZIG BCDEF 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    UZIG GHIJK 3 A_WeaponReady(WRF_NOFIRE)
    UZID B 0 A_ReFire
    goto Ready+12
  Fire_SteadyAim:
    UZIH A 0 A_PlayWeaponSound("uzi/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    UZIH A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,18,-3)
    UZIH A 1 BRIGHT A_FireBullets (4.0, 4.0, -1, 8, "HHBulletPuff", 1, 6000)
    UZIH BB 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    UZIH A 0 A_JumpIfNoAmmo("FireEmpty")
    UZIH A 0 A_PlaySoundEx("uzi/fire","SoundSlot5")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    UZIH A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,-20,0)
    UZIH B 1 BRIGHT A_FireBullets (4.0, 4.0, -1, 7, "HHBulletPuff", 1, 6000)
    UZIH A 0 A_JumpIfNoAmmo("FireEmpty")
    UZIH C 0 A_GunFlash
    UZIH A 0 A_JumpIfInventory("MiniUziAmmo",1,3)
    UZIH CD 1 A_ReFire
    goto Ready+12
    UZIH A 0 A_JumpIfNoAmmo("ReloadStart")
    UZIH CD 1 A_ReFire
    goto Ready+12
  Hold_SteadyAim:
    UZIH A 0 A_PlayWeaponSound("uzi/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    UZIH A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,18,-3)
    UZIH A 1 BRIGHT A_FireBullets (8.0, 8.0, -1, 8, "HHBulletPuff", 1, 6000)
    UZIH BB 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    UZIH A 0 A_JumpIfNoAmmo("FireEmpty")
    UZIH A 0 A_PlaySoundEx("uzi/fire","SoundSlot5")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    UZIH A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,-20,0)
    UZIH B 1 BRIGHT A_FireBullets (8.0, 8.0, -1, 7, "HHBulletPuff", 1, 6000)
    UZIH A 0 A_JumpIfNoAmmo("FireEmpty")
    UZIH C 0 A_GunFlash
    UZIH A 0 A_JumpIfInventory("MiniUziAmmo",1,3)
    UZIH CD 1 A_ReFire
    goto Ready+12
    UZIH A 0 A_JumpIfNoAmmo("ReloadStart")
    UZIH CD 1 A_ReFire
    goto Ready+12
  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 MiniUziClip3 : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 64
    ammo.backpackamount 0
    ammo.backpackmaxamount 64
    +IGNORESKILL
}

actor MiniUziAkimbo : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}
actor MiniUziPickup : CustomInventory
{
  inventory.pickupmessage "Mini-UZI"  
  inventory.pickupsound "misc/w_pkup"
  +INVENTORY.AUTOACTIVATE
  inventory.respawntics 35
  scale 0.15
  States
  {
  Spawn:
    WEAP K -1
    stop
  Pickup:
    JDGP A 0
    JDGP A 0 A_JumpIfInventory("Mini-UZI",1,"FailPickup") // If the player already has this weapon, they get more ammo for it
    JDGP A 0 A_JumpIfInventory("Mini-UZI Akimbo",1,"FailPickup")
    JDGP A 0 A_JumpIfInventory("Mini-UZI Ex Mags",1,"FailPickup")
    JDGP A 0 A_JumpIfInventory("MaxWeaponsFilled",0,"FailPickup2")
    BKPK A 0 ACS_ExecuteWithResult(618,11,0,0)
    stop
  AmmoPickup:
    JDGP A 0
    JDGP A 0 A_JumpIfInventory("MiniUziAmmo",0,"FailPickup")
    JDGP A 0 A_GiveInventory("MiniUziAmmo",32)
    stop
  FailPickup:
    WEAP K 1
    fail
  FailPickup2:
    WEAP K 1 
    BKPK A 0 ACS_ExecuteAlways(620,0,0,0,0)
    fail
  }
}

