actor "SCAR-H" : RGUWeapon
{
  obituary "%k scarred %o with the SCAR-H."
  inventory.pickupmessage "SCAR-H"  
  //attacksound "ump45/fire6"
  weapon.selectionorder 2
  weapon.ammotype "SCARHClip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "SCARHAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    SCAA A 2 //A_PlayWeaponSound("m9/select")
    SCAA BCDEFGHIJK 2 A_WeaponReady(WRF_NOPRIMARY)
    SCAA K 0 A_JumpIfNoAmmo("Reload")
    SCAA K 0 A_JumpIfInventory("Aiming",1,5)
    SCAA K 0 A_JumpIfInventory("Reloading",1,"Reload")
    SCAA K 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    SCAA K 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAA K 1 A_WeaponReady
    goto Ready+11
    SCAC F 0 A_JumpIfInventory("Reloading",1,"Reload")    
    SCAC F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    SCAC F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAC F 1 A_WeaponReady(WRF_NOBOB)
    goto Ready+17
  Deselect:
    SCAA K 0 A_TakeInventory("Aiming",1)
    SCAA K 0 ACS_ExecuteAlways(602,0,0,0,0)
    SCAA L 0 A_TakeInventory("Reloading",1)
    SCAA L 0 A_ZoomFactor(1.0)
    SCAA K 0 A_Lower
    SCAA K 1 A_Lower
    goto Deselect+2
  Select:
    SCAA A 0 A_Raise
	SCAA A 0 ACS_ExecuteAlways(602,0,0,0,0)
	TNT1 F 0 A_GiveInventory("InCombatCrosshair", 35)
    loop
  Fire:	
    SCAB B 0 A_JumpIfInventory("Aiming",1,"FireAim")
    SCAB B 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    SCAB A 0 A_PlayWeaponSound("scar/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    SCAB A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,8,0)
    SCAB A 1 BRIGHT A_FireBullets (7.0, 7.0, -1, 21, "RiflePuff", 1, 6000)
    SCAB B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    SCAB A 0 A_JumpIfNoAmmo("FireEmpty")
    SCAB B 1 BRIGHT A_GunFlash
    SCAB C 1
    SCAB D 1
    SCAB A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAB A 0 A_ReFire
    goto Ready+11
    SCAB A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_ReFire
    goto Ready+11
  Hold:
    SCAB A 0 A_JumpIfInventory("Aiming",1,"HoldAim")
    SCAB K 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    SCAB A 0 A_PlayWeaponSound("scar/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    SCAB A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,8,0)
    SCAB A 1 BRIGHT A_FireBullets (10.5, 10.5, -1, 21, "RiflePuff", 1, 6000)
    SCAB B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    SCAB A 0 A_JumpIfNoAmmo("FireEmpty")
    SCAB B 1 BRIGHT A_GunFlash
    SCAB C 1
    SCAB D 1
    SCAB A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAB A 0 A_ReFire
    goto Ready+11
    SCAB A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_ReFire
    goto Ready+11
  FireEmpty:
    SCAB BC 1 BRIGHT A_GunFlash
    SCAB D 1 A_GiveInventory("SCARHBolt",1)
    SCAB A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAB A 0 A_ReFire
    goto Ready+11
    SCAB A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_ReFire
    goto Ready+11
  FireAim:
    SCAC G 0 A_PlayWeaponSound("scar/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    SCAC G 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,1)
    SCAC G 1 BRIGHT A_FireBullets (0.5, 0.5, -1, 21, "RiflePuff", 1, 6000)
    SCAC G 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    SCAC G 0 A_JumpIfNoAmmo("FireAimEmpty")
    SCAC H 1 BRIGHT A_GunFlash
    SCAC I 1
    SCAC J 1
    SCAC A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAC A 0 A_ReFire
    goto Ready+17
    SCAC A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAC A 0 A_ReFire
    goto Ready+17
  HoldAim:
    SCAC A 0 A_PlayWeaponSound("scar/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    SCAC A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,1)
    SCAC G 1 BRIGHT A_FireBullets (3.0, 3.0, -1, 21, "RiflePuff", 1, 6000)
    SCAC G 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    SCAC G 0 A_JumpIfNoAmmo("FireAimEmpty")
    SCAC H 1 BRIGHT A_GunFlash
    SCAC I 1
    SCAC J 1
    SCAC A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAC A 0 A_ReFire
    goto Ready+17
    SCAC A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAC A 0 A_ReFire
    goto Ready+17
  FireAimEmpty:
    SCAC HI 1 BRIGHT A_GunFlash
    SCAC J 1 A_GiveInventory("SCARHBolt",1)
    SCAC A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAC A 0 A_ReFire
    goto Ready+17
    SCAC A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAC A 0 A_ReFire
    goto Ready+17
  Reload: //AltFire:
    SCAC A 0 A_JumpIfInventory("SCARHAmmo",1,"ReloadStart")
    SCAC A 0 A_TakeInventory("Reloading",1)
    goto Ready+14
  ReloadStart:
  	TNT1 A 0 ACS_ExecuteAlways(652,0,0,0,0) // Shout "Reloading" 
    SCAD A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    SCAD A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    SCAD A 3 A_PlaySoundEx("scar/clipout","SoundSlot5")
    SCAD BCDEFGHIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAD KLMNOPQRS 3 A_WeaponReady(WRF_NOFIRE)
    SCAD T 3 A_PlaySoundEx("scar/clipin","SoundSlot5")
    SCAD UV 3 A_TakeInventory("Reloading",1)
    goto ReloadAmmo
  ReloadAmmo:
    SCAD Z 0 A_GiveInventory("SCARHClip",1)
    SCAD Z 0 A_TakeInventory("SCARHAmmo",1)
    SCAD Z 0 A_JumpIfInventory("SCARHClip",20,"ReloadEnd")
    SCAD Z 0 A_JumpIfInventory("SCARHAmmo",1,"ReloadAmmo")
    goto ReloadEnd
  ReloadEnd:
    SCAD A 0 A_JumpIfInventory("SCARHBolt",1,"ReloadEndBolt") 
    SCAD WXYZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE ABCDEFG 3 A_WeaponReady(WRF_NOFIRE)
    SCAE G 0 A_ReFire
    goto Ready+11 
  ReloadEndBolt:
    SCAE Z 0 A_TakeInventory("SCARHBolt",1)
    SCAD WX 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE HI 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE J 3 A_PlaySoundEx("scar/bolt","SoundSlot5")
    SCAE KLMNO 3 A_WeaponReady(WRF_NOFIRE)
    SCAE BCDEFG 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE V 0 A_ReFire
    goto Ready+11 
  AltFire:
    SCAC A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    SCAC A 0 A_ZoomFactor(1.2)
    SCAC ABCDEF 1
    SCAC G 0 A_GiveInventory("Aiming",1)
    SCAC G 0 ACS_ExecuteAlways(602,0,0,0,0)
    SCAC G 0 A_Refire
    goto Ready+17
  AltFire2:
    SCAC A 0 A_ZoomFactor(1.0)
    SCAC FEDCBA 1
    SCAC A 0 A_TakeInventory("Aiming",1)
    SCAC A 0 ACS_ExecuteAlways(602,0,0,0,0)
    SCAC G 0 A_Refire
    goto Ready+11
  AltHold:
    SCAA K 1 A_JumpIfInventory("Aiming",1,"AltHoldAim")
    SCAA K 1 A_ReFire
    goto Ready+11
  AltHoldAim:
    SCAC F 1
    SCAC F 1 A_ReFire
    goto Ready+17
  ReloadStartAim:
    SCAC A 0 A_ZoomFactor(1.0)
    SCAC FEDCBA 1
    SCAC A 0 A_TakeInventory("Aiming",1)
    SCAC 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 S 15
    WEAP S 0 A_SpawnItemEx("SCARHPickup")
    stop
  ReloadStart_SOH:
    SCAD A 2 A_PlaySoundEx("scar/clipout","SoundSlot5")
    SCAD BCDEFGHIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAD KLMNOPQRS 2 A_WeaponReady(WRF_NOFIRE)
    SCAD T 2 A_PlaySoundEx("scar/clipin","SoundSlot5")
    SCAD UV 2 A_TakeInventory("Reloading",1)
    goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    SCAD Z 0 A_GiveInventory("SCARHClip",1)
    SCAD Z 0 A_TakeInventory("SCARHAmmo",1)
    SCAD Z 0 A_JumpIfInventory("SCARHClip",20,"ReloadEnd_SOH")
    SCAD Z 0 A_JumpIfInventory("SCARHAmmo",1,"ReloadAmmo_SOH")
    goto ReloadEnd_SOH
  ReloadEnd_SOH:
    SCAD A 0 A_JumpIfInventory("SCARHBolt",1,"ReloadEndBolt_SOH") 
    SCAD WXYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE ABCDEFG 2 A_WeaponReady(WRF_NOFIRE)
    SCAE G 0 A_ReFire
    goto Ready+11 
  ReloadEndBolt_SOH:
    SCAE Z 0 A_TakeInventory("SCARHBolt",1)
    SCAD WX 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE HI 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE J 2 A_PlaySoundEx("scar/bolt","SoundSlot5")
    SCAE KLMNO 2 A_WeaponReady(WRF_NOFIRE)
    SCAE BCDEFG 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE V 0 A_ReFire
    goto Ready+11 
  Fire_SteadyAim:
    SCAB A 0 A_PlayWeaponSound("scar/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    SCAB A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,8,3)
    SCAB A 1 BRIGHT A_FireBullets (4.62, 4.62, -1, 21, "RiflePuff", 1, 6000)
    SCAB B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    SCAB A 0 A_JumpIfNoAmmo("FireEmpty")
    SCAB B 1 BRIGHT A_GunFlash
    SCAB C 1
    SCAB D 1
    SCAB A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAB A 0 A_ReFire
    goto Ready+11
    SCAB A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_ReFire
    goto Ready+11
  Hold_SteadyAim:
    SCAB A 0 A_PlayWeaponSound("scar/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",17)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    SCAB A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,8,3)
    SCAB A 1 BRIGHT A_FireBullets (6.93, 6.93, -1, 21, "RiflePuff", 1, 6000)
    SCAB B 0 BRIGHT ACS_ExecuteAlways(600,0,120,0,0)
    SCAB A 0 A_JumpIfNoAmmo("FireEmpty")
    SCAB B 1 BRIGHT A_GunFlash
    SCAB C 1
    SCAB D 1
    SCAB A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAB A 0 A_ReFire
    goto Ready+11
    SCAB A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 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 SCARHClip : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 20
    ammo.backpackamount 0
    ammo.backpackmaxamount 20
    +IGNORESKILL
}

actor SCARHBolt : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}
actor "SCAR-H Ex Mags" : "SCAR-H"
{
  obituary "%k scarred %o with the SCAR-H."
  inventory.pickupmessage "SCAR-H"  
  //attacksound "ump45/fire6"
  weapon.selectionorder 2
  weapon.ammotype "SCARHClip2"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "SCARHAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Reload: //AltFire:
    SCAC A 0 A_JumpIfInventory("SCARHAmmo",1,"ReloadStart")
    SCAC A 0 A_TakeInventory("Reloading",1)
    goto Ready+14
  ReloadStart:
  	TNT1 A 0 ACS_ExecuteAlways(652,0,0,0,0) // Shout "Reloading" 
    SCAD A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    SCAD A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    SCAD A 3 A_PlaySoundEx("scar/clipout","SoundSlot5")
    SCAD BCDEFGHIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAD KLMNOPQRS 3 A_WeaponReady(WRF_NOFIRE)
    SCAD T 3 A_PlaySoundEx("scar/clipin","SoundSlot5")
    SCAD UV 3 A_TakeInventory("Reloading",1)
    goto ReloadAmmo
  ReloadAmmo:
    SCAD Z 0 A_GiveInventory("SCARHClip2",1)
    SCAD Z 0 A_TakeInventory("SCARHAmmo",1)
    SCAD Z 0 A_JumpIfInventory("SCARHClip2",30,"ReloadEnd")
    SCAD Z 0 A_JumpIfInventory("SCARHAmmo",1,"ReloadAmmo")
    goto ReloadEnd
  ReloadEnd:
    SCAD A 0 A_JumpIfInventory("SCARHBolt",1,"ReloadEndBolt") 
    SCAD WXYZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE ABCDEFG 3 A_WeaponReady(WRF_NOFIRE)
    SCAE G 0 A_ReFire
    goto Ready+11 
  ReloadEndBolt:
    SCAE Z 0 A_TakeInventory("SCARHBolt",1)
    SCAD WX 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE HI 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE J 3 A_PlaySoundEx("scar/bolt","SoundSlot5")
    SCAE KLMNO 3 A_WeaponReady(WRF_NOFIRE)
    SCAE BCDEFG 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE V 0 A_ReFire
    goto Ready+11 
  ReloadStartAim:
    SCAC A 0 A_ZoomFactor(1.0)
    SCAC FEDCBA 1
    SCAC A 0 A_TakeInventory("Aiming",1)
    SCAC A 0 ACS_ExecuteAlways(602,0,0,0,0)
    goto ReloadStart+1
  ReloadStart_SOH:
    SCAD A 2 A_PlaySoundEx("scar/clipout","SoundSlot5")
    SCAD BCDEFGHIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAD KLMNOPQRS 2 A_WeaponReady(WRF_NOFIRE)
    SCAD T 2 A_PlaySoundEx("scar/clipin","SoundSlot5")
    SCAD UV 2 A_TakeInventory("Reloading",1)
    goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    SCAD Z 0 A_GiveInventory("SCARHClip2",1)
    SCAD Z 0 A_TakeInventory("SCARHAmmo",1)
    SCAD Z 0 A_JumpIfInventory("SCARHClip2",30,"ReloadEnd_SOH")
    SCAD Z 0 A_JumpIfInventory("SCARHAmmo",1,"ReloadAmmo_SOH")
    goto ReloadEnd_SOH
  ReloadEnd_SOH:
    SCAD A 0 A_JumpIfInventory("SCARHBolt",1,"ReloadEndBolt_SOH") 
    SCAD WXYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE ABCDEFG 2 A_WeaponReady(WRF_NOFIRE)
    SCAE G 0 A_ReFire
    goto Ready+11 
  ReloadEndBolt_SOH:
    SCAE Z 0 A_TakeInventory("SCARHBolt",1)
    SCAD WX 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE HI 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE J 2 A_PlaySoundEx("scar/bolt","SoundSlot5")
    SCAE KLMNO 2 A_WeaponReady(WRF_NOFIRE)
    SCAE BCDEFG 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE V 0 A_ReFire
    goto Ready+11 

  }
}

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

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

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