actor "FN F2000" : RGUWeapon
{
  obituary "%k F'd %o up with the F2000."
  inventory.pickupmessage "You got the FN F2000 assault rifle."
  //attacksound "acr/fire"
  weapon.selectionorder 4
  weapon.ammotype "F2000Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "F2000Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    F2KA A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    F2KA BCDEF 2 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
	F2KA GHIJKL 2 A_WeaponReady(WRF_ALLOWZOOM)
	M4CD A 0 A_JumpIfInventory("F2000Token",1,"Reload")
    F2KA M 0 A_JumpIfNoAmmo("Reload")
	M4CC F 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    F2KA M 0 A_JumpIfInventory("Aiming",1,5)
    F2KA M 0 A_JumpIfInventory("Reloading",1,"Reload")
    F2KA M 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    F2KA M 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KA M 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+16
    F2KC E 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    F2KC E 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    F2KC E 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    F2KC E 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
  Deselect:
    F2KA M 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    F2KA M 0 A_TakeInventory("Aiming",1)
    F2KA M 0 A_TakeInventory("Reloading",1)
    F2KA M 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    F2KA M 0 A_ZoomFactor(1.0)
    F2KA M 0 A_Lower
    F2KA M 1 A_Lower
    Goto Deselect+5
  Select:
    F2KA A 0 A_Raise
    Loop
  Fire:
    F2KB A 0 A_JumpIfInventory("Aiming",1,"FireAim")
    F2KB A 0 A_JumpIfNoAmmo("ReloadStart")
    F2KB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    F2KB A 0 A_PlayWeaponSound("f2000/fire")
    F2KB A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,9,2)
    F2KB A 0 BRIGHT A_GunFlash
    F2KB B 1 BRIGHT A_FireCustomMissile("HHCBF2K", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-6.00,6.00))
	F2KB B 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,13,34-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    F2KB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("F2000Clip",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    F2KB B 0 A_JumpIfNoAmmo("FireEmpty")
    F2KB C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KB D 0 A_JumpIfInventory("F2000Ammo",1,2)
    F2KB D 1 A_ReFire
    Goto Ready+16
    F2KB D 0 A_JumpIfNoAmmo("ReloadStart")
    F2KB D 1 A_ReFire
    Goto Ready+16
  Hold:
    F2KB A 0 A_JumpIfInventory("Aiming",1,"HoldAim")
    F2KB A 0 A_JumpIfNoAmmo("ReloadStart")
    F2KB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    F2KB A 0 A_PlayWeaponSound("f2000/fire")
    F2KB A 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,9,2)
    F2KB A 0 BRIGHT A_GunFlash
    F2KB B 1 BRIGHT A_FireCustomMissile("HHCBF2K", frandom(-9.00,9.00), 1, 0, 4, 0, frandom(-9.00,9.00))
	F2KB B 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,13,34-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    F2KB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("F2000Clip",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    F2KB B 0 A_JumpIfNoAmmo("FireEmpty")
    F2KB C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KB D 0 A_JumpIfInventory("F2000Ammo",1,2)
    F2KB D 1 A_ReFire
    Goto Ready+16
    F2KB D 0 A_JumpIfNoAmmo("ReloadStart")
    F2KB D 1 A_ReFire
    Goto Ready+16
  FireEmpty:
    F2KB C 0
    F2KB C 1 A_GiveInventory("F2000Bolt",1)
    F2KB D 0 A_JumpIfInventory("F2000Ammo",1,2)
    F2KB D 1 A_ReFire
    Goto Ready+16
    F2KB D 0 A_JumpIfNoAmmo("ReloadStart")
    F2KB D 1 A_ReFire
    Goto Ready+16
  FireAim:
    F2KD A 0 A_PlayWeaponSound("f2000/fire")
    F2KD A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,3)
    F2KD A 0 BRIGHT A_GunFlash
    F2KD B 1 BRIGHT A_FireCustomMissile("HHCBF2K", frandom(-1.20,1.20), 1, 0, 4, 0, frandom(-1.20,1.20))
	F2KD B 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,-4,36-(Sin(Pitch)*43),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    F2KD B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("F2000Clip",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    F2KD B 0 A_JumpIfNoAmmo("FireAimEmpty")
    F2KD C 1
    F2KD D 0 A_JumpIfInventory("F2000Ammo",1,2)
    F2KD D 1 A_ReFire
    Goto Ready+22
    F2KD D 0 A_JumpIfNoAmmo("ReloadStart")
    F2KD D 1 A_ReFire
    Goto Ready+22
  HoldAim:
    F2KD A 0 A_PlayWeaponSound("f2000/fire")
    F2KD A 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,0,3)
    F2KD A 0 BRIGHT A_GunFlash
    F2KD B 1 BRIGHT A_FireCustomMissile("HHCBF2K", frandom(-1.80,1.80), 1, 0, 4, 0, frandom(-1.80,1.80))
	F2KD B 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,-4,36-(Sin(Pitch)*43),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    F2KD B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("F2000Clip",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    F2KD B 0 A_JumpIfNoAmmo("FireAimEmpty")
    F2KD C 1
    F2KD D 0 A_JumpIfInventory("F2000Ammo",1,2)
    F2KD D 1 A_ReFire
    Goto Ready+22
    F2KD D 0 A_JumpIfNoAmmo("ReloadStart")
    F2KD D 1 A_ReFire
    Goto Ready+22
  FireAimEmpty:
    F2KD C 0
    F2KD C 1 A_GiveInventory("F2000Bolt",1)
    F2KD D 0 A_JumpIfInventory("F2000Ammo",1,2)
    F2KD D 1 A_ReFire
    Goto Ready+22
    F2KD D 0 A_JumpIfNoAmmo("ReloadStart")
    F2KD D 1 A_ReFire
    Goto Ready+22
  Reload: //AltFire:
    F2KD A 0 A_JumpIfInventory("F2000Clip",30,2)
    F2KD A 0 A_JumpIfInventory("F2000Ammo",1,"ReloadStart")
    F2KD A 0 A_TakeInventory("Reloading",1)
    F2KD A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+19
  ReloadStart:
    F2KE A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    F2KE A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    F2KE A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	F2KE A 0 A_JumpIfInventory("F2000Token",1,"Reload2")
    F2KE B 3 A_PlaySoundEx("f2000/clipout","SoundSlot5")
    F2KE CDEFG 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	F2KE G 0 A_FireCustomMissile("EmptyBoxMagSpawner",0,0,0,-4)
	F2KE G 0 A_GiveInventory("F2000Token",1)
    F2KE HIJK 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload2
  Reload2:
	F2KE LMNOPQ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    F2KE RSTUVW 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KE Y 0 A_TakeInventory("Reloading",1)
    F2KE Y 3 A_PlaySoundEx("f2000/clipin","SoundSlot5")
    Goto ReloadAmmo
  ReloadAmmo:
    F2KE Z 0 A_JumpIfInventory("F2000Clip",30,"ReloadEnd")
	F2KE Z 0 A_TakeInventory("F2000Token",1)
    F2KE Z 0 A_JumpIfInventory("F2000Ammo",1,1)
    Goto ReloadEnd
    F2KE Z 0 A_GiveInventory("F2000Clip",1)
    F2KE Z 0 A_TakeInventory("F2000Ammo",1)
    Goto ReloadAmmo
  ReloadEnd:
    F2KE Z 0 A_JumpIfInventory("F2000Bolt",1,"ReloadEndBolt")
    F2KE Z 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KF ABCDE 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KF FHIJ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KF G 0 A_ReFire
    Goto Ready+16
  ReloadEndBolt:
    F2KE Z 3 A_TakeInventory("F2000Bolt",1)
    F2KG ABCD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KG G 0 A_PlaySoundEx("f2000/bolt","SoundSlot5")
    F2KG EFHIJKL 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    F2KG MNOP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KG V 0 A_ReFire
    Goto Ready+16
  Zoom:
  PostReloadAlt:
    M4CD A 0 A_JumpIfInventory("F2000Token",1,"Reload")
    F2KC E 0 A_ZoomFactor(1.3)
    F2KC D 0 A_GiveInventory("Aiming",1)
	F2KC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    F2KC ABCDE 1
    Goto AltHold
  AltFireHoldAim:
    "####" "#" 0 A_JumpIfInventory("F2000Clip",1,1)
	Goto Reload
    F2KD A 0 A_PlayWeaponSound("f2000/fire")
	GRNA L 0 A_TakeInventory("F2000Clip",1)
    F2KD A 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,0,3)
    F2KD A 0 BRIGHT A_GunFlash
    F2KD B 1 BRIGHT A_FireCustomMissile("HHCBF2K", frandom(-1.80,1.80), 1, 0, 4, 0, frandom(-1.80,1.80))
	F2KD B 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,-4,36-(Sin(Pitch)*43),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    F2KD B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("F2000Clip",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    F2KD C 1
    "####" "#" 0 A_JumpIfInventory("F2000Clip",1,1)
	Goto Reload
    F2KD D 1 A_ReFire
    Goto Ready+22
  AltHold:
    F2KC E 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+22
  AltFire:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    M4CD A 0 A_JumpIfInventory("F2000Token",1,"Reload")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    F2KC A 0 A_ZoomFactor(1.3)
    F2KC A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    F2KC AB 1
    F2KC B 0 A_GiveInventory("Aiming",1)
    F2KC CDE 1
    F2KC E 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    F2KC E 0 A_Refire
    Goto Ready+22
  AltFire2:
    F2KC E 0 A_ZoomFactor(1.0)
    F2KC ED 1
    F2KC D 0 A_TakeInventory("Aiming",1)
    F2KC CBA 1
    F2KC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	F2KA MMMM 1
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+16
  AltFire3:
    F2KC E 0 A_ZoomFactor(1.0)
    F2KC ED 1
    F2KC D 0 A_TakeInventory("Aiming",1)
    F2KC CBA 1
    F2KC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    F2KC A 0 A_Refire
	goto DropWeapon
  ReloadStartAim:
    F2KC E 0 A_ZoomFactor(1.0)
    F2KC ED 1
    F2KC D 0 A_TakeInventory("Aiming",1)
    F2KC CBA 1
    F2KC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+2
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  Spawn:
    WEAP V 0
    WEAP V 0 A_SpawnItem("F2000Drop")
    stop
  ReloadStart_SOH:
    F2KE A 0 A_JumpIfInventory("F2000Token",1,"Reload3")
    F2KE B 2 A_PlaySoundEx("f2000/clipout","SoundSlot5")
    F2KE CDEFG 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	F2KE G 0 A_FireCustomMissile("EmptyBoxMagSpawner",0,0,0,-4)
	F2KE G 0 A_GiveInventory("F2000Token",1)
    F2KE HIJK 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload3
  Reload3:
    F2KE LMNOPQ 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    F2KE RSTUVW 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KE Y 0 A_TakeInventory("Reloading",1)
    F2KE Y 2 A_PlaySoundEx("f2000/clipin","SoundSlot5")
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    F2KE Z 0 A_JumpIfInventory("F2000Clip",30,"ReloadEnd_SOH")
	F2KE Z 0 A_TakeInventory("F2000Token",1)
    F2KE Z 0 A_JumpIfInventory("F2000Ammo",1,1)
    Goto ReloadEnd_SOH
    F2KE Z 0 A_GiveInventory("F2000Clip",1)
    F2KE Z 0 A_TakeInventory("F2000Ammo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    F2KE Z 0 A_JumpIfInventory("F2000Bolt",1,"ReloadEndBolt_SOH")
    F2KE Z 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KF ABCDE 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KF FGHIJ 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KF G 0 A_ReFire
    Goto Ready+16
  ReloadEndBolt_SOH:
    F2KE Z 2 A_TakeInventory("F2000Bolt",1)
    F2KG ABCD 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KG G 0 A_PlaySoundEx("f2000/bolt","SoundSlot5")
    F2KG EFHIJKL 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    F2KG MNOP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KG V 0 A_ReFire
    Goto Ready+16
  Fire_SteadyAim:
    F2KB A 0 A_PlayWeaponSound("f2000/fire")
    F2KB A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,9,2)
    F2KB A 0 BRIGHT A_GunFlash
    F2KB B 1 BRIGHT A_FireCustomMissile("HHCBF2K", frandom(-4.25,4.25), 1, 6, 3, 0, frandom(-4.25,4.25))
	F2KB B 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,13,34-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    F2KB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("F2000Clip",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    F2KB B 0 A_JumpIfNoAmmo("FireEmpty")
    F2KB C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KB D 0 A_JumpIfInventory("F2000Ammo",1,2)
    F2KB D 1 A_ReFire
    Goto Ready+16
    F2KB D 0 A_JumpIfNoAmmo("ReloadStart")
    F2KB D 1 A_ReFire
    Goto Ready+16
  Hold_SteadyAim:
    F2KB A 0 A_PlayWeaponSound("f2000/fire")
    F2KB A 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,9,2)
    F2KB A 0 BRIGHT A_GunFlash
    F2KB B 1 BRIGHT A_FireCustomMissile("HHCBF2K", frandom(-7.00,7.00), 1, 6, 3, 0, frandom(-7.00,7.00))
	F2KB B 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,13,34-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    F2KB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("F2000Clip",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    F2KB B 0 A_JumpIfNoAmmo("FireEmpty")
    F2KB C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KB D 0 A_JumpIfInventory("F2000Ammo",1,2)
    F2KB D 1 A_ReFire
    Goto Ready+16
    F2KB D 0 A_JumpIfNoAmmo("ReloadStart")
    F2KB D 1 A_ReFire
    Goto Ready+16
  FragGrenade:
    U45F A 0 ACS_NamedExecuteAlways("RefSpeak",0,1,0,0)
    U45F A 0 A_ZoomFactor(1.0)
    U45A L 0 A_TakeInventory("Aiming",1)
    U45A L 0 A_TakeInventory("Reloading",1)
    U45F A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	M4CA J 0 A_JumpIfInventory("ThrowingStun",1,"StunGrenade")
	M4CA J 0 A_JumpIfInventory("ThrowingIncd",1,"IncGrenade")
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"FragGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 2
    TNT1 A 15
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 2
    GRNA L 0 A_TakeInventory("GrenadeAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("FragGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  FragGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 1
    TNT1 A 10
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 1
    GRNA L 0 A_TakeInventory("GrenadeAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("FragGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    U45F A 0 A_ZoomFactor(1.0)
    U45A L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    U45A L 0 A_TakeInventory("Aiming",1)
    U45A L 0 A_TakeInventory("Reloading",1)
    U45F A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"KnifeAttack_SOH")
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_Commando")
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",104)
    KNFA DEFGHIJKL 1
    TNT1 A 20
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_Commando:
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",160)
    KNFA DEFGHIJKL 1
    TNT1 A 20
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_SOH:
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_SOH_Commando")
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",104)
    KNFA DEFGHIJKL 1
    TNT1 A 10
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_SOH_Commando:
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",160)
    KNFA DEFGHIJKL 1
    TNT1 A 10
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  StunGrenade:
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"StunGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 2
    TNT1 A 15
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 2
    GRNA L 0 A_TakeInventory("StunAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("StunGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  IncGrenade:
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"IncGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 2
    TNT1 A 15
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 2
    GRNA L 0 A_TakeInventory("IncdAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("IncGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  StunGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 1
    TNT1 A 10
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 1
    GRNA L 0 A_TakeInventory("StunAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("StunGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  IncGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 1
    TNT1 A 10
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 1
    GRNA L 0 A_TakeInventory("IncdAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("IncGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  DropWeapon:
    F2KA LKJIHGFEDCB 2 A_WeaponReady(WRF_NOPRIMARY)
	F2KA 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("F2000Dropped",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("F2000Thrown",0,0,7,2)
	stop
  }
}

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

actor F2000Bolt : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}
actor "FN F2000 Ex Mags" : "FN F2000"
{
  obituary "%k F'd %o up with the F2000."
  inventory.pickupmessage "You got the FN F2000 assault rifle."
  //attacksound "acr/fire"
  weapon.selectionorder 4
  weapon.ammotype "F2000Clip2"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "F2000Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    F2KA A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    F2KA BCDEF 2 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
	F2KA GHIJKL 2 A_WeaponReady(WRF_ALLOWZOOM)
	M4CD A 0 A_JumpIfInventory("F2000Token",1,"Reload")
    F2KA M 0 A_JumpIfNoAmmo("Reload")
	M4CC F 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    F2KA M 0 A_JumpIfInventory("Aiming",1,5)
    F2KA M 0 A_JumpIfInventory("Reloading",1,"Reload")
    F2KA M 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    F2KA M 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KA M 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+16
    F2KC E 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    F2KC E 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    F2KC E 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    F2KC E 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
  Fire:
    F2KB A 0 A_JumpIfInventory("Aiming",1,"FireAim")
    F2KB A 0 A_JumpIfNoAmmo("ReloadStart")
    F2KB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    F2KB A 0 A_PlayWeaponSound("f2000/fire")
    F2KB A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,9,2)
    F2KB A 0 BRIGHT A_GunFlash
    F2KB B 1 BRIGHT A_FireCustomMissile("HHCBF2K", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-6.00,6.00))
	F2KB B 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,13,34-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    F2KB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("F2000Clip2",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    F2KB B 0 A_JumpIfNoAmmo("FireEmpty")
    F2KB C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KB D 0 A_JumpIfInventory("F2000Ammo",1,2)
    F2KB D 1 A_ReFire
    Goto Ready+16
    F2KB D 0 A_JumpIfNoAmmo("ReloadStart")
    F2KB D 1 A_ReFire
    Goto Ready+16
  Hold:
    F2KB A 0 A_JumpIfInventory("Aiming",1,"HoldAim")
    F2KB A 0 A_JumpIfNoAmmo("ReloadStart")
    F2KB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    F2KB A 0 A_PlayWeaponSound("f2000/fire")
    F2KB A 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,9,2)
    F2KB A 0 BRIGHT A_GunFlash
    F2KB B 1 BRIGHT A_FireCustomMissile("HHCBF2K", frandom(-9.00,9.00), 1, 0, 4, 0, frandom(-9.00,9.00))
	F2KB B 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,13,34-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    F2KB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("F2000Clip2",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    F2KB B 0 A_JumpIfNoAmmo("FireEmpty")
    F2KB C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KB D 0 A_JumpIfInventory("F2000Ammo",1,2)
    F2KB D 1 A_ReFire
    Goto Ready+16
    F2KB D 0 A_JumpIfNoAmmo("ReloadStart")
    F2KB D 1 A_ReFire
    Goto Ready+16
  FireAim:
    F2KD A 0 A_PlayWeaponSound("f2000/fire")
    F2KD A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,3)
    F2KD A 0 BRIGHT A_GunFlash
    F2KD B 1 BRIGHT A_FireCustomMissile("HHCBF2K", frandom(-1.20,1.20), 1, 0, 4, 0, frandom(-1.20,1.20))
	F2KD B 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,-4,36-(Sin(Pitch)*43),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    F2KD B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("F2000Clip2",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    F2KD B 0 A_JumpIfNoAmmo("FireAimEmpty")
    F2KD C 1
    F2KD D 0 A_JumpIfInventory("F2000Ammo",1,2)
    F2KD D 1 A_ReFire
    Goto Ready+22
    F2KD D 0 A_JumpIfNoAmmo("ReloadStart")
    F2KD D 1 A_ReFire
    Goto Ready+22
  HoldAim:
    F2KD A 0 A_PlayWeaponSound("f2000/fire")
    F2KD A 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,0,3)
    F2KD A 0 BRIGHT A_GunFlash
    F2KD B 1 BRIGHT A_FireCustomMissile("HHCBF2K", frandom(-1.80,1.80), 1, 0, 4, 0, frandom(-1.80,1.80))
	F2KD B 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,-4,36-(Sin(Pitch)*43),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    F2KD B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("F2000Clip2",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    F2KD B 0 A_JumpIfNoAmmo("FireAimEmpty")
    F2KD C 1
    F2KD D 0 A_JumpIfInventory("F2000Ammo",1,2)
    F2KD D 1 A_ReFire
    Goto Ready+22
    F2KD D 0 A_JumpIfNoAmmo("ReloadStart")
    F2KD D 1 A_ReFire
    Goto Ready+22
  Fire_SteadyAim:
    F2KB A 0 A_PlayWeaponSound("f2000/fire")
    F2KB A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,9,2)
    F2KB A 0 BRIGHT A_GunFlash
    F2KB B 1 BRIGHT A_FireCustomMissile("HHCBF2K", frandom(-4.25,4.25), 1, 6, 3, 0, frandom(-4.25,4.25))
	F2KB B 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,13,34-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    F2KB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("F2000Clip2",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    F2KB B 0 A_JumpIfNoAmmo("FireEmpty")
    F2KB C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KB D 0 A_JumpIfInventory("F2000Ammo",1,2)
    F2KB D 1 A_ReFire
    Goto Ready+16
    F2KB D 0 A_JumpIfNoAmmo("ReloadStart")
    F2KB D 1 A_ReFire
    Goto Ready+16
  Hold_SteadyAim:
    F2KB A 0 A_PlayWeaponSound("f2000/fire")
    F2KB A 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,9,2)
    F2KB A 0 BRIGHT A_GunFlash
    F2KB B 1 BRIGHT A_FireCustomMissile("HHCBF2K", frandom(-7.00,7.00), 1, 6, 3, 0, frandom(-7.00,7.00))
	F2KB B 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,13,34-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    F2KB B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("F2000Clip2",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    F2KB B 0 A_JumpIfNoAmmo("FireEmpty")
    F2KB C 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KB D 0 A_JumpIfInventory("F2000Ammo",1,2)
    F2KB D 1 A_ReFire
    Goto Ready+16
    F2KB D 0 A_JumpIfNoAmmo("ReloadStart")
    F2KB D 1 A_ReFire
    Goto Ready+16
  Reload: //AltFire:
    F2KD A 0 A_JumpIfInventory("F2000Clip2",45,2)
    F2KD A 0 A_JumpIfInventory("F2000Ammo",1,"ReloadStart")
    F2KD A 0 A_TakeInventory("Reloading",1)
    F2KD A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+19
  ReloadStart:
    F2KE A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    F2KE A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    F2KE A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	F2KE A 0 A_JumpIfInventory("F2000Token",1,"Reload2")
    F2KE B 3 A_PlaySoundEx("f2000/clipout","SoundSlot5")
    F2KE CDEFG 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	F2KE G 0 A_FireCustomMissile("F2000EmptyMagExtendedSpawner",0,0,0,-4)
	F2KE G 0 A_GiveInventory("F2000Token",1)
    F2KE HIJK 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload2
  Reload2:
    F2KE LMNOPQ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    F2KE RSTUVW 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KE Y 0 A_TakeInventory("Reloading",1)
    F2KE Y 3 A_PlaySoundEx("f2000/clipin","SoundSlot5")
    Goto ReloadAmmo
  ReloadAmmo:
    F2KE Z 0 A_JumpIfInventory("F2000Clip2",45,"ReloadEnd")
	F2KE Z 0 A_TakeInventory("F2000Token",1)
    F2KE Z 0 A_JumpIfInventory("F2000Ammo",1,1)
    Goto ReloadEnd
    F2KE Z 0 A_GiveInventory("F2000Clip2",1)
    F2KE Z 0 A_TakeInventory("F2000Ammo",1)
    Goto ReloadAmmo
  ReloadEnd:
    F2KE Z 0 A_JumpIfInventory("F2000Bolt",1,"ReloadEndBolt")
    F2KE Z 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KF ABCDE 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KF FHIJ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KF G 0 A_ReFire
    Goto Ready+16
  ReloadEndBolt:
    F2KE Z 3 A_TakeInventory("F2000Bolt",1)
    F2KG ABCD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KG G 0 A_PlaySoundEx("f2000/bolt","SoundSlot5")
    F2KG EFHIJKL 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    F2KG MNOP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KG V 0 A_ReFire
    Goto Ready+16
  ReloadStartAim:
    F2KC E 0 A_ZoomFactor(1.0)
    F2KC ED 1
    F2KC D 0 A_TakeInventory("Aiming",1)
    F2KC CBA 1
    F2KC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+2
  ReloadStart_SOH:
    F2KE A 0 A_JumpIfInventory("F2000Token",1,"Reload3")
    F2KE B 2 A_PlaySoundEx("f2000/clipout","SoundSlot5")
    F2KE CDEFG 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	F2KE G 0 A_FireCustomMissile("F2000EmptyMagExtendedSpawner",0,0,0,-4)
	F2KE G 0 A_GiveInventory("F2000Token",1)
    F2KE HIJK 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload3
  Reload3:
    F2KE LMNOPQ 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    F2KE RSTUVW 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KE Y 0 A_TakeInventory("Reloading",1)
    F2KE Y 2 A_PlaySoundEx("f2000/clipin","SoundSlot5")
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    F2KE Z 0 A_JumpIfInventory("F2000Clip2",45,"ReloadEnd_SOH")
	F2KE Z 0 A_TakeInventory("F2000Token",1)
    F2KE Z 0 A_JumpIfInventory("F2000Ammo",1,1)
    Goto ReloadEnd_SOH
    F2KE Z 0 A_GiveInventory("F2000Clip2",1)
    F2KE Z 0 A_TakeInventory("F2000Ammo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    F2KE Z 0 A_JumpIfInventory("F2000Bolt",1,"ReloadEndBolt_SOH")
    F2KE Z 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KF ABCDE 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KF FGHIJ 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KF G 0 A_ReFire
    Goto Ready+16
  ReloadEndBolt_SOH:
    F2KE Z 2 A_TakeInventory("F2000Bolt",1)
    F2KG ABCD 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    F2KG G 0 A_PlaySoundEx("f2000/bolt","SoundSlot5")
    F2KG EFHIJKL 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    F2KG MNOP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    F2KG V 0 A_ReFire
    Goto Ready+16
  AltFireHoldAim:
    "####" "#" 0 A_JumpIfInventory("F2000Clip2",1,1)
	Goto Reload
    F2KD A 0 A_PlayWeaponSound("f2000/fire")
	GRNA L 0 A_TakeInventory("F2000Clip2",1)
    F2KD A 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,0,3)
    F2KD A 0 BRIGHT A_GunFlash
    F2KD B 1 BRIGHT A_FireCustomMissile("HHCBF2K", frandom(-1.80,1.80), 1, 0, 4, 0, frandom(-1.80,1.80))
	F2KD B 0 A_SpawnItemEx("RifleCasing",Cos(Pitch)*30,-4,36-(Sin(Pitch)*43),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    F2KD B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("F2000Clip2",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    F2KD C 1
    "####" "#" 0 A_JumpIfInventory("F2000Clip2",1,1)
	Goto Reload
    F2KD D 1 A_ReFire
    Goto Ready+22
  }
}

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

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

actor F2000Pickup : CustomInventory
{
  inventory.pickupmessage "You got the FN F2000 assault rifle."
  inventory.pickupsound "akm/bolt"
  +INVENTORY.AUTOACTIVATE
  //inventory.respawntics 70
  scale 0.15
  States
  {
  Spawn:
    WEAP V -1
    stop
  Pickup:
    WEAP V 0
    WEAP V 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",0,0,0)) == 1, "PickupStay")
    WEAP V 0 A_JumpIfInventory("FN F2000",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP V 0 A_JumpIfInventory("FN F2000 Ex Mags",1,"AmmoPickup")
    WEAP V 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP V 0 A_JumpIfInventory("MaxWeaponsFilled",69,"FailPickup2")
	WEAP V 0 A_GiveInventory("MaxWeaponsFilled",32)
    WEAP V 0 ACS_NamedExecuteWithResult("RefPickU",20,0,0)
    stop
  PickupStay:
    WEAP V 0
    WEAP V 0 A_JumpIfInventory("FN F2000",1,"FailPickup") // If the player already has this weapon, they get more ammo for it
    WEAP V 0 A_JumpIfInventory("FN F2000 Ex Mags",1,"FailPickup")
    WEAP V 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP V 0 A_JumpIfInventory("MaxWeaponsFilled",69,"FailPickup2")
	WEAP V 0 A_GiveInventory("MaxWeaponsFilled",32)
    WEAP V 0 ACS_NamedExecuteWithResult("RefPickU",20,0,0)
    WEAP V 0 ACS_NamedExecuteWithResult("RefPickC",20,0,0)
    WEAP V 0 A_PlaySound("akm/bolt")
    fail
  AmmoPickup:
    WEAP V 0
    WEAP V 0 A_JumpIfInventory("F2000Ammo",0,"FailPickup")
    WEAP V 0 A_GiveInventory("F2000Ammo",30)
    stop
  OneManArmy:
    WEAP V 0
	WEAP V 0 A_JumpIfInventory("MaxWeaponsFilled",106,"FailPickup2")
	WEAP V 0 A_GiveInventory("MaxWeaponsFilled",32)
	WEAP V 0 ACS_NamedExecuteWithResult("RefPickU",20,0,0)
	stop
  FailPickup:
    WEAP V 1
    fail
  FailPickup2:
    WEAP V 1
    WEAP V 0 ACS_NamedExecuteAlways("RefSlots",0,21,0,0)
    fail
  }
}

actor F2000Drop : F2000Pickup
{
  States
  {
  Spawn:
    WEAP V -1
    stop
  Pickup:
    WEAP V 0
    WEAP V 0 A_JumpIfInventory("FN F2000",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP V 0 A_JumpIfInventory("FN F2000 Ex Mags",1,"AmmoPickup")
    WEAP V 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP V 0 A_JumpIfInventory("MaxWeaponsFilled",69,"FailPickup2")
	WEAP V 0 A_GiveInventory("MaxWeaponsFilled",32)
    WEAP V 0 ACS_NamedExecuteWithResult("RefPickU",20,0,0)
    stop
  }
}

actor F2000Drop2 : F2000Drop
{
  States
  {
  Spawn:
    WEAP V -1
    stop
  Pickup:
    WEAP V 0
    WEAP V 0 A_JumpIfInventory("FN F2000",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP V 0 A_JumpIfInventory("FN F2000 Ex Mags",1,"AmmoPickup")
    WEAP V 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP V 0 A_JumpIfInventory("MaxWeaponsFilled",69,"FailPickup2")
	WEAP V 0 A_GiveInventory("MaxWeaponsFilled",32)
    WEAP V 0 ACS_NamedExecuteWithResult("RefPickU",20,0,0)
    stop
  AmmoPickup:
    WEAP V 0
    stop
  }
}

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