actor "AUG HBAR" : RGUWeapon
{
  obituary "%k fed %o with lead with the AUG HBAR."
  inventory.pickupmessage "You got the AUG HBAR light machinegun."
  //attacksound "hbar/fire1"
  weapon.selectionorder 1
  weapon.ammotype "AUGHBARClip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "AUGHBARAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    BARA A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    BARA A 0 
    BARA ABCD 3
    BARA EF 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARA GHIJKLM 2 A_WeaponReady(WRF_ALLOWZOOM)
	M4CD A 0 A_JumpIfInventory("AUGToken",1,"Reload")
    BARA N 0 A_JumpIfNoAmmo("Reload")
	M4CC F 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    BARA N 0 A_JumpIfInventory("Aiming",1,5)
    BARA N 0 A_JumpIfInventory("Reloading",1,"Reload")
    BARA N 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    BARA N 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARA N 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+19
    BARC F 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    BARC F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    BARC F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    BARC F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+25
  Deselect:
    BARA N 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    BARA N 0 A_TakeInventory("Aiming",1)
    BARA N 0 A_TakeInventory("Reloading",1)
    BARA N 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    BARA N 0 A_ZoomFactor(1.0)
    BARA N 0 A_Lower
    BARA N 1 A_Lower
    Goto Deselect+5
  Select:
    BARA A 0 A_Raise
    Loop
  Fire:
    BARB A 0 A_JumpIfInventory("Aiming",1,"FireAim")
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    BARB A 0 A_PlayWeaponSound("hbar/fire")
    BARB A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,6,3)
    BARB A 1 BRIGHT A_FireCustomMissile("HHCBAUG", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	BARB A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("AUGHBARClip",5,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    BARB A 0 A_JumpIfNoAmmo("FireEmpty")
    BARB B 1 BRIGHT A_GunFlash
    BARB CD 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARB D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARB EF 1 A_ReFire
    Goto Ready+19
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB EF 1 A_ReFire
    Goto Ready+19
  Hold:
    BARB A 0 A_JumpIfInventory("Aiming",1,"HoldAim")
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    BARB A 0 A_PlayWeaponSound("hbar/fire")
    BARB A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,6,3)
    BARB A 1 BRIGHT A_FireCustomMissile("HHCBAUG", frandom(-9.00,9.00), 1, 0, 4, 0, frandom(-9.00,9.00))
	BARB A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BARB A 0 A_JumpIfInventory("AUGHBARClip",5,2)
    BARB A 0 A_PlaySound("m9/lock")
    BARB A 0 A_JumpIfNoAmmo("FireEmpty")
    BARB B 1 BRIGHT A_GunFlash
    BARB CD 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARB D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARB EF 1 A_ReFire
    Goto Ready+19
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB EF 1 A_ReFire
    Goto Ready+19
  FireAim:
    BARD A 0 A_PlayWeaponSound("hbar/fire")
    BARD A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,0,2)
    BARD A 1 BRIGHT A_FireCustomMissile("HHCBAUG", frandom(-1.30,1.30), 1, 0, 4, 0, frandom(-1.30,1.30))
	BARD A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,30-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BARB A 0 A_JumpIfInventory("AUGHBARClip",5,2)
    BARB A 0 A_PlaySound("m9/lock")
    BARD A 0 A_JumpIfNoAmmo("FireAimEmpty")
    BARD B 1 BRIGHT A_GunFlash
    BARD CD 1
    BARD D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARD EF 1 A_ReFire
    Goto Ready+25
    BARD A 0 A_JumpIfNoAmmo("ReloadStart")
    BARD EF 1 A_ReFire
    Goto Ready+25
  HoldAim:
    BARD A 0 A_PlayWeaponSound("hbar/fire")
    BARD A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,0,2)
    BARD A 1 BRIGHT A_FireCustomMissile("HHCBAUG", frandom(-1.90,1.90), 1, 0, 4, 0, frandom(-1.90,1.90))
	BARD A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,30-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BARD A 0 A_JumpIfInventory("AUGHBARClip",5,2)
    BARD A 0 A_PlaySound("m9/lock")
    BARD A 0 A_JumpIfNoAmmo("FireAimEmpty")
    BARD B 1 BRIGHT A_GunFlash
    BARD CD 1
    BARD D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARD EF 1 A_ReFire
    Goto Ready+25
    BARD A 0 A_JumpIfNoAmmo("ReloadStart")
    BARD EF 1 A_ReFire
    Goto Ready+25
  FireEmpty:
    BARB B 1 BRIGHT A_GunFlash
    BARB CDEF 1 A_GiveInventory("AUGHBARBolt",1)
    BARB D 0 A_JumpIfInventory("AUGHBARAmmo",1,2)
    BARB D 0 A_ReFire
    Goto Ready+19
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB D 0 A_ReFire
    Goto Ready+19
  FireAimEmpty:
    BARD B 1 BRIGHT A_GunFlash
    BARD CDEF 1 A_GiveInventory("AUGHBARBolt",1)
    BARD D 0 A_JumpIfInventory("AUGHBARAmmo",1,2)
    BARD D 0 A_ReFire
    Goto Ready+25
    BARD A 0 A_JumpIfNoAmmo("ReloadStart")
    BARD D 0 A_ReFire
    Goto Ready+25
  Reload: //AltFire:
    BARE A 0 A_JumpIfInventory("AUGHBARClip",42,2)
    BARE A 0 A_JumpIfInventory("AUGHBARAmmo",1,"ReloadStart")
    BARE A 0 A_TakeInventory("Reloading",1)
    BARE A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+22
  ReloadStart:
    BARE A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    BARE A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    BARE A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	BARE A 0 A_JumpIfInventory("AUGToken",1,"Reload2")
    BARE A 3 A_PlaySoundEx("hbar/up","SoundSlot5")
    BARE BCDEFG 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARE HIJKL 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BARE M 3 A_PlaySoundEx("hbar/clipout","SoundSlot5")
	BARE M 0 A_FireCustomMissile("EmptyBoxMagSpawner",0,0,0,-4)
	BARE M 0 A_GiveInventory("AUGToken",1)
	BARE NOPQR 3
	goto Reload2
  Reload2:
    BARE S 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARE TUVWXYZ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BARF AB 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARF C 3 A_PlaySoundEx("hbar/clipin","SoundSlot5")
    BARF D 3 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo
  ReloadAmmo:
    BARF Z 0 A_JumpIfInventory("AUGHBARClip",42,"ReloadEnd")
	BARF Z 0 A_TakeInventory("AUGToken",1)
    BARF Z 0 A_JumpIfInventory("AUGHBARAmmo",1,1)
    Goto ReloadEnd
    BARF Z 0 A_GiveInventory("AUGHBARClip",1)
    BARF Z 0 A_TakeInventory("AUGHBARAmmo",1)
    Goto ReloadAmmo
  ReloadEnd:
    BARF EF 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARF G 3 A_JumpIfInventory("AUGHBARBolt",1,"ReloadEndBolt")
    BARF HIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARF KLMN 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARF G 0 A_ReFire
    Goto Ready+19
  ReloadEndBolt:
    BARG A 0 A_TakeInventory("AUGHBARBolt",1)
    BARG ABCD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARG E 3 A_PlaySoundEx("hbar/bolt","SoundSlot5")
    BARG FGHI 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BARG JKLMNO 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARG V 0 A_ReFire
    Goto Ready+19
  Zoom:
  PostReloadAlt:
    BARE A 0 A_JumpIfInventory("AUGToken",1,"Reload")
    BARC F 0 A_ZoomFactor(1.2)
    BARC E 0 A_GiveInventory("Aiming",1)
	BARC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    BARC ABCDEF 1
    Goto AltHold
  AltFireHoldAim:
    "####" "#" 0 A_JumpIfInventory("AUGHBARClip",1,1)
	Goto Reload
    BARD A 0 A_PlayWeaponSound("hbar/fire")
	GRNA L 0 A_TakeInventory("AUGHBARClip",1)
    BARD A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,0,2)
    BARD A 1 BRIGHT A_FireCustomMissile("HHCBAUG", frandom(-1.90,1.90), 1, 0, 4, 0, frandom(-1.90,1.90))
	BARD A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,30-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BARD A 0 A_JumpIfInventory("AUGHBARClip",5,2)
    BARD A 0 A_PlaySound("m9/lock")
    BARD B 1 BRIGHT A_GunFlash
    BARD CD 1
    "####" "#" 0 A_JumpIfInventory("AUGHBARClip",1,1)
	Goto Reload
    BARD EF 1 A_ReFire
    Goto Ready+25
  AltHold:
    BARC 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+25
  AltFire:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    M4CD A 0 A_JumpIfInventory("AUGToken",1,"Reload")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    BARC A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    BARC A 0 A_ZoomFactor(1.2)
    BARC AB 1
    BARC B 0 A_GiveInventory("Aiming",1)
    BARC CDEF 1
    BARC F 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    BARC F 0 A_Refire
    Goto Ready+25
  AltFire2:
    BARC F 0 A_ZoomFactor(1.0)
    BARC FE 1
    BARC E 0 A_TakeInventory("Aiming",1)
    BARC DCBA 1
    BARC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	BARA NNNN 1
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+19
  AltFire3:
    BARC F 0 A_ZoomFactor(1.0)
    BARC FE 1
    BARC E 0 A_TakeInventory("Aiming",1)
    BARC DCBA 1
    BARC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    BARC A 0 A_Refire
	goto DropWeapon
  ReloadStartAim:
    BARC F 0 A_ZoomFactor(1.0)
    BARC FE 1
    BARC E 0 A_TakeInventory("Aiming",1)
    BARC DCBA 1
    BARC 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:
    WEP2 B 0
    WEP2 B 0 A_SpawnItem("AUGHBARDrop")
    stop
  ReloadStart_SOH:
    BARE A 0 A_JumpIfInventory("AUGToken",1,"Reload3")
    BARE A 2 A_PlaySoundEx("hbar/up","SoundSlot5")
    BARE BCDEFG 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARE HIJK 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BARE L 2 A_PlaySoundEx("hbar/clipout","SoundSlot5")
	BARE L 0 A_FireCustomMissile("EmptyBoxMagSpawner",0,0,0,-4)
    BARE M 0 A_GiveInventory("AUGToken",1)
	BARE NOPQR 2
	goto Reload3
  Reload3:
    BARE S 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARE TUVWXYZ 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BARF AB 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARF C 2 A_PlaySoundEx("hbar/clipin","SoundSlot5")
    BARF D 2 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    BARF Z 0 A_JumpIfInventory("AUGHBARClip",42,"ReloadEnd_SOH")
	BARF Z 0 A_TakeInventory("AUGToken",1)
    BARF Z 0 A_JumpIfInventory("AUGHBARAmmo",1,1)
    Goto ReloadEnd_SOH
    BARF Z 0 A_GiveInventory("AUGHBARClip",1)
    BARF Z 0 A_TakeInventory("AUGHBARAmmo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    BARF EF 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARF G 2 A_JumpIfInventory("AUGHBARBolt",1,"ReloadEndBolt_SOH")
    BARF HIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARF KLMN 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARF G 0 A_ReFire
    Goto Ready+19
  ReloadEndBolt_SOH:
    BARG A 0 A_TakeInventory("AUGHBARBolt",1)
    BARG AB 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARG C 2 A_PlaySoundEx("hbar/bolt","SoundSlot5")
    BARG DEFGHI 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BARG JKLMNO 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARG V 0 A_ReFire
    Goto Ready+19
  Fire_SteadyAim:
    BARB A 0 A_PlayWeaponSound("hbar/fire")
    BARB A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,6,3)
    BARB A 1 BRIGHT A_FireCustomMissile("HHCBAUG", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-5.00,5.00))
	BARB A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BARB A 0 A_JumpIfInventory("AUGHBARClip",5,2)
    BARB A 0 A_PlaySound("m9/lock")
    BARB A 0 A_JumpIfNoAmmo("FireEmpty")
    BARB B 1 BRIGHT A_GunFlash
    BARB CD 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARB D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARB EF 1 A_ReFire
    Goto Ready+19
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB EF 1 A_ReFire
    Goto Ready+19
  Hold_SteadyAim:
    BARB A 0 A_PlayWeaponSound("hbar/fire")
    BARB A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,6,3)
    BARB A 1 BRIGHT A_FireCustomMissile("HHCBAUG", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	BARB A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BARB A 0 A_JumpIfInventory("AUGHBARClip",5,2)
    BARB A 0 A_PlaySound("m9/lock")
    BARB A 0 A_JumpIfNoAmmo("FireEmpty")
    BARB B 1 BRIGHT A_GunFlash
    BARB CD 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARB D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARB EF 1 A_ReFire
    Goto Ready+19
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB EF 1 A_ReFire
    Goto Ready+19
  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
    Goto Ready+2
  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
    Goto Ready+2
  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)
    Goto Ready+2
  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)
    Goto Ready+2
  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)
    Goto Ready+2
  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)
    Goto Ready+2
  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
    Goto Ready+2
  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
    Goto Ready+2
  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
    Goto Ready+2
  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
    Goto Ready+2
  DropWeapon:
    BARA NMLKJIHGFEDCB 2 A_WeaponReady(WRF_NOPRIMARY)
	BARA 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("AUGDropped",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("AUGThrown",0,0,7,2)
	stop
  }
}

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

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

actor "AUG HBAR Ex Mags" : "AUG HBAR"
{
  obituary "%k fed %o with lead with the AUG HBAR."
  inventory.pickupmessage "You got the AUG HBAR light machinegun."
  //attacksound "hbar/fire1"
  weapon.selectionorder 1
  weapon.ammotype "AUGHBARClip2"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "AUGHBARAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    BARA A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    BARA A 0 
    BARA ABCD 3
    BARA EF 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARA GHIJKLM 2 A_WeaponReady(WRF_ALLOWZOOM)
	M4CD A 0 A_JumpIfInventory("AUGToken",1,"Reload")
    BARA N 0 A_JumpIfNoAmmo("Reload")
	M4CC F 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    BARA N 0 A_JumpIfInventory("Aiming",1,5)
    BARA N 0 A_JumpIfInventory("Reloading",1,"Reload")
    BARA N 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    BARA N 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARA N 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+19
    BARC F 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    BARC F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    BARC F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    BARC F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+25
  Fire:
    BARB A 0 A_JumpIfInventory("Aiming",1,"FireAim")
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    BARB A 0 A_PlayWeaponSound("hbar/fire")
    BARB A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,6,3)
    BARB A 1 BRIGHT A_FireCustomMissile("HHCBAUG", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	BARB A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BARB A 0 A_JumpIfInventory("AUGHBARClip2",5,2)
    BARB A 0 A_PlaySound("m9/lock")
    BARB A 0 A_JumpIfNoAmmo("FireEmpty")
    BARB B 1 BRIGHT A_GunFlash
    BARB CD 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARB D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARB EF 1 A_ReFire
    Goto Ready+19
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB EF 1 A_ReFire
    Goto Ready+19
  Hold:
    BARB A 0 A_JumpIfInventory("Aiming",1,"HoldAim")
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    BARB A 0 A_PlayWeaponSound("hbar/fire")
    BARB A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,6,3)
    BARB A 1 BRIGHT A_FireCustomMissile("HHCBAUG", frandom(-9.00,9.00), 1, 0, 4, 0, frandom(-9.00,9.00))
	BARB A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BARB A 0 A_JumpIfInventory("AUGHBARClip2",5,2)
    BARB A 0 A_PlaySound("m9/lock")
    BARB A 0 A_JumpIfNoAmmo("FireEmpty")
    BARB B 1 BRIGHT A_GunFlash
    BARB CD 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARB D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARB EF 1 A_ReFire
    Goto Ready+19
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB EF 1 A_ReFire
    Goto Ready+19
  FireAim:
    BARD A 0 A_PlayWeaponSound("hbar/fire")
    BARD A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,0,2)
    BARD A 1 BRIGHT A_FireCustomMissile("HHCBAUG", frandom(-1.30,1.30), 1, 0, 4, 0, frandom(-1.30,1.30))
	BARD A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,30-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BARD A 0 A_JumpIfInventory("AUGHBARClip2",5,2)
    BARD A 0 A_PlaySound("m9/lock")
    BARD A 0 A_JumpIfNoAmmo("FireAimEmpty")
    BARD B 1 BRIGHT A_GunFlash
    BARD CD 1
    BARD D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARD EF 1 A_ReFire
    Goto Ready+25
    BARD A 0 A_JumpIfNoAmmo("ReloadStart")
    BARD EF 1 A_ReFire
    Goto Ready+25
  HoldAim:
    BARD A 0 A_PlayWeaponSound("hbar/fire")
    BARD A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,0,2)
    BARD A 1 BRIGHT A_FireCustomMissile("HHCBAUG", frandom(-1.90,1.90), 1, 0, 4, 0, frandom(-1.90,1.90))
	BARD A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,30-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BARD A 0 A_JumpIfInventory("AUGHBARClip2",5,2)
    BARD A 0 A_PlaySound("m9/lock")
    BARD A 0 A_JumpIfNoAmmo("FireAimEmpty")
    BARD B 1 BRIGHT A_GunFlash
    BARD CD 1
    BARD D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARD EF 1 A_ReFire
    Goto Ready+25
    BARD A 0 A_JumpIfNoAmmo("ReloadStart")
    BARD EF 1 A_ReFire
    Goto Ready+25
  Fire_SteadyAim:
    BARB A 0 A_PlayWeaponSound("hbar/fire")
    BARB A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,6,3)
    BARB A 1 BRIGHT A_FireCustomMissile("HHCBAUG", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-5.00,5.00))
	BARB A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BARB A 0 A_JumpIfInventory("AUGHBARClip2",5,2)
    BARB A 0 A_PlaySound("m9/lock")
    BARB A 0 A_JumpIfNoAmmo("FireEmpty")
    BARB B 1 BRIGHT A_GunFlash
    BARB CD 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARB D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARB EF 1 A_ReFire
    Goto Ready+19
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB EF 1 A_ReFire
    Goto Ready+19
  Hold_SteadyAim:
    BARB A 0 A_PlayWeaponSound("hbar/fire")
    BARB A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,6,3)
    BARB A 1 BRIGHT A_FireCustomMissile("HHCBAUG", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	BARB A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BARB A 0 A_JumpIfInventory("AUGHBARClip2",5,2)
    BARB A 0 A_PlaySound("m9/lock")
    BARB A 0 A_JumpIfNoAmmo("FireEmpty")
    BARB B 1 BRIGHT A_GunFlash
    BARB CD 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARB D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARB EF 1 A_ReFire
    Goto Ready+19
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB EF 1 A_ReFire
    Goto Ready+19
  Reload: //AltFire:
    BARE A 0 A_JumpIfInventory("AUGHBARClip2",63,2)
    BARE A 0 A_JumpIfInventory("AUGHBARAmmo",1,"ReloadStart")
    BARE A 0 A_TakeInventory("Reloading",1)
    BARE A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+22
  ReloadStart:
    BARE A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    BARE A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    BARE A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	BARE A 0 A_JumpIfInventory("AUGToken",1,"Reload2")
    BARE A 3 A_PlaySoundEx("hbar/up","SoundSlot5")
    BARE BCDEFG 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARE HIJKL 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BARE M 3 A_PlaySoundEx("hbar/clipout","SoundSlot5")
	BARE M 0 A_FireCustomMissile("F2000EmptyMagExtendedSpawner",0,0,0,-4)
    BARE M 0 A_GiveInventory("AUGToken",1)
	BARE NOPQR 3
	goto Reload2
  Reload2:
    BARE S 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARE TUVWXYZ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BARF AB 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARF C 3 A_PlaySoundEx("hbar/clipin","SoundSlot5")
    BARF D 3 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo
  ReloadAmmo:
    BARF Z 0 A_JumpIfInventory("AUGHBARClip2",63,"ReloadEnd")
	BARF Z 0 A_TakeInventory("AUGToken",1)
    BARF Z 0 A_JumpIfInventory("AUGHBARAmmo",1,1)
    Goto ReloadEnd
    BARF Z 0 A_GiveInventory("AUGHBARClip2",1)
    BARF Z 0 A_TakeInventory("AUGHBARAmmo",1)
    Goto ReloadAmmo
  ReloadEnd:
    BARF EF 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARF G 3 A_JumpIfInventory("AUGHBARBolt",1,"ReloadEndBolt")
    BARF HIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARF KLMN 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARF G 0 A_ReFire
    Goto Ready+19
  ReloadEndBolt:
    BARG A 0 A_TakeInventory("AUGHBARBolt",1)
    BARG ABCD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARG E 3 A_PlaySoundEx("hbar/bolt","SoundSlot5")
    BARG FGHI 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BARG JKLMNO 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARG V 0 A_ReFire
    Goto Ready+19
  ReloadStartAim:
    BARC F 0 A_ZoomFactor(1.0)
    BARC FE 1
    BARC E 0 A_TakeInventory("Aiming",1)
    BARC DCBA 1
    BARC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+2
  ReloadStart_SOH:
    BARE A 0 A_JumpIfInventory("AUGToken",1,"Reload3")
    BARE A 2 A_PlaySoundEx("hbar/up","SoundSlot5")
    BARE BCDEFG 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARE HIJK 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BARE L 2 A_PlaySoundEx("hbar/clipout","SoundSlot5")
	BARE L 0 A_FireCustomMissile("F2000EmptyMagExtendedSpawner",0,0,0,-4)
    BARE M 0 A_GiveInventory("AUGToken",1)
	BARE NOPQR 2
	goto Reload3
  Reload3:
    BARE S 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARE TUVWXYZ 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BARF AB 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARF C 2 A_PlaySoundEx("hbar/clipin","SoundSlot5")
    BARF D 2 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    BARF Z 0 A_JumpIfInventory("AUGHBARClip2",63,"ReloadEnd_SOH")
	BARF Z 0 A_TakeInventory("AUGToken",1)
    BARF Z 0 A_JumpIfInventory("AUGHBARAmmo",1,1)
    Goto ReloadEnd_SOH
    BARF Z 0 A_GiveInventory("AUGHBARClip2",1)
    BARF Z 0 A_TakeInventory("AUGHBARAmmo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    BARF EF 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARF G 2 A_JumpIfInventory("AUGHBARBolt",1,"ReloadEndBolt_SOH")
    BARF HIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARF KLMN 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARF G 0 A_ReFire
    Goto Ready+19
  ReloadEndBolt_SOH:
    BARG A 0 A_TakeInventory("AUGHBARBolt",1)
    BARG AB 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BARG C 2 A_PlaySoundEx("hbar/bolt","SoundSlot5")
    BARG DEFGHI 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BARG JKLMNO 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARG V 0 A_ReFire
    Goto Ready+19
  AltFireHoldAim:
    "####" "#" 0 A_JumpIfInventory("AUGHBARClip2",1,1)
	Goto Reload
    BARD A 0 A_PlayWeaponSound("hbar/fire")
	GRNA L 0 A_TakeInventory("AUGHBARClip2",1)
    BARD A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,0,2)
    BARD A 1 BRIGHT A_FireCustomMissile("HHCBAUG", frandom(-1.90,1.90), 1, 0, 4, 0, frandom(-1.90,1.90))
	BARD A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,30-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BARD A 0 A_JumpIfInventory("AUGHBARClip2",5,2)
    BARD A 0 A_PlaySound("m9/lock")
    BARD B 1 BRIGHT A_GunFlash
    BARD CD 1
    "####" "#" 0 A_JumpIfInventory("AUGHBARClip2",1,1)
	Goto Reload
    BARD EF 1 A_ReFire
    Goto Ready+25
  }
}

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

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

actor "AUG HBAR Grip" : "AUG HBAR"
{
  obituary "%k fed %o with lead with the AUG HBAR."
  inventory.pickupmessage "You got the AUG HBAR light machinegun."
  //attacksound "hbar/fire1"
  weapon.selectionorder 1
  weapon.ammotype "AUGHBARClip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "AUGHBARAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Fire:
    BARB A 0 A_JumpIfInventory("Aiming",1,"FireAim")
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    BARB A 0 A_PlayWeaponSound("hbar/fire")
    BARB A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,6,3)
    BARB A 1 BRIGHT A_FireCustomMissile("HHCBAUGG", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-5.00,5.00))
	BARB A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,90,0,0)
    BARB A 0 A_JumpIfInventory("AUGHBARClip",5,2)
    BARB A 0 A_PlaySound("m9/lock")
    BARB A 0 A_JumpIfNoAmmo("FireEmpty")
    BARB B 1 BRIGHT A_GunFlash
    BARB CD 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARB D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARB EF 1 A_ReFire
    Goto Ready+19
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB EF 1 A_ReFire
    Goto Ready+19
  Hold:
    BARB A 0 A_JumpIfInventory("Aiming",1,"HoldAim")
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    BARB A 0 A_PlayWeaponSound("hbar/fire")
    BARB A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,6,3)
    BARB A 1 BRIGHT A_FireCustomMissile("HHCBAUGG", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	BARB A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,90,0,0)
    BARB A 0 A_JumpIfInventory("AUGHBARClip",5,2)
    BARB A 0 A_PlaySound("m9/lock")
    BARB A 0 A_JumpIfNoAmmo("FireEmpty")
    BARB B 1 BRIGHT A_GunFlash
    BARB CD 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARB D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARB EF 1 A_ReFire
    Goto Ready+19
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB EF 1 A_ReFire
    Goto Ready+19
  FireAim:
    BARD A 0 A_PlayWeaponSound("hbar/fire")
    BARD A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,0,2)
    BARD A 1 BRIGHT A_FireCustomMissile("HHCBAUGG", frandom(-1.00,1.00), 1, 0, 4, 0, frandom(-1.00,1.00))
	BARD A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,30-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,90,0,0)
    BARD A 0 A_JumpIfInventory("AUGHBARClip",5,2)
    BARD A 0 A_PlaySound("m9/lock")
    BARD A 0 A_JumpIfNoAmmo("FireAimEmpty")
    BARD B 1 BRIGHT A_GunFlash
    BARD CD 1
    BARD D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARD EF 1 A_ReFire
    Goto Ready+25
    BARD A 0 A_JumpIfNoAmmo("ReloadStart")
    BARD EF 1 A_ReFire
    Goto Ready+25
  HoldAim:
    BARD A 0 A_PlayWeaponSound("hbar/fire")
    BARD A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,0,2)
    BARD A 1 BRIGHT A_FireCustomMissile("HHCBAUGG", frandom(-1.40,1.40), 1, 0, 4, 0, frandom(-1.40,1.40))
	BARD A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,30-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,90,0,0)
    BARD A 0 A_JumpIfInventory("AUGHBARClip",5,2)
    BARD A 0 A_PlaySound("m9/lock")
    BARD A 0 A_JumpIfNoAmmo("FireAimEmpty")
    BARD B 1 BRIGHT A_GunFlash
    BARD CD 1
    BARD D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARD EF 1 A_ReFire
    Goto Ready+25
    BARD A 0 A_JumpIfNoAmmo("ReloadStart")
    BARD EF 1 A_ReFire
    Goto Ready+25
  Fire_SteadyAim:
    BARB A 0 A_PlayWeaponSound("hbar/fire")
    BARB A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,6,3)
    BARB A 1 BRIGHT A_FireCustomMissile("HHCBAUGG", frandom(-3.50,3.50), 1, 0, 4, 0, frandom(-3.50,3.50))
	BARB A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,90,0,0)
    BARB A 0 A_JumpIfInventory("AUGHBARClip",5,2)
    BARB A 0 A_PlaySound("m9/lock")
    BARB A 0 A_JumpIfNoAmmo("FireEmpty")
    BARB B 1 BRIGHT A_GunFlash
    BARB CD 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARB D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARB EF 1 A_ReFire
    Goto Ready+19
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB EF 1 A_ReFire
    Goto Ready+19
  Hold_SteadyAim:
    BARB A 0 A_PlayWeaponSound("hbar/fire")
    BARB A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,6,3)
    BARB A 1 BRIGHT A_FireCustomMissile("HHCBAUGG", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-5.00,5.00))
	BARB A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,90,0,0)
    BARB A 0 A_JumpIfInventory("AUGHBARClip",5,2)
    BARB A 0 A_PlaySound("m9/lock")
    BARB A 0 A_JumpIfNoAmmo("FireEmpty")
    BARB B 1 BRIGHT A_GunFlash
    BARB CD 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    BARB D 0 A_JumpIfInventory("AUGHBARAmmo",1,3)
    BARB EF 1 A_ReFire
    Goto Ready+19
    BARB A 0 A_JumpIfNoAmmo("ReloadStart")
    BARB EF 1 A_ReFire
    Goto Ready+19
  AltFireHoldAim:
    "####" "#" 0 A_JumpIfInventory("AUGHBARClip",1,1)
	Goto Reload
    BARD A 0 A_PlayWeaponSound("hbar/fire")
	GRNA L 0 A_TakeInventory("AUGHBARClip",1)
    BARD A 0 A_FireCustomMissile("WeaponSmokePuff_LMGMuzzle",0,0,0,2)
    BARD A 1 BRIGHT A_FireCustomMissile("HHCBAUGG", frandom(-1.40,1.40), 1, 0, 4, 0, frandom(-1.40,1.40))
	BARD A 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,3,30-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BARD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,90,0,0)
    BARD A 0 A_JumpIfInventory("AUGHBARClip",5,2)
    BARD A 0 A_PlaySound("m9/lock")
    BARD B 1 BRIGHT A_GunFlash
    BARD CD 1
    "####" "#" 0 A_JumpIfInventory("AUGHBARClip",1,1)
	Goto Reload
    BARD EF 1 A_ReFire
    Goto Ready+25
  }
}

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

actor AUGHBARPickup : CustomInventory
{
  inventory.pickupmessage "You got the AUG HBAR light machinegun."
  inventory.pickupsound "hbar/bolt"
  +INVENTORY.AUTOACTIVATE
  //inventory.respawntics 70
  scale 0.15
  States
  {
  Spawn:
    WEP2 B -1
    stop
  Pickup:
    WEP2 B 0
    WEP2 B 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",0,0,0)) == 1, "PickupStay")
    WEP2 B 0 A_JumpIfInventory("AUG HBAR",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 B 0 A_JumpIfInventory("AUG HBAR Ex Mags",1,"AmmoPickup")
    WEP2 B 0 A_JumpIfInventory("AUG HBAR Grip",1,"AmmoPickup")
    WEP2 B 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 B 0 A_JumpIfInventory("MaxWeaponsFilled",62,"FailPickup2")
	WEP2 B 0 A_GiveInventory("MaxWeaponsFilled",39)
    WEP2 B 0 ACS_NamedExecuteWithResult("RefPickU",28,0,0)
    stop
  PickupStay:
    WEP2 B 0
    WEP2 B 0 A_JumpIfInventory("AUG HBAR",1,"FailPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 B 0 A_JumpIfInventory("AUG HBAR Ex Mags",1,"FailPickup")
    WEP2 B 0 A_JumpIfInventory("AUG HBAR Grip",1,"FailPickup")
    WEP2 B 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 B 0 A_JumpIfInventory("MaxWeaponsFilled",62,"FailPickup2")
	WEP2 B 0 A_GiveInventory("MaxWeaponsFilled",39)
    WEP2 B 0 ACS_NamedExecuteWithResult("RefPickU",28,0,0)
    WEP2 B 0 ACS_NamedExecuteWithResult("RefPickC",28,0,0)
    WEP2 B 0 A_PlaySound("hbar/bolt")
    fail
  AmmoPickup:
    WEP2 B 0
    WEP2 B 0 A_JumpIfInventory("AUGHBARAmmo",0,"FailPickup")
    WEP2 B 0 A_GiveInventory("AUGHBARAmmo",42)
    stop
  OneManArmy:
    WEP2 B 0
	WEP2 B 0 A_JumpIfInventory("MaxWeaponsFilled",99,"FailPickup2")
	WEP2 B 0 A_GiveInventory("MaxWeaponsFilled",39)
	WEP2 B 0 ACS_NamedExecuteWithResult("RefPickU",28,0,0)
	stop
  FailPickup:
    WEP2 B 1
    fail
  FailPickup2:
    WEP2 B 1
    WEP2 B 0 ACS_NamedExecuteAlways("RefSlots",0,30,0,0)
    fail
  }
}

actor AUGHBARDrop : AUGHBARPickup
{
  States
  {
  Spawn:
    WEP2 B -1
    stop
  Pickup:
    WEP2 B 0
    WEP2 B 0 A_JumpIfInventory("AUG HBAR",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 B 0 A_JumpIfInventory("AUG HBAR Ex Mags",1,"AmmoPickup")
    WEP2 B 0 A_JumpIfInventory("AUG HBAR Grip",1,"AmmoPickup")
    WEP2 B 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 B 0 A_JumpIfInventory("MaxWeaponsFilled",62,"FailPickup2")
	WEP2 B 0 A_GiveInventory("MaxWeaponsFilled",39)
    WEP2 B 0 ACS_NamedExecuteWithResult("RefPickU",28,0,0)
    stop
  }
}

actor AUGHBARDrop2 : AUGHBARDrop
{
  States
  {
  Spawn:
    WEP2 B -1
    stop
  Pickup:
    WEP2 B 0
    WEP2 B 0 A_JumpIfInventory("AUG HBAR",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 B 0 A_JumpIfInventory("AUG HBAR Ex Mags",1,"AmmoPickup")
    WEP2 B 0 A_JumpIfInventory("AUG HBAR Grip",1,"AmmoPickup")
    WEP2 B 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 B 0 A_JumpIfInventory("MaxWeaponsFilled",62,"FailPickup2")
	WEP2 B 0 A_GiveInventory("MaxWeaponsFilled",39)
    WEP2 B 0 ACS_NamedExecuteWithResult("RefPickU",28,0,0)
    stop
  AmmoPickup:
    WEP2 B 0
    stop
  }
}

actor HHCBAUG : HHBullet
{
  damage (random(29,35))
  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
  }
}

actor HHCBAUGG : HHCBAUG
{
  damage (random(29,32))
}