actor "FN SCAR-H" : RGUWeapon
{
  obituary "%k scarred %o with the SCAR-H."
  inventory.pickupmessage "You got the FN SCAR-H battle rifle."
  //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:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    TNT1 A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    SCAA ABCDE 2 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
	SCAA FGHIJ 2 A_WeaponReady(WRF_ALLOWZOOM)
	M4CD A 0 A_JumpIfInventory("SCARToken",1,"Reload")
    SCAA K 0 A_JumpIfNoAmmo("Reload")
	M4CC F 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    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(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+15
    SCAC F 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    SCAC F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    SCAC F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    SCAC F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+21
  Deselect:
    SCAA K 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    SCAA K 0 A_TakeInventory("Aiming",1)
    SCAA K 0 A_TakeInventory("Reloading",1)
    SCAA K 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    SCAA K 0 A_ZoomFactor(1.0)
    SCAA K 0 A_Lower
    SCAA K 1 A_Lower
    Goto Deselect+5
  Select:
    SCAA A 0 A_Raise
    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")
    SCAB A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,7,0)
    SCAB A 1 BRIGHT A_FireCustomMissile("HHCBSCAR", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-5.00,5.00))
	SCAB A 0 A_SpawnItemEx("RifleCasingSCAR",Cos(Pitch)*30,3,34-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SCAB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("SCARHClip",3,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    SCAB A 0 A_JumpIfNoAmmo("FireEmpty")
    SCAB B 1 BRIGHT A_GunFlash
    SCAB C 1
    SCAB D 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAB A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAB A 0 A_ReFire
    Goto Ready+15
    SCAB A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_ReFire
    Goto Ready+15
  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")
    SCAB A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,7,0)
    SCAB A 1 BRIGHT A_FireCustomMissile("HHCBSCAR", frandom(-9.00,9.00), 1, 0, 4, 0, frandom(-9.00,9.00))
	SCAB A 0 A_SpawnItemEx("RifleCasingSCAR",Cos(Pitch)*30,3,34-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SCAB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("SCARHClip",3,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    SCAB A 0 A_JumpIfNoAmmo("FireEmpty")
    SCAB B 1 BRIGHT A_GunFlash
    SCAB C 1
    SCAB D 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAB A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAB A 0 A_ReFire
    Goto Ready+15
    SCAB A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_ReFire
    Goto Ready+15
  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+15
    SCAB A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_ReFire
    Goto Ready+15
  FireAim:
    SCAC G 0 A_PlayWeaponSound("scar/fire")
    SCAC G 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,0)
    SCAC G 1 BRIGHT A_FireCustomMissile("HHCBSCAR", frandom(-1.00,1.00), 1, 0, 4, 0, frandom(-1.00,1.00))
	SCAC G 0 A_SpawnItemEx("RifleCasingSCAR",Cos(Pitch)*30,-4,34-(Sin(Pitch)*43),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SCAC G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("SCARHClip",3,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    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+21
    SCAC A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAC A 0 A_ReFire
    Goto Ready+21
  HoldAim:
    SCAC G 0 A_PlayWeaponSound("scar/fire")
    SCAC G 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,0)
    SCAC G 1 BRIGHT A_FireCustomMissile("HHCBSCAR", frandom(-1.80,1.80), 1, 0, 4, 0, frandom(-1.80,1.80))
	SCAC G 0 A_SpawnItemEx("RifleCasingSCAR",Cos(Pitch)*30,-4,34-(Sin(Pitch)*43),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SCAC G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("SCARHClip",3,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    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+21
    SCAC A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAC A 0 A_ReFire
    Goto Ready+21
  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+21
    SCAC A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAC A 0 A_ReFire
    Goto Ready+21
  Reload: //AltFire:
    SCAC A 0 A_JumpIfInventory("SCARHClip",20,2)
    SCAC A 0 A_JumpIfInventory("SCARHAmmo",1,"ReloadStart")
    SCAC A 0 A_TakeInventory("Reloading",1)
    SCAC A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+18
  ReloadStart:
    SCAD A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    SCAD A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    SCAD A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	SCAD A 0 A_JumpIfInventory("SCARToken",1,"Reload2")
    SCAD A 3 A_PlaySoundEx("scar/clipout","SoundSlot5")
    SCAD BCDEFGHIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	SCAD J 0 A_FireCustomMissile("SCAREmptyMagSpawner",0,0,0,-4)
	SCAD J 0 A_GiveInventory("SCARToken",1)
	goto Reload2
  Reload2:
    SCAD KLMNOP 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    SCAD Q 0 A_PlaySoundEx("weapon/wellbonk","SoundSlot5")
    SCAD QRST 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    SCAD U 3 A_PlaySoundEx("scar/clipin","SoundSlot5")
    SCAD V 3 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo
  ReloadAmmo:
    SCAD Z 0 A_JumpIfInventory("SCARHClip",20,"ReloadEnd")
	SCAD Z 0 A_TakeInventory("SCARToken",1)
    SCAD Z 0 A_JumpIfInventory("SCARHAmmo",1,1)
    Goto ReloadEnd
    SCAD Z 0 A_GiveInventory("SCARHClip",1)
    SCAD Z 0 A_TakeInventory("SCARHAmmo",1)
    Goto ReloadAmmo
  ReloadEnd:
    SCAD A 0 A_JumpIfInventory("SCARHBolt",1,"ReloadEndBolt")
    SCAD WXYZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE ABCDEFG 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAE G 0 A_ReFire
    Goto Ready+15
  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_NOBOB|WRF_NOFIRE)
    SCAE CDEFG 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAE V 0 A_ReFire
    Goto Ready+15
  Zoom:
  PostReloadAlt:
    M4CD A 0 A_JumpIfInventory("SCARToken",1,"Reload")
    SCAC F 0 A_ZoomFactor(1.3)
    SCAC E 0 A_GiveInventory("Aiming",1)
	SCAC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    SCAC ABCDEF 1
    Goto AltHold
  AltFireHoldAim:
    "####" "#" 0 A_JumpIfInventory("SCARHClip",1,1)
	Goto Reload
    SCAC G 0 A_PlayWeaponSound("scar/fire")
	GRNA L 0 A_TakeInventory("SCARHClip",1)
    SCAC G 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,0)
    SCAC G 1 BRIGHT A_FireCustomMissile("HHCBSCAR", frandom(-1.80,1.80), 1, 0, 4, 0, frandom(-1.80,1.80))
	SCAC G 0 A_SpawnItemEx("RifleCasingSCAR",Cos(Pitch)*30,-4,34-(Sin(Pitch)*43),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SCAC G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("SCARHClip",3,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    SCAC H 1 BRIGHT A_GunFlash
    SCAC I 1
    SCAC J 1
    "####" "#" 0 A_JumpIfInventory("SCARHClip",1,1)
	Goto Reload
    SCAC A 0 A_ReFire
    Goto Ready+21
  AltHold:
    SCAC F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
	M4CA C 0 A_JumpIfInventory("FireHeld",1,"AltFireHoldAim")
	M4CA C 0 A_JumpIfInventory("Reloading",1,"Reload")
	U45A L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    U45A L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
	M4CA F 0 A_Refire("AltHold")
	M4CA C 0 A_JumpIfInventory("Aiming",1,"AltFire2")
	Goto Ready+21
  AltFire:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    M4CD A 0 A_JumpIfInventory("SCARToken",1,"Reload")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    SCAC A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    SCAC A 0 A_ZoomFactor(1.3)
    SCAC AB 1
    SCAC B 0 A_GiveInventory("Aiming",1)
    SCAC CDEF 1
    SCAC F 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    SCAC F 0 A_Refire
    Goto Ready+21
  AltFire2:
    SCAC F 0 A_ZoomFactor(1.0)
    SCAC FE 1
    SCAC E 0 A_TakeInventory("Aiming",1)
    SCAC DCBA 1
    SCAC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	SCAA KKKK 1
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+15
  AltFire3:
    SCAC F 0 A_ZoomFactor(1.0)
    SCAC FE 1
    SCAC E 0 A_TakeInventory("Aiming",1)
    SCAC DCBA 1
    SCAC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    SCAC A 0 A_Refire
	goto DropWeapon
  ReloadStartAim:
    SCAC F 0 A_ZoomFactor(1.0)
    SCAC FE 1
    SCAC E 0 A_TakeInventory("Aiming",1)
    SCAC DCBA 1
    SCAC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+2
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  Spawn:
    WEAP S 0
    WEAP S 0 A_SpawnItem("SCARHDrop")
    stop
  ReloadStart_SOH:
    SCAD A 0 A_JumpIfInventory("SCARToken",1,"Reload3")
    SCAD A 2 A_PlaySoundEx("scar/clipout","SoundSlot5")
    SCAD BCDEFGHIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	SCAD J 0 A_FireCustomMissile("SCAREmptyMagSpawner",0,0,0,-4)
	SCAD J 0 A_GiveInventory("SCARToken",1)
	goto Reload3
  Reload3:
    SCAD KLMNOP 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    SCAD Q 0 A_PlaySoundEx("weapon/wellbonk","SoundSlot5")
    SCAD QRST 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    SCAD U 2 A_PlaySoundEx("scar/clipin","SoundSlot5")
    SCAD V 2 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    SCAD Z 0 A_JumpIfInventory("SCARHClip",20,"ReloadEnd_SOH")
	SCAD Z 0 A_TakeInventory("SCARToken",1)
    SCAD Z 0 A_JumpIfInventory("SCARHAmmo",1,1)
    Goto ReloadEnd_SOH
    SCAD Z 0 A_GiveInventory("SCARHClip",1)
    SCAD Z 0 A_TakeInventory("SCARHAmmo",1)
    Goto ReloadAmmo_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_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAE G 0 A_ReFire
    Goto Ready+15
  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_NOBOB|WRF_NOFIRE)
    SCAE CDEFG 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAE V 0 A_ReFire
    Goto Ready+15
  Fire_SteadyAim:
    SCAB A 0 A_PlayWeaponSound("scar/fire")
    SCAB A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,7,0)
    SCAB A 1 BRIGHT A_FireCustomMissile("HHCBSCAR", frandom(-3.50,3.50), 1, 0, 4, 0, frandom(-3.50,3.50))
	SCAB A 0 A_SpawnItemEx("RifleCasingSCAR",Cos(Pitch)*30,3,34-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SCAB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("SCARHClip",3,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    SCAB A 0 A_JumpIfNoAmmo("FireEmpty")
    SCAB B 1 BRIGHT A_GunFlash
    SCAB C 1
    SCAB D 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAB A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAB A 0 A_ReFire
    Goto Ready+15
    SCAB A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_ReFire
    Goto Ready+15
  Hold_SteadyAim:
    SCAB A 0 A_PlayWeaponSound("scar/fire")
    SCAB A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,7,0)
    SCAB A 1 BRIGHT A_FireCustomMissile("HHCBSCAR", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	SCAB A 0 A_SpawnItemEx("RifleCasingSCAR",Cos(Pitch)*30,3,34-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SCAB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("SCARHClip",3,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    SCAB A 0 A_JumpIfNoAmmo("FireEmpty")
    SCAB B 1 BRIGHT A_GunFlash
    SCAB C 1
    SCAB D 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAB A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAB A 0 A_ReFire
    Goto Ready+15
    SCAB A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_ReFire
    Goto Ready+15
  FragGrenade:
    U45F A 0 ACS_NamedExecuteAlways("RefSpeak",0,1,0,0)
    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_NamedExecuteAlways("RefSpeed",0,0,0,0)
	M4CA J 0 A_JumpIfInventory("ThrowingStun",1,"StunGrenade")
	M4CA J 0 A_JumpIfInventory("ThrowingIncd",1,"IncGrenade")
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"FragGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 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("GrenadeAmmo",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",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  FragGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 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("GrenadeAmmo",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",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    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_NamedExecuteAlways("RefSpeed",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_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",104)
    KNFA DEFGHIJKL 1
    TNT1 A 20
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_Commando:
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",160)
    KNFA DEFGHIJKL 1
    TNT1 A 20
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_SOH:
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_SOH_Commando")
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",104)
    KNFA DEFGHIJKL 1
    TNT1 A 10
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_SOH_Commando:
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",160)
    KNFA DEFGHIJKL 1
    TNT1 A 10
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  StunGrenade:
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"StunGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 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("StunAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("StunGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  IncGrenade:
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"IncGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 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("IncdAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("IncGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  StunGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 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("StunAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("StunGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  IncGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 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("IncdAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("IncGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  DropWeapon:
    SCAA JIHGFEDCB 2 A_WeaponReady(WRF_NOPRIMARY)
	SCAA A 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CC F 0 A_JumpIfInventory("weapondropper",2,"ThrowWeapon")
    KNFA A 0 ACS_NamedExecuteAlways("RefDropW",0,0,0,0)
	GRNA L 0 A_TakeInventory("weapondropper",1)
	M4CB A 0 A_FireCustomMissile("SCARDropped",0,0,7,2)
	stop
  ThrowWeapon:
    GRNA IKMN 1
	KNFA B 0 A_PlaySound("knife/swing")
    KNFA A 0 ACS_NamedExecuteAlways("RefDropW",0,0,0,0)
	GRNA L 0 A_TakeInventory("weapondropper",2)
	M4CB A 0 A_FireCustomMissile("SCARThrown",0,0,7,2)
	stop
  }
}

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 "FN SCAR-H Ex Mags" : "FN SCAR-H"
{
  obituary "%k scarred %o with the SCAR-H."
  inventory.pickupmessage "You got the FN SCAR-H battle rifle."
  //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
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    TNT1 A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    SCAA ABCDE 2 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
	SCAA FGHIJ 2 A_WeaponReady(WRF_ALLOWZOOM)
	M4CD A 0 A_JumpIfInventory("SCARToken",1,"Reload")
    SCAA K 0 A_JumpIfNoAmmo("Reload")
	M4CC F 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    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(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+15
    SCAC F 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    SCAC F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    SCAC F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    SCAC F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+21
  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")
    SCAB A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,7,0)
    SCAB A 1 BRIGHT A_FireCustomMissile("HHCBSCAR", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-5.00,5.00))
	SCAB A 0 A_SpawnItemEx("RifleCasingSCAR",Cos(Pitch)*30,3,34-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SCAB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("SCARHClip2",3,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    SCAB A 0 A_JumpIfNoAmmo("FireEmpty")
    SCAB B 1 BRIGHT A_GunFlash
    SCAB C 1
    SCAB D 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAB A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAB A 0 A_ReFire
    Goto Ready+15
    SCAB A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_ReFire
    Goto Ready+15
  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")
    SCAB A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,7,0)
    SCAB A 1 BRIGHT A_FireCustomMissile("HHCBSCAR", frandom(-9.00,9.00), 1, 0, 4, 0, frandom(-9.00,9.00))
	SCAB A 0 A_SpawnItemEx("RifleCasingSCAR",Cos(Pitch)*30,3,34-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SCAB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("SCARHClip2",3,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    SCAB A 0 A_JumpIfNoAmmo("FireEmpty")
    SCAB B 1 BRIGHT A_GunFlash
    SCAB C 1
    SCAB D 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAB A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAB A 0 A_ReFire
    Goto Ready+15
    SCAB A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_ReFire
    Goto Ready+15
  FireAim:
    SCAC G 0 A_PlayWeaponSound("scar/fire")
    SCAC G 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,0)
    SCAC G 1 BRIGHT A_FireCustomMissile("HHCBSCAR", frandom(-1.00,1.00), 1, 0, 4, 0, frandom(-1.00,1.00))
	SCAC G 0 A_SpawnItemEx("RifleCasingSCAR",Cos(Pitch)*30,-4,34-(Sin(Pitch)*43),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SCAC G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("SCARHClip2",3,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    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+21
    SCAC A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAC A 0 A_ReFire
    Goto Ready+21
  HoldAim:
    SCAC G 0 A_PlayWeaponSound("scar/fire")
    SCAC G 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,0)
    SCAC G 1 BRIGHT A_FireCustomMissile("HHCBSCAR", frandom(-1.80,1.80), 1, 0, 4, 0, frandom(-1.80,1.80))
	SCAC G 0 A_SpawnItemEx("RifleCasingSCAR",Cos(Pitch)*30,-4,34-(Sin(Pitch)*43),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SCAC G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("SCARHClip2",3,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    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+21
    SCAC A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAC A 0 A_ReFire
    Goto Ready+21
  Reload: //AltFire:
    SCAC A 0 A_JumpIfInventory("SCARHClip2",30,2)
    SCAC A 0 A_JumpIfInventory("SCARHAmmo",1,"ReloadStart")
    SCAC A 0 A_TakeInventory("Reloading",1)
    SCAC A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+18
  ReloadStart:
    SCAD A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    SCAD A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    SCAD A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	SCAD A 0 A_JumpIfInventory("SCARToken",1,"Reload2")
    SCAD A 3 A_PlaySoundEx("scar/clipout","SoundSlot5")
    SCAD BCDEFGHIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	SCAD J 0 A_FireCustomMissile("SCAREmptyMagExtSpawner",0,0,0,-4)
	SCAD J 0 A_GiveInventory("SCARToken",1)
	goto Reload2
  Reload2:
    SCAD KLMNOP 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    SCAD Q 0 A_PlaySoundEx("weapon/wellbonk","SoundSlot5")
    SCAD QRST 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    SCAD U 3 A_PlaySoundEx("scar/clipin","SoundSlot5")
    SCAD V 3 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo
  ReloadAmmo:
    SCAD Z 0 A_JumpIfInventory("SCARHClip2",30,"ReloadEnd")
	SCAD Z 0 A_TakeInventory("SCARToken",1)
    SCAD Z 0 A_JumpIfInventory("SCARHAmmo",1,1)
    Goto ReloadEnd
    SCAD Z 0 A_GiveInventory("SCARHClip2",1)
    SCAD Z 0 A_TakeInventory("SCARHAmmo",1)
    Goto ReloadAmmo
  ReloadEnd:
    SCAD A 0 A_JumpIfInventory("SCARHBolt",1,"ReloadEndBolt")
    SCAD WXYZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCAE ABCDEFG 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAE G 0 A_ReFire
    Goto Ready+15
  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_NOBOB|WRF_NOFIRE)
    SCAE CDEFG 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAE V 0 A_ReFire
    Goto Ready+15
  ReloadStartAim:
    SCAC F 0 A_ZoomFactor(1.0)
    SCAC FE 1
    SCAC E 0 A_TakeInventory("Aiming",1)
    SCAC DCBA 1
    SCAC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+2
  ReloadStart_SOH:
    SCAD A 0 A_JumpIfInventory("SCARToken",1,"Reload3")
    SCAD A 2 A_PlaySoundEx("scar/clipout","SoundSlot5")
    SCAD BCDEFGHIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	SCAD J 0 A_FireCustomMissile("SCAREmptyMagExtSpawner",0,0,0,-4)
	SCAD J 0 A_GiveInventory("SCARToken",1)
	goto Reload3
  Reload3:
    SCAD KLMNOP 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    SCAD Q 0 A_PlaySoundEx("weapon/wellbonk","SoundSlot5")
    SCAD QRST 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    SCAD U 2 A_PlaySoundEx("scar/clipin","SoundSlot5")
    SCAD V 2 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    SCAD Z 0 A_JumpIfInventory("SCARHClip2",30,"ReloadEnd_SOH")
	SCAD Z 0 A_TakeInventory("SCARToken",1)
    SCAD Z 0 A_JumpIfInventory("SCARHAmmo",1,1)
    Goto ReloadEnd_SOH
    SCAD Z 0 A_GiveInventory("SCARHClip2",1)
    SCAD Z 0 A_TakeInventory("SCARHAmmo",1)
    Goto ReloadAmmo_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_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAE G 0 A_ReFire
    Goto Ready+15
  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_NOBOB|WRF_NOFIRE)
    SCAE CDEFG 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAE V 0 A_ReFire
    Goto Ready+15
  Fire_SteadyAim:
    SCAB A 0 A_PlayWeaponSound("scar/fire")
    SCAB A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,7,0)
    SCAB A 1 BRIGHT A_FireCustomMissile("HHCBSCAR", frandom(-3.50,3.50), 1, 0, 4, 0, frandom(-3.50,3.50))
    SCAB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("SCARHClip2",3,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    SCAB A 0 A_JumpIfNoAmmo("FireEmpty")
    SCAB B 1 BRIGHT A_GunFlash
    SCAB C 1
    SCAB D 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAB A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAB A 0 A_ReFire
    Goto Ready+15
    SCAB A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_ReFire
    Goto Ready+15
  Hold_SteadyAim:
    SCAB A 0 A_PlayWeaponSound("scar/fire")
    SCAB A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,7,0)
    SCAB A 1 BRIGHT A_FireCustomMissile("HHCBSCAR", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
    SCAB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("SCARHClip2",3,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    SCAB A 0 A_JumpIfNoAmmo("FireEmpty")
    SCAB B 1 BRIGHT A_GunFlash
    SCAB C 1
    SCAB D 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    SCAB A 0 A_JumpIfInventory("SCARHAmmo",1,2)
    SCAB A 0 A_ReFire
    Goto Ready+15
    SCAB A 0 A_JumpIfNoAmmo("ReloadStart")
    SCAB A 0 A_ReFire
    Goto Ready+15
  PostReloadAlt:
    M4CD A 0 A_JumpIfInventory("SCARToken",1,"Reload")
    SCAC F 0 A_ZoomFactor(1.3)
    SCAC E 0 A_GiveInventory("Aiming",1)
	SCAC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    SCAC ABCDEF 1
    Goto AltHold
  AltFireHoldAim:
    "####" "#" 0 A_JumpIfInventory("SCARHClip2",1,1)
	Goto Reload
    SCAC G 0 A_PlayWeaponSound("scar/fire")
	GRNA L 0 A_TakeInventory("SCARHClip2",1)
    SCAC G 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,0)
    SCAC G 1 BRIGHT A_FireCustomMissile("HHCBSCAR", frandom(-1.80,1.80), 1, 0, 4, 0, frandom(-1.80,1.80))
	SCAC G 0 A_SpawnItemEx("RifleCasingSCAR",Cos(Pitch)*30,-4,34-(Sin(Pitch)*43),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SCAC G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("SCARHClip2",3,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    SCAC H 1 BRIGHT A_GunFlash
    SCAC I 1
    SCAC J 1
    "####" "#" 0 A_JumpIfInventory("SCARHClip2",1,1)
	Goto Reload
    SCAC A 0 A_ReFire
    Goto Ready+21
  AltHold:
    SCAC F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
	M4CA C 0 A_JumpIfInventory("FireHeld",1,"AltFireHoldAim")
	M4CA C 0 A_JumpIfInventory("Reloading",1,"Reload")
	U45A L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    U45A L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
	M4CA F 0 A_Refire("AltHold")
	M4CA C 0 A_JumpIfInventory("Aiming",1,"AltFire2")
	Goto Ready+21
  }
}

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 "You got the FN SCAR-H battle rifle."
  inventory.pickupsound "akm/bolt"
  +INVENTORY.AUTOACTIVATE
  //inventory.respawntics 70
  scale 0.15
  States
  {
  Spawn:
    WEAP S -1
    stop
  Pickup:
    WEAP S 0
    WEAP S 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",0,0,0)) == 1, "PickupStay")
    WEAP S 0 A_JumpIfInventory("FN SCAR-H",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP S 0 A_JumpIfInventory("FN SCAR-H Ex Mags",1,"AmmoPickup")
    WEAP S 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP S 0 A_JumpIfInventory("MaxWeaponsFilled",67,"FailPickup2")
	WEAP S 0 A_GiveInventory("MaxWeaponsFilled",34)
    WEAP S 0 ACS_NamedExecuteWithResult("RefPickU",17,0,0)
    stop
  PickupStay:
    WEAP S 0
    WEAP S 0 A_JumpIfInventory("FN SCAR-H",1,"FailPickup") // If the player already has this weapon, they get more ammo for it
    WEAP S 0 A_JumpIfInventory("FN SCAR-H Ex Mags",1,"FailPickup")
    WEAP S 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP S 0 A_JumpIfInventory("MaxWeaponsFilled",67,"FailPickup2")
	WEAP S 0 A_GiveInventory("MaxWeaponsFilled",34)
    WEAP S 0 ACS_NamedExecuteWithResult("RefPickU",17,0,0)
    WEAP S 0 ACS_NamedExecuteWithResult("RefPickC",17,0,0)
    WEAP S 0 A_PlaySound("akm/bolt")
    fail
  AmmoPickup:
    WEAP S 0
    WEAP S 0 A_JumpIfInventory("SCARHAmmo",0,"FailPickup")
    WEAP S 0 A_GiveInventory("SCARHAmmo",20)
    stop
  OneManArmy:
    WEAP S 0
	WEAP S 0 A_JumpIfInventory("MaxWeaponsFilled",104,"FailPickup2")
	WEAP S 0 A_GiveInventory("MaxWeaponsFilled",34)
	WEAP S 0 ACS_NamedExecuteWithResult("RefPickU",17,0,0)
	stop
  FailPickup:
    WEAP S 1
    fail
  FailPickup2:
    WEAP S 1
    WEAP S 0 ACS_NamedExecuteAlways("RefSlots",0,23,0,0)
    fail
  }
}

actor SCARHDrop : SCARHPickup
{
  States
  {
  Spawn:
    WEAP S -1
    stop
  Pickup:
    WEAP S 0
    WEAP S 0 A_JumpIfInventory("FN SCAR-H",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP S 0 A_JumpIfInventory("FN SCAR-H Ex Mags",1,"AmmoPickup")
    WEAP S 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP S 0 A_JumpIfInventory("MaxWeaponsFilled",67,"FailPickup2")
	WEAP S 0 A_GiveInventory("MaxWeaponsFilled",34)
    WEAP S 0 ACS_NamedExecuteWithResult("RefPickU",17,0,0)
    stop
  }
}

actor SCARHDrop2 : SCARHDrop
{
  States
  {
  Spawn:
    WEAP S -1
    stop
  Pickup:
    WEAP S 0
    WEAP S 0 A_JumpIfInventory("FN SCAR-H",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP S 0 A_JumpIfInventory("FN SCAR-H Ex Mags",1,"AmmoPickup")
    WEAP S 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP S 0 A_JumpIfInventory("MaxWeaponsFilled",67,"FailPickup2")
	WEAP S 0 A_GiveInventory("MaxWeaponsFilled",34)
    WEAP S 0 ACS_NamedExecuteWithResult("RefPickU",17,0,0)
    stop
  AmmoPickup:
    WEAP S 0
    stop
  }
}

actor HHCBSCAR : HHBullet
{
  damage (random(35,42))
  Speed 400
  damagetype "Rifle"
  States
  {
  Spawn:
    TNT1 A 15
    stop
  Death:
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
    stop
  XDeath:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 5 A_PlaySound("generic/ricochets")
    stop
  Crash:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff_2", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
    stop
  }
}