actor "M93 Raffica" : RGUWeapon
{
  obituary "%k capped %o with the M93 Raffica."
  inventory.pickupmessage "M93R"  
  //attacksound "u45/fire6"
  weapon.selectionorder 19
  weapon.ammotype "M93RClip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "M93RAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Ready:
    M93A A 2 //A_PlayWeaponSound("m9/select")
    M93A BCDEFGH 2 A_WeaponReady(WRF_NOPRIMARY)
    M93A H 0 A_JumpIfNoAmmo("Reload")
    M93A H 0 A_JumpIfInventory("Aiming",1,5)
    M93A H 0 A_JumpIfInventory("Reloading",1,"Reload")
    M93A H 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    M93A H 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93A H 1 A_WeaponReady
    goto Ready+8
    M93C E 0 A_JumpIfInventory("Reloading",1,"Reload")    
    M93C E 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    M93C E 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93C E 1 A_WeaponReady(WRF_NOBOB)
    goto Ready+14
  Deselect:
    M93A H 0 A_TakeInventory("Aiming",1)
    M93A H 0 ACS_ExecuteAlways(602,0,0,0,0)
    M93A H 0 A_TakeInventory("Reloading",1)
    M93A H 0 A_ZoomFactor(1.0)
    M93A H 0 A_Lower
    M93A H 1 A_Lower
    goto Deselect+2
  Select:
    M93A A 0 A_Raise
	M93A A 0 ACS_ExecuteAlways(602,0,0,0,0)
	TNT1 F 0 A_GiveInventory("InCombatCrosshair", 35)
    loop
  Fire:	
    M93A A 0 A_JumpIfInventory("Aiming",1,"FireAim")
    M93A H 1 A_JumpIfNoAmmo("ReloadStart")
    M93B A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    M93B A 0 A_PlayWeaponSound("m93r/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    M93B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,8,3)
    M93B A 1 BRIGHT A_FireBullets (10.0, 10.0, -1, 11, "HHBulletPuff", 1, 4000)
    M93B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    M93B A 0 A_JumpIfNoAmmo("FireEmpty")
    M93B B 1 BRIGHT A_GunFlash
    M93B A 0 A_PlayWeaponSound("m93r/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    M93B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,8,3)
    M93B A 1 BRIGHT A_FireBullets (10.0, 10.0, -1, 11, "HHBulletPuff", 1, 4000)
    M93B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    M93B A 0 A_JumpIfNoAmmo("FireEmpty")
    M93B B 1 BRIGHT A_GunFlash
    M93B A 0 A_PlayWeaponSound("m93r/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    M93B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,8,3)
    M93B A 1 BRIGHT A_FireBullets (10.0, 10.0, -1, 11, "HHBulletPuff", 1, 4000)
    M93B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    M93B A 0 A_JumpIfNoAmmo("FireEmpty")
    M93B B 1 BRIGHT A_GunFlash
    M93B CDEF 1
    M93B A 0 A_JumpIfInventory("M93RAmmo",1,2)
    M93B A 0 A_ReFire
    goto Ready+8
    M93B A 0 A_JumpIfNoAmmo("ReloadStart")
    M93B A 0 A_ReFire
    goto Ready+8
  FireEmpty:
    M93B B 1 BRIGHT A_GunFlash
    M93B C 1 BRIGHT A_PlaySound("m9/lock")
    M93B DEF 1
    M93B F 1 A_GiveInventory("M93RBolt",1)
    M93B A 0 A_JumpIfInventory("M93RAmmo",1,2)
    M93B A 0 A_ReFire
    goto Ready+8
    M93B A 0 A_JumpIfNoAmmo("ReloadStart")
    M93B A 0 A_ReFire
    goto Ready+8
  Hold:
    M93A H 3 A_JumpIfInventory("Aiming",1,"HoldAim")
    M93A H 1 A_ReFire
    goto Ready+8
  HoldAim:
    M93C E 3
    M93C E 1 A_ReFire
    goto Ready+14
  FireAim:
    M93C E 1 A_JumpIfNoAmmo("ReloadStart")
    M93D A 0 A_PlayWeaponSound("m93r/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    M93D A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,8)
    M93D A 1 BRIGHT A_FireBullets (2, 2, -1, 11, "HHBulletPuff", 1, 4000)
    M93D B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    M93D A 0 A_JumpIfNoAmmo("FireAimEmpty")
    M93D B 1 BRIGHT A_GunFlash
    M93D A 0 A_PlayWeaponSound("m93r/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    M93D A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,8)
    M93D A 1 BRIGHT A_FireBullets (3, 3, -1, 11, "HHBulletPuff", 1, 4000)
    M93D B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    M93D A 0 A_JumpIfNoAmmo("FireAimEmpty")
    M93D B 1 BRIGHT A_GunFlash
    M93D A 0 A_PlayWeaponSound("m93r/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    M93D A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,8)
    M93D A 1 BRIGHT A_FireBullets (3, 3, -1, 11, "HHBulletPuff", 1, 4000)
    M93D B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    M93D A 0 A_JumpIfNoAmmo("FireAimEmpty")
    M93D B 1 BRIGHT A_GunFlash
    M93D CDE 1
    M93C E 1
    M93D A 0 A_JumpIfInventory("M93RAmmo",1,2)
    M93D A 0 A_ReFire
    goto Ready+8
    M93D A 0 A_JumpIfNoAmmo("ReloadStart")
    M93D A 0 A_ReFire
    goto Ready+8
  FireAimEmpty:
    M93D B 1 BRIGHT A_GunFlash
    M93D C 1 BRIGHT A_PlaySound("m9/lock")
    M93D DE 1
    M93C E 1
    M93C E 1 A_GiveInventory("M93RBolt",1)
    M93D A 0 A_JumpIfInventory("M93RAmmo",1,2)
    M93D A 0 A_ReFire
    goto Ready+8
    M93D A 0 A_JumpIfNoAmmo("ReloadStart")
    M93D A 0 A_ReFire
    goto Ready+8
  Reload: //AltFire:
    VECC A 0 A_JumpIfInventory("M93RAmmo",1,"ReloadStart")
    VECC A 0 A_TakeInventory("Reloading",1)
    goto Ready+11
  ReloadStart:
  	TNT1 A 0 ACS_ExecuteAlways(652,0,0,0,0) // Shout "Reloading" 
    M93E A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    M93E A 0 A_JumpIfInventory("M93RBolt",1,"ReloadStartBolt") 
    M93E A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    M93E ABCDE 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93E F 3 A_PlaySoundEx("m93r/clipout","SoundSlot5")
    M93E GHIJKLMN 3 A_WeaponReady(WRF_NOFIRE)
    M93E O 0 A_PlaySoundEx("m93r/clipin","SoundSlot5")
    M93E O 3 A_TakeInventory("Reloading",1)
    goto ReloadAmmo
  ReloadAmmo:
    M93E Z 0 A_GiveInventory("M93RClip",1)
    M93E Z 0 A_TakeInventory("M93RAmmo",1)
    M93E Z 0 A_JumpIfInventory("M93RClip",20,"ReloadEnd")
    M93E Z 0 A_JumpIfInventory("M93RAmmo",1,"ReloadAmmo")
    goto ReloadEnd
  ReloadEnd:
    M93E PQRS 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93E TUV 3 A_WeaponReady(WRF_NOFIRE)
    M93E G 0 A_ReFire
    goto Ready+8  
  ReloadStartBolt:
    M93F A 0 A_TakeInventory("M93RBolt",1) 
    M93F A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStartBolt_SOH")
    M93F ABCDE 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93F F 3 A_PlaySoundEx("m93r/clipout","SoundSlot5")
    M93F GHIJKLMN 3 A_WeaponReady(WRF_NOFIRE)
    M93F O 0 A_PlaySoundEx("m93r/clipin","SoundSlot5")
    M93F O 3 A_TakeInventory("Reloading",1)
    goto ReloadAmmoBolt
  ReloadAmmoBolt:
    M93F Z 0 A_GiveInventory("M93RClip",1)
    M93F Z 0 A_TakeInventory("M93RAmmo",1)
    M93F Z 0 A_JumpIfInventory("M93RClip",20,"ReloadEndBolt")
    M93F Z 0 A_JumpIfInventory("M93RAmmo",1,"ReloadAmmoBolt")
    goto ReloadEndBolt
  ReloadEndBolt:
    M93F PQR 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93F S 3 A_PlaySoundEx("m93r/bolt","SoundSlot5")
    M93F TUVW 3 A_WeaponReady(WRF_NOFIRE)
    M93F G 0 A_ReFire
    goto Ready+8  
  AltFire:
    M93C A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    M93C A 0 A_ZoomFactor(1.2)
    M93C ABCDE 1
    M93C G 0 A_GiveInventory("Aiming",1)
    M93C G 0 ACS_ExecuteAlways(602,0,0,0,0)
    goto Ready+14
  AltFire2:
    M93C E 1 A_ZoomFactor(1.0)
    M93C EDCBA 1
    M93C A 0 A_TakeInventory("Aiming",1)
    M93C A 0 ACS_ExecuteAlways(602,0,0,0,0)
    goto Ready+8
  ReloadStartAim:
    M93C E 1 A_ZoomFactor(1.0)
    M93C EDCBA 1
    M93C A 0 A_TakeInventory("Aiming",1)
    M93C 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 X 15 
    WEAP A 0 A_SpawnItem("M93RPickup")
    stop
  Fire_SteadyAim:
    M93B A 0 A_PlayWeaponSound("m93r/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    M93B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,8,3)
    M93B A 1 BRIGHT A_FireBullets (6.6, 6.6, -1, 11, "HHBulletPuff", 1, 4000)
    M93B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    M93B A 0 A_JumpIfNoAmmo("FireEmpty")
    M93B B 1 BRIGHT A_GunFlash
    M93B A 0 A_PlayWeaponSound("m93r/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    M93B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,8,3)
    M93B A 1 BRIGHT A_FireBullets (6.6, 6.6, -1, 11, "HHBulletPuff", 1, 4000)
    M93B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    M93B A 0 A_JumpIfNoAmmo("FireEmpty")
    M93B B 1 BRIGHT A_GunFlash
    M93B A 0 A_PlayWeaponSound("m93r/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    M93B A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,8,3)
    M93B A 1 BRIGHT A_FireBullets (6.6, 6.6, -1, 11, "HHBulletPuff", 1, 4000)
    M93B B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    M93B A 0 A_JumpIfNoAmmo("FireEmpty")
    M93B B 1 BRIGHT A_GunFlash
    M93B CDEF 1
    M93B A 0 A_JumpIfInventory("M93RAmmo",1,2)
    M93B A 0 A_ReFire
    goto Ready+8
    M93B A 0 A_JumpIfNoAmmo("ReloadStart")
    M93B A 0 A_ReFire
    goto Ready+8
  ReloadStart_SOH:
    M93E ABCDE 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93E F 2 A_PlaySoundEx("m93r/clipout","SoundSlot5")
    M93E GHIJKLMN 2 A_WeaponReady(WRF_NOFIRE)
    M93E O 0 A_PlaySoundEx("m93r/clipin","SoundSlot5")
    M93E O 2 A_TakeInventory("Reloading",1)
    goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    M93E Z 0 A_GiveInventory("M93RClip",1)
    M93E Z 0 A_TakeInventory("M93RAmmo",1)
    M93E Z 0 A_JumpIfInventory("M93RClip",20,"ReloadEnd_SOH")
    M93E Z 0 A_JumpIfInventory("M93RAmmo",1,"ReloadAmmo_SOH")
    goto ReloadEnd_SOH
  ReloadEnd_SOH:
    M93E PQRS 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93E TUV 2 A_WeaponReady(WRF_NOFIRE)
    M93E G 0 A_ReFire
    goto Ready+8  
  ReloadStartBolt_SOH:
    M93F ABCDE 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93F F 2 A_PlaySoundEx("m93r/clipout","SoundSlot5")
    M93F GHIJKLMN 2 A_WeaponReady(WRF_NOFIRE)
    M93F O 0 A_PlaySoundEx("m93r/clipin","SoundSlot5")
    M93F O 2 A_TakeInventory("Reloading",1)
    goto ReloadAmmoBolt_SOH
  ReloadAmmoBolt_SOH:
    M93F Z 0 A_GiveInventory("M93RClip",1)
    M93F Z 0 A_TakeInventory("M93RAmmo",1)
    M93F Z 0 A_JumpIfInventory("M93RClip",20,"ReloadEndBolt_SOH")
    M93F Z 0 A_JumpIfInventory("M93RAmmo",1,"ReloadAmmoBolt_SOH")
    goto ReloadEndBolt_SOH
  ReloadEndBolt_SOH:
    M93F PQR 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93F S 2 A_PlaySoundEx("m93r/bolt","SoundSlot5")
    M93F TUVW 2 A_WeaponReady(WRF_NOFIRE)
    M93F G 0 A_ReFire
    goto Ready+8  
  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 M93RBolt : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}
actor M93RClip : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 20
    ammo.backpackamount 0
    ammo.backpackmaxamount 20
    +IGNORESKILL
}
actor "M93 Raffica Ex Mags" : "M93 Raffica"
{
  obituary "%k capped %o with the M93 Raffica."
  inventory.pickupmessage "M93R"  
  //attacksound "u45/fire6"
  weapon.selectionorder 19
  weapon.ammotype "M93RClip2"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "M93RAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Reload: //AltFire:
    VECC A 0 A_JumpIfInventory("M93RAmmo",1,"ReloadStart")
    VECC A 0 A_TakeInventory("Reloading",1)
    goto Ready+11
  ReloadStart:
  	TNT1 A 0 ACS_ExecuteAlways(652,0,0,0,0) // Shout "Reloading" 
    M93E A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    M93E A 0 A_JumpIfInventory("M93RBolt",1,"ReloadStartBolt") 
    M93E A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    M93E ABCDE 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93E F 3 A_PlaySoundEx("m93r/clipout","SoundSlot5")
    M93E GHIJKLMN 3 A_WeaponReady(WRF_NOFIRE)
    M93E O 0 A_PlaySoundEx("m93r/clipin","SoundSlot5")
    M93E O 3 A_TakeInventory("Reloading",1)
    goto ReloadAmmo
  ReloadAmmo:
    M93E Z 0 A_GiveInventory("M93RClip2",1)
    M93E Z 0 A_TakeInventory("M93RAmmo",1)
    M93E Z 0 A_JumpIfInventory("M93RClip2",30,"ReloadEnd")
    M93E Z 0 A_JumpIfInventory("M93RAmmo",1,"ReloadAmmo")
    goto ReloadEnd
  ReloadEnd:
    M93E PQRS 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93E TUV 3 A_WeaponReady(WRF_NOFIRE)
    M93E G 0 A_ReFire
    goto Ready+8  
  ReloadStartBolt:
    M93F A 0 A_TakeInventory("M93RBolt",1) 
    M93F A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStartBolt_SOH")
    M93F ABCDE 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93F F 3 A_PlaySoundEx("m93r/clipout","SoundSlot5")
    M93F GHIJKLMN 3 A_WeaponReady(WRF_NOFIRE)
    M93F O 0 A_PlaySoundEx("m93r/clipin","SoundSlot5")
    M93F O 3 A_TakeInventory("Reloading",1)
    goto ReloadAmmoBolt
  ReloadAmmoBolt:
    M93F Z 0 A_GiveInventory("M93RClip2",1)
    M93F Z 0 A_TakeInventory("M93RAmmo",1)
    M93F Z 0 A_JumpIfInventory("M93RClip2",30,"ReloadEndBolt")
    M93F Z 0 A_JumpIfInventory("M93RAmmo",1,"ReloadAmmoBolt")
    goto ReloadEndBolt
  ReloadEndBolt:
    M93F PQR 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93F S 3 A_PlaySoundEx("m93r/bolt","SoundSlot5")
    M93F TUVW 3 A_WeaponReady(WRF_NOFIRE)
    M93F G 0 A_ReFire
    goto Ready+8  
  ReloadStartAim:
    M93C E 1 A_ZoomFactor(1.0)
    M93C EDCBA 1
    M93C A 0 A_TakeInventory("Aiming",1)
    M93C A 0 ACS_ExecuteAlways(602,0,0,0,0)
    goto ReloadStart+1
  ReloadStart_SOH:
    M93E ABCDE 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93E F 2 A_PlaySoundEx("m93r/clipout","SoundSlot5")
    M93E GHIJKLMN 2 A_WeaponReady(WRF_NOFIRE)
    M93E O 0 A_PlaySoundEx("m93r/clipin","SoundSlot5")
    M93E O 2 A_TakeInventory("Reloading",1)
    goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    M93E Z 0 A_GiveInventory("M93RClip2",1)
    M93E Z 0 A_TakeInventory("M93RAmmo",1)
    M93E Z 0 A_JumpIfInventory("M93RClip2",30,"ReloadEnd_SOH")
    M93E Z 0 A_JumpIfInventory("M93RAmmo",1,"ReloadAmmo_SOH")
    goto ReloadEnd_SOH
  ReloadEnd_SOH:
    M93E PQRS 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93E TUV 2 A_WeaponReady(WRF_NOFIRE)
    M93E G 0 A_ReFire
    goto Ready+8  
  ReloadStartBolt_SOH:
    M93F ABCDE 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93F F 2 A_PlaySoundEx("m93r/clipout","SoundSlot5")
    M93F GHIJKLMN 2 A_WeaponReady(WRF_NOFIRE)
    M93F O 0 A_PlaySoundEx("m93r/clipin","SoundSlot5")
    M93F O 2 A_TakeInventory("Reloading",1)
    goto ReloadAmmoBolt_SOH
  ReloadAmmoBolt_SOH:
    M93F Z 0 A_GiveInventory("M93RClip2",1)
    M93F Z 0 A_TakeInventory("M93RAmmo",1)
    M93F Z 0 A_JumpIfInventory("M93RClip2",30,"ReloadEndBolt_SOH")
    M93F Z 0 A_JumpIfInventory("M93RAmmo",1,"ReloadAmmoBolt_SOH")
    goto ReloadEndBolt_SOH
  ReloadEndBolt_SOH:
    M93F PQR 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M93F S 2 A_PlaySoundEx("m93r/bolt","SoundSlot5")
    M93F TUVW 2 A_WeaponReady(WRF_NOFIRE)
    M93F G 0 A_ReFire
    goto Ready+8  
  }
}
actor M93RClip2 : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 30
    ammo.backpackamount 0
    ammo.backpackmaxamount 30
    +IGNORESKILL
}


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