
ACTOR RLNanomachicArmamentGenerator : RLWeapon
{
  Inventory.Pickupsound "weapons/unique"
  Obituary "%o was alarmed by %k's grand arsenal."
  Decal BulletChip
  +WEAPON.NOAUTOFIRE
  Tag "Nanomachic Armament Generator"
  Weapon.SelectionOrder 11
  Weapon.SlotNumber 4
  Weapon.AmmoUse1 1
  Weapon.AmmoGive1 0
  Weapon.AmmoType1 "RLNanomachicArmamentGeneratorClip"
  Weapon.AmmoType2 "Clip"
  Inventory.Icon "NAG0ICON"
  States
  {
  Ready:
    TNT1 A 0
	TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown",1,"MisfirePrevention")
	TNT1 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 11, "ReadyCyclone")
	TNT1 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 10, "ReadyDogGun")
	TNT1 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 9, "ReadySCAR")
	TNT1 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 8, "ReadyM4A1")
	TNT1 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 7, "ReadyM14")
	TNT1 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 6, "ReadySR3M")
	TNT1 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 5, "ReadyFAMAS")
	TNT1 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 4, "ReadyMP5")
	TNT1 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 3, "ReadyUMP45")
	TNT1 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 2, "ReadyAK74")
	TNT1 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 1, "ReadyHK416")
    TNT1 A 1 A_WeaponReady
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorMessage", 1, "Ready")
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorMessage", 1)
	"####" "#" 0 A_Print("Thank you for purchasing the Nanomachic Armament Generator.\nTo begin your journey into a world of guns, press \ciFire.\c-\nTo activate this device manually,\nhold down the \caDrop Item (DRLA)\c- button.\n\nThe UAC hopes this product meets your expectations of quality.",14)
    Loop
  ReadyHK416:
    NAG1 A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    Loop
  ReadyAK74:
    NAG2 A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    Loop
  ReadyUMP45:
    NAG3 A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    Loop
  ReadyMP5:
    NAG4 A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    Loop
  ReadyFAMAS:
    NAG5 A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    Loop
  ReadySR3M:
    NAG6 A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    Loop
  ReadyM14:
    NAG7 A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    Loop
  ReadyM4A1:
    NAG8 A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    Loop
  ReadySCAR:
    NAG9 A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    Loop
  ReadyDogGun:
    NA10 A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    Loop
  ReadyCyclone:
    NA11 A 1 A_WeaponReady (WRF_ALLOWZOOM)
    Loop
  ReadyNoReload:
    "####" "#" 1 A_WeaponReady (WRF_ALLOWZOOM | WRF_NOFIRE)
    Goto Ready
	
  Zoom:
    "####" "#" 1 A_WeaponReady (WRF_NOFIRE)
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorChangeCounter",1)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorChangeCounter",10,"DropGun")
    "####" "#" 1 A_WeaponReady (WRF_ALLOWZOOM | WRF_NOFIRE)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorChangeCounter",10)
	"####" "#" 0 A_Jump(256, "WeaponDrop")
	Goto WeaponDrop
  ScavengerDrop:
	"####" "#" 0 A_JumpIfInventory("RLScavengerDrop",1,"WeaponDropConfirm")
	"####" "#" 0 A_GiveInventory("RLScavengerDrop",1)
	"####" "#" 0 A_Print("Press again to drop current weapon,\nor press \crAlt Fire\c- to scrap it to retrieve a Mod Pack.")
	Goto AfterModDrop
  WeaponDropConfirm:
	"####" "#" 0 A_GiveInventory("RLMisfireSpamPreventionCooldown",1)
	"####" "#" 0 A_TakeInventory("RLScavengerDrop",1)
	"####" "#" 0 A_TakeInventory("RLWeaponDrop",1)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorModLimit", 1, "WeaponDropModded")
	"####" "#" 0 A_SpawnItemEx("RLNanomachicArmamentGeneratorPickup", 0, 0, 40, 12, 0, 0, 0, SXF_SETMASTER)
	Goto WeaponDropRemoval
  WeaponDropModded:
	"####" "#" 2 A_SpawnItemEx("RLNanomachicArmamentGeneratorPickupModded", 0, 0, 40, 12, 0, 0, 0, SXF_SETMASTER)
  WeaponDropRemoval:
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorClip", 999)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorGunType", 99)
    "####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorModLimit", 1)
    "####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorSniperMod", 1)
    "####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorFirestormMod", 1)
    "####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorNanoMod", 1)
	"####" "#" 0 A_GiveInventory("RLRarityTokenRemover", 1)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorSelected", 1)
	"####" "#" 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 1 A_TakeInventory("RLNanomachicArmamentGenerator",1)
	Stop
  AfterModDrop:
    "####" "#" 8 A_WeaponReady (16)
    Goto Ready
	
  MisfirePrevention:
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 11, "MisfirePreventionCyclone")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 10, "MisfirePreventionDogGun")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 9, "MisfirePreventionSCAR")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 8, "MisfirePreventionM4A1")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 7, "MisfirePreventionM14")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 6, "MisfirePreventionSR3M")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 5, "MisfirePreventionFAMAS")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 4, "MisfirePreventionMP5")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 3, "MisfirePreventionUMP45")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 2, "MisfirePreventionAK74")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 1, "MisfirePreventionHK416")
    TNT1 A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
  MisfirePreventionHK416:
    NAG1 A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
  MisfirePreventionAK74:
    NAG2 A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
  MisfirePreventionUMP45:
    NAG3 A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
  MisfirePreventionMP5:
    NAG4 A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
  MisfirePreventionFAMAS:
    NAG5 A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
  MisfirePreventionSR3M:
    NAG6 A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
  MisfirePreventionM14:
    NAG7 A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
  MisfirePreventionM4A1:
    NAG8 A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
  MisfirePreventionSCAR:
    NAG9 A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
  MisfirePreventionDogGun:
    NA10 A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
  MisfirePreventionCyclone:
    NA11 A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
	
  Deselect:
	TNT1 A 0 A_Print("Thank you for using this product.", 1)
	"####" "#" 0 A_GiveInventory("RLDeselectionFunction",1)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorSelected", 1)
	"####" "#" 0 A_GiveInventory("RLRarityTokenRemover", 1)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 11, "DeselectCyclone")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 10, "DeselectDogGun")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 9, "DeselectSCAR")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 8, "DeselectM4A1")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 7, "DeselectM14")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 6, "DeselectSR3M")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 5, "DeselectFAMAS")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 4, "DeselectMP5")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 3, "DeselectUMP45")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 2, "DeselectAK74")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 1, "DeselectHK416")
  DeselectLoop:
    "####" "#" 0 A_JumpIfInventory("RLShellshockPerk", 1, "DeselectRenegade")
    "####" "#" 0 A_Lower
    "####" "#" 1 A_Lower
    Goto DeselectLoop
  DeselectLoopFast:
    "####" "#" 0 A_JumpIfInventory("RLShellshockPerk", 1, "DeselectRenegade")
    "####" "##" 0 A_Lower
    "####" "#" 1 A_Lower
    Goto DeselectLoop
  DeselectLoopSlow:
    "####" "#" 0 A_JumpIfInventory("RLShellshockPerk", 1, "DeselectRenegade")
    "####" "#" 1 A_Lower
    Goto DeselectLoop
  DeselectRenegade:
    "####" "#" 0 A_Lower
    Loop
  DeselectHK416:
    NAG1 A 0
    Goto DeselectLoop
  DeselectAK74:
    NAG2 A 0
    Goto DeselectLoop
  DeselectUMP45:
    NAG3 A 0
    Goto DeselectLoop
  DeselectMP5:
    NAG4 A 0
    Goto DeselectLoop
  DeselectFAMAS:
    NAG5 A 0
    Goto DeselectLoop
  DeselectSR3M:
    NAG6 A 0
    Goto DeselectLoop
  DeselectM14:
    NAG7 A 0
    Goto DeselectLoop
  DeselectM4A1:
    NAG8 A 0
    Goto DeselectLoop
  DeselectSCAR:
    NAG9 A 0
    Goto DeselectLoop
  DeselectDogGun:
    NA10 A 0
    Goto DeselectLoopFast
  DeselectCyclone:
    NA11 A 0
    "####" "#" 0 A_StopSound(CHAN_WEAPON)
    "####" "#" 0 A_PlaySound("weapons/nmagcyclonedown", 7, 1, 0, 1.4)
    Goto DeselectLoopSlow
  SelectRenegade: 
    "####" "#" 0 A_Raise
    Loop
  SelectSetWeapon:
	TNT1 A 0 A_GiveInventory("RLRapidfireTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLSingleShotRifleTypeWeapon", 1)
	"####" "#" 0 A_GiveInventory("RLUniqueWeaponToken", 1)
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorSelected", 1)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 11, "SelectCyclone")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 10, "SelectDogGun")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 9, "SelectSCAR")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 8, "SelectM4A1")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 7, "SelectM14")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 6, "SelectSR3M")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 5, "SelectFAMAS")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 4, "SelectMP5")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 3, "SelectUMP45")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 2, "SelectAK74")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 1, "SelectHK416")
	TNT1 A 0
    Goto SelectLoop
  SelectHK416:
    NAG1 A 0
    Goto SelectLoop
  SelectAK74:
    NAG2 A 0
    Goto SelectLoop
  SelectUMP45:
    NAG3 A 0
    Goto SelectLoop
  SelectMP5:
    NAG4 A 0
    Goto SelectLoop
  SelectFAMAS:
    NAG5 A 0
    Goto SelectLoop
  SelectSR3M:
    NAG6 A 0
    Goto SelectLoop
  SelectM14:
    NAG7 A 0
    Goto SelectLoop
  SelectM4A1:
    NAG8 A 0
    Goto SelectLoop
  SelectSCAR:
    NAG9 A 0
    Goto SelectLoop
  SelectDogGun:
    NA10 A 0
    Goto SelectLoopFast
  SelectCyclone:
    NA11 A 0
    "####" "#" 0 A_PlaySound("weapons/nmagcycloneup", 7, 1, 0, 1.4)
    Goto SelectLoopSlow
  SelectLoop:
    "####" "#" 0 A_JumpIfInventory("RLShellshockPerk", 1, "SelectRenegade")
    "####" "#" 0 A_Raise
    "####" "#" 1 A_Raise
    Loop
  SelectLoopFast:
    "####" "#" 0 A_JumpIfInventory("RLShellshockPerk", 1, "SelectRenegade")
    "####" "##" 0 A_Raise
    "####" "#" 1 A_Raise
    Loop
  SelectLoopSlow:
    "####" "#" 0 A_JumpIfInventory("RLShellshockPerk", 1, "SelectRenegade")
    "####" "#" 1 A_Raise
    Loop
	
  DropGun:
// Discarding a gun. Shivers will forgive you if you get a new one.
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorChangeCounter",10)
	"####" "#" 0 A_Print("Fabricating gun, please standby...", 1)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 11, "DropCyclone")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 10, "DropDogGun")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 9, "DropSCAR")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 8, "DropM4A1")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 7, "DropM14")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 6, "DropSR3M")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 5, "DropFAMAS")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 4, "DropMP5")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 3, "DropUMP45")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 2, "DropAK74")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 1, "DropHK416")
    Goto CreateGun
// You megamoron.
    Goto ReadyNoReload
  DropHK416:
    NAG1 EFGHIJK 2
    Goto CreateGun
  DropAK74:
    NAG2 EFGHIJK 2
    Goto CreateGun
  DropUMP45:
    NAG3 EFGHIJK 2
    Goto CreateGun
  DropMP5:
    NAG4 EFGHIJK 2
    Goto CreateGun
  DropFAMAS:
    NAG5 EFGHIJK 2
    Goto CreateGun
  DropSR3M:
    NAG6 EFGHIJK 2
    Goto CreateGun
  DropM14:
    NAG7 EFGHIJK 2
    Goto CreateGun
  DropM4A1:
    NAG8 EFGHIJK 2
    Goto CreateGun
  DropSCAR:
    NAG9 EFGHIJK 2
    Goto CreateGun
  DropDogGun:
    NA10 EFGHIJK 2
    Goto CreateGun
  DropCyclone:
    "####" "#" 0 A_PlaySound("weapons/nmagcyclonedown", 7, 1, 0, 1.4)
    NA11 EFGHIJK 2
    Goto CreateGun
	
  CreateGun:
// Summoning a new gun.
	"####" "#" 0 A_Print("Fabricating gun, please standby...", 1)
	"####" "#" 0 A_PlaySound("weapons/chameleonriflechangemode", 7, 1, 0, 1.8)
    TNT1 A 35
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorClip", 999)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorGunType", 99)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorNanoMod", 1, "CreateNanoGun")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorFirestormMod", 1, "CreateFirestormGun")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorSniperMod", 1, "CreateSniperGun")
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorGunType", random(1,9))
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 9, "CreateSCAR")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 8, "CreateM4A1")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 7, "CreateM14")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 6, "CreateSR3M")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 5, "CreateFAMAS")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 4, "CreateMP5")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 3, "CreateUMP45")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 2, "CreateAK74")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 1, "CreateHK416")
// Somehow you didn't make a gun. You have disappointed Shivers.
    Goto ReadyNoReload
  CreateNanoGun:
// Summoning any standard or weird gun.
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorGunType", random(1,10))
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 10, "CreateDogGun")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 9, "CreateSCAR")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 8, "CreateM4A1")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 7, "CreateM14")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 6, "CreateSR3M")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 5, "CreateFAMAS")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 4, "CreateMP5")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 3, "CreateUMP45")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 2, "CreateAK74")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 1, "CreateHK416")
// Somehow you didn't make a gun. You have disappointed Shivers.
    Goto ReadyNoReload
  CreateFirestormGun:
// Summoning any fast or powerful machine gun.
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorGunType", randompick(3,5,9,11))
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 11, "CreateCyclone")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 9, "CreateSCAR")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 5, "CreateFAMAS")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 3, "CreateUMP45")
// Somehow you didn't make a gun. You have disappointed Shivers.
    Goto ReadyNoReload
  CreateSniperGun:
// Summoning any accurate gun.
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorGunType", randompick(1,7,8))
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 8, "CreateM4A1")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 7, "CreateM14")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 1, "CreateHK416")
// Somehow you didn't make a gun. You have disappointed Shivers.
    Goto ReadyNoReload
  CreateHK416:
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 20)
    NAG1 KJIHGFE 2
    Goto Ready
  CreateAK74:
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 30)
    NAG2 KJIHGFE 2
    Goto Ready
  CreateUMP45:
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 25)
    NAG3 KJIHGFE 2
    Goto Ready
  CreateMP5:
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 15)
    NAG4 KJIHGFE 2
    Goto Ready
  CreateFAMAS:
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 25)
    NAG5 KJIHGFE 2
    Goto Ready
  CreateSR3M:
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 30)
    NAG6 KJIHGFE 2
    Goto Ready
  CreateM14:
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 20)
    NAG7 KJIHGFE 2
    Goto Ready
  CreateM4A1:
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 30)
    NAG8 KJIHGFE 2
    Goto Ready
  CreateSCAR:
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 20)
    NAG9 KJIHGFE 2
    Goto Ready
  CreateDogGun:
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 10)
    NA10 KJIHGFE 2
    Goto Ready
  CreateCyclone:
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 100)
    "####" "#" 0 A_PlaySound("weapons/nmagcycloneup", 7, 1, 0, 1.4)
    NA11 KJIHGFE 2
    Goto Ready
	
  Fire:
	"####" "#" 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"MeleeRestricted") // Cannot fire in levels that restrict it
	"####" "#" 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"SilencedRestricted") // Cannot fire in levels that restrict it
	"####" "#" 0 A_JumpIfInventory("RLRestrictionBoomOnly",1,"BoomRestricted") // Cannot fire in levels that restrict it
	"####" "#" 0 A_JumpIfInventory("RLRestrictionLowTechOnly",1,"LowTechRestricted") // Cannot fire in levels that restrict it
	"####" "#" 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"CunningRestricted") // Cannot fire in levels that restrict it
	
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 11, "FireCyclone")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 10, "FireDogGun")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 9, "FireSCAR")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 8, "FireM4A1")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 7, "FireM14")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 6, "FireSR3M")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 5, "FireFAMAS")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 4, "FireMP5")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 3, "FireUMP45")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 2, "FireAK74")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 1, "FireHK416")
	Goto CreateGun
	
  FireHK416:
	"####" "#" 0 A_JumpIfNoAmmo("DropGun")
	"####" "#" 0 A_AlertMonsters
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,2)
	"####" "#" 0 A_JumpIfInventory("RLAmmochainPerk",1,2)
	"####" "#" 0 A_FireBullets (3, 2, -1, 6, "RLBulletPuff")
    Goto FireHK416Continue
	"####" "#" 0 A_FireBullets (3, 2, -1, 6, "RLBulletPuff", 0)
    Goto FireHK416Continue
  FireHK416Continue:
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,6)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",2,4)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",1,2)
    "####" "#" 0 A_PlaySound("weapons/nmaghk416", CHAN_WEAPON, 1, 0, 0.7)
    Goto FireHK416SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmaghk416", CHAN_ITEM, 1, 0, 0.7)
    Goto FireHK416SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmaghk416", CHAN_BODY, 1, 0, 0.7)
    Goto FireHK416SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmaghk416", CHAN_VOICE, 1, 0, 0.7)
    Goto FireHK416SoundDone
  FireHK416SoundDone:
    TNT1 A 0 A_SpawnItemEx ("RLThompsonRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" "#" 0 A_PlaySound("weapons/nmaghk416", 7, 0.05, 0, 0.20)
    NAG1 B 1 Bright A_GunFlash
    NAG1 C 1 Bright
	TNT1 A 0 A_JumpIfInventory("RLAmmochainPerk",1,"FireFinishHK416PowerupCheck") // Check for powerups.
  FireFinishHK416PowerupCheckDone: // No valid powerups detected.
    NAG1 D 1
    Goto FireFinishContinue

//-------------------------------------------------------------------------------------------------
  FireFinishHK416PowerupCheck: // Marine fires one Firestorm's worth faster while affected by powerups.
	TNT1 A 0 A_JumpIfInventory("PowerInvulnerable",1,"FireFinishHK416PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInvisibility",1,"FireFinishHK416PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerIronFeet",1,"FireFinishHK416PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerLightAmp",1,"FireFinishHK416PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInfiniteAmmo",1,"FireFinishHK416PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerDrain",1,"FireFinishHK416PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerRLBerserkResistance",1,"FireFinishHK416PowerupCheckConfirmed")
	Goto FireFinishHK416PowerupCheckDone
  FireFinishHK416PowerupCheckConfirmed:
	TNT1 A 0
	Goto FireFinishContinue
//-------------------------------------------------------------------------------------------------
  
  FireAK74:
	"####" "#" 0 A_JumpIfNoAmmo("DropGun")
	"####" "#" 0 A_AlertMonsters
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,2)
	"####" "#" 0 A_JumpIfInventory("RLAmmochainPerk",1,2)
	"####" "#" 0 A_FireBullets (5.5, 3, -1, 8, "RLBulletPuff")
    Goto FireAK74Continue
	"####" "#" 0 A_FireBullets (5.5, 3, -1, 8, "RLBulletPuff", 0)
    Goto FireAK74Continue
  FireAK74Continue:
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,6)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",2,4)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",1,2)
    "####" "#" 0 A_PlaySound("weapons/nmagak74", CHAN_WEAPON, 1, 0, 0.7)
    Goto FireAK74SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagak74", CHAN_ITEM, 1, 0, 0.7)
    Goto FireAK74SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagak74", CHAN_BODY, 1, 0, 0.7)
    Goto FireAK74SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagak74", CHAN_VOICE, 1, 0, 0.7)
    Goto FireAK74SoundDone
  FireAK74SoundDone:
    TNT1 A 0 A_SpawnItemEx ("RLUziRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" "#" 0 A_PlaySound("weapons/nmagak74", 7, 0.05, 0, 0.20)
    NAG2 B 1 Bright A_GunFlash
    NAG2 C 1 Bright
    NAG2 D 1
	TNT1 A 0 A_JumpIfInventory("RLAmmochainPerk",1,"FireFinishAK74PowerupCheck") // Check for powerups.
  FireFinishAK74PowerupCheckDone: // No valid powerups detected.
    NAG2 A 1
    Goto FireFinishContinue

//-------------------------------------------------------------------------------------------------
  FireFinishAK74PowerupCheck: // Marine fires one Firestorm's worth faster while affected by powerups.
	TNT1 A 0 A_JumpIfInventory("PowerInvulnerable",1,"FireFinishAK74PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInvisibility",1,"FireFinishAK74PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerIronFeet",1,"FireFinishAK74PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerLightAmp",1,"FireFinishAK74PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInfiniteAmmo",1,"FireFinishAK74PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerDrain",1,"FireFinishAK74PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerRLBerserkResistance",1,"FireFinishAK74PowerupCheckConfirmed")
	Goto FireFinishAK74PowerupCheckDone
  FireFinishAK74PowerupCheckConfirmed:
	TNT1 A 0
	Goto FireFinishContinue
//-------------------------------------------------------------------------------------------------
	
  FireUMP45:
	"####" "#" 0 A_JumpIfNoAmmo("DropGun")
	"####" "#" 0 A_AlertMonsters
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,2)
	"####" "#" 0 A_JumpIfInventory("RLAmmochainPerk",1,2)
	"####" "#" 0 A_FireBullets (4, 2.5, -1, 7, "RLBulletPuff")
    Goto FireUMP45Continue
	"####" "#" 0 A_FireBullets (4, 2.5, -1, 7, "RLBulletPuff", 0)
    Goto FireUMP45Continue
  FireUMP45Continue:
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,6)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",2,4)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",1,2)
    "####" "#" 0 A_PlaySound("weapons/nmagump45", CHAN_WEAPON, 1, 0, 0.7)
    Goto FireUMP45SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagump45", CHAN_ITEM, 1, 0, 0.7)
    Goto FireUMP45SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagump45", CHAN_BODY, 1, 0, 0.7)
    Goto FireUMP45SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagump45", CHAN_VOICE, 1, 0, 0.7)
    Goto FireUMP45SoundDone
  FireUMP45SoundDone:
    TNT1 A 0 A_SpawnItemEx ("RLUziRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" "#" 0 A_PlaySound("weapons/nmagump45", 7, 0.05, 0, 0.20)
    NAG3 B 1 Bright A_GunFlash
    NAG3 C 1 Bright
    NAG3 D 1
	TNT1 A 0 A_JumpIfInventory("RLAmmochainPerk",1,"FireFinishUMP45PowerupCheck") // Check for powerups.
  FireFinishUMP45PowerupCheckDone: // No valid powerups detected.
    NAG3 A 1
    Goto FireFinishContinue
	
//-------------------------------------------------------------------------------------------------
  FireFinishUMP45PowerupCheck: // Marine fires one Firestorm's worth faster while affected by powerups.
	TNT1 A 0 A_JumpIfInventory("PowerInvulnerable",1,"FireFinishUMP45PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInvisibility",1,"FireFinishUMP45PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerIronFeet",1,"FireFinishUMP45PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerLightAmp",1,"FireFinishUMP45PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInfiniteAmmo",1,"FireFinishUMP45PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerDrain",1,"FireFinishUMP45PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerRLBerserkResistance",1,"FireFinishUMP45PowerupCheckConfirmed")
	Goto FireFinishUMP45PowerupCheckDone
  FireFinishUMP45PowerupCheckConfirmed:
	TNT1 A 0
	Goto FireFinishContinue
//-------------------------------------------------------------------------------------------------
	
  FireMP5:
	"####" "#" 0 A_JumpIfNoAmmo("DropGun")
	"####" "#" 0 A_AlertMonsters
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,2)
	"####" "#" 0 A_JumpIfInventory("RLAmmochainPerk",1,2)
	"####" "#" 0 A_FireBullets (6, 4, -1, 6, "RLBulletPuff")
    Goto FireMP5Continue
	"####" "#" 0 A_FireBullets (6, 4, -1, 6, "RLBulletPuff", 0)
    Goto FireMP5Continue
  FireMP5Continue:
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,6)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",2,4)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",1,2)
    "####" "#" 0 A_PlaySound("weapons/nmagmp5", CHAN_WEAPON, 1, 0, 0.7)
    Goto FireMP5SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagmp5", CHAN_ITEM, 1, 0, 0.7)
    Goto FireMP5SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagmp5", CHAN_BODY, 1, 0, 0.7)
    Goto FireMP5SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagmp5", CHAN_VOICE, 1, 0, 0.7)
    Goto FireMP5SoundDone
  FireMP5SoundDone:
    "####" "#" 0 A_SpawnItemEx ("RLThompsonRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" "#" 0 A_PlaySound("weapons/nmagmp5", 7, 0.05, 0, 0.20)
    NAG4 B 1 Bright A_GunFlash
    NAG4 C 1 Bright
	TNT1 A 0 A_JumpIfInventory("RLAmmochainPerk",1,"FireFinishMP5PowerupCheck") // Check for powerups.
  FireFinishMP5PowerupCheckDone: // No valid powerups detected.
    NAG4 D 1
    Goto FireFinishContinue
	
//-------------------------------------------------------------------------------------------------
  FireFinishMP5PowerupCheck: // Marine fires one Firestorm's worth faster while affected by powerups.
	TNT1 A 0 A_JumpIfInventory("PowerInvulnerable",1,"FireFinishMP5PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInvisibility",1,"FireFinishMP5PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerIronFeet",1,"FireFinishMP5PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerLightAmp",1,"FireFinishMP5PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInfiniteAmmo",1,"FireFinishMP5PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerDrain",1,"FireFinishMP5PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerRLBerserkResistance",1,"FireFinishMP5PowerupCheckConfirmed")
	Goto FireFinishMP5PowerupCheckDone
  FireFinishMP5PowerupCheckConfirmed:
	TNT1 A 0
	Goto FireFinishContinue
//-------------------------------------------------------------------------------------------------
	
  FireFAMAS:
	"####" "#" 0 A_JumpIfNoAmmo("DropGun")
	"####" "#" 0 A_AlertMonsters
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,2)
	"####" "#" 0 A_JumpIfInventory("RLAmmochainPerk",1,2)
	"####" "#" 0 A_FireBullets (3, 2, -1, 6, "RLBulletPuff")
    Goto FireFAMASContinue
	"####" "#" 0 A_FireBullets (3, 2, -1, 6, "RLBulletPuff", 0)
    Goto FireFAMASContinue
  FireFAMASContinue:
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,6)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",2,4)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",1,2)
    "####" "#" 0 A_PlaySound("weapons/nmagfamas", CHAN_WEAPON, 1, 0, 0.7)
    Goto FireFAMASSoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagfamas", CHAN_ITEM, 1, 0, 0.7)
    Goto FireFAMASSoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagfamas", CHAN_BODY, 1, 0, 0.7)
    Goto FireFAMASSoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagfamas", CHAN_VOICE, 1, 0, 0.7)
    Goto FireFAMASSoundDone
  FireFAMASSoundDone:
    "####" "#" 0 A_SpawnItemEx ("RLThompsonRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" "#" 0 A_PlaySound("weapons/nmagfamas", 7, 0.05, 0, 0.20)
    NAG5 B 1 Bright A_GunFlash
    NAG5 C 1 Bright
	TNT1 A 0 A_JumpIfInventory("RLAmmochainPerk",1,"FireFinishFAMASPowerupCheck") // Check for powerups.
  FireFinishFAMASPowerupCheckDone: // No valid powerups detected.
    NAG5 D 1
    Goto FireFinishContinue
	
//-------------------------------------------------------------------------------------------------
  FireFinishFAMASPowerupCheck: // Marine fires one Firestorm's worth faster while affected by powerups.
	TNT1 A 0 A_JumpIfInventory("PowerInvulnerable",1,"FireFinishFAMASPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInvisibility",1,"FireFinishFAMASPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerIronFeet",1,"FireFinishFAMASPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerLightAmp",1,"FireFinishFAMASPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInfiniteAmmo",1,"FireFinishFAMASPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerDrain",1,"FireFinishFAMASPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerRLBerserkResistance",1,"FireFinishFAMASPowerupCheckConfirmed")
	Goto FireFinishFAMASPowerupCheckDone
  FireFinishFAMASPowerupCheckConfirmed:
	TNT1 A 0
	Goto FireFinishContinue
//-------------------------------------------------------------------------------------------------
	
  FireSR3M:
	"####" "#" 0 A_JumpIfNoAmmo("DropGun")
	"####" "#" 0 A_AlertMonsters
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,2)
	"####" "#" 0 A_JumpIfInventory("RLAmmochainPerk",1,2)
	"####" "#" 0 A_FireBullets (5, 5, -1, 6, "RLBulletPuff")
    Goto FireSR3MContinue
	"####" "#" 0 A_FireBullets (5, 5, -1, 6, "RLBulletPuff", 0)
    Goto FireSR3MContinue
  FireSR3MContinue:
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,6)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",2,4)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",1,2)
    "####" "#" 0 A_PlaySound("weapons/nmagsr3m", CHAN_WEAPON, 1, 0, 0.7)
    Goto FireSR3MSoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagsr3m", CHAN_ITEM, 1, 0, 0.7)
    Goto FireSR3MSoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagsr3m", CHAN_BODY, 1, 0, 0.7)
    Goto FireSR3MSoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagsr3m", CHAN_VOICE, 1, 0, 0.7)
    Goto FireSR3MSoundDone
  FireSR3MSoundDone:
    "####" "#" 0 A_SpawnItemEx ("RLThompsonRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" "#" 0 A_PlaySound("weapons/nmagsr3m", 7, 0.05, 0, 0.20)
    NAG6 B 1 Bright A_GunFlash
    NAG6 C 1 Bright
	TNT1 A 0 A_JumpIfInventory("RLAmmochainPerk",1,"FireFinishSR3MPowerupCheck") // Check for powerups.
  FireFinishSR3MPowerupCheckDone: // No valid powerups detected.
    NAG6 D 1
    Goto FireFinishContinue
	
//-------------------------------------------------------------------------------------------------
  FireFinishSR3MPowerupCheck: // Marine fires one Firestorm's worth faster while affected by powerups.
	TNT1 A 0 A_JumpIfInventory("PowerInvulnerable",1,"FireFinishSR3MPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInvisibility",1,"FireFinishSR3MPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerIronFeet",1,"FireFinishSR3MPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerLightAmp",1,"FireFinishSR3MPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInfiniteAmmo",1,"FireFinishSR3MPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerDrain",1,"FireFinishSR3MPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerRLBerserkResistance",1,"FireFinishSR3MPowerupCheckConfirmed")
	Goto FireFinishSR3MPowerupCheckDone
  FireFinishSR3MPowerupCheckConfirmed:
	TNT1 A 0
	Goto FireFinishContinue
//-------------------------------------------------------------------------------------------------
	
  FireM14:
	"####" "#" 0 A_JumpIfNoAmmo("DropGun")
	"####" "#" 0 A_AlertMonsters
	"####" "#" 0 A_FireBullets (1.5, 1.5, -1, 20, "RLBulletPuff")
    "####" "#" 0 A_SpawnItemEx ("RLPistolRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" "#" 0 A_PlaySound("weapons/nmagm14", CHAN_WEAPON, 1, 0, 0.7)
    "####" "#" 0 A_PlaySound("weapons/nmagm14", 7, 0.05, 0, 0.20)
    NAG7 B 2 Bright A_GunFlash ("FlashM14")
    NAG7 C 2 Bright
    NAG7 DA 4
	"####" "#" 0 A_JumpIfNoAmmo("Ready")
    "####" "#" 0 A_ReFire
    Goto Ready
	
  FireM4A1:
	"####" "#" 0 A_JumpIfNoAmmo("DropGun")
	"####" "#" 0 A_AlertMonsters
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,2)
	"####" "#" 0 A_JumpIfInventory("RLAmmochainPerk",1,2)
	"####" "#" 0 A_FireBullets (2.5, 1, -1, 7, "RLBulletPuff")
    Goto FireM4A1Continue
	"####" "#" 0 A_FireBullets (2.5, 1, -1, 7, "RLBulletPuff", 0)
    Goto FireM4A1Continue
  FireM4A1Continue:
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,6)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",2,4)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",1,2)
    "####" "#" 0 A_PlaySound("weapons/nmagm4a1", CHAN_WEAPON, 1, 0, 0.7)
    Goto FireM4A1SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagm4a1", CHAN_ITEM, 1, 0, 0.7)
    Goto FireM4A1SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagm4a1", CHAN_BODY, 1, 0, 0.7)
    Goto FireM4A1SoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagm4a1", CHAN_VOICE, 1, 0, 0.7)
    Goto FireM4A1SoundDone
  FireM4A1SoundDone:
    "####" "#" 0 A_SpawnItemEx ("RLThompsonRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" "#" 0 A_PlaySound("weapons/nmagm4a1", 7, 0.05, 0, 0.20)
    NAG8 B 1 Bright A_GunFlash
    NAG8 C 1 Bright
	TNT1 A 0 A_JumpIfInventory("RLAmmochainPerk",1,"FireFinishM4A1PowerupCheck") // Check for powerups.
  FireFinishM4A1PowerupCheckDone: // No valid powerups detected.
    NAG8 D 1
    Goto FireFinishContinue
	
//-------------------------------------------------------------------------------------------------
  FireFinishM4A1PowerupCheck: // Marine fires one Firestorm's worth faster while affected by powerups.
	TNT1 A 0 A_JumpIfInventory("PowerInvulnerable",1,"FireFinishM4A1PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInvisibility",1,"FireFinishM4A1PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerIronFeet",1,"FireFinishM4A1PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerLightAmp",1,"FireFinishM4A1PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInfiniteAmmo",1,"FireFinishM4A1PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerDrain",1,"FireFinishM4A1PowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerRLBerserkResistance",1,"FireFinishM4A1PowerupCheckConfirmed")
	Goto FireFinishM4A1PowerupCheckDone
  FireFinishM4A1PowerupCheckConfirmed:
	TNT1 A 0
	Goto FireFinishContinue
//-------------------------------------------------------------------------------------------------
	
  FireSCAR:
	"####" "#" 0 A_JumpIfNoAmmo("DropGun")
	"####" "#" 0 A_AlertMonsters
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,2)
	"####" "#" 0 A_JumpIfInventory("RLAmmochainPerk",1,2)
	"####" "#" 0 A_FireBullets (5, 4, -1, 8, "RLBulletPuff")
    Goto FireSCARContinue
	"####" "#" 0 A_FireBullets (5, 4, -1, 6, "RLBulletPuff", 0)
    Goto FireSCARContinue
  FireSCARContinue:
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,6)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",2,4)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",1,2)
    "####" "#" 0 A_PlaySound("weapons/nmagscar", CHAN_WEAPON, 1, 0, 0.7)
    Goto FireSCARSoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagscar", CHAN_ITEM, 1, 0, 0.7)
    Goto FireSCARSoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagscar", CHAN_BODY, 1, 0, 0.7)
    Goto FireSCARSoundDone
    "####" "#" 0 A_PlaySound("weapons/nmagscar", CHAN_VOICE, 1, 0, 0.7)
    Goto FireSCARSoundDone
  FireSCARSoundDone:
    TNT1 A 0 A_SpawnItemEx ("RLUziRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" "#" 0 A_PlaySound("weapons/nmagscar", 7, 0.05, 0, 0.20)
    NAG9 B 1 Bright A_GunFlash
    NAG9 C 1 Bright
    NAG9 D 1
	TNT1 A 0 A_JumpIfInventory("RLAmmochainPerk",1,"FireFinishSCARPowerupCheck") // Check for powerups.
  FireFinishSCARPowerupCheckDone: // No valid powerups detected.
    NAG9 A 1
    Goto FireFinishContinue
	
//-------------------------------------------------------------------------------------------------
  FireFinishSCARPowerupCheck: // Marine fires one Firestorm's worth faster while affected by powerups.
	TNT1 A 0 A_JumpIfInventory("PowerInvulnerable",1,"FireFinishSCARPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInvisibility",1,"FireFinishSCARPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerIronFeet",1,"FireFinishSCARPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerLightAmp",1,"FireFinishSCARPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInfiniteAmmo",1,"FireFinishSCARPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerDrain",1,"FireFinishSCARPowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerRLBerserkResistance",1,"FireFinishSCARPowerupCheckConfirmed")
	Goto FireFinishSCARPowerupCheckDone
  FireFinishSCARPowerupCheckConfirmed:
	TNT1 A 0
	Goto FireFinishContinue
//-------------------------------------------------------------------------------------------------
	
  FireDogGun:
	"####" "#" 0 A_JumpIfNoAmmo("DropGun")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip", 2, 1)
	Goto FireDogGunLittle
	"####" "#" 0 A_AlertMonsters
	"####" "#" 0 A_Jump (32, "FireDogGunBlue")
	"####" "#" 0 A_Jump (96, "FireDogGunLittle")
    NA10 B 3 Bright A_GunFlash ("FlashDogGun")
	"####" "#" 0 A_PlaySound ("stegglesbig/bark", CHAN_WEAPON, 1, 0, 0.8)
	"####" "#" 0 A_SpawnItemEx ("RLNAGDog", 0,0,32, frandom(8,12),frandom(-1,1),frandom(-1,1), frandom(-1,1), SXF_NOCHECKPOSITION)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorClip", 2, TIF_NOTAKEINFINITE)
    TNT1 A 0 A_SpawnItemEx ("RLPistolRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    NA10 C 3 Bright
    NA10 DA 1
    Goto Ready
  FireDogGunLittle:
    NA10 B 2 Bright A_GunFlash ("FlashM14")
	"####" "#" 0 A_PlaySound ("steggles/bark", CHAN_WEAPON, 1, 0, 0.8)
	"####" "#" 0 A_SpawnItemEx ("RLNAGLittleDog", 0,0,32, frandom(8,12),frandom(-1,1),frandom(-1,1), frandom(-1,1), SXF_NOCHECKPOSITION)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorClip", 1, TIF_NOTAKEINFINITE)
    TNT1 A 0 A_SpawnItemEx ("RLPistolRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    NA10 C 2 Bright
    NA10 DA 1
    Goto Ready
  FireDogGunBlue:
    NA10 B 3 Bright A_GunFlash ("FlashDogGun")
	"####" "#" 0 A_PlaySound ("stegglesbig/bark", CHAN_WEAPON, 1, 0, 0.8)
	"####" "#" 0 A_SpawnItemEx ("RLNAGBlueDog", 0,0,32, frandom(8,12),frandom(-1,1),frandom(-1,1), frandom(-1,1), SXF_NOCHECKPOSITION)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorClip", 2, TIF_NOTAKEINFINITE)
    TNT1 A 0 A_SpawnItemEx ("RLPistolRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    NA10 C 3 Bright
    NA10 DA 1
    Goto Ready
	
  FireCyclone:
	"####" "#" 0 A_JumpIfNoAmmo("FireCycloneAmmoPool")
	"####" "#" 0 A_AlertMonsters
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,2)
	"####" "#" 0 A_JumpIfInventory("RLAmmochainPerk",1,2)
	"####" "#" 0 A_FireBullets (7.5, 5, -1, 12, "RLBulletPuff")
    Goto FireCycloneContinue
	"####" "#" 0 A_FireBullets (7.5, 5, -1, 12, "RLBulletPuff", 0)
    Goto FireCycloneContinue
  FireCycloneAmmoPool:
	"####" "#" 0 A_JumpIfInventory("Clip",1,1)
	Goto DropGun
	"####" "#" 0 A_AlertMonsters
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,2)
	"####" "#" 0 A_JumpIfInventory("RLAmmochainPerk",1,3)
	"####" "#" 0 A_FireBullets (7.5, 5, -1, 12, "RLBulletPuff", 0)
	"####" "#" 0 A_TakeInventory("Clip",1, TIF_NOTAKEINFINITE)
    Goto FireCycloneContinue
	"####" "#" 0 A_FireBullets (7.5, 5, -1, 12, "RLBulletPuff", 0)
    Goto FireCycloneContinue
  FireCycloneContinue:
	TNT1 A 0 A_CheckFloor (2)
	TNT1 A 0 A_Jump(256,4)
	TNT1 A 0 A_JumpIfInventory("RLGrapplingSteelBootsToken",1,4)
	TNT1 A 0 A_JumpIfInventory("RLGrapplingProtectiveBootsToken",1,3)
	TNT1 A 0 A_JumpIfInventory("RLGrapplingPlasteelBootsToken",1,2)
    TNT1 A 0 A_ChangeVelocity (Cos(Pitch) * -0.5, 0, Sin(Pitch) * 0.5, 1)
    "####" "#" 0 A_PlaySound("weapons/nmagcycloneloop", CHAN_WEAPON, 1, 1, 0.6)
    "####" "#" 0 A_PlaySound("weapons/nmagcycloneloop", 7, 0.05, 1, 0.20)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,6)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",2,2)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",1,4)
    NA11 B 1 Bright A_GunFlash
	TNT1 A 0 A_JumpIfInventory("RLAmmochainPerk",1,"FireFinishCyclonePowerupCheck") // Check for powerups.
  FireFinishCyclonePowerupCheckDone: // No valid powerups detected.
    NA11 D 1
    Goto FireFinishCycloneContinue
    NA11 C 1 Bright A_GunFlash
	TNT1 A 0 A_JumpIfInventory("RLAmmochainPerk",1,"FireFinishCyclonePowerupCheck") // Check for powerups.
  FireFinishCyclonePowerupCheckDone: // No valid powerups detected.
    NA11 D 1
    Goto FireFinishCycloneContinue
	
//-------------------------------------------------------------------------------------------------
  FireFinishCyclonePowerupCheck: // Marine fires one Firestorm's worth faster while affected by powerups.
	TNT1 A 0 A_JumpIfInventory("PowerInvulnerable",1,"FireFinishCyclonePowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInvisibility",1,"FireFinishCyclonePowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerIronFeet",1,"FireFinishCyclonePowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerLightAmp",1,"FireFinishCyclonePowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerInfiniteAmmo",1,"FireFinishCyclonePowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerDrain",1,"FireFinishCyclonePowerupCheckConfirmed")
	TNT1 A 0 A_JumpIfInventory("PowerRLBerserkResistance",1,"FireFinishCyclonePowerupCheckConfirmed")
	Goto FireFinishCyclonePowerupCheckDone
  FireFinishCyclonePowerupCheckConfirmed:
	TNT1 A 0
	Goto FireFinishContinue
//-------------------------------------------------------------------------------------------------
	
  FireFinishCycloneContinue:
    "####" "#" 0 A_SpawnItemEx ("RLUziRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",3,2)
	"####" "#" 0 A_Jump(256,6)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorAmmochain",3)
	"####" "#" 0 A_JumpIfNoAmmo("FireFinishCycloneAmmoCheck")
    "####" "#" 0 A_ReFire
    "####" "#" 0 A_PlaySound("weapons/nmagcycloneloopend", CHAN_WEAPON, 1, 0, 0.6)
    "####" "#" 0 A_PlaySound("weapons/nmagcycloneloopend", 7, 0.05, 0, 0.20)
    Goto Ready
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorAmmochain",1)
	"####" "#" 0 A_JumpIfNoAmmo("FireFinishCycloneAmmoCheck")
    "####" "#" 0 A_ReFire
    "####" "#" 0 A_PlaySound("weapons/nmagcycloneloopend", CHAN_WEAPON, 1, 0, 0.6)
    "####" "#" 0 A_PlaySound("weapons/nmagcycloneloopend", 7, 0.05, 0, 0.20)
    Goto Ready
  FireFinishCycloneAmmoCheck:
	"####" "#" 0 A_JumpIfInventory("Clip",1,3)
    "####" "#" 0 A_PlaySound("weapons/nmagcycloneloopend", CHAN_WEAPON, 1, 0, 0.6)
    "####" "#" 0 A_PlaySound("weapons/nmagcycloneloopend", 7, 0.05, 0, 0.20)
    Goto Ready
    "####" "#" 0 A_ReFire
    "####" "#" 0 A_PlaySound("weapons/nmagcycloneloopend", CHAN_WEAPON, 1, 0, 0.6)
    "####" "#" 0 A_PlaySound("weapons/nmagcycloneloopend", 7, 0.05, 0, 0.20)
    Goto Ready
	
  FireFinishContinue:
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorAmmochain",0,2)
	"####" "#" 0 A_Jump(256,4)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorAmmochain",0)
	"####" "#" 0 A_JumpIfNoAmmo("Ready")
    "####" "#" 0 A_ReFire
    Goto Ready
	"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGeneratorAmmochain",1)
	"####" "#" 0 A_JumpIfNoAmmo("Ready")
    "####" "#" 0 A_ReFire
    Goto Ready
	
  Reload:
	"####" "#" 1 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 10, "ReloadDogGun")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 9, "ReloadSCAR")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 8, "ReloadM4A1")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 7, "ReloadM14")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 6, "ReloadSR3M")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 5, "ReloadFAMAS")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 4, "ReloadMP5")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 3, "ReloadUMP45")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 2, "ReloadAK74")
	"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorGunType", 1, "ReloadHK416")
	Goto CreateGun
	
  ReloadHK416:
	NAG1 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip", 20, "ReadyNoReload")
	"####" A 0 A_JumpIfInventory("Clip", 1, 1)
	Goto ReadyNoReload
	"####" A 0 // Play the reload animation.
    "####" E 2
    "####" F 2
    "####" G 2
    "####" H 2
    "####" I 2
	"####" A 0 A_PlaySound("weapons/nmaghk416unload", 7)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" J 2
    "####" K 2
    TNT1 A 17
	Goto ReloadHK416Working
  ReloadHK416Working:
	"####" A 0 A_TakeInventory("Clip", 1)
	"####" A 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 1)
	"####" A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip",20,"ReloadHK416Finish")
  ReloadHK416WorkingAmmoCheck:
	"####" A 0 A_JumpIfInventory("Clip",1,"ReloadHK416Working")
	Goto ReloadHK416Finish
  ReloadHK416Finish:
	"####" A 0 A_PlaySound("weapons/nmaghk416load", CHAN_ITEM)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    NAG1 K 2
    "####" J 2
    "####" I 2
    "####" H 2
    "####" G 2
    "####" F 2
    "####" E 2
    "####" A 7 A_ReFire
	Goto Ready
	
  ReloadAK74:
	NAG2 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip", 30, "ReadyNoReload")
	"####" A 0 A_JumpIfInventory("Clip", 1, 1)
	Goto ReadyNoReload
	"####" A 0 // Play the reload animation.
    "####" E 2
    "####" F 2
    "####" G 2
    "####" H 2
    "####" I 2
	"####" A 0 A_PlaySound("weapons/nmagak74unload", 7)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" J 2
    "####" K 2
    TNT1 A 17
	Goto ReloadAK74Working
  ReloadAK74Working:
	"####" A 0 A_TakeInventory("Clip", 1)
	"####" A 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 1)
	"####" A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip",30,"ReloadAK74Finish")
  ReloadAK74WorkingAmmoCheck:
	"####" A 0 A_JumpIfInventory("Clip",1,"ReloadAK74Working")
	Goto ReloadAK74Finish
  ReloadAK74Finish:
	"####" A 0 A_PlaySound("weapons/nmagak74load", CHAN_ITEM)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    NAG2 K 2
    "####" J 2
    "####" I 2
    "####" H 2
    "####" G 2
    "####" F 2
    "####" E 2
    "####" A 7 A_ReFire
	Goto Ready
	
  ReloadUMP45:
	NAG3 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip", 25, "ReadyNoReload")
	"####" A 0 A_JumpIfInventory("Clip", 1, 1)
	Goto ReadyNoReload
	"####" A 0 // Play the reload animation.
    "####" E 2
    "####" F 2
    "####" G 2
    "####" H 2
    "####" I 2
	"####" A 0 A_PlaySound("weapons/nmagump45unload", 7)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" J 2
    "####" K 2
    TNT1 A 17
	Goto ReloadUMP45Working
  ReloadUMP45Working:
	"####" A 0 A_TakeInventory("Clip", 1)
	"####" A 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 1)
	"####" A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip",25,"ReloadUMP45Finish")
  ReloadUMP45WorkingAmmoCheck:
	"####" A 0 A_JumpIfInventory("Clip",1,"ReloadUMP45Working")
	Goto ReloadUMP45Finish
  ReloadUMP45Finish:
	"####" A 0 A_PlaySound("weapons/nmagump45load", CHAN_ITEM)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    NAG3 K 2
    "####" J 2
    "####" I 2
    "####" H 2
    "####" G 2
    "####" F 2
    "####" E 2
    "####" A 7 A_ReFire
	Goto Ready
	
  ReloadMP5:
	NAG4 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip", 15, "ReadyNoReload")
	"####" A 0 A_JumpIfInventory("Clip", 1, 1)
	Goto ReadyNoReload
	"####" A 0 // Play the reload animation.
    "####" E 2
    "####" F 2
    "####" G 2
    "####" H 2
    "####" I 2
	"####" A 0 A_PlaySound("weapons/nmagmp5unload", 7)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" J 2
    "####" K 2
    TNT1 A 17
	Goto ReloadMP5Working
  ReloadMP5Working:
	"####" A 0 A_TakeInventory("Clip", 1)
	"####" A 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 1)
	"####" A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip",15,"ReloadMP5Finish")
  ReloadMP5WorkingAmmoCheck:
	"####" A 0 A_JumpIfInventory("Clip",1,"ReloadMP5Working")
	Goto ReloadMP5Finish
  ReloadMP5Finish:
	"####" A 0 A_PlaySound("weapons/nmagmp5load", CHAN_ITEM)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    NAG4 K 2
    "####" J 2
    "####" I 2
    "####" H 2
    "####" G 2
    "####" F 2
    "####" E 2
    "####" A 7 A_ReFire
	Goto Ready
	
  ReloadFAMAS:
	NAG5 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip", 25, "ReadyNoReload")
	"####" A 0 A_JumpIfInventory("Clip", 1, 1)
	Goto ReadyNoReload
	"####" A 0 // Play the reload animation.
    "####" E 2
    "####" F 2
    "####" G 2
    "####" H 2
    "####" I 2
	"####" A 0 A_PlaySound("weapons/nmagfamasunload", 7)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" J 2
    "####" K 2
    TNT1 A 17
	Goto ReloadFAMASWorking
  ReloadFAMASWorking:
	"####" A 0 A_TakeInventory("Clip", 1)
	"####" A 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 1)
	"####" A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip",25,"ReloadFAMASFinish")
  ReloadFAMASWorkingAmmoCheck:
	"####" A 0 A_JumpIfInventory("Clip",1,"ReloadFAMASWorking")
	Goto ReloadFAMASFinish
  ReloadFAMASFinish:
	"####" A 0 A_PlaySound("weapons/nmagfamasload", CHAN_ITEM)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    NAG5 K 2
    "####" J 2
    "####" I 2
    "####" H 2
    "####" G 2
    "####" F 2
    "####" E 2
    "####" A 7 A_ReFire
	Goto Ready
	
  ReloadSR3M:
	NAG6 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip", 30, "ReadyNoReload")
	"####" A 0 A_JumpIfInventory("Clip", 1, 1)
	Goto ReadyNoReload
	"####" A 0 // Play the reload animation.
    "####" F 2
    "####" L 2
    "####" M 2
    "####" N 2
    "####" O 2
    "####" P 2
    "####" Q 2
	"####" A 0 A_PlaySound("weapons/nmagsr3munload", 7)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" R 2
    "####" S 2
    "####" T 17
    "####" U 2
    "####" V 2
	Goto ReloadSR3MWorking
  ReloadSR3MWorking:
	"####" A 0 A_TakeInventory("Clip", 1)
	"####" A 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 1)
	"####" A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip",30,"ReloadSR3MFinish")
  ReloadSR3MWorkingAmmoCheck:
	"####" A 0 A_JumpIfInventory("Clip",1,"ReloadSR3MWorking")
	Goto ReloadSR3MFinish
  ReloadSR3MFinish:
	"####" A 0 A_PlaySound("weapons/nmagsr3mload", CHAN_ITEM)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" W 2
    "####" X 2
    "####" Y 2
    "####" Z 2
    "####" F 2
    "####" A 7 A_ReFire
	Goto Ready
	
  ReloadM14:
	NAG7 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip", 20, "ReadyNoReload")
	"####" A 0 A_JumpIfInventory("Clip", 1, 1)
	Goto ReadyNoReload
	"####" A 0 // Play the reload animation.
    "####" E 2
    "####" F 2
    "####" G 2
    "####" H 2
    "####" I 2
	"####" A 0 A_PlaySound("weapons/nmagm14unload", 7)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" J 2
    "####" K 2
    TNT1 A 17
	Goto ReloadM14Working
  ReloadM14Working:
	"####" A 0 A_TakeInventory("Clip", 1)
	"####" A 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 1)
	"####" A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip",20,"ReloadM14Finish")
  ReloadM14WorkingAmmoCheck:
	"####" A 0 A_JumpIfInventory("Clip",1,"ReloadM14Working")
	Goto ReloadM14Finish
  ReloadM14Finish:
	"####" A 0 A_PlaySound("weapons/nmagm14load", CHAN_ITEM)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    NAG7 K 2
    "####" J 2
    "####" I 2
    "####" H 2
    "####" G 2
    "####" F 2
    "####" E 2
    "####" A 7 A_ReFire
	Goto Ready
	
  ReloadM4A1:
	NAG8 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip", 30, "ReadyNoReload")
	"####" A 0 A_JumpIfInventory("Clip", 1, 1)
	Goto ReadyNoReload
	"####" A 0 // Play the reload animation.
    "####" E 2
    "####" F 2
    "####" G 2
    "####" H 2
    "####" I 2
	"####" A 0 A_PlaySound("weapons/nmagm4a1unload", 7)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" J 2
    "####" K 2
    TNT1 A 17
	Goto ReloadM4A1Working
  ReloadM4A1Working:
	"####" A 0 A_TakeInventory("Clip", 1)
	"####" A 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 1)
	"####" A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip",30,"ReloadM4A1Finish")
  ReloadM4A1WorkingAmmoCheck:
	"####" A 0 A_JumpIfInventory("Clip",1,"ReloadM4A1Working")
	Goto ReloadM4A1Finish
  ReloadM4A1Finish:
	"####" A 0 A_PlaySound("weapons/nmagm4a1load", CHAN_ITEM)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    NAG8 K 2
    "####" J 2
    "####" I 2
    "####" H 2
    "####" G 2
    "####" F 2
    "####" E 2
    "####" A 7 A_ReFire
	Goto Ready
	
  ReloadSCAR:
	NAG9 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip", 20, "ReadyNoReload")
	"####" A 0 A_JumpIfInventory("Clip", 1, 1)
	Goto ReadyNoReload
	"####" A 0 // Play the reload animation.
    "####" F 2
    "####" L 2
    "####" M 2
    "####" N 2
    "####" O 2
	"####" A 0 A_PlaySound("weapons/nmagscarunload", 7)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" P 2
    "####" Q 2
    "####" R 17
    "####" S 2
    "####" T 2
    "####" U 2
	Goto ReloadSCARWorking
  ReloadSCARWorking:
	"####" A 0 A_TakeInventory("Clip", 1)
	"####" A 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 1)
	"####" A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip",20,"ReloadSCARFinish")
  ReloadSCARWorkingAmmoCheck:
	"####" A 0 A_JumpIfInventory("Clip",1,"ReloadSCARWorking")
	Goto ReloadSCARFinish
  ReloadSCARFinish:
	"####" A 0 A_PlaySound("weapons/nmagscarload", CHAN_ITEM)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" V 2
    "####" W 2
    "####" X 2
    "####" F 2
    "####" A 7 A_ReFire
	Goto Ready
	
  ReloadDogGun:
	NA10 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip", 10, "ReadyNoReload")
	"####" A 0 A_JumpIfInventory("Clip", 1, 1)
	Goto ReadyNoReload
	"####" A 0 // Play the reload animation.
    "####" E 2
    "####" F 2
    "####" G 2
    "####" H 2
    "####" I 2
	"####" A 0 A_PlaySound("weapons/nmagdoggununload", 7)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    "####" J 2
    "####" K 2
    TNT1 A 17
	Goto ReloadDogGunWorking
  ReloadDogGunWorking:
	"####" A 0 A_TakeInventory("Clip", 1)
	"####" A 0 A_GiveInventory("RLNanomachicArmamentGeneratorClip", 1)
	"####" A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorClip",10,"ReloadDogGunFinish")
  ReloadDogGunWorkingAmmoCheck:
	"####" A 0 A_JumpIfInventory("Clip",1,"ReloadDogGunWorking")
	Goto ReloadDogGunFinish
  ReloadDogGunFinish:
	"####" A 0 A_PlaySound("weapons/nmagdoggunload", CHAN_ITEM)
    "####" A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    NA10 K 2
    "####" J 2
    "####" I 2
    "####" H 2
    "####" G 2
    "####" F 2
    "####" E 2
    "####" A 7 A_ReFire
	Goto Ready
	
  Flash:
    TNT1 A 1 A_Light1
    TNT1 A 1 A_Light2
    TNT1 A 0 A_Light0
    Goto LightDone
  FlashM14:
    TNT1 A 2 A_Light1
    TNT1 A 2 A_Light2
    TNT1 A 0 A_Light0
    Goto LightDone
  FlashDogGun:
    TNT1 A 3 A_Light1
    TNT1 A 3 A_Light2
    TNT1 A 0 A_Light0
    Goto LightDone
	
  Spawn:
	TNT1 A 0 NoDelay A_SpawnItemEx("RLNanomachicArmamentGeneratorPickup",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION, 0, tid)
    Stop
  Altfire:
	"####" "#" 0 A_JumpIfInventory("RLArmorModItemActivate",1, "ArmorModConversion")
	"####" "#" 0 A_JumpIfInventory("RLScavengerDrop",1,"ScavengerTime")
    Goto ReadyNoReload
  ModDiscombobulation:
	TNT1 A 0 A_Print("Applied Mod pack extracted from discarded weapon.")
	TNT1 A 0 ACS_NamedExecuteAlways("ScavengeMods", 0)
	TNT1 A 3
	TNT1 A 0 A_TakeInventory("RLScavengerDrop",1)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorClip", 999)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorGunType", 99)
    "####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorModLimit", 1)
    "####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorSniperMod", 1)
    "####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorFirestormMod", 1)
    "####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorNanoMod", 1)
	"####" "#" 0 A_GiveInventory("RLRarityTokenRemover", 1)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	Goto ScavengerTimeEnd
  ScavengerTime:
	TNT1 A 0 A_GiveInventory("RLScavengingExtraEffects", 1)
	TNT1 A 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorModLimit",1,"ModDiscombobulation")
	"####" "#" 0 A_Print("Mod pack extracted from discarded weapon.")
	"####" "#" 0 A_TakeInventory("RLScavengerDrop",1)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorClip", 999)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorGunType", 99)
    "####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorModLimit", 1)
    "####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorSniperMod", 1)
    "####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorFirestormMod", 1)
    "####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorNanoMod", 1)
	"####" "#" 0 A_GiveInventory("RLRarityTokenRemover", 1)
	"####" "#" 0 A_TakeInventory("RLNanomachicArmamentGeneratorSelected", 1)
	"####" "#" 0 A_TakeInventory("RLWeaponLimit",1)
	"####" "#" 0 A_FireCustomMissile("DroppedRLNanoMod",0,0,0)
	Goto ScavengerTimeEnd
  ScavengerTimeEnd:
	"####" "#" 1 A_TakeInventory("RLNanomachicArmamentGenerator",1)
	Stop
  }
}

//-------------------------------------------------------------------
//		PROJECTILES

ACTOR RLNAGDog
{
  Health 20
  Speed 10
  PainChance 180
  Radius 12
  Height 28
  Mass 100
  Monster
  Species "Player"
  +THRUSPECIES
  +JUMPDOWN
  +FRIENDLY
  +LOOKALLAROUND
  ActiveSound "stegglesbig/bark"
  DeathSound "stegglesbig/death"
  PainSound "stegglesbig/pain"
  SeeSound "stegglesbig/bark"
  Obituary "%o fought a dog and died."
  States
  {
  Spawn:
    NDOG CD 10 A_Look
    Loop
  See:
    NDOG AABBCCDD 2 A_Chase
    Loop
  Melee:
    NDOG IJ 4 A_FaceTarget
    TNT1 A 0 A_FaceTarget
    NDOG K 8 A_CustomMeleeAttack (6*random(1,10), "stegglesbig/attack", "stegglesbig/bark", Melee, 1)
    NDOG I 4 A_FaceTarget
    Goto See
  Pain:
    NDOG I 2
    NDOG J 2 A_Pain
    NDOG I 2
    Goto See
  Death:
    NDOG E 4
    NDOG F 4 A_Scream
    NDOG G 4 A_Fall
    NDOG H random(16,48)
    TNT1 A 0 A_PlaySound("weapons/dn2gunbigexplosion", CHAN_BODY, 1, 0, 0.7)
	TNT1 A 0 A_SpawnItemEx("RLDuke2NukeExplosion",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
	TNT1 A 10
	Stop
  }
}

ACTOR RLNAGLittleDog : RLNAGDog
{
  Health 10
  Speed 13
  PainChance 256
  Radius 9
  Height 20
  Mass 60
  Scale 0.6
  ActiveSound "steggles/bark"
  DeathSound "steggles/death"
  PainSound "steggles/pain"
  SeeSound "steggles/bark"
  Obituary "%o somehow died to a puppy."
  States
  {
  Melee:
    NDOG IJ 3 A_FaceTarget
    TNT1 A 0 A_FaceTarget
    NDOG K 6 A_CustomMeleeAttack (4*random(1,10), "steggles/attack", "steggles/bark", Melee, 1)
    NDOG I 3 A_FaceTarget
    Goto See
  }
}

ACTOR RLNAGBlueDog : RLNAGDog
{
  Translation "64:79=194:207", "96:111=199:207"
  Obituary "%o was barked at."
  States
  {
  Missile:
  Melee:
    NDOG IJ 4 A_FaceTarget
    TNT1 A 0 A_FaceTarget
    NDOG K 8 A_CustomMissile ("RLPlasmaPistolBall", 20)
    NDOG I 4 A_FaceTarget
    Goto See
  }
}

ACTOR RLSteggles : RLNAGDog
{
  +INVULNERABLE
  Obituary "%o was kill by steggles."
}

//-------------------------------------------------------------------
//		MECHANICS

Actor RLNanomachicArmamentGeneratorSelected : RLPermanentInventory {}
Actor RLNanomachicArmamentGeneratorMessage : RLPermanentInventory {}
Actor RLNanomachicArmamentGeneratorAmmochain : RLAmmochainDefault {}
Actor RLNanomachicArmamentGeneratorChangeCounter : RLPermanentInventory
{
inventory.maxamount 10
}

Actor RLNanomachicArmamentGeneratorGunType : RLPermanentInventory
{
inventory.maxamount 99
}

Actor RLNanomachicArmamentGeneratorModLimit : RLUniqueModAmount {}
Actor RLNanomachicArmamentGeneratorNanoMod : RLUniqueModAmount {}
Actor RLNanomachicArmamentGeneratorFirestormMod : RLUniqueModAmount {}
Actor RLNanomachicArmamentGeneratorSniperMod : RLUniqueModAmount {}

ACTOR RLNanomachicArmamentGeneratorClip : Ammo
{
   +INVENTORY.IGNORESKILL
   Inventory.MaxAmount 999
   Inventory.Icon ""
}

//-------------------------------------------------------------------
//		PICKUPS

ACTOR RLNanomachicArmamentGeneratorPickup : RLUniqueWeaponPickup
{
	//$Sprite NAG0X0
	Tag "Nanomachic Armament Generator [Pickup]"
	States
	{
	SpawnFrame:
		NAG0 X 4
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
	SpawnLoop:
		"####" "#" 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	FloorHit:
		"####" "#" 0 A_PlaySound("weapons/gundropmedium")
		"####" "#" 0 A_ScaleVelocity (0.5)
		"####" "#" 0 A_ChangeFlag("SPECIAL", true)
		"####" "#" 0 A_ChangeFlag("THRUACTORS", false)
		"####" "#" 0 A_SetUserVar("user_floorhit", 1)
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Stop
	Pickup:
		"####" "#" 0
		"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGenerator",1,"NotPickup") // If the player already has this weapon, they are not given the weapon
		"####" "#" 0 A_JumpIfInventory("RLWeaponLimit",0,"NotPickupLimit") // The absolute max limit check for weapons
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon
	GiveWeapon:
		"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGenerator",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_GiveInventory("RLUniqueItemFound",1, AAPTR_PLAYER1)
		"####" "#" 0 A_Print("\ccPicked up the \cdNanomachic Armament Generator.")
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_Jump(256, "NotPickup")
		Goto NotPickup
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cd= Nanomachic Armament Generator =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup_NoPrint:
		"####" "#" 0
		Fail
	PickupSound:
		"####" "#" 0 A_PlaySound("weapons/nmagpickup")
		Stop
//==============================================================================
	MarathonStuff:
		"####" "#" 0 A_SpawnItemEx("RLMarathonClip",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
	SuperweaponStuff:
		"####" "#" 0 A_Jump(256, "NoSpecialStartsStuff")
		Goto NoSpecialStartsStuff
	}
}

ACTOR RLNanomachicArmamentGeneratorWorldSpawnPickup : RLNanomachicArmamentGeneratorPickup 17124
{
	States
	{
	NoSpecialStartsStuff:
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamUniqueWorld", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		"####" "#" 0 A_Jump(256, "SpawnFrame")
		Goto SpawnFrame
		
	SpawnFrame:
		NAG0 X 4
		"####" "#" 0 A_GiveInventory("RLUniqueItemSpawnMessageSender",1)
		"####" "#" 0 A_PlaySound("weapons/uniquespawned", 7, 0.25, 0, 0)
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
		
	GiveWeapon:
		"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGenerator",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_GiveInventory("RLUniqueItemFound",1, AAPTR_PLAYER1)
		"####" "#" 0 A_Print("\ccPicked up the \cdNanomachic Armament Generator.")
		"####" "#" 0 A_GiveInventory("RLDangerLevelUniqueGiver",1, AAPTR_PLAYER1)
		Goto PickupSound
	}
}

ACTOR RLNanomachicArmamentGeneratorPickupModded : RLNanomachicArmamentGeneratorPickup
{
	+INVENTORY.TRANSFER
	States
	{
	Spawn:
		TNT1 A 0 NoDelay ACS_NamedExecuteAlways("GetWeaponMods", 0)
		TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 0, "NoSpecialStartsStuff")
		"####" "#" 0 A_Jump(256, "SpecialStartsStuff")
		Goto SpecialStartsStuff
		
	SpawnFrame:
		NAG0 X 4
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
	SpawnLoop:
		"####" "#" 0 A_JumpIf(VelZ <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		"####" "#" 1
		Loop
	GiveWeapon:
		"####" "#" 0 A_GiveInventory("RLNanomachicArmamentGenerator",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_Print("\ccPicked up a \cbmodded \cdNanomachic Armament Generator.")
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cd= Nanomachic Armament Generator =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("RLNanomachicArmamentGeneratorModLimit", 1, "NotPickup_Modded")
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cd= Nanomachic Armament Generator =\n\n\ccYou replace your unmodded\n\ccweapon with the one you picked up.", 5, "CONFONT")
		Goto PickupSound
	NotPickup_Modded:
		"####" "#" 0 A_Print("\cd= Nanomachic Armament Generator =\n\n\caYou are already carrying a modded\n\caweapon of this type", 5, "CONFONT")
		Fail
	}
}
