
ACTOR RLBlaster : RLPistolWeapon
{
  Obituary "%o was zapped by %k's blaster."
  Decal BulletChip
  Tag "Blaster"
  Weapon.SelectionOrder 1899
  Weapon.SlotNumber 2
  Weapon.AmmoUse1 1
  Weapon.AmmoGive1 0
  Weapon.AmmoType1 "RLBlasterClip"
  Inventory.Icon "BLASICON"
  States
  {
  Ready:
	TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown",1,"MisfirePrevention")
    Goto NanoRegenCheck
  NanoRegenCheck:
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",1,2)
    BLAS C 70 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
	Goto NanoRegenCheckBegin
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",8,4)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",2,2)
    BLAS C 10 A_WeaponReady (WRF_ALLOWZOOM)
	Goto NanoRegenCheckBegin
    BLAS B 10 A_WeaponReady (WRF_ALLOWZOOM)
	Goto NanoRegenCheckBegin
    BLAS A 10 A_WeaponReady (WRF_ALLOWZOOM)
	Goto NanoRegenCheckBegin
  NanoRegenCheckBegin:
	TNT1 A 0 A_JumpIfInventory("RLBlasterBulkMod",1,2)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip", 10, "Ready")
	Goto NanoRegen
	TNT1 A 0 A_JumpIfInventory("RLBlasterBulkMod",2,2)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip", 13, "Ready")
	Goto NanoRegen
	TNT1 A 0 A_JumpIfInventory("RLBlasterBulkMod",3,2)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip", 16, "Ready")
	Goto NanoRegen
	TNT1 A 0 A_JumpIfInventory("RLBlasterBulkMod",4,2)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip", 19, "Ready")
	Goto NanoRegen
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip", 22, "Ready")
	Goto NanoRegen
  NanoRegen:
	BLAS C 0 A_JumpIfInventory("RLRestrictionNoRecharge",1,"RechargeRestricted") // Cannot recharge in levels that restrict it
	TNT1 A 0 A_GiveInventory("RLBlasterClip", 1)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",8,4)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",2,2)
    BLAS C 6 A_WeaponReady (WRF_ALLOWZOOM)
	Goto NanoRegenCheckBegin
    BLAS B 6 A_WeaponReady (WRF_ALLOWZOOM)
	Goto NanoRegenCheckBegin
    BLAS A 6 A_WeaponReady (WRF_ALLOWZOOM)
    Goto NanoRegenCheckBegin
	
  ScavengerDrop:
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop",1,"WeaponDropConfirm")
	TNT1 A 0 A_GiveInventory("RLScavengerDrop",1)
	TNT1 A 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:
	TNT1 A 0 A_GiveInventory("RLMisfireSpamPreventionCooldown",1)
	TNT1 A 0 A_TakeInventory("RLScavengerDrop",1)
	TNT1 A 0 A_TakeInventory("RLWeaponDrop",1)
	TNT1 A 0 A_JumpIfInventory("RLBlasterModLimit", 1, "WeaponDropModded")
	TNT1 A 0 A_SpawnItemEx("RLBlasterPickup", 0, 0, 40, 16, 0, 0, 0, SXF_SETMASTER)
	Goto WeaponDropRemoval
  WeaponDropModded:
	TNT1 A 2 A_SpawnItemEx("RLBlasterPickupModded", 0, 0, 40, 16, 0, 0, 0, SXF_SETMASTER)
  WeaponDropRemoval:
    TNT1 A 0 A_TakeInventory("RLBlasterModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterNanoMod", 2)
	TNT1 A 0 A_TakeInventory("RLHighPowerBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLStormBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLOverchargedBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLNanoManufactureAmmoBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLBlasterSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 1 A_TakeInventory("RLBlaster",1)
	Stop
  AfterModDrop:
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",8,4)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",2,2)
    BLAS C 8 A_WeaponReady (16)
	Goto Ready
    BLAS B 8 A_WeaponReady (16)
	Goto Ready
    BLAS A 8 A_WeaponReady (16)
    Goto Ready
  MisfirePrevention:
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",8,6)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",2,3)
    BLAS C 1 A_WeaponReady (16)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
	Goto Ready
    BLAS B 1 A_WeaponReady (16)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
	Goto Ready
    BLAS A 1 A_WeaponReady (16)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
  Deselect:
	TNT1 A 0
	TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
	TNT1 A 0 A_TakeInventory("RLBlasterSelected", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
  DeselectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "DeselectRenegade")
    TNT1 AA 0 A_Lower
    BLAS D 1 A_Lower
    Loop
  DeselectRenegade:
    TNT1 A 0 A_Lower
    loop
  SelectRenegade: 
    TNT1 A 0 A_Raise
    loop
  SelectSetWeapon:
	TNT1 A 0 A_GiveInventory("RLPistolTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLRechargingAmmoWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLExoticWeaponToken", 1)
	TNT1 A 0 A_GiveInventory("RLBlasterSelected", 1)
    Goto SelectLoop
  SelectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "SelectRenegade")
    TNT1 AA 0 A_Raise
    BLAS D 1 A_Raise
    Loop
// 8x damage with Scout, half spread
  Fire:
	TNT1 A 0 A_JumpIfInventory("RLHighPowerBlasterConfirm",1, "AssembleHighPowerBlaster")
	TNT1 A 0 A_JumpIfInventory("RLStormBlasterConfirm",1, "AssembleStormBlaster")
	TNT1 A 0 A_JumpIfInventory("RLOverchargedBlasterConfirm",1, "AssembleOverchargedBlaster")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterConfirm",1, "AssembleHeavyPulseBlaster")
	TNT1 A 0 A_JumpIfInventory("RLNanoManufactureAmmoBlasterConfirm",1, "AssembleNanoManufactureAmmoBlaster")
	
	BLAS C 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"MeleeRestricted") // Cannot fire in levels that restrict it
	BLAS C 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"SilencedRestricted") // Cannot fire in levels that restrict it
	BLAS C 0 A_JumpIfInventory("RLRestrictionBoomOnly",1,"BoomRestricted") // Cannot fire in levels that restrict it
	BLAS C 0 A_JumpIfInventory("RLRestrictionLowTechOnly",1,"LowTechRestricted") // Cannot fire in levels that restrict it
	BLAS C 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"CunningRestricted") // Cannot fire in levels that restrict it
	
	TNT1 A 0 A_JumpIfNoAmmo("Ready")
	Goto FireBegin
  FireBegin:
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_JumpIfInventory("RLBlasterSniperMod",1,"FireS")
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",1,"FireP")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",1,"FireA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (3.5, 0, -1, (random(1,7)*6), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1.75, 0, -1, (48), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireP:
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",2,"FirePP")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",1,"FirePA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (3.5, 0, -1, (random(1,7)*7), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1.75, 0, -1, (56), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireA:
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",1,"FirePA")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",2,"FireAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (3, 0, -1, (random(1,7)*6), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1.5, 0, -1, (48), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FirePP:
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",3,"FirePPP")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",1,"FirePPA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (3.5, 0, -1, (random(1,7)*8), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1.75, 0, -1, (64), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FirePA:
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",2,"FirePPA")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",2,"FirePAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (3, 0, -1, (random(1,7)*7), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1.5, 0, -1, (56), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireAA:
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",1,"FirePAA")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",3,"FireAAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (2.5, 0, -1, (random(1,7)*6), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1.25, 0, -1, (48), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FirePPP:
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",4,"FirePPPP")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",1,"FirePPPA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (3.5, 0, -1, (random(1,7)*9), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1.75, 0, -1, (72), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FirePPA:
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",3,"FirePPPA")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",2,"FirePPAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (3, 0, -1, (random(1,7)*8), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1.5, 0, -1, (64), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FirePAA:
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",2,"FirePPAA")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",3,"FirePAAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (2.5, 0, -1, (random(1,7)*7), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1.25, 0, -1, (56), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireAAA:
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",1,"FirePAAA")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",4,"FireAAAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (2, 0, -1, (random(1,7)*6), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1, 0, -1, (48), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FirePPPP:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (3.5, 0, -1, (random(1,7)*10), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1.75, 0, -1, (80), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FirePPPA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (3, 0, -1, (random(1,7)*9), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1.5, 0, -1, (72), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FirePPAA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (2.5, 0, -1, (random(1,7)*8), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1.25, 0, -1, (64), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FirePAAA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (2, 0, -1, (random(1,7)*7), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1, 0, -1, (56), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireAAAA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (1.5, 0, -1, (random(1,7)*6), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (0.75, 0, -1, (48), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireS:
	TNT1 A 0 A_JumpIfInventory("RLBlasterSniperMod",2,"FireSS")
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",1,"FireSP")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",1,"FireSA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (1.5, 0, 1, (random(1,7)*6), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (0.75, 0, 1, (48), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireSS:
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",1,"FireSSP")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",1,"FireSSA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_RailAttack ((random(1,7)*6), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0, 0, 0, 3, 1, 10)
    Goto FireFinish
	TNT1 A 0 A_RailAttack ((48), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0, 0, 0, 3, 1, 10)
    Goto FireFinish
  FireSP:
	TNT1 A 0 A_JumpIfInventory("RLBlasterSniperMod",2,"FireSSP")
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",2,"FireSPP")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",1,"FireSPA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (1.5, 0, 1, (random(1,7)*7), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (0.75, 0, 1, (56), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireSA:
	TNT1 A 0 A_JumpIfInventory("RLBlasterSniperMod",2,"FireSSA")
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",1,"FireSPA")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",2,"FireSAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (1, 0, 1, (random(1,7)*6), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (0.5, 0, 1, (48), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireSSP:
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",2,"FireSSPP")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",1,"FireSSPA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_RailAttack ((random(1,7)*7), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0, 0, 0, 3, 1, 10)
    Goto FireFinish
	TNT1 A 0 A_RailAttack ((56), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0, 0, 0, 3, 1, 10)
    Goto FireFinish
  FireSSA:
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",1,"FireSSPA")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",2,"FireSSAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_RailAttack ((random(1,7)*6), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0, 0, 0, 3, 1, 10)
    Goto FireFinish
	TNT1 A 0 A_RailAttack ((48), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0, 0, 0, 3, 1, 10)
    Goto FireFinish
  FireSPP:
	TNT1 A 0 A_JumpIfInventory("RLBlasterSniperMod",2,"FireSSPP")
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",3,"FireSPPP")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",1,"FireSPPA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (1.5, 0, 1, (random(1,7)*8), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (0.75, 0, 1, (64), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireSPA:
	TNT1 A 0 A_JumpIfInventory("RLBlasterSniperMod",2,"FireSSPA")
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",2,"FireSPPA")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",2,"FireSPAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (1, 0, 1, (random(1,7)*7), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (0.5, 0, 1, (56), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireSAA:
	TNT1 A 0 A_JumpIfInventory("RLBlasterSniperMod",2,"FireSSAA")
	TNT1 A 0 A_JumpIfInventory("RLBlasterPowerMod",1,"FireSPAA")
	TNT1 A 0 A_JumpIfInventory("RLBlasterAgilityMod",3,"FireSAAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (0.5, 0, 1, (random(1,7)*6), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (0.25, 0, 1, (48), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireSSPP:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_RailAttack ((random(1,7)*8), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0, 0, 0, 3, 1, 10)
    Goto FireFinish
	TNT1 A 0 A_RailAttack ((64), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0, 0, 0, 3, 1, 10)
    Goto FireFinish
  FireSSAA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_RailAttack ((random(1,7)*6), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0, 0, 0, 3, 1, 10)
    Goto FireFinish
	TNT1 A 0 A_RailAttack ((48), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0, 0, 0, 3, 1, 10)
    Goto FireFinish
  FireSSPA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_RailAttack ((random(1,7)*7), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0, 0, 0, 3, 1, 10)
    Goto FireFinish
	TNT1 A 0 A_RailAttack ((56), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0, 0, 0, 3, 1, 10)
    Goto FireFinish
  FireSPPP:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (1.5, 0, 1, (random(1,7)*9), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (0.75, 0, 1, (72), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireSPPA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (1, 0, 1, (random(1,7)*8), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (0.5, 0, 1, (64), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireSPAA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (0.5, 0, 1, (random(1,7)*7), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (0.25, 0, 1, (56), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireSAAA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (0, 0, 1, (random(1,7)*6), "RLLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (0, 0, 1, (48), "RLLaserPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireFinish:
    TNT1 A 0 A_PlaySound("weapons/blaster", CHAN_WEAPON, 1, 0, 0.9)
	TNT1 A 0 A_JumpIfInventory("RLBlasterFirestormMod",2,"FireFinishF2")
	TNT1 A 0 A_JumpIfInventory("RLBlasterFirestormMod",1,"FireFinishF1")
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",8,4)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",2,2)
    BLAS G 3 Bright A_GunFlash
	Goto FireFinishFinal
    BLAS F 3 Bright A_GunFlash
	Goto FireFinishFinal
    BLAS E 3 Bright A_GunFlash
	Goto FireFinishFinal
  FireFinishF1:
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",8,4)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",2,2)
    BLAS G 2 Bright A_GunFlash
	Goto FireFinishFinal
    BLAS F 2 Bright A_GunFlash
	Goto FireFinishFinal
    BLAS E 2 Bright A_GunFlash
	Goto FireFinishFinal
  FireFinishF2:
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",8,4)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",2,2)
    BLAS G 1 Bright A_GunFlash
	Goto FireFinishFinal
    BLAS F 1 Bright A_GunFlash
	Goto FireFinishFinal
    BLAS E 1 Bright A_GunFlash
	Goto FireFinishFinal
  FireFinishFinal:
	TNT1 A 0 A_JumpIfInventory("RLBlasterFirestormMod",2,"FireFinishFinalF2")
	TNT1 A 0 A_JumpIfInventory("RLBlasterFirestormMod",1,"FireFinishFinalF1")
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",8,4)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",2,2)
    BLAS C 8
	Goto Ready
    BLAS B 8
	Goto Ready
    BLAS A 8
	Goto Ready
  FireFinishFinalF1:
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",8,4)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",2,2)
    BLAS C 6
	Goto Ready
    BLAS B 6
	Goto Ready
    BLAS A 6
	Goto Ready
  FireFinishFinalF2:
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",8,4)
	TNT1 A 0 A_JumpIfInventory("RLBlasterClip",2,2)
    BLAS C 4
	Goto Ready
    BLAS B 4
	Goto Ready
    BLAS A 4
	Goto Ready
  Flash:
    TNT1 A 2 A_Light2
    TNT1 A 1 A_Light1
    Goto LightDone
  Spawn:
	TNT1 A 0 NoDelay A_SpawnItemEx("RLBlasterPickup",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION, 0, tid)
    Stop
  Altfire:
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate",1, "ArmorModConversion")
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop",1,"ScavengerTime")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerBlasterConfirm",1, "CancelAssembly")
	TNT1 A 0 A_JumpIfInventory("RLStormBlasterConfirm",1, "CancelAssembly")
	TNT1 A 0 A_JumpIfInventory("RLOverchargedBlasterConfirm",1, "CancelAssembly")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterConfirm",1, "CancelAssembly")
	TNT1 A 0 A_JumpIfInventory("RLNanoManufactureAmmoBlasterConfirm",1, "CancelAssembly")
	Goto Ready
  CancelAssembly:
	TNT1 A 0 A_Print("Assembly canceled.")
  CancelAssembly2:
	TNT1 A 0 A_PlaySound("hud/assemblycancel", 5)
	TNT1 A 0 A_TakeInventory("RLHighPowerBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLStormBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLOverchargedBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLNanoManufactureAmmoBlasterConfirm",1)
	TNT1 A 0 A_GiveInventory("RLMisfireSpamPreventionCooldown",1)
	Goto MisfirePrevention
  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)
    TNT1 A 0 A_TakeInventory("RLBlasterModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLHighPowerBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLStormBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLOverchargedBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLNanoManufactureAmmoBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLBlasterSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	Goto ScavengerTimeEnd
  ScavengerTime:
	TNT1 A 0 A_GiveInventory("RLScavengingExtraEffects", 1)
	TNT1 A 0 A_JumpIfInventory("RLBlasterModLimit",1,"ModDiscombobulation")
	TNT1 A 0 A_Print("Mod pack extracted from discarded weapon.")
	TNT1 A 0 A_TakeInventory("RLScavengerDrop",1)
    TNT1 A 0 A_TakeInventory("RLBlasterModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLHighPowerBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLStormBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLOverchargedBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLNanoManufactureAmmoBlasterConfirm",1)
	TNT1 A 0 A_TakeInventory("RLBlasterSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_GiveInventory("RLEmitScavengedModExotic", 1) // Determines what mods this can generate when scavenged.
	Goto ScavengerTimeEnd
  ScavengerTimeEnd:
	TNT1 A 1 A_TakeInventory("RLBlaster",1)
	Stop
  AssembleHighPowerBlaster:
	TNT1 A 0 A_JumpIfInventory("RLHighPowerBlaster",1, "AlreadyHaveAssembly")
	TNT1 A 0 A_GiveInventory("RLDangerLevelBasicGiver",1, AAPTR_PLAYER1)
	TNT1 A 0 A_Print("\cvHigh Power Blaster \c-assembled.")
    TNT1 A 0 A_PlaySound("weapons/assembly", CHAN_ITEM)
	TNT1 A 0 A_TakeInventory("RLBlasterSelected", 1)
    TNT1 A 0 A_TakeInventory("RLBlasterModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLHighPowerBlasterConfirm",1)
	TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, 2)
	TNT1 A 0 A_Jump(256, 2)
	TNT1 A 0 A_GiveInventory("RLMisfireSpamPreventionCooldown",1)
	TNT1 A 0 A_GiveInventory("RLHighPowerBlaster",1)
	TNT1 A 0 A_SelectWeapon("RLHighPowerBlaster")
	TNT1 A 0 A_TakeInventory("RLBlaster",1)
	Stop
  AssembleStormBlaster:
	TNT1 A 0 A_JumpIfInventory("RLStormBlaster",1, "AlreadyHaveAssembly")
	TNT1 A 0 A_GiveInventory("RLDangerLevelAdvancedGiver",1, AAPTR_PLAYER1)
	TNT1 A 0 A_Print("\cvStorm Blaster \c-assembled.")
    TNT1 A 0 A_PlaySound("weapons/assembly", CHAN_ITEM)
	TNT1 A 0 A_TakeInventory("RLBlasterSelected", 1)
    TNT1 A 0 A_TakeInventory("RLBlasterModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLStormBlasterConfirm",1)
	TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, 2)
	TNT1 A 0 A_Jump(256, 2)
	TNT1 A 0 A_GiveInventory("RLMisfireSpamPreventionCooldown",1)
	TNT1 A 0 A_GiveInventory("RLStormBlaster",1)
	TNT1 A 0 A_SelectWeapon("RLStormBlaster")
	TNT1 A 0 A_TakeInventory("RLBlaster",1)
	Stop
  AssembleOverchargedBlaster:
	TNT1 A 0 A_JumpIfInventory("RLOverchargedBlaster",1, "AlreadyHaveAssembly")
	TNT1 A 0 A_GiveInventory("RLDangerLevelAdvancedGiver",1, AAPTR_PLAYER1)
	TNT1 A 0 A_Print("\cvOvercharged Blaster \c-assembled.")
    TNT1 A 0 A_PlaySound("weapons/assembly", CHAN_ITEM)
	TNT1 A 0 A_TakeInventory("RLBlasterSelected", 1)
    TNT1 A 0 A_TakeInventory("RLBlasterModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLOverchargedBlasterConfirm",1)
	TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, 2)
	TNT1 A 0 A_Jump(256, 2)
	TNT1 A 0 A_GiveInventory("RLMisfireSpamPreventionCooldown",1)
	TNT1 A 0 A_GiveInventory("RLOverchargedBlaster",1)
	TNT1 A 0 A_SelectWeapon("RLOverchargedBlaster")
	TNT1 A 0 A_TakeInventory("RLBlaster",1)
	Stop
  AssembleHeavyPulseBlaster:
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlaster",1, "AlreadyHaveAssembly")
	TNT1 A 0 A_GiveInventory("RLDangerLevelMasterGiver",1, AAPTR_PLAYER1)
	TNT1 A 0 A_Print("\cvHeavy Pulse Blaster \c-assembled.")
    TNT1 A 0 A_PlaySound("weapons/masterassembly", CHAN_ITEM)
	TNT1 A 0 A_JumpIfInventory("RLScavengerPerk",1, 2)
	TNT1 A 0 A_Jump(256, 2)
    TNT1 A 0 A_PlaySound("technician/laugh", CHAN_VOICE)
    TNT1 A 0 A_PlaySound("weapons/masterassemblyfanfare", CHAN_AUTO)
	TNT1 A 0 A_TakeInventory("RLBlasterSelected", 1)
    TNT1 A 0 A_TakeInventory("RLBlasterModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterConfirm",1)
	TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, 2)
	TNT1 A 0 A_Jump(256, 2)
	TNT1 A 0 A_GiveInventory("RLMisfireSpamPreventionCooldown",1)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlaster",1)
	TNT1 A 0 A_SelectWeapon("RLHeavyPulseBlaster")
	TNT1 A 0 A_TakeInventory("RLBlaster",1)
	Stop
  AssembleNanoManufactureAmmoBlaster:
	TNT1 A 0 A_JumpIfInventory("RLNanomanufactureAmmoBlaster",1, "AlreadyHaveAssembly")
	TNT1 A 0 A_GiveInventory("RLDangerLevelMasterGiver",1, AAPTR_PLAYER1)
	TNT1 A 0 A_Print("\cvNanomachic Blaster \c-assembled.")
    TNT1 A 0 A_PlaySound("weapons/masterassembly", CHAN_ITEM)
	TNT1 A 0 A_JumpIfInventory("RLScavengerPerk",1, 2)
	TNT1 A 0 A_Jump(256, 2)
    TNT1 A 0 A_PlaySound("technician/laugh", CHAN_VOICE)
    TNT1 A 0 A_PlaySound("weapons/masterassemblyfanfare", CHAN_AUTO)
	TNT1 A 0 A_TakeInventory("RLBlasterSelected", 1)
    TNT1 A 0 A_TakeInventory("RLBlasterModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLBlasterFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLBlasterNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLNanoManufactureAmmoBlasterConfirm",1)
	TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, 2)
	TNT1 A 0 A_Jump(256, 2)
	TNT1 A 0 A_GiveInventory("RLMisfireSpamPreventionCooldown",1)
	TNT1 A 0 A_GiveInventory("RLNanoManufactureAmmoBlaster",1)
	TNT1 A 0 A_SelectWeapon("RLNanoManufactureAmmoBlaster")
	TNT1 A 0 A_TakeInventory("RLBlaster",1)
	Stop
  }
}

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

Actor RLBlasterSelected : RLPermanentInventory {}

Actor RLBlasterModLimit : RLStandardModAmount {}
Actor RLBlasterPowerMod : RLStandardModAmount {}
Actor RLBlasterBulkMod : RLStandardModAmount {}
Actor RLBlasterAgilityMod : RLStandardModAmount {}
Actor RLBlasterTechnicalMod : RLStandardModAmount {}
Actor RLBlasterNanoMod : RLExoticModAmount {}
Actor RLBlasterFirestormMod : RLExoticModAmount {}
Actor RLBlasterSniperMod : RLExoticModAmount {}

ACTOR RLBlasterClip : Ammo
{
   +INVENTORY.IGNORESKILL
   Inventory.MaxAmount 22
   Inventory.Icon ""
}

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

ACTOR RLBlasterPickup : RLExoticWeaponPickup 16900
{
	//$Sprite BLASX0
	Tag "Blaster [Pickup]"
	States
	{
	SpawnFrame:
		BLAS X 4
	SpawnLoop:
		"####" "#" 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	FloorHit:
		"####" "#" 0 A_PlaySound("weapons/gundropsmall")
		"####" "#" 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("RLBlaster",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("RLBlaster",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_Print("\ccPicked up a \ctBlaster.")
		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("\ct= Blaster =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup_NoPrint:
		"####" "#" 0
		Fail
	PickupSound:
		"####" "#" 0 A_PlaySound("weapons/Blasterpickup")
		Stop
//==============================================================================
	MarathonStuff:
		"####" "#" 0 A_SpawnItemEx("RLMarathonClip",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
	}
}

ACTOR RLBlasterPickupModded : RLBlasterPickup
{
	+INVENTORY.TRANSFER
	+DONTGIB
	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:
		BLAS X 4
	SpawnLoop:
		"####" "#" 0 A_JumpIf(VelZ <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		"####" "#" 1
		Loop
		
	Pickup:
		"####" "#" 0
		"####" "#" 0 A_JumpIfInventory("RLBlaster",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("RLBlaster",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_Print("\ccPicked up a \cbmodded \ctBlaster.")
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\ct= Blaster =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("RLBlasterModLimit", 1, "NotPickup_Modded")
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\ct= Blaster =\n\n\ccYou replace your unmodded\n\ccweapon with the one you picked up.", 5, "CONFONT")
		Goto PickupSound
	NotPickup_Modded:
		"####" "#" 0 A_Print("\ct= Blaster =\n\n\caYou are already carrying a modded\n\caweapon of this type", 5, "CONFONT")
		Fail
	}
}
