
ACTOR RLNuclearPlasmaPistol : RLPistolWeapon
{
  Obituary "%o was burnt by %k."
  Tag "Nuclear Plasma Pistol"
  Weapon.SelectionOrder 3900
  Weapon.SlotNumber 6
  Weapon.AmmoUse1 1
  Weapon.AmmoGive1 0
  Weapon.AmmoType1 "RLNuclearPlasmaPistolClip"
  Inventory.Icon "NUK3ICON"
  States
  {
  Ready:
	TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown",1,"MisfirePrevention")
    TNT1 A 0 A_PlaySound("weapons/nukeplasmapistolidle", 6, 1, 1)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 1, "ReadyCantAltFire")
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop", 1, "ReadyCanAltFire")
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate", 1, "ReadyCanAltFire")
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
	Goto ReadyCycleCharging
  ReadyCanAltFire:
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
	Goto ReadyCycleCharging
  ReadyCantAltFire:
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop", 1, "ReadyCanFire")
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate", 1, "ReadyCanFire")
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOSECONDARY | WRF_ALLOWZOOM)
	Goto ReadyCycleCharged
  ReadyCanFire:
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_ALLOWZOOM)
	Goto ReadyCycleCharged
//=================================================================================
  ReadyCycleCharging:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 1, "ReadyCycleCharged")
	Goto ReadyChargingAmmo
  ReadyChargingAmmo:
	NUPP A 0 A_JumpIfInventory("RLRestrictionNoRecharge",1,"RechargeRestricted") // Cannot recharge in levels that restrict it
	TNT1 A 0 A_GiveInventory("RLNuclearPlasmaPistolClip", 1)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop", 1, "ReadyChargingAmmo2")
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate", 1, "ReadyChargingAmmo2")
	TNT1 A 0 A_JumpIfInventory("RLNuclearWeaponSetBonusActive", 1, 2)
    NUPP A 6 A_WeaponReady (WRF_NOSECONDARY | WRF_ALLOWZOOM)
    Goto ReadyCycleCharging
    NUPP A 3 A_WeaponReady (WRF_NOSECONDARY | WRF_ALLOWZOOM)
    Goto ReadyCycleCharging
  ReadyChargingAmmo2:
	TNT1 A 0 A_JumpIfInventory("RLNuclearWeaponSetBonusActive", 1, 2)
    NUPP A 6 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    Goto ReadyCycleCharging
    NUPP A 3 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    Goto ReadyCycleCharging
//=================================================================================
  ReadyCycleCharged:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolBulkMod",1,2)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 16, "Ready")
	Goto ReadyChargedAmmo
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolBulkMod",2,2)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 21, "Ready")
	Goto ReadyChargedAmmo
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolBulkMod",3,2)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 26, "Ready")
	Goto ReadyChargedAmmo
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolBulkMod",4,2)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 31, "Ready")
	Goto ReadyChargedAmmo
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 36, "Ready")
	Goto ReadyChargedAmmo
  ReadyChargedAmmo:
	NUPP A 0 A_JumpIfInventory("RLRestrictionNoRecharge",1,"RechargeRestricted") // Cannot recharge in levels that restrict it
	TNT1 A 0 A_GiveInventory("RLNuclearPlasmaPistolClip", 1)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop", 1, "ReadyChargedAmmo2")
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate", 1, "ReadyChargedAmmo2")
	TNT1 A 0 A_JumpIfInventory("RLNuclearWeaponSetBonusActive", 1, 2)
    NUPP A 6 A_WeaponReady (WRF_NOSECONDARY | WRF_ALLOWZOOM)
    Goto ReadyCycleCharged
    NUPP A 3 A_WeaponReady (WRF_NOSECONDARY | WRF_ALLOWZOOM)
    Goto ReadyCycleCharged
  ReadyChargedAmmo2:
	TNT1 A 0 A_JumpIfInventory("RLNuclearWeaponSetBonusActive", 1, 2)
    NUPP A 6 A_WeaponReady (WRF_ALLOWZOOM)
    Goto ReadyCycleCharged
    NUPP A 3 A_WeaponReady (WRF_ALLOWZOOM)
    Goto ReadyCycleCharged
//=================================================================================
  ReadyDepleted:
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop", 1, "ReadyDepletedCanAltFire")
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate", 1, "ReadyDepletedCanAltFire")
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
	Goto Ready
  ReadyDepletedCanAltFire:
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
	Goto Ready
//=================================================================================

  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 ACS_NamedExecuteWithResult("RLNuclearSetBonusCheck", 1) // Checks for all parts of the set bonus, gives or removes it accordingly - argument is tic delay before checking
    TNT1 A 0 A_StopSound(6)
    TNT1 A 0 A_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 A_TakeInventory("RLScavengerDrop",1)
	TNT1 A 0 A_TakeInventory("RLWeaponDrop",1)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolModLimit", 1, "WeaponDropModded")
	TNT1 A 0 A_SpawnItemEx("RLNuclearPlasmaPistolPickup", 0, 0, 40, 16, 0, 0, 0, SXF_SETMASTER)
	Goto WeaponDropRemoval
  WeaponDropModded:
	TNT1 A 2 A_SpawnItemEx("RLNuclearPlasmaPistolPickupModded", 0, 0, 40, 16, 0, 0, 0, SXF_SETMASTER)
  WeaponDropRemoval:
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSniperMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverConfirm",1)
	TNT1 A 0 A_TakeInventory("RLHighPowerNuclearPlasmaPistolConfirm",1)
	TNT1 A 0 A_TakeInventory("RLStormNuclearPlasmaPistolConfirm",1)
	TNT1 A 0 A_TakeInventory("RLSuperchargedNuclearPlasmaPistolConfirm",1)
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 1 A_TakeInventory("RLNuclearPlasmaPistol",1)
	Stop
	
  AfterModDrop:
	TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (16)
	TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 5 A_WeaponReady (16)
    Goto Ready
  MisfirePrevention:
	TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NUPP A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
	
  Deselect:
	TNT1 A 0
    TNT1 A 0 A_StopSound(6)
    TNT1 A 0 A_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSelected", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
  DeselectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "DeselectRenegade")
    TNT1 AA 0 A_Lower
    NUPP A 1 A_Lower
    Goto DeselectLoop
  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("RLNuclearAmmoWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLExoticWeaponToken", 1)
	TNT1 A 0 A_GiveInventory("RLNuclearPlasmaPistolSelected", 1)
    Goto SelectLoop
  SelectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "SelectRenegade")
    TNT1 AA 0 A_Raise
    NUPP A 1 A_Raise
    Loop
// 8x damage with Scout, no deviation
  Fire:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverConfirm",1, "AssembleNuclearPlasmaRevolver")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerNuclearPlasmaPistolConfirm",1, "AssembleHighPowerNuclearPlasmaPistol")
	TNT1 A 0 A_JumpIfInventory("RLStormNuclearPlasmaPistolConfirm",1, "AssembleStormNuclearPlasmaPistol")
	TNT1 A 0 A_JumpIfInventory("RLSuperchargedNuclearPlasmaPistolConfirm",1, "AssembleSuperchargedNuclearPlasmaPistol")
	
	NUPP A 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"MeleeRestricted") // Cannot fire in levels that restrict it
	NUPP A 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"SilencedRestricted") // Cannot fire in levels that restrict it
	NUPP A 0 A_JumpIfInventory("RLRestrictionBoomOnly",1,"BoomRestricted") // Cannot fire in levels that restrict it
	NUPP A 0 A_JumpIfInventory("RLRestrictionLowTechOnly",1,"LowTechRestricted") // Cannot fire in levels that restrict it
	NUPP A 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"CunningRestricted") // Cannot fire in levels that restrict it
	
	TNT1 A 0 A_JumpIfNoAmmo("ReadyDepleted")
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolSniperMod",1,"FireS")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",1,"FireP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",1,"FireA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBall", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSharpshooter", 0, 1)
    Goto FireFinish
  FireP:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",2,"FirePP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",1,"FirePA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallP", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPSharpshooter", 0, 1)
    Goto FireFinish
  FireA:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",1,"FirePA")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",2,"FireAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallASharpshooter", 0, 1)
    Goto FireFinish
  FirePP:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",3,"FirePPP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",1,"FirePPA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPP", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPPSharpshooter", 0, 1)
    Goto FireFinish
  FirePA:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",2,"FirePPA")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",2,"FirePAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPASharpshooter", 0, 1)
    Goto FireFinish
  FireAA:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",1,"FirePAA")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",3,"FireAAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallAA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallAASharpshooter", 0, 1)
    Goto FireFinish
  FirePPP:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",4,"FirePPPP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",1,"FirePPPA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPPP", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPPPSharpshooter", 0, 1)
    Goto FireFinish
  FirePPA:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",3,"FirePPPA")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",2,"FirePPAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPPA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPPASharpshooter", 0, 1)
    Goto FireFinish
  FirePAA:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",2,"FirePPAA")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",3,"FirePAAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPAA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPAASharpshooter", 0, 1)
    Goto FireFinish
  FireAAA:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",1,"FirePAAA")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",4,"FireAAAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallAAA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallAAASharpshooter", 0, 1)
    Goto FireFinish
  FirePPPP:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPPPP", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPPPPSharpshooter", 0, 1)
    Goto FireFinish
  FirePPPA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPPPA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPPPASharpshooter", 0, 1)
    Goto FireFinish
  FirePPAA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPPAA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPPAASharpshooter", 0, 1)
    Goto FireFinish
  FirePAAA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPAAA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallPAAASharpshooter", 0, 1)
    Goto FireFinish
  FireAAAA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallAAAA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallAAAASharpshooter", 0, 1)
    Goto FireFinish
  FireS:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolSniperMod",2,"FireSS")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",1,"FireSP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",1,"FireSA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallS", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSSharpshooter", 0, 1)
    Goto FireFinish
  FireSS:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",1,"FireSSP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",1,"FireSSA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSS", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSSSharpshooter", 0, 1)
    Goto FireFinish
  FireSP:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolSniperMod",2,"FireSSP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",2,"FireSPP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",1,"FireSPA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSP", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSPSharpshooter", 0, 1)
    Goto FireFinish
  FireSA:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolSniperMod",2,"FireSSA")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",1,"FireSPA")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",2,"FireSAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSA", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSASharpshooter", 0, 1)
    Goto FireFinish
  FireSSP:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",2,"FireSSPP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",1,"FireSSPA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSSP", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSSPSharpshooter", 0, 1)
    Goto FireFinish
  FireSSA:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",1,"FireSSPA")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",2,"FireSSAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSSA", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSSASharpshooter", 0, 1)
    Goto FireFinish
  FireSPP:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolSniperMod",2,"FireSSPP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",3,"FireSPPP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",1,"FireSPPA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSPP", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSPPSharpshooter", 0, 1)
    Goto FireFinish
  FireSPA:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolSniperMod",2,"FireSSPA")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",2,"FireSPPA")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",2,"FireSPAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSPA", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSPASharpshooter", 0, 1)
    Goto FireFinish
  FireSAA:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolSniperMod",2,"FireSSAA")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolPowerMod",1,"FireSPAA")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolAgilityMod",3,"FireSAAA")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSAA", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSAASharpshooter", 0, 1)
    Goto FireFinish
  FireSSPP:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSSPP", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSSPPSharpshooter", 0, 1)
    Goto FireFinish
  FireSSAA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSSAA", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSSAASharpshooter", 0, 1)
    Goto FireFinish
  FireSSPA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSSPA", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSSPASharpshooter", 0, 1)
    Goto FireFinish
  FireSPPP:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSPPP", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSPPPSharpshooter", 0, 1)
    Goto FireFinish
  FireSPPA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSPPA", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSPPASharpshooter", 0, 1)
    Goto FireFinish
  FireSPAA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSPAA", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSPAASharpshooter", 0, 1)
    Goto FireFinish
  FireSAAA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSAAA", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaPistolBallSAAASharpshooter", 0, 1)
    Goto FireFinish
  FireFinish:
    TNT1 A 0 A_SpawnItemEx ("RLPistolRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolFirestormMod",2,"FireFinishF2")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolFirestormMod",1,"FireFinishF")
    NUPP B 3 Bright A_GunFlash ("FlashB")
    NUPP C 3 Bright A_GunFlash ("FlashC")
    NUPP D 3 A_GunFlash ("FlashB")
    TNT1 A 0 A_GunFlash
    NUPP A 5 A_Refire
    Goto Ready
  FireFinishF:
    NUPP B 2 Bright A_GunFlash ("FlashB")
    NUPP C 2 Bright A_GunFlash ("FlashC")
    NUPP D 2 A_GunFlash ("FlashB")
    TNT1 A 0 A_GunFlash
    NUPP A 5 A_Refire
    Goto Ready
  FireFinishF2:
    NUPP B 1 Bright A_GunFlash ("FlashB")
    NUPP C 1 Bright A_GunFlash ("FlashC")
    NUPP D 1 A_GunFlash ("FlashB")
    TNT1 A 0 A_GunFlash
    NUPP A 5 A_Refire
    Goto Ready
  Flash:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 16, 6)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 8, 4)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 1, 2)
    NU1Y A 6 Bright
    Goto LightDone
    NU1Y B 6 Bright
    Goto LightDone
    NU1Y C 6 Bright
    Goto LightDone
    NU1Y D 6 Bright
    Goto LightDone
  FlashB:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 16, 6)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 8, 4)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 1, 2)
    NU1Y E 3 Bright
    Goto LightDone
    NU1Y F 3 Bright
    Goto LightDone
    NU1Y G 3 Bright
    Goto LightDone
    NU1Y H 3 Bright
    Goto LightDone
  FlashC:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 16, 6)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 8, 4)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolClip", 1, 2)
    NU1Y I 3 Bright
    Goto LightDone
    NU1Y J 3 Bright
    Goto LightDone
    NU1Y K 3 Bright
    Goto LightDone
    NU1Y L 3 Bright
    Goto LightDone
  FlashDrop:
    TNT1 A 0
    Goto LightDone
  Spawn:
	TNT1 A 0 NoDelay A_SpawnItemEx("RLNuclearPlasmaPistolPickup",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("RLNuclearPlasmaRevolverConfirm",1, "CancelAssembly")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerNuclearPlasmaPistolConfirm",1, "CancelAssembly")
	TNT1 A 0 A_JumpIfInventory("RLStormNuclearPlasmaPistolConfirm",1, "CancelAssembly")
	TNT1 A 0 A_JumpIfInventory("RLSuperchargedNuclearPlasmaPistolConfirm",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("RLNuclearPlasmaRevolverConfirm",1)
	TNT1 A 0 A_TakeInventory("RLHighPowerNuclearPlasmaPistolConfirm",1)
	TNT1 A 0 A_TakeInventory("RLStormNuclearPlasmaPistolConfirm",1)
	TNT1 A 0 A_TakeInventory("RLSuperchargedNuclearPlasmaPistolConfirm",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("RLNuclearPlasmaPistolModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolFirestormMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverConfirm",1)
	TNT1 A 0 A_TakeInventory("RLHighPowerNuclearPlasmaPistolConfirm",1)
	TNT1 A 0 A_TakeInventory("RLStormNuclearPlasmaPistolConfirm",1)
	TNT1 A 0 A_TakeInventory("RLSuperchargedNuclearPlasmaPistolConfirm",1)
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
    TNT1 A 0 A_StopSound(6)
    TNT1 A 0 A_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 ACS_NamedExecuteWithResult("RLNuclearSetBonusCheck", 1) // Checks for all parts of the set bonus, gives or removes it accordingly - argument is tic delay before checking
	Goto ScavengerTimeEnd
  ScavengerTime:
	TNT1 A 0 A_GiveInventory("RLScavengingExtraEffects", 1)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaPistolModLimit",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("RLNuclearPlasmaPistolModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolFirestormMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLHighPowerNuclearPlasmaPistolConfirm",1)
	TNT1 A 0 A_TakeInventory("RLStormNuclearPlasmaPistolConfirm",1)
	TNT1 A 0 A_TakeInventory("RLSuperchargedNuclearPlasmaPistolConfirm",1)
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
    TNT1 A 0 A_StopSound(6)
    TNT1 A 0 A_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 ACS_NamedExecuteWithResult("RLNuclearSetBonusCheck", 1) // Checks for all parts of the set bonus, gives or removes it accordingly - argument is tic delay before checking
  ScavengerContinue:
	TNT1 A 0 A_GiveInventory("RLEmitScavengedModExotic", 1) // Determines what mods this can generate when scavenged.
	Goto ScavengerTimeEnd
  ScavengerTimeEnd:
	TNT1 A 1 A_TakeInventory("RLNuclearPlasmaPistol",1)
	Stop
  AssembleNuclearPlasmaRevolver:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolver",1, "AlreadyHaveAssembly")
	TNT1 A 0 A_GiveInventory("RLDangerLevelBasicGiver",1, AAPTR_PLAYER1)
	TNT1 A 0 A_Print("\cvNuclear Plasma Revolver \c-assembled.")
    TNT1 A 0 A_PlaySound("weapons/assembly", CHAN_ITEM)
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSelected", 1)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSniperMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverConfirm",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_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 A_GiveInventory("RLNuclearPlasmaRevolver",1)
	TNT1 A 0 A_SelectWeapon("RLNuclearPlasmaRevolver")
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistol",1)
	Stop
  AssembleHighPowerNuclearPlasmaPistol:
	TNT1 A 0 A_JumpIfInventory("RLHighPowerNuclearPlasmaPistol",1, "AlreadyHaveAssembly")
	TNT1 A 0 A_GiveInventory("RLDangerLevelBasicGiver",1, AAPTR_PLAYER1)
	TNT1 A 0 A_Print("\cvHigh Power Nuclear Plasma Pistol \c-assembled.")
    TNT1 A 0 A_PlaySound("weapons/assembly", CHAN_ITEM)
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSelected", 1)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSniperMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLHighPowerNuclearPlasmaPistolConfirm",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_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 A_GiveInventory("RLHighPowerNuclearPlasmaPistol",1)
	TNT1 A 0 A_SelectWeapon("RLHighPowerNuclearPlasmaPistol")
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistol",1)
	Stop
  AssembleStormNuclearPlasmaPistol:
	TNT1 A 0 A_JumpIfInventory("RLStormNuclearPlasmaPistol",1, "AlreadyHaveAssembly")
	TNT1 A 0 A_GiveInventory("RLDangerLevelAdvancedGiver",1, AAPTR_PLAYER1)
	TNT1 A 0 A_Print("\cvStorm Nuclear Plasma Pistol \c-assembled.")
    TNT1 A 0 A_PlaySound("weapons/assembly", CHAN_ITEM)
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSelected", 1)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSniperMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLStormNuclearPlasmaPistolConfirm",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_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 A_GiveInventory("RLStormNuclearPlasmaPistol",1)
	TNT1 A 0 A_SelectWeapon("RLStormNuclearPlasmaPistol")
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistol",1)
	Stop
  AssembleSuperchargedNuclearPlasmaPistol:
	TNT1 A 0 A_JumpIfInventory("RLSuperchargedNuclearPlasmaPistol",1, "AlreadyHaveAssembly")
	TNT1 A 0 A_GiveInventory("RLDangerLevelAdvancedGiver",1, AAPTR_PLAYER1)
	TNT1 A 0 A_Print("\cvSupercharged Nuclear Plasma Pistol \c-assembled.")
    TNT1 A 0 A_PlaySound("weapons/assembly", CHAN_ITEM)
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSelected", 1)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistolSniperMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLSuperchargedNuclearPlasmaPistolConfirm",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_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 A_GiveInventory("RLSuperchargedNuclearPlasmaPistol",1)
	TNT1 A 0 A_SelectWeapon("RLSuperchargedNuclearPlasmaPistol")
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaPistol",1)
	Stop
  }
}

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

ACTOR RLNuclearPlasmaPistolBall : PlasmaBall
{
	Species "Player"
	+THRUSPECIES
	+THRUGHOST
	+FORCEXYBILLBOARD
	Decal "PlasmaScorch"
	Alpha 0.85
	Scale 0.9
	Damagetype "Plasma"
	Damage 6
	SeeSound "weapons/plasmapistol"

	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(CallACS("DRLA_FancyProjectiles") == 1, "FancyLoop")
		SpawnLoop:
			PLSS AB 6 Bright
			Loop
		Death:
			TNT1 A 0 A_JumpIf(CallACS("DRLA_FancyProjectiles") == 1, "FancyDeath")
			PLSE ABCDE 4 Bright
			Stop

		FancyLoop:
			PLSS AAABBB 1 Bright A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			Loop
		FancyDeath:
			PLSE ABCDE 4 Bright
			Stop
	}
}

ACTOR RLNuclearPlasmaPistolFancyTrail
{
	Renderstyle Add
	Scale 0.8
	Alpha 0.5
	var int user_nppftweave;
	+NOINTERACTION
	+FORCEXYBILLBOARD
	States
	{
		Spawn:
			PLFT A 0 NoDelay A_SetUserVar("user_nppftweave", randompick(-1,1))
		Spawn.GoDojo:
			PLFT AAAA 1 Bright A_SetScale(scalex - 0.1)
			PLFT AAAA 0 A_Weave(user_nppftweave,user_nppftweave,1,1)
			
			PLFT BBB 1 Bright A_SetScale(scalex - 0.1)
			PLFT BBB 0 A_Weave(user_nppftweave,user_nppftweave,1,1)
			
			PLFT CC 1 Bright A_SetScale(scalex - 0.05)
			PLFT CC 0 A_Weave(user_nppftweave,user_nppftweave,1,1)
			
			PLFT D 1 Bright A_SetScale(scalex - 0.05)
			PLFT D 0 A_Weave(user_nppftweave,user_nppftweave,1,1)
			Stop
	}
}

ACTOR RLNuclearPlasmaPistolBallP : RLNuclearPlasmaPistolBall
{
  Damage 7
}

ACTOR RLNuclearPlasmaPistolBallA : RLNuclearPlasmaPistolBall
{
  Speed 35
}

ACTOR RLNuclearPlasmaPistolBallPP : RLNuclearPlasmaPistolBall
{
  Damage 8
}

ACTOR RLNuclearPlasmaPistolBallPA : RLNuclearPlasmaPistolBall
{
  Speed 35
  Damage 7
}

ACTOR RLNuclearPlasmaPistolBallAA : RLNuclearPlasmaPistolBall
{
  Speed 45
}

ACTOR RLNuclearPlasmaPistolBallPPP : RLNuclearPlasmaPistolBall
{
  Damage 9
}

ACTOR RLNuclearPlasmaPistolBallPPA : RLNuclearPlasmaPistolBall
{
  Speed 35
  Damage 8
}

ACTOR RLNuclearPlasmaPistolBallPAA : RLNuclearPlasmaPistolBall
{
  Speed 45
  Damage 7
}

ACTOR RLNuclearPlasmaPistolBallAAA : RLNuclearPlasmaPistolBall
{
  Speed 55
}

ACTOR RLNuclearPlasmaPistolBallPPPP : RLNuclearPlasmaPistolBall
{
  Damage 10
}

ACTOR RLNuclearPlasmaPistolBallPPPA : RLNuclearPlasmaPistolBall
{
  Speed 35
  Damage 9
}

ACTOR RLNuclearPlasmaPistolBallPPAA : RLNuclearPlasmaPistolBall
{
  Speed 45
  Damage 8
}

ACTOR RLNuclearPlasmaPistolBallPAAA : RLNuclearPlasmaPistolBall
{
  Speed 55
  Damage 7
}

ACTOR RLNuclearPlasmaPistolBallAAAA : RLNuclearPlasmaPistolBall
{
  Speed 65
}

ACTOR RLNuclearPlasmaPistolBallS : RLNuclearPlasmaPistolBall
{
	States
	{
		Spawn:
			TNT1 A 0 NoDelay A_JumpIf(CallACS("DRLA_FancyProjectiles") == 1, "Spawn.Fancy")
		Spawn.Normal:
			PLSS AB 2 Bright A_ScaleVelocity(1.10)
			Loop
		Spawn.Fancy:
			PLSS A 1 Bright A_ScaleVelocity(1.10)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			PLSS B 1 Bright A_ScaleVelocity(1.10)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			PLSS A 1 Bright A_ScaleVelocity(1.10)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			PLSS B 1 Bright A_ScaleVelocity(1.10)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			Loop
	}
}

ACTOR RLNuclearPlasmaPistolBallSS : RLNuclearPlasmaPistolBall
{
	States
	{
		Spawn:
			TNT1 A 0 NoDelay A_JumpIf(CallACS("DRLA_FancyProjectiles") == 1, "Spawn.Fancy")
		Spawn.Normal:
			PLSS AB 2 Bright A_ScaleVelocity(1.25)
			Loop
		Spawn.Fancy:
			PLSS A 1 Bright A_ScaleVelocity(1.25)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			PLSS B 1 Bright A_ScaleVelocity(1.25)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			PLSS A 1 Bright A_ScaleVelocity(1.25)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			PLSS B 1 Bright A_ScaleVelocity(1.25)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			Loop
	}
}

ACTOR RLNuclearPlasmaPistolBallSP : RLNuclearPlasmaPistolBallS
{
  Damage 7
}

ACTOR RLNuclearPlasmaPistolBallSA : RLNuclearPlasmaPistolBallS
{
  Speed 35
}

ACTOR RLNuclearPlasmaPistolBallSPP : RLNuclearPlasmaPistolBallS
{
  Damage 8
}

ACTOR RLNuclearPlasmaPistolBallSSA : RLNuclearPlasmaPistolBallSS
{
  Speed 35
}

ACTOR RLNuclearPlasmaPistolBallSSP : RLNuclearPlasmaPistolBallSS
{
  Damage 7
}

ACTOR RLNuclearPlasmaPistolBallSPA : RLNuclearPlasmaPistolBallS
{
  Speed 35
  Damage 7
}

ACTOR RLNuclearPlasmaPistolBallSAA : RLNuclearPlasmaPistolBallS
{
  Speed 45
}

ACTOR RLNuclearPlasmaPistolBallSSPP : RLNuclearPlasmaPistolBallSS
{
  Damage 8
}

ACTOR RLNuclearPlasmaPistolBallSSAA : RLNuclearPlasmaPistolBallSS
{
  Speed 45
}

ACTOR RLNuclearPlasmaPistolBallSSPA : RLNuclearPlasmaPistolBallSS
{
  Speed 35
  Damage 7
}

ACTOR RLNuclearPlasmaPistolBallSPPP : RLNuclearPlasmaPistolBallS
{
  Damage 9
}

ACTOR RLNuclearPlasmaPistolBallSPPA : RLNuclearPlasmaPistolBallS
{
  Speed 35
  Damage 8
}

ACTOR RLNuclearPlasmaPistolBallSPAA : RLNuclearPlasmaPistolBallS
{
  Speed 45
  Damage 7
}

ACTOR RLNuclearPlasmaPistolBallSAAA : RLNuclearPlasmaPistolBallS
{
  Speed 55
}

//-------------------------------------------------------------------
//		SHARPSHOOTER PROJECTILES

ACTOR RLNuclearPlasmaPistolBallSharpshooter : RLNuclearPlasmaPistolBall
{
  Alpha 0.85
  Decal "PlasmaScorch"
  Damage (48)
}

ACTOR RLNuclearPlasmaPistolBallPSharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
  Damage (56)
}

ACTOR RLNuclearPlasmaPistolBallASharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
  Speed 35
}

ACTOR RLNuclearPlasmaPistolBallPPSharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
  Damage (64)
}

ACTOR RLNuclearPlasmaPistolBallPASharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
  Speed 35
  Damage (56)
}

ACTOR RLNuclearPlasmaPistolBallAASharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
  Speed 45
}

ACTOR RLNuclearPlasmaPistolBallPPPSharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
  Damage (72)
}

ACTOR RLNuclearPlasmaPistolBallPPASharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
  Speed 35
  Damage (64)
}

ACTOR RLNuclearPlasmaPistolBallPAASharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
  Speed 45
  Damage (56)
}

ACTOR RLNuclearPlasmaPistolBallAAASharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
  Speed 55
}

ACTOR RLNuclearPlasmaPistolBallPPPPSharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
  Damage (80)
}

ACTOR RLNuclearPlasmaPistolBallPPPASharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
  Speed 35
  Damage (72)
}

ACTOR RLNuclearPlasmaPistolBallPPAASharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
  Speed 45
  Damage (64)
}

ACTOR RLNuclearPlasmaPistolBallPAAASharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
  Speed 55
  Damage (56)
}

ACTOR RLNuclearPlasmaPistolBallAAAASharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
  Speed 65
}

ACTOR RLNuclearPlasmaPistolBallSSharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
	States
	{
		Spawn:
			TNT1 A 0 NoDelay A_JumpIf(CallACS("DRLA_FancyProjectiles") == 1, "Spawn.Fancy")
		Spawn.Normal:
			PLSS AB 2 Bright A_ScaleVelocity(1.10)
			Loop
		Spawn.Fancy:
			PLSS A 1 Bright A_ScaleVelocity(1.10)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			PLSS B 1 Bright A_ScaleVelocity(1.10)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			PLSS A 1 Bright A_ScaleVelocity(1.10)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			PLSS B 1 Bright A_ScaleVelocity(1.10)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			Loop
	}
}

ACTOR RLNuclearPlasmaPistolBallSSSharpshooter : RLNuclearPlasmaPistolBallSharpshooter
{
	States
	{
		Spawn:
			TNT1 A 0 NoDelay A_JumpIf(CallACS("DRLA_FancyProjectiles") == 1, "Spawn.Fancy")
		Spawn.Normal:
			PLSS AB 2 Bright A_ScaleVelocity(1.25)
			Loop
		Spawn.Fancy:
			PLSS A 1 Bright A_ScaleVelocity(1.25)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			PLSS B 1 Bright A_ScaleVelocity(1.25)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			PLSS A 1 Bright A_ScaleVelocity(1.25)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			PLSS B 1 Bright A_ScaleVelocity(1.25)
			"####" "#" 0 A_CustomMissile("RLNuclearPlasmaPistolFancyTrail", frandom(-1.0,1.0), frandom(-1.0,1.0))
			Loop
	}
}

ACTOR RLNuclearPlasmaPistolBallSPSharpshooter : RLNuclearPlasmaPistolBallSSharpshooter
{
  Damage (56)
}

ACTOR RLNuclearPlasmaPistolBallSASharpshooter : RLNuclearPlasmaPistolBallSSharpshooter
{
  Speed 35
}

ACTOR RLNuclearPlasmaPistolBallSPPSharpshooter : RLNuclearPlasmaPistolBallSSharpshooter
{
  Damage (64)
}

ACTOR RLNuclearPlasmaPistolBallSSASharpshooter : RLNuclearPlasmaPistolBallSSSharpshooter
{
  Speed 35
}

ACTOR RLNuclearPlasmaPistolBallSSPSharpshooter : RLNuclearPlasmaPistolBallSSSharpshooter
{
  Damage (56)
}

ACTOR RLNuclearPlasmaPistolBallSPASharpshooter : RLNuclearPlasmaPistolBallSSharpshooter
{
  Speed 35
  Damage (56)
}

ACTOR RLNuclearPlasmaPistolBallSAASharpshooter : RLNuclearPlasmaPistolBallSSharpshooter
{
  Speed 45
}

ACTOR RLNuclearPlasmaPistolBallSSPPSharpshooter : RLNuclearPlasmaPistolBallSSSharpshooter
{
  Damage (64)
}

ACTOR RLNuclearPlasmaPistolBallSSAASharpshooter : RLNuclearPlasmaPistolBallSSSharpshooter
{
  Speed 45
}

ACTOR RLNuclearPlasmaPistolBallSSPASharpshooter : RLNuclearPlasmaPistolBallSSSharpshooter
{
  Speed 35
  Damage (56)
}

ACTOR RLNuclearPlasmaPistolBallSPPPSharpshooter : RLNuclearPlasmaPistolBallSSharpshooter
{
  Damage (72)
}

ACTOR RLNuclearPlasmaPistolBallSPPASharpshooter : RLNuclearPlasmaPistolBallSSharpshooter
{
  Speed 35
  Damage (64)
}

ACTOR RLNuclearPlasmaPistolBallSPAASharpshooter : RLNuclearPlasmaPistolBallSSharpshooter
{
  Speed 45
  Damage (56)
}

ACTOR RLNuclearPlasmaPistolBallSAAASharpshooter : RLNuclearPlasmaPistolBallSSharpshooter
{
  Speed 55
}

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

Actor RLNuclearPlasmaPistolSelected : RLPermanentInventory {}

Actor RLNuclearPlasmaPistolModLimit : RLStandardModAmount {}
Actor RLNuclearPlasmaPistolPowerMod : RLStandardModAmount {}
Actor RLNuclearPlasmaPistolBulkMod : RLStandardModAmount {}
Actor RLNuclearPlasmaPistolAgilityMod : RLStandardModAmount {}
Actor RLNuclearPlasmaPistolTechnicalMod : RLStandardModAmount {}
Actor RLNuclearPlasmaPistolFirestormMod : RLExoticModAmount {}
Actor RLNuclearPlasmaPistolSniperMod : RLExoticModAmount {}

ACTOR RLNuclearPlasmaPistolClip : Ammo
{
   +INVENTORY.IGNORESKILL
   Inventory.MaxAmount 36
   Inventory.Icon ""
}

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

ACTOR RLNuclearPlasmaPistolPickup : RLExoticWeaponPickup 16912
{
	//$Sprite NUPPX0
	Tag "Nuclear Plasma Pistol [Pickup]"
	States
	{
	SpawnFrame:
		NUPP 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("RLNuclearPlasmaPistol",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 ACS_NamedExecuteWithResult("RLNuclearSetBonusCheck", 1) // Checks for all parts of the set bonus, gives or removes it accordingly - argument is tic delay before checking
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon
	GiveWeapon:
		"####" "#" 0 A_GiveInventory("RLNuclearPlasmaPistol",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_Print("\ccPicked up a \ctNuclear Plasma Pistol.")
		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= Nuclear Plasma Pistol =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup_NoPrint:
		"####" "#" 0
		Fail
	PickupSound:
		"####" "#" 0 A_PlaySound("weapons/NukePlasmaPistolpickup")
		Stop
/*	SetBonusStart:
		"####" "#" 0 A_GiveInventory("RLNuclearWeaponSetBonusWeapon",1)
		"####" "#" 0 A_JumpIfInventory("RLNuclearWeaponSetBonusArmor",1,"SetBonusCheck")
		"####" "#" 0 A_Print("\ccPicked up a \ctNuclear Plasma Pistol.")
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon
	SetBonusCheck:
		"####" "#" 0 A_GiveInventory("RLNuclearWeaponSetBonusActive",1)
		"####" "#" 0 A_Print("\ccPicked up a \ctNuclear Plasma Pistol.\n\c-= FURIOUS FUSION =\n\ccNuclear weaponry recharges twice as fast", 8, "CONFONT")
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon*/
//==============================================================================
	MarathonStuff:
		"####" "#" 0 A_SpawnItemEx("RLMarathonShells",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
	}
}

ACTOR RLNuclearPlasmaPistolPickupModded : RLNuclearPlasmaPistolPickup
{
	+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:
		NUPP 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("RLNuclearPlasmaPistol",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 ACS_NamedExecuteWithResult("RLNuclearSetBonusCheck", 1) // Checks for all parts of the set bonus, gives or removes it accordingly - argument is tic delay before checking
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon
	GiveWeapon:
		"####" "#" 0 A_GiveInventory("RLNuclearPlasmaPistol",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\ct= Nuclear Plasma Pistol =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("RLNuclearPlasmaPistolModLimit", 1, "NotPickup_Modded")
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\ct= Nuclear Plasma Pistol =\n\n\ccYou replace your unmodded\n\ccweapon with the one you picked up.", 5, "CONFONT")
		Goto PickupSound
	NotPickup_Modded:
		"####" "#" 0 A_Print("\ct= Nuclear Plasma Pistol =\n\n\caYou are already carrying a modded\n\caweapon of this type", 5, "CONFONT")
		Fail
/*	SetBonusStart:
		"####" "#" 0 A_GiveInventory("RLNuclearWeaponSetBonusWeapon",1)
		"####" "#" 0 A_JumpIfInventory("RLNuclearWeaponSetBonusArmor",1,"SetBonusCheck")
		"####" "#" 0 A_Print("\ccPicked up a \cbmodded \ctNuclear Plasma Pistol.")
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon*/
	}
}
