actor "M14 EBR" : RGUWeapon
{
  obituary "%k sniped %o with the M14 EBR."
  inventory.pickupmessage "You got the M14 enhanced battle rifle. They can't hide from you now."
  //attacksound "barrett/fire"
  weapon.selectionorder 15
  weapon.ammotype "M14Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "M14Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  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")
    M14A ABCDE 3 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
    M14A FGHIJ 2 A_WeaponReady(WRF_ALLOWZOOM)
    M14A K 2 A_WeaponReady(WRF_ALLOWZOOM)
	M4CD A 0 A_JumpIfInventory("M14Token",1,"Reload")
    M14A K 0 A_JumpIfNoAmmo("Reload")
	M4CC F 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    M14A K 0 A_JumpIfInventory("Aiming",1,5)
    M14A K 0 A_JumpIfInventory("Reloading",1,"Reload")
    M14A K 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    M14A K 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14A K 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+16
    SCOP A 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    SCOP A 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    SCOP A 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCOP A 0 A_JumpIfInventory("GZCheck",1,4)
    SCOP A 0 A_JumpIfInventory("Perk3_SteadyAim_Pro",1,2)
    SCOP A 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
    SCOP A 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
    SCOP C 0 A_JumpIfInventory("Perk3_SteadyAim_Pro",1,2)
    SCOP C 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
    SCOP C 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
  Deselect:
    M14A K 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    M14A K 0 A_TakeInventory("Aiming",1)
    M14A K 0 A_TakeInventory("Reloading",1)
    M14A K 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    M14A K 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
    M14A K 0 A_Lower
    M14A K 1 A_Lower
    Goto Deselect+5
  Select:
    B50A A 0 A_Raise
    Loop
  Fire:
    "####" "#" 0 A_JumpIfInventory("Aiming",1,"FireAim")
    M14A K 1 A_JumpIfNoAmmo("ReloadStart")
    M14B A 0 A_JumpIfInventory("CoopCheck",1,2)
    M14B A 0 A_TakeInventory("PowerInvisibility",500)
    M14B A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    M14B A 0 A_PlayWeaponSound("m14/fire")
    M14B AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,3)
    M14B A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,6,3)
    M14B A 1 BRIGHT A_FireCustomMissile("HHCBM14EBRA", frandom(-10.00,10.00), 1, 0, 4, 0, frandom(-10.00,10.00))
	M14B A 0 A_SpawnItemEx("RifleCasingMK14",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)
    M14B B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M14B A 0 A_JumpIfNoAmmo("FireEmpty")
    M14B B 1 BRIGHT A_GunFlash
    M14B CDE 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    M14A KK 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    M14B A 0 A_JumpIfInventory("M14Ammo",1,1)
    Goto Ready+16
    M14B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireEmpty:
    M14B B 1 BRIGHT A_GunFlash
    M14B C 1 A_GiveInventory("M14Bolt",1)
    M14B DE 1
    M14B A 0 A_JumpIfInventory("M14Ammo",1,1)
    Goto Ready+16
    M14B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireAim:
    "####" "#" 1 A_JumpIfNoAmmo("ReloadStart")
    "####" "#" 0 A_JumpIfInventory("CoopCheck",1,2)
    "####" "#" 0 A_TakeInventory("PowerInvisibility",500)
    "####" "#" 0 A_PlayWeaponSound("m14/fire")
    "####" "##" 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,2)
    "####" "#" 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,2)
    "####" "#" 0 A_JumpIf((MomX*MomX)+(MomY*MomY) > 15,"FireAimMoving")
    "####" "#" 0 BRIGHT A_FireCustomMissile("HHCBM14EBRD", frandom(-0.10,0.10), 0, 0, 4, 0, frandom(-0.10,0.10))
    "####" "#" 1 BRIGHT A_FireCustomMissile("HHCBM14EBRD", frandom(-0.10,0.10), 1, 0, 4, 0, frandom(-0.10,0.10))
	"####" "#" 0 A_SpawnItemEx("RifleCasingMK14",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)
  FireAimCont:
    "####" "#" 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    "####" "#" 0 A_JumpIfNoAmmo("FireAimEmpty")
    "####" "#" 0 A_JumpIfInventory("Perk3_SteadyAim_Pro",1,"FireAimSteady")
    "####" "#" 1 BRIGHT A_GunFlash
    "####" "#####" 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("M14Ammo",1,1)
    Goto Ready+22
    "####" "#" 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+22
  FireAimSteady:
    "####" "#" 1 BRIGHT A_GunFlash
    "####" "##" 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "##" 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
	Goto FireAimCont+9
  FireAimMoving:
    "####" "#" 0 A_JumpIfInventory("Perk3_SteadyAim_Pro",1,3)
    "####" "#" 1 BRIGHT A_FireCustomMissile("HHCBM14EBRC", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-6.00,6.00))
	"####" "#" 0 A_SpawnItemEx("RifleCasingMK14",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)
    Goto FireAimCont
    "####" "#" 1 BRIGHT A_FireCustomMissile("HHCBM14EBRB", frandom(-1.00,1.00), 1, 0, 4, 0, frandom(-1.00,1.00))
	"####" "#" 0 A_SpawnItemEx("RifleCasingMK14",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)
    Goto FireAimCont
  FireAimEmpty:
    "####" "#" 1 BRIGHT A_GunFlash
    "####" "#" 1 A_GiveInventory("M14Bolt",1)
    "####" "##" 1
    "####" "#" 0 A_JumpIfInventory("M14Ammo",1,1)
    Goto Ready+22
    "####" "#" 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+22
  Reload: //AltFire:
    M14D A 0 A_JumpIfInventory("M14Clip",10,2)
    M14D A 0 A_JumpIfInventory("M14Ammo",1,"ReloadStart")
    M14D A 0 A_TakeInventory("Reloading",1)
    M14D A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+19
  ReloadStart:
    M14D A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    M14D A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    M14D A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	M14D A 0 A_JumpIfInventory("M14Token",1,"Reload2")
    M14D BCDEFGH 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14D I 3 A_PlaySoundEx("m14/clipout","SoundSlot5")
	M14D I 0 A_FireCustomMissile("M14EmptyMagSpawner",0,0,0,-4)
	M14D A 0 A_GiveInventory("M14Token",1)
	goto Reload2
  Reload2:
    M14D JKLMNOPQ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    M14D RSTUVW 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14D W 3 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo
  ReloadAmmo:
    M14D W 0 A_JumpIfInventory("M14Clip",10,"ReloadEnd")
	M14D W 0 A_TakeInventory("M14Token",1)
    M14D W 0 A_JumpIfInventory("M14Ammo",1,1)
    Goto ReloadEnd
    M14D W 0 A_GiveInventory("M14Clip",1)
    M14D W 0 A_TakeInventory("M14Ammo",1)
    Goto ReloadAmmo
  ReloadEnd:
    M14D X 3 A_PlaySoundEx("m14/clipin","SoundSlot5")
    M14D YZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14E ABC 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14E D 3 A_JumpIfInventory("M14Bolt",1,"ReloadEndBolt")
    M14E EF 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+16
  ReloadEndBolt:
    M14F ABCD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14F E 3 A_PlaySoundEx("m14/bolt","SoundSlot5")
    M14F F 3 A_TakeInventory("M14Bolt",1)
    M14F GHIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14F KLMNO 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto Ready+16
  Zoom:
  PostReloadAlt:
    M14D A 0 A_JumpIfInventory("M14Token",1,"Reload")
    M14C E 0 A_GiveInventory("Aiming",1)
	M14C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    M14C ABCDEF 1
	"####" "#" 0 ACS_NamedExecuteAlways("RefKick",0,0,0,2)
	M14C F 0 A_ZoomFactor(3.0,ZOOM_INSTANT)
    Goto AltHold
  ReloadBreak:
    M14C F 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
    M14C FE 1
    M14C E 0 A_TakeInventory("Aiming",1)
    M14C DCBA 1
    M14C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  ClearRefire: 
    SCOP C 1 A_ClearReFire
	Goto AltHold
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("M14Clip",1,2)
	TNT1 A 0 A_GiveInventory("M14Bolt",1)
	Goto ReloadBreak
    "####" "#" 0 A_JumpIfInventory("CoopCheck",1,2)
    "####" "#" 0 A_TakeInventory("PowerInvisibility",500)
    "####" "#" 0 A_PlayWeaponSound("m14/fire")
	"####" "#" 0 A_TakeInventory("M14Clip",1)
    "####" "##" 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,2)
    "####" "#" 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,2)
    //"####" "#" 0 A_JumpIf((MomX*MomX)+(MomY*MomY) > 15,"FireAimMoving")
    "####" "#" 0 BRIGHT A_FireCustomMissile("HHCBM14EBRD", frandom(-0.10,0.10), 0, 0, 4, 0, frandom(-0.10,0.10))
    "####" "#" 1 BRIGHT A_FireCustomMissile("HHCBM14EBRD", frandom(-0.10,0.10), 1, 0, 4, 0, frandom(-0.10,0.10))
	"####" "#" 0 A_SpawnItemEx("RifleCasingMK14",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)
    "####" "#" 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    //"####" "#" 0 A_JumpIfInventory("Perk3_SteadyAim_Pro",1,"FireAimSteady")
    "####" "#" 1 BRIGHT A_GunFlash
    "####" "#" 0 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("M14Clip",1,2)
	TNT1 A 0 A_GiveInventory("M14Bolt",1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  AltHold:
    "####" "#" 0 A_JumpIfInventory("FireHeld",1,"ClearRefire")
    SCOP C 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
	"####" "#" 0 A_JumpIfInventory("FireHeld",1,"FireAimAltHold")
	"####" "#" 0 A_JumpIfInventory("Reloading",1,"ReloadBreak")
	"####" "#" 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    "####" "#" 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	//"####" "#" 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
	"####" "#" 0 A_Refire("AltHold")
	"####" "#" 0 A_JumpIfInventory("Aiming",1,"AltFire2")
	Goto Ready+22
  AltFire:
    "####" "#" 0 A_TakeInventory("weapondropper",2)
    "####" "#" 0 A_JumpIfInventory("M14Token",1,"Reload")
	"####" "#" 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    "####" "#" 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    M14C AB 1
    "####" "#" 0 A_GiveInventory("Aiming",1)
    M14C CDEF 1
    "####" "#" 0 A_ZoomFactor(3.0,ZOOM_INSTANT)
    "####" "#" 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    "####" "#" 0 ACS_NamedExecuteAlways("RefKick",0,0,0,2)
	"####" "##" 0 A_Refire("AltHold")
    Goto Ready+22
  AltFire2:
    M14C F 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
    M14C FE 1
    M14C E 0 A_TakeInventory("Aiming",1)
    M14C DCBA 1
    M14C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto Ready+16
  ReloadStartAim:
    M14C F 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
    M14C FE 1
    M14C E 0 A_TakeInventory("Aiming",1)
    M14C DCBA 1
    M14C 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 K 15
    WEAP A 0 A_SpawnItem("M14Drop")
    stop
  Fire_SteadyAim:
    M14B A 0 A_PlayWeaponSound("m14/fire")
    M14B AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,3)
    M14B A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,6,3)
    M14B A 1 BRIGHT A_FireCustomMissile("HHCBM14EBRD", frandom(-7.50,7.50), 1, 0, 4, 0, frandom(-7.50,7.50))
	M14B A 0 A_SpawnItemEx("RifleCasingMK14",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)
    M14B B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M14B A 0 A_JumpIfNoAmmo("FireEmpty")
    M14B B 1 BRIGHT A_GunFlash
    M14B CDE 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    M14A KK 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    M14B A 0 A_JumpIfInventory("M14Ammo",1,1)
    Goto Ready+16
    M14B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  ReloadStart_SOH:
    M14D A 0 A_JumpIfInventory("M14Token",1,"Reload3")
    M14D A 2
    M14D BCDEFGH 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14D I 2 A_PlaySoundEx("m14/clipout","SoundSlot5")
	M14D I 0 A_FireCustomMissile("M14EmptyMagSpawner",0,0,0,-4)
	M14D A 0 A_GiveInventory("M14Token",1)
	goto Reload3
  Reload3:
    M14D JKLMNOPQ 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    M14D RSTUV 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14D W 2 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    M14D W 0 A_JumpIfInventory("M14Clip",10,"ReloadEnd_SOH")
	M14D W 0 A_TakeInventory("M14Token",1)
    M14D W 0 A_JumpIfInventory("M14Ammo",1,1)
    Goto ReloadEnd_SOH
    M14D W 0 A_GiveInventory("M14Clip",1)
    M14D W 0 A_TakeInventory("M14Ammo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    M14D X 2 A_PlaySoundEx("m14/clipin","SoundSlot5")
    M14D YZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14E ABC 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14E D 2 A_JumpIfInventory("M14Bolt",1,"ReloadEndBolt_SOH")
    M14E EF 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+16
  ReloadEndBolt_SOH:
    M14F ABCD 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14F E 2 A_PlaySoundEx("m14/bolt","SoundSlot5")
    M14F F 2 A_TakeInventory("M14Bolt",1)
    M14F GHIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14F KLMNO 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto Ready+16
  FragGrenade:
    U45F A 0 ACS_NamedExecuteAlways("RefSpeak",0,1,0,0)
    U45F A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
    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,ZOOM_INSTANT)
    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("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",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("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",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("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",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("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",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:
    M14A JIHGFEDCB 2 A_WeaponReady(WRF_NOPRIMARY)
	M14A 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("M14Dropped",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("M14Thrown",0,0,7,2)
	stop
  }
}

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

actor M14Bolt : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}
actor "M14 EBR Thermal" : "M14 EBR"
{
  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")
    M14A ABCDE 3 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
    M14A FGHIJ 2 A_WeaponReady(WRF_ALLOWZOOM)
    M14A K 2 A_WeaponReady(WRF_ALLOWZOOM)
	M4CD A 0 A_JumpIfInventory("M14Token",1,"Reload")
    M14A K 0 A_JumpIfNoAmmo("Reload")
	M4CC F 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    M14A K 0 A_JumpIfInventory("Aiming",1,5)
    M14A K 0 A_JumpIfInventory("Reloading",1,"Reload")
    M14A K 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    M14A K 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14A K 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+16
    SCOP A 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    SCOP A 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    SCOP A 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCOP A 0 A_GiveInventory("SniperInfrared",1)
    SCOP A 0 A_JumpIfInventory("GZCheck",1,4)
    SCOP A 0 A_JumpIfInventory("Perk3_SteadyAim_Pro",1,2)
    SCOP A 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
    SCOP A 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
    SCOP C 0 A_JumpIfInventory("Perk3_SteadyAim_Pro",1,2)
    SCOP C 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
    SCOP C 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
  Deselect:
    M14A K 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    M14A K 0 A_TakeInventory("PowerLightAmp",500)
    M14A K 0 A_TakeInventory("Aiming",1)
    M14A K 0 A_TakeInventory("AimingFar",1)
    M14A K 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    M14A K 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
    M14A K 0 A_Lower
    M14A K 1 A_Lower
    Goto Deselect+6
  Zoom:
  PostReloadAlt:
    M14D A 0 A_JumpIfInventory("M14Token",1,"Reload")
    M14C E 0 A_GiveInventory("Aiming",1)
	M14C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    M14C ABCDEF 1
	"####" "#" 0 ACS_NamedExecuteAlways("RefKick",0,0,0,2)
	"####" "#" 0 A_GiveInventory("SniperInfrared",1)
	"####" "#" 0 A_GiveInventory("AimingFar",1)
	M14C F 0 A_ZoomFactor(3.0,ZOOM_INSTANT)
    Goto AltHold
  ReloadBreak:
    M14C F 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
	M14C F 0 A_TakeInventory("PowerLightAmp",500)
    M14C FE 1
    M14C E 0 A_TakeInventory("Aiming",1)
    M14C DCBA 1
    M14C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("M14Clip",1,2)
	TNT1 A 0 A_GiveInventory("M14Bolt",1)
	Goto ReloadBreak
    "####" "#" 0 A_JumpIfInventory("CoopCheck",1,2)
    "####" "#" 0 A_TakeInventory("PowerInvisibility",500)
    "####" "#" 0 A_PlayWeaponSound("m14/fire")
	"####" "#" 0 A_TakeInventory("M14Clip",1)
    "####" "##" 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,2)
    "####" "#" 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,2)
    //"####" "#" 0 A_JumpIf((MomX*MomX)+(MomY*MomY) > 15,"FireAimMoving")
    "####" "#" 0 BRIGHT A_FireCustomMissile("HHCBM14EBRD", frandom(-0.10,0.10), 0, 0, 4, 0, frandom(-0.10,0.10))
    "####" "#" 1 BRIGHT A_FireCustomMissile("HHCBM14EBRD", frandom(-0.10,0.10), 1, 0, 4, 0, frandom(-0.10,0.10))
	"####" "#" 0 A_SpawnItemEx("RifleCasingMK14",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)
    "####" "#" 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    //"####" "#" 0 A_JumpIfInventory("Perk3_SteadyAim_Pro",1,"FireAimSteady")
    "####" "#" 1 BRIGHT A_GunFlash
    "####" "#" 0 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("M14Clip",1,2)
	TNT1 A 0 A_GiveInventory("M14Bolt",1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  AltHold:
    "####" "#" 0 A_GiveInventory("SniperInfrared",1)
	"####" "#" 0 A_GiveInventory("AimingFar",1)
    "####" "#" 0 A_JumpIfInventory("FireHeld",1,"ClearRefire")
    SCOP C 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
	"####" "#" 0 A_JumpIfInventory("FireHeld",1,"FireAimAltHold")
	"####" "#" 0 A_JumpIfInventory("Reloading",1,"ReloadBreak")
	"####" "#" 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    "####" "#" 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	//"####" "#" 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
	"####" "#" 0 A_Refire("AltHold")
	"####" "#" 0 A_JumpIfInventory("Aiming",1,"AltFire2")
	Goto Ready+22
  AltFire:
    "####" "#" 0 A_TakeInventory("weapondropper",2)
    "####" "#" 0 A_JumpIfInventory("M14Token",1,"Reload")
	"####" "#" 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    "####" "#" 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    M14C AB 1
    M14C B 0 A_GiveInventory("Aiming",1)
    M14C B 0 A_TakeInventory("AimingFar",1)
    M14C CDEF 1
    M14C F 0 A_ZoomFactor(3.0,ZOOM_INSTANT)
    M14C F 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    M14C F 0 ACS_NamedExecuteAlways("RefKick",0,0,0,2)
	"####" "##" 0 A_Refire("AltHold")
    Goto Ready+22
  AltFire2:
    "####" "#" 0 A_JumpIfInventory("AimingFar",1,"AltFire3")
    "####" "#" 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    "####" "#" 0 A_GiveInventory("AimingFar",1)
    "####" "#" 5 A_ZoomFactor(7.5)
    Goto Ready+26
  AltFire3:
    M14C F 0 A_TakeInventory("PowerLightAmp",500)
    M14C F 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
    M14C FE 1
    M14C E 0 A_TakeInventory("Aiming",1)
    M14C E 0 A_TakeInventory("AimingFar",1)
    M14C DCBA 1
    M14C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto Ready+16
  ReloadStartAim:
    M14C F 0 A_TakeInventory("PowerLightAmp",500)
    M14C F 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
    M14C FE 1
    M14C E 0 A_TakeInventory("Aiming",1)
    M14C E 0 A_TakeInventory("AimingFar",1)
    M14C DCBA 1
    M14C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+2
  FragGrenade:
    U45F A 0 ACS_NamedExecuteAlways("RefSpeak",0,1,0,0)
    U45F A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
    U45F A 0 A_TakeInventory("PowerLightAmp",500)
    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
  KnifeAttack:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    U45F A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
    U45F A 0 A_TakeInventory("PowerLightAmp",500)
    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("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  }
}

actor M14Thermal : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}
actor "M14 EBR Ex Mags" : "M14 EBR"
{
  weapon.ammotype "M14Clip2"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "M14Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  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")
    M14A ABCDE 3 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
    M14A FGHIJ 2 A_WeaponReady(WRF_ALLOWZOOM)
    M14A K 2 A_WeaponReady(WRF_ALLOWZOOM)
	M4CD A 0 A_JumpIfInventory("M14Token",1,"Reload")
    M14A K 0 A_JumpIfNoAmmo("Reload")
	M4CC F 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    M14A K 0 A_JumpIfInventory("Aiming",1,5)
    M14A K 0 A_JumpIfInventory("Reloading",1,"Reload")
    M14A K 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    M14A K 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14A K 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+16
    SCOP A 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    SCOP A 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    SCOP A 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SCOP A 0 A_JumpIfInventory("GZCheck",1,4)
    SCOP A 0 A_JumpIfInventory("Perk3_SteadyAim_Pro",1,2)
    SCOP A 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
    SCOP A 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
    SCOP C 0 A_JumpIfInventory("Perk3_SteadyAim_Pro",1,2)
    SCOP C 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
    SCOP C 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
  Reload: //AltFire:
    M14D A 0 A_JumpIfInventory("M14Clip2",15,2)
    M14D A 0 A_JumpIfInventory("M14Ammo",1,"ReloadStart")
    M14D A 0 A_TakeInventory("Reloading",1)
    M14D A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+19
  ReloadStart:
    M14D A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    M14D A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    M14D A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	M14D A 0 A_JumpIfInventory("M14Token",1,"Reload2")
    M14D BCDEFGH 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14D I 3 A_PlaySoundEx("m14/clipout","SoundSlot5")
	M14D I 0 A_FireCustomMissile("M14EmptyMagExtSpawner",0,0,0,-4)
	M14D A 0 A_GiveInventory("M14Token",1)
	goto Reload2
  Reload2:
    M14D JKLMNOPQ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    M14D RSTUV 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14D W 3 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo
  ReloadAmmo:
    M14D W 0 A_JumpIfInventory("M14Clip2",15,"ReloadEnd")
	M14D W 0 A_TakeInventory("M14Token",1)
    M14D W 0 A_JumpIfInventory("M14Ammo",1,1)
    Goto ReloadEnd
    M14D W 0 A_GiveInventory("M14Clip2",1)
    M14D W 0 A_TakeInventory("M14Ammo",1)
    Goto ReloadAmmo
  ReloadEnd:
    M14D X 3 A_PlaySoundEx("m14/clipin","SoundSlot5")
    M14D YZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14E ABC 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14E D 3 A_JumpIfInventory("M14Bolt",1,"ReloadEndBolt")
    M14E EF 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+16
  ReloadEndBolt:
    M14F ABCD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14F E 3 A_PlaySoundEx("m14/bolt","SoundSlot5")
    M14F F 3 A_TakeInventory("M14Bolt",1)
    M14F GHIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14F KLMNO 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto Ready+16
  ReloadStartAim:
    M14C F 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
    M14C FE 1
    M14C E 0 A_TakeInventory("Aiming",1)
    M14C DCBA 1
    M14C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+2
  ReloadStart_SOH:
    M14D A 0 A_JumpIfInventory("M14Token",1,"Reload3")
    M14D A 2
    M14D BCDEFGH 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14D I 2 A_PlaySoundEx("m14/clipout","SoundSlot5")
	M14D I 0 A_FireCustomMissile("M14EmptyMagExtSpawner",0,0,0,-4)
	M14D A 0 A_GiveInventory("M14Token",1)
	goto Reload3
  Reload3:
    M14D JKLMNOPQ 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    M14D RSTUV 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14D W 2 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    M14D W 0 A_JumpIfInventory("M14Clip2",15,"ReloadEnd_SOH")
	M14D W 0 A_TakeInventory("M14Token",1)
    M14D W 0 A_JumpIfInventory("M14Ammo",1,1)
    Goto ReloadEnd_SOH
    M14D W 0 A_GiveInventory("M14Clip2",1)
    M14D W 0 A_TakeInventory("M14Ammo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    M14D X 2 A_PlaySoundEx("m14/clipin","SoundSlot5")
    M14D YZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14E ABC 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14E D 2 A_JumpIfInventory("M14Bolt",1,"ReloadEndBolt_SOH")
    M14E EF 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+16
  ReloadEndBolt_SOH:
    M14F ABCD 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14F E 2 A_PlaySoundEx("m14/bolt","SoundSlot5")
    M14F F 2 A_TakeInventory("M14Bolt",1)
    M14F GHIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    M14F KLMNO 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto Ready+16
  ReloadBreak:
    M14C F 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
    M14C FE 1
    M14C E 0 A_TakeInventory("Aiming",1)
    M14C DCBA 1
    M14C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  ClearRefire: 
    SCOP C 1 A_ClearReFire
	Goto AltHold
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("M14Clip2",1,2)
	TNT1 A 0 A_GiveInventory("M14Bolt",1)
	Goto ReloadBreak
    "####" "#" 0 A_JumpIfInventory("CoopCheck",1,2)
    "####" "#" 0 A_TakeInventory("PowerInvisibility",500)
    "####" "#" 0 A_PlayWeaponSound("m14/fire")
	"####" "#" 0 A_TakeInventory("M14Clip2",1)
    "####" "##" 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,2)
    "####" "#" 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,2)
    //"####" "#" 0 A_JumpIf((MomX*MomX)+(MomY*MomY) > 15,"FireAimMoving")
    "####" "#" 0 BRIGHT A_FireCustomMissile("HHCBM14EBRD", frandom(-0.10,0.10), 0, 0, 4, 0, frandom(-0.10,0.10))
    "####" "#" 1 BRIGHT A_FireCustomMissile("HHCBM14EBRD", frandom(-0.10,0.10), 1, 0, 4, 0, frandom(-0.10,0.10))
	"####" "#" 0 A_SpawnItemEx("RifleCasingMK14",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)
    "####" "#" 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    //"####" "#" 0 A_JumpIfInventory("Perk3_SteadyAim_Pro",1,"FireAimSteady")
    "####" "#" 1 BRIGHT A_GunFlash
    "####" "#" 0 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("M14Clip2",1,2)
	TNT1 A 0 A_GiveInventory("M14Bolt",1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  }
}

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

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

actor "M14 EBR Explosive" : "M14 EBR"
{
  obituary "%k blew %o apart with an explosive M14 EBR round."
  inventory.pickupmessage "You got the M14 enhanced battle rifle. They can't hide from you now."
  //attacksound "barrett/fire"
  +WEAPON.EXPLOSIVE
  weapon.selectionorder 15
  weapon.ammotype "M14Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "M14Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Fire:
    "####" "#" 0 A_JumpIfInventory("Aiming",1,"FireAim")
    M14A K 1 A_JumpIfNoAmmo("ReloadStart")
    M14B A 0 A_JumpIfInventory("CoopCheck",1,2)
    M14B A 0 A_TakeInventory("PowerInvisibility",500)
    M14B A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    M14B A 0 A_PlayWeaponSound("m14/fire")
    M14B AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,3)
    M14B A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,6,3)
    M14B A 1 BRIGHT A_FireCustomMissile("HHCBM14EBRAE", frandom(-10.00,10.00), 1, 0, 4, 0, frandom(-10.00,10.00))
	M14B A 0 A_SpawnItemEx("RifleCasingMK14EXP",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)
    M14B B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M14B A 0 A_JumpIfNoAmmo("FireEmpty")
    M14B B 1 BRIGHT A_GunFlash
    M14B CDE 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    M14A KK 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    M14B A 0 A_JumpIfInventory("M14Ammo",1,1)
    Goto Ready+16
    M14B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireEmpty:
    M14B B 1 BRIGHT A_GunFlash
    M14B C 1 A_GiveInventory("M14Bolt",1)
    M14B DE 1
    M14B A 0 A_JumpIfInventory("M14Ammo",1,1)
    Goto Ready+16
    M14B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireAim:
    "####" "#" 1 A_JumpIfNoAmmo("ReloadStart")
    "####" "#" 0 A_JumpIfInventory("CoopCheck",1,2)
    "####" "#" 0 A_TakeInventory("PowerInvisibility",500)
    "####" "#" 0 A_PlayWeaponSound("m14/fire")
    "####" "##" 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,3)
    "####" "#" 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,6,3)
    "####" "#" 0 A_JumpIf((MomX*MomX)+(MomY*MomY) > 15,"FireAimMoving")
    "####" "#" 1 BRIGHT A_FireCustomMissile("HHCBM14EBRBE", frandom(-0.10,0.10), 1, 0, 4, 0, frandom(-0.10,0.10))
	"####" "#" 0 A_SpawnItemEx("RifleCasingMK14EXP",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)
  FireAimCont:
    "####" "#" 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    "####" "#" 0 A_JumpIfNoAmmo("FireAimEmpty")
    "####" "#" 1 BRIGHT A_GunFlash
    "####" "#" 0 A_JumpIfInventory("Perk3_SteadyAim_Pro",1,"FireAimSteady")
    "####" "#####" 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("M14Ammo",1,1)
    Goto Ready+22
    "####" "#" 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+22
  FireAimMoving:
    "####" "#" 0 A_JumpIfInventory("Perk3_SteadyAim_Pro",1,3)
    "####" "#" 1 BRIGHT A_FireCustomMissile("HHCBM14EBRCE", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-6.00,6.00))
	"####" "#" 0 A_SpawnItemEx("RifleCasingMK14EXP",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)
    Goto FireAimCont
    "####" "#" 1 BRIGHT A_FireCustomMissile("HHCBM14EBRBE", frandom(-1.00,1.00), 1, 0, 4, 0, frandom(-1.00,1.00))
	"####" "#" 0 A_SpawnItemEx("RifleCasingMK14EXP",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)
    Goto FireAimCont
  FireAimEmpty:
    "####" "#" 1 BRIGHT A_GunFlash
    "####" "#" 1 A_GiveInventory("M14Bolt",1)
    "####" "##" 1
    "####" "#" 0 A_JumpIfInventory("M14Ammo",1,1)
    Goto Ready+22
    "####" "#" 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+22
  Fire_SteadyAim:
    M14B A 0 A_PlayWeaponSound("m14/fire")
    M14B AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,3)
    M14B A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,6,3)
    M14B A 1 BRIGHT A_FireCustomMissile("HHCBM14EBRDE", frandom(-7.50,7.50), 1, 0, 4, 0, frandom(-7.50,7.50))
	M14B A 0 A_SpawnItemEx("RifleCasingMK14EXP",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)
    M14B B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    M14B A 0 A_JumpIfNoAmmo("FireEmpty")
    M14B B 1 BRIGHT A_GunFlash
    M14B CDE 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    M14A KK 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    M14B A 0 A_JumpIfInventory("M14Ammo",1,1)
    Goto Ready+16
    M14B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("M14Clip",1,2)
	TNT1 A 0 A_GiveInventory("M14Bolt",1)
	Goto ReloadBreak
    "####" "#" 0 A_JumpIfInventory("CoopCheck",1,2)
    "####" "#" 0 A_TakeInventory("PowerInvisibility",500)
    "####" "#" 0 A_PlayWeaponSound("m14/fire")
	"####" "#" 0 A_TakeInventory("M14Clip",1)
    "####" "##" 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,3)
    "####" "#" 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,6,3)
    //"####" "#" 0 A_JumpIf((MomX*MomX)+(MomY*MomY) > 15,"FireAimMoving")
    "####" "#" 1 BRIGHT A_FireCustomMissile("HHCBM14EBRBE", frandom(-0.10,0.10), 1, 0, 4, 0, frandom(-0.10,0.10))
	"####" "#" 0 A_SpawnItemEx("RifleCasingMK14EXP",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)
    "####" "#" 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    //"####" "#" 0 A_JumpIfInventory("Perk3_SteadyAim_Pro",1,"FireAimSteady")
    "####" "#" 1 BRIGHT A_GunFlash
    "####" "#" 0 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("M14Clip",1,2)
	TNT1 A 0 A_GiveInventory("M14Bolt",1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  }
}

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

actor M14Pickup : CustomInventory
{
  inventory.pickupmessage "You got the M14 enhanced battle rifle. They can't hide from you now."
  inventory.pickupsound "barrett/bolt"
  +INVENTORY.AUTOACTIVATE
  //inventory.respawntics 70
  scale 0.15
  States
  {
  Spawn:
    WEP2 K -1
    stop
  Pickup:
    WEP2 K 0
    WEP2 K 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",0,0,0)) == 1, "PickupStay")
    WEP2 K 0 A_JumpIfInventory("M14 EBR",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 K 0 A_JumpIfInventory("M14 EBR Ex Mags",1,"AmmoPickup")
    WEP2 K 0 A_JumpIfInventory("M14 EBR Thermal",1,"AmmoPickup")
    WEP2 K 0 A_JumpIfInventory("M14 EBR Explosive",1,"AmmoPickup")
    WEP2 K 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 K 0 A_JumpIfInventory("MaxWeaponsFilled",71,"FailPickup2")
	WEP2 K 0 A_GiveInventory("MaxWeaponsFilled",30)
    WEP2 K 0 ACS_NamedExecuteWithResult("RefPickU",37,0,0)
    stop
  PickupStay:
    WEP2 K 0
    WEP2 K 0 A_JumpIfInventory("M14 EBR",1,"FailPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 K 0 A_JumpIfInventory("M14 EBR Ex Mags",1,"FailPickup")
    WEP2 K 0 A_JumpIfInventory("M14 EBR Thermal",1,"FailPickup")
    WEP2 K 0 A_JumpIfInventory("M14 EBR Explosive",1,"FailPickup")
    WEP2 K 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 K 0 A_JumpIfInventory("MaxWeaponsFilled",71,"FailPickup2")
	WEP2 K 0 A_GiveInventory("MaxWeaponsFilled",30)
    WEP2 K 0 ACS_NamedExecuteWithResult("RefPickU",37,0,0)
    WEP2 K 0 ACS_NamedExecuteWithResult("RefPickC",37,0,0)
    WEP2 K 0 A_PlaySound("barrett/bolt")
    fail
  AmmoPickup:
    WEP2 K 0
    WEP2 K 0 A_JumpIfInventory("M14Ammo",0,"FailPickup")
    WEP2 K 0 A_GiveInventory("M14Ammo",10)
    stop
  OneManArmy:
    WEP2 K 0
	WEP2 K 0 A_JumpIfInventory("MaxWeaponsFilled",108,"FailPickup2")
	WEP2 K 0 A_GiveInventory("MaxWeaponsFilled",30)
	WEP2 K 0 ACS_NamedExecuteWithResult("RefPickU",37,0,0)
	stop
  FailPickup:
    WEP2 K 1
    fail
  FailPickup2:
    WEP2 K 1
    WEP2 K 0 ACS_NamedExecuteAlways("RefSlots",0,26,0,0)
    fail
  }
}

actor M14Drop : M14Pickup
{
  States
  {
  Spawn:
    WEP2 K -1
    stop
  Pickup:
    WEP2 K 0
    WEP2 K 0 A_JumpIfInventory("M14 EBR",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 K 0 A_JumpIfInventory("M14 EBR Ex Mags",1,"AmmoPickup")
    WEP2 K 0 A_JumpIfInventory("M14 EBR Thermal",1,"AmmoPickup")
    WEP2 K 0 A_JumpIfInventory("M14 EBR Explosive",1,"AmmoPickup")
    WEP2 K 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 K 0 A_JumpIfInventory("MaxWeaponsFilled",71,"FailPickup2")
	WEP2 K 0 A_GiveInventory("MaxWeaponsFilled",30)
    WEP2 K 0 ACS_NamedExecuteWithResult("RefPickU",37,0,0)
    stop
  }
}

actor M14Drop2 : M14Drop
{
  States
  {
  Spawn:
    WEP2 K -1
    stop
  Pickup:
    WEP2 K 0
    WEP2 K 0 A_JumpIfInventory("M14 EBR",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 K 0 A_JumpIfInventory("M14 EBR Ex Mags",1,"AmmoPickup")
    WEP2 K 0 A_JumpIfInventory("M14 EBR Thermal",1,"AmmoPickup")
    WEP2 K 0 A_JumpIfInventory("M14 EBR Explosive",1,"AmmoPickup")
    WEP2 K 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 K 0 A_JumpIfInventory("MaxWeaponsFilled",71,"FailPickup2")
	WEP2 K 0 A_GiveInventory("MaxWeaponsFilled",30)
    WEP2 K 0 ACS_NamedExecuteWithResult("RefPickU",37,0,0)
    stop
  AmmoPickup:
    WEP2 K 0
    stop
  }
}

actor HHCBM14EBRA : HHBullet
{
  damage (110)
  damagetype "Sniper"
  States
  {
  Spawn:
    TNT1 A 2
    Loop
  Death:
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
	TNT1 A 10 A_AlertMonsters(136)
    stop
  XDeath:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 5 A_PlaySound("generic/ricochets")
	TNT1 A 10 A_AlertMonsters(136)
    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")
	TNT1 A 10 A_AlertMonsters(136)
    stop
  }
}
actor HHCBM14EBRB : HHCBM14EBRA
{
  damage (110)
}
actor HHCBM14EBRC : HHCBM14EBRA
{
  damage (90)
}
actor HHCBM14EBRD : HHCBM14EBRA
{
  damage (55)
}

actor HHCBM14EBRAE : HHBullet
{
  damage (70)
  +FORCERADIUSDMG
  -BLOODSPLATTER
  decal RevenantScorch
  damagetype "Sniper"
  SeeSound "generic/explosionsmall"
  AttackSound "generic/explosionsmall"
  States
  {
  Spawn:
    TNT1 A 2
	Loop
  XDeath:
  Crash:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
  Death:
    TNT1 A 0 Radius_Quake(2,5,0,5,0)
    TNT1 A 0 A_SetDamageType("Explosion")
    TNT1 A 0 A_Explode(23,60)
	TNT1 A 0 A_PlaySoundEx("distant/explosionsmaller","SoundSlot6")
    TNT1 AAAAAA 0 A_SpawnItemEx("ImpactSpark2", 0, 0, 0, random(-3,-1), random(-2,2), random(-2,2), 0, 128, 64)
    TNT1 AA 0 A_SpawnItemEx("ExplosionSmall3", random(-2,0), random(-1,1), random(-1,1), 0, 0, 0, 0, 128, 0)
    TNT1 A 5
    TNT1 A 15 A_AlertMonsters(240)
    stop
  }
}
actor HHCBM14EBRBE : HHCBM14EBRAE
{
  damage (55)
  States
  {
  XDeath:
  Crash:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
  Death:
    TNT1 A 0 Radius_Quake(2,5,0,5,0)
    TNT1 A 0 A_SetDamageType("Explosion")
    TNT1 A 0 A_Explode(55,60)
	TNT1 A 0 A_PlaySoundEx("distant/explosionsmaller","SoundSlot6")
    TNT1 AAAAAA 0 A_SpawnItemEx("ImpactSpark2", 0, 0, 0, random(-3,-1), random(-2,2), random(-2,2), 0, 128, 64)
    TNT1 AA 0 A_SpawnItemEx("ExplosionSmall3", random(-2,0), random(-1,1), random(-1,1), 0, 0, 0, 0, 128, 0)
    TNT1 A 5
    TNT1 A 15 A_AlertMonsters(240)
    stop
  }
}
actor HHCBM14EBRCE : HHCBM14EBRAE
{
  damage (45)
  States
  {
  XDeath:
  Crash:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
  Death:
    TNT1 A 0 Radius_Quake(2,5,0,5,0)
    TNT1 A 0 A_SetDamageType("Explosion")
    TNT1 A 0 A_Explode(45,60)
	TNT1 A 0 A_PlaySoundEx("distant/explosionsmaller","SoundSlot6")
    TNT1 AAAAAA 0 A_SpawnItemEx("ImpactSpark2", 0, 0, 0, random(-3,-1), random(-2,2), random(-2,2), 0, 128, 64)
    TNT1 AA 0 A_SpawnItemEx("ExplosionSmall3", random(-2,0), random(-1,1), random(-1,1), 0, 0, 0, 0, 128, 0)
    TNT1 A 5
    TNT1 A 15 A_AlertMonsters(240)
    stop
  }
}
actor HHCBM14EBRDE : HHCBM14EBRAE
{
  damage (27)
  States
  {
  XDeath:
  Crash:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
  Death:
    TNT1 A 0 Radius_Quake(2,5,0,5,0)
    TNT1 A 0 A_SetDamageType("Explosion")
    TNT1 A 0 A_Explode(28,60)
	TNT1 A 0 A_PlaySoundEx("distant/explosionsmaller","SoundSlot6")
    TNT1 AAAAAA 0 A_SpawnItemEx("ImpactSpark2", 0, 0, 0, random(-3,-1), random(-2,2), random(-2,2), 0, 128, 64)
    TNT1 AA 0 A_SpawnItemEx("ExplosionSmall3", random(-2,0), random(-1,1), random(-1,1), 0, 0, 0, 0, 128, 0)
    TNT1 A 5
    TNT1 A 15 A_AlertMonsters(240)
    stop
  }
}