
ACTOR RLNuclearPlasmaRevolver : RLPistolWeapon
{
  Obituary "%o was blasted apart by %k."
  Tag "Nuclear Plasma Revolver"
  Weapon.SelectionOrder 3900
  Weapon.SlotNumber 6
  Weapon.AmmoUse1 1
  Weapon.AmmoGive1 0
  Weapon.AmmoType1 "RLNuclearPlasmaRevolverClip"
  Inventory.Icon "NPRVICON"
  States
  {
  Ready:
	TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown",1,"MisfirePrevention")
    TNT1 A 0 A_PlaySound("weapons/nukeplasmarevolveridle", 6, 1, 1)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 1, "ReadyCantAltFire")
	TNT1 A 0 A_JumpIfInventory("RLPowerNuclearPlasmaRevolverRecharge",1,2)
	TNT1 A 0 A_JumpIfInventory("RLPowerNuclearPlasmaRevolverRecharge2",1,1)
	Goto IHAVETHEPOWER
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop", 1, "ReadyCanAltFire")
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate", 1, "ReadyCanAltFire")
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NPRV A 5 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
	Goto Ready
  ReadyCantAltFire:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 6, "ReadyNoNeedToCharge")
	TNT1 A 0 A_JumpIfInventory("RLPowerNuclearPlasmaRevolverRecharge",1,2)
	TNT1 A 0 A_JumpIfInventory("RLPowerNuclearPlasmaRevolverRecharge2",1,1)
	Goto IHAVETHEPOWER
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop", 1, "ReadyCanFire")
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate", 1, "ReadyCanFire")
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NPRV A 5 A_WeaponReady (WRF_NOSECONDARY | WRF_ALLOWZOOM)
	Goto Ready
  ReadyNoNeedToCharge:
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop", 1, "ReadyCanFire")
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate", 1, "ReadyCanFire")
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NPRV A 5 A_WeaponReady (WRF_NOSECONDARY | WRF_ALLOWZOOM)
	Goto Ready
	
  ReadyCanAltFire:
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NPRV A 5 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
	Goto Ready
  ReadyCanFire:
    TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NPRV A 5 A_WeaponReady (WRF_ALLOWZOOM)
	Goto Ready
	
  IHAVETHEPOWER:
	TNT1 A 0 A_GiveInventory("RLNuclearPlasmaRevolverClip", 6)
    TNT1 A 0 A_GunFlash ("FlashCharged", GFF_NOEXTCHANGE)
    NPRV A 2 A_WeaponReady (WRF_NOSECONDARY | 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 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_TakeInventory("PowerRLTechnicianBasicDamage", 1)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverModLimit", 1, "WeaponDropModded")
	TNT1 A 0 A_SpawnItemEx("RLNuclearPlasmaRevolverPickup", 0, 0, 40, 16, 0, 0, 0, SXF_SETMASTER)
	Goto WeaponDropRemoval
  WeaponDropModded:
	TNT1 A 2 A_SpawnItemEx("RLNuclearPlasmaRevolverPickupModded", 0, 0, 40, 16, 0, 0, 0, SXF_SETMASTER)
  WeaponDropRemoval:
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverModLimit", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverPowerMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverBulkMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverAgilityMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverSniperMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 1 A_TakeInventory("RLNuclearPlasmaRevolver",1)
	Stop
  AfterModDrop:
	TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NPRV A 5 A_WeaponReady (16)
	TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NPRV A 5 A_WeaponReady (16)
    Goto Ready
  MisfirePrevention:
	TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    NPRV 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("RLNuclearPlasmaRevolverSelected", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("PowerRLTechnicianBasicDamage", 1)
  DeselectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "DeselectRenegade")
    TNT1 AA 0 A_Lower
    NPRV 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("RLBasicAssemblyTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLPistolTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLNuclearAmmoWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLAssembledWeaponToken", 1)
	TNT1 A 0 A_GiveInventory("RLNuclearPlasmaRevolverSelected", 1)
	TNT1 A 0 A_JumpIfInventory("RLScavengerPerk",1, 1)
    Goto SelectLoop
	TNT1 A 0 A_GiveInventory("PowerRLTechnicianBasicDamage", 1)
    Goto SelectLoop
  SelectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "SelectRenegade")
    TNT1 AA 0 A_Raise
    NPRV A 1 A_Raise
    Loop
// 8x damage with Scout, no deviation
  Fire:
	NPRV A 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"MeleeRestricted") // Cannot fire in levels that restrict it
	NPRV A 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"SilencedRestricted") // Cannot fire in levels that restrict it
	NPRV A 0 A_JumpIfInventory("RLRestrictionBoomOnly",1,"BoomRestricted") // Cannot fire in levels that restrict it
	NPRV A 0 A_JumpIfInventory("RLRestrictionLowTechOnly",1,"LowTechRestricted") // Cannot fire in levels that restrict it
	NPRV A 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"CunningRestricted") // Cannot fire in levels that restrict it
	
	TNT1 A 0 A_JumpIfNoAmmo("Ready")
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverSniperMod",1,"FireS")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverBulkMod",1,"FireP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverPowerMod",1,"FireP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverAgilityMod",1,"FireA")
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,4)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBall", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallSharpshooter", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBall", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallSharpshooter", 0, 1)
    Goto FireFinish
  FireP:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverBulkMod",2,"FirePP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverPowerMod",2,"FirePP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverAgilityMod",1,"FirePA")
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,4)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallP", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallPSharpshooter", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallP", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallPSharpshooter", 0, 1)
    Goto FireFinish
  FireA:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverPowerMod",1,"FirePA")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverAgilityMod",2,"FireAA")
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,4)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallASharpshooter", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallASharpshooter", 0, 1)
    Goto FireFinish
  FirePP:
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,4)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallPP", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallPPSharpshooter", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallPP", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallPPSharpshooter", 0, 1)
    Goto FireFinish
  FirePA:
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,4)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallPA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallPASharpshooter", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallPA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallPASharpshooter", 0, 1)
    Goto FireFinish
  FireAA:
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,4)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallAA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallAASharpshooter", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallAA", frandom(-0.2,0.2), 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallAASharpshooter", 0, 1)
    Goto FireFinish
  FireS:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverSniperMod",2,"FireSS")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverBulkMod",1,"FireSP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverPowerMod",1,"FireSP")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverAgilityMod",1,"FireSA")
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,4)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallS", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallSSharpshooter", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallS", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallSSharpshooter", 0, 1)
    Goto FireFinish
  FireSS:
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,4)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallSS", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallSSSharpshooter", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallSS", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallSSSharpshooter", 0, 1)
    Goto FireFinish
  FireSP:
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,4)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallSP", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallSPSharpshooter", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallSP", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallSPSharpshooter", 0, 1)
    Goto FireFinish
  FireSA:
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,4)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallSA", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLNuclearPlasmaRevolverBallSASharpshooter", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallSA", 0, 1)
    Goto FireFinish
	TNT1 A 0 A_FireCustomMissile ("RLWWNuclearPlasmaRevolverBallSASharpshooter", 0, 1)
    Goto FireFinish
	
  FireFinish:
	NPRV A 0 A_JumpIfInventory("RLRestrictionNoRecharge",1,"FireFinishChargeStarted") // Cannot recharge in levels that restrict it
	TNT1 A 0 A_JumpIfInventory("RLNuclearWeaponSetBonusActive", 1, 4)
	TNT1 A 0 A_JumpIfInventory("RLPowerNuclearPlasmaRevolverRecharge",1,"FireFinishChargeStarted")
	TNT1 A 0 A_GiveInventory("RLPowerNuclearPlasmaRevolverRecharge",1)
    TNT1 A 0 A_PlaySound("weapons/nuclearplasmarevolvercharge", 7, 0.25, 0, 1.3)
	Goto FireFinishChargeStarted
	TNT1 A 0 A_JumpIfInventory("RLPowerNuclearPlasmaRevolverRecharge2",1,"FireFinishChargeStarted")
	TNT1 A 0 A_GiveInventory("RLPowerNuclearPlasmaRevolverRecharge2",1)
    TNT1 A 0 A_PlaySound("weapons/nuclearplasmarevolvercharge2", 7, 0.25, 0, 1.3)
	Goto FireFinishChargeStarted
  FireFinishChargeStarted:
    TNT1 A 0 A_SpawnItemEx ("RLPlasmaShotgunRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverFirestormMod",2,"FireFinishF2")
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverFirestormMod",1,"FireFinishF")
    NPRV E 3 Bright A_GunFlash ("FlashE")
    NPRV B 3 A_GunFlash ("FlashB", GFF_NOEXTCHANGE)
    NPRV C 3 A_GunFlash ("FlashC", GFF_NOEXTCHANGE)
    NPRV D 3 A_GunFlash ("FlashD", GFF_NOEXTCHANGE)
    TNT1 A 0 A_GunFlash 
    NPRV A 5 A_Refire
    Goto Ready
  FireFinishF:
    NPRV E 2 Bright A_GunFlash ("FlashE")
    NPRV B 2 A_GunFlash ("FlashB", GFF_NOEXTCHANGE)
    NPRV C 2 A_GunFlash ("FlashC", GFF_NOEXTCHANGE)
    NPRV D 2 A_GunFlash ("FlashD", GFF_NOEXTCHANGE)
    TNT1 A 0 A_GunFlash
    NPRV A 5 A_Refire
    Goto Ready
  FireFinishF2:
    NPRV E 1 Bright A_GunFlash ("FlashE")
    NPRV B 1 A_GunFlash ("FlashB", GFF_NOEXTCHANGE)
    NPRV C 1 A_GunFlash ("FlashC", GFF_NOEXTCHANGE)
    NPRV D 1 A_GunFlash ("FlashD", GFF_NOEXTCHANGE)
    TNT1 A 0 A_GunFlash
    NPRV A 5 A_Refire
    Goto Ready
	
  Flash:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 6, 6)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 4, 4)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 1, 2)
    NPR1 D 6 Bright
    Goto LightDone
    NPR1 C 6 Bright
    Goto LightDone
    NPR1 B 6 Bright
    Goto LightDone
    NPR1 A 6 Bright
    Goto LightDone
  FlashB:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 6, 6)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 4, 4)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 1, 2)
    NPR2 D 4 Bright
    Goto LightDone
    NPR2 C 4 Bright
    Goto LightDone
    NPR2 B 4 Bright
    Goto LightDone
    NPR2 A 4 Bright
    Goto LightDone
  FlashC:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 6, 6)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 4, 4)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 1, 2)
    NPR3 D 4 Bright
    Goto LightDone
    NPR3 C 4 Bright
    Goto LightDone
    NPR3 B 4 Bright
    Goto LightDone
    NPR3 A 4 Bright
    Goto LightDone
  FlashD:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 6, 6)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 4, 4)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 1, 2)
    NPR4 D 4 Bright
    Goto LightDone
    NPR4 C 4 Bright
    Goto LightDone
    NPR4 B 4 Bright
    Goto LightDone
    NPR4 A 4 Bright
    Goto LightDone
  FlashE:
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 6, 6)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 4, 4)
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverClip", 1, 2)
    NPR5 D 4 Bright
    Goto LightDone
    NPR5 C 4 Bright
    Goto LightDone
    NPR5 B 4 Bright
    Goto LightDone
    NPR5 A 4 Bright
    Goto LightDone
  FlashCharged:
    NPR6 A 3 Bright
    Goto LightDone
  FlashDrop:
    TNT1 A 0
    Goto LightDone
  Spawn:
	TNT1 A 0 NoDelay A_SpawnItemEx("RLNuclearPlasmaRevolverPickup",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")
	Goto Ready
  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("RLNuclearPlasmaRevolverModLimit", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverPowerMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverBulkMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverAgilityMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverFirestormMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_TakeInventory("PowerRLTechnicianBasicDamage", 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_GiveInventory("RLSpeedloaderPistolAssemblyLearntToken", 1) // Assembly is now listed in the HUD menus
	TNT1 A 0 A_JumpIfInventory("RLNuclearPlasmaRevolverModLimit",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("RLNuclearPlasmaRevolverModLimit", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverPowerMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverBulkMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverAgilityMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverFirestormMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLNuclearPlasmaRevolverSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_TakeInventory("PowerRLTechnicianBasicDamage", 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_Jump(256,1,2)
	TNT1 A 0 A_FireCustomMissile("DroppedRLAgilityMod",0,0,0)
	Goto ScavengerTimeEnd
	TNT1 A 0 A_FireCustomMissile("DroppedRLTechnicalMod",0,0,0)
	Goto ScavengerTimeEnd
  ScavengerTimeEnd:
	TNT1 A 1 A_TakeInventory("RLNuclearPlasmaRevolver",1)
	Stop
  }
}

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

ACTOR RLNuclearPlasmaRevolverBall : PlasmaBall
{
	Damage 20
	Damagetype "Plasma"
	Alpha 0.85
	Scale 0.20
	Species "Player"
	+THRUSPECIES
	+THRUGHOST
	+FORCEXYBILLBOARD
	Decal "BlueSmallLightning"
	SeeSound "weapons/nuclearplasmarevolver"
	DeathSound "weapons/hpplasmaimpact"
	States
	{
		Spawn:
			NKON A 0 NoDelay A_JumpIf(CallACS("DRLA_Fancyprojectiles") == 1, "Spawn.Fancy")
			TNT1 A 0 A_Jump (256, "Spawn.Normal")
			Goto Spawn.Normal
		Spawn.Normal:
			NKON JKLM 1 Bright
			Loop
		Spawn.Fancy:
			NKON JKLM 1 Bright A_SpawnItemEx("RLNuclearPlasmaRevolverBallTrail",-5)
			Loop
		Death:
			TNT1 A 0 A_SetScale (0.8)
			BPLX CDEFGHI 2 Bright
			Stop
	}
}

ACTOR RLNuclearPlasmaRevolverBallTrail
{
	Renderstyle Add
	Scale 0.15
	+NOINTERACTION
	+FORCEXYBILLBOARD
	States
	{
		Spawn:
			NKON FGHI 2 A_FadeOut
			Stop
	}
}

ACTOR RLNuclearPlasmaRevolverBallP : RLNuclearPlasmaRevolverBall
{
  Damage 22
}

ACTOR RLNuclearPlasmaRevolverBallA : RLNuclearPlasmaRevolverBall
{
  Speed 35
}

ACTOR RLNuclearPlasmaRevolverBallPP : RLNuclearPlasmaRevolverBall
{
  Damage 24
}

ACTOR RLNuclearPlasmaRevolverBallPA : RLNuclearPlasmaRevolverBall
{
  Speed 35
  Damage 22
}

ACTOR RLNuclearPlasmaRevolverBallAA : RLNuclearPlasmaRevolverBall
{
  Speed 45
}

ACTOR RLNuclearPlasmaRevolverBallS : RLNuclearPlasmaRevolverBall
{
  States
  {
		Spawn.Normal:
			TNT1 A 0 A_ScaleVelocity(1.10)
			NKON JKLM 1 Bright
			Loop
		Spawn.Fancy:
			TNT1 A 0 A_ScaleVelocity(1.10)
			NKON JKLM 1 Bright A_SpawnItemEx("RLNuclearPlasmaRevolverBallTrail",-5)
			Loop
  }
}

ACTOR RLNuclearPlasmaRevolverBallSS : RLNuclearPlasmaRevolverBall
{
  States
  {
		Spawn.Normal:
			TNT1 A 0 A_ScaleVelocity(1.25)
			NKON JKLM 1 Bright
			Loop
		Spawn.Fancy:
			TNT1 A 0 A_ScaleVelocity(1.25)
			NKON JKLM 1 Bright A_SpawnItemEx("RLNuclearPlasmaRevolverBallTrail",-5)
			Loop
  }
}

ACTOR RLNuclearPlasmaRevolverBallSP : RLNuclearPlasmaRevolverBallS
{
  Damage 22
}

ACTOR RLNuclearPlasmaRevolverBallSA : RLNuclearPlasmaRevolverBallS
{
  Speed 35
}

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

ACTOR RLNuclearPlasmaRevolverBallSharpshooter : RLNuclearPlasmaRevolverBall
{
  Damage (160)
}

ACTOR RLNuclearPlasmaRevolverBallPSharpshooter : RLNuclearPlasmaRevolverBallSharpshooter
{
  Damage (176)
}

ACTOR RLNuclearPlasmaRevolverBallASharpshooter : RLNuclearPlasmaRevolverBallSharpshooter
{
  Speed 35
}

ACTOR RLNuclearPlasmaRevolverBallPPSharpshooter : RLNuclearPlasmaRevolverBallSharpshooter
{
  Damage (192)
}

ACTOR RLNuclearPlasmaRevolverBallPASharpshooter : RLNuclearPlasmaRevolverBallSharpshooter
{
  Speed 35
  Damage (176)
}

ACTOR RLNuclearPlasmaRevolverBallAASharpshooter : RLNuclearPlasmaRevolverBallSharpshooter
{
  Speed 45
}

ACTOR RLNuclearPlasmaRevolverBallSSharpshooter : RLNuclearPlasmaRevolverBallSharpshooter
{
  States
  {
		Spawn.Normal:
			TNT1 A 0 A_ScaleVelocity(1.10)
			NKON JKLM 1 Bright
			Loop
		Spawn.Fancy:
			TNT1 A 0 A_ScaleVelocity(1.10)
			NKON JKLM 1 Bright A_SpawnItemEx("RLNuclearPlasmaRevolverBallTrail",-5)
			Loop
  }
}

ACTOR RLNuclearPlasmaRevolverBallSSSharpshooter : RLNuclearPlasmaRevolverBallSharpshooter
{
  States
  {
		Spawn.Normal:
			TNT1 A 0 A_ScaleVelocity(1.25)
			NKON JKLM 1 Bright
			Loop
		Spawn.Fancy:
			TNT1 A 0 A_ScaleVelocity(1.25)
			NKON JKLM 1 Bright A_SpawnItemEx("RLNuclearPlasmaRevolverBallTrail",-5)
			Loop
  }
}

ACTOR RLNuclearPlasmaRevolverBallSPSharpshooter : RLNuclearPlasmaRevolverBallSSharpshooter
{
  Damage (176)
}

ACTOR RLNuclearPlasmaRevolverBallSASharpshooter : RLNuclearPlasmaRevolverBallSSharpshooter
{
  Speed 35
}

//-------------------------------------------------------------------
//		WW PROJECTILES

ACTOR RLWWNuclearPlasmaRevolverBall : RLNuclearPlasmaRevolverBall
{
	Damage 30
}

ACTOR RLWWNuclearPlasmaRevolverBallP : RLNuclearPlasmaRevolverBallP
{
	Damage 34
}

ACTOR RLWWNuclearPlasmaRevolverBallA : RLNuclearPlasmaRevolverBallA
{
	Damage 30
}

ACTOR RLWWNuclearPlasmaRevolverBallPP : RLNuclearPlasmaRevolverBallPP
{
	Damage 38
}

ACTOR RLWWNuclearPlasmaRevolverBallPA : RLNuclearPlasmaRevolverBallPA
{
	Damage 34
}

ACTOR RLWWNuclearPlasmaRevolverBallAA : RLNuclearPlasmaRevolverBallAA
{
	Damage 30
}

ACTOR RLWWNuclearPlasmaRevolverBallS : RLNuclearPlasmaRevolverBallS
{
	Damage 30
}

ACTOR RLWWNuclearPlasmaRevolverBallSS : RLNuclearPlasmaRevolverBallSS
{
	Damage 30
}

ACTOR RLWWNuclearPlasmaRevolverBallSP : RLNuclearPlasmaRevolverBallSP
{
	Damage 34
}

ACTOR RLWWNuclearPlasmaRevolverBallSA : RLNuclearPlasmaRevolverBallSA
{
	Damage 30
}

ACTOR RLWWNuclearPlasmaRevolverBallSharpshooter : RLNuclearPlasmaRevolverBall
{
	Damage (240)
}

ACTOR RLWWNuclearPlasmaRevolverBallPSharpshooter : RLNuclearPlasmaRevolverBallP
{
	Damage (272)
}

ACTOR RLWWNuclearPlasmaRevolverBallASharpshooter : RLNuclearPlasmaRevolverBallA
{
	Damage (240)
}

ACTOR RLWWNuclearPlasmaRevolverBallPPSharpshooter : RLNuclearPlasmaRevolverBallPP
{
	Damage (304)
}

ACTOR RLWWNuclearPlasmaRevolverBallPASharpshooter : RLNuclearPlasmaRevolverBallPA
{
	Damage (272)
}

ACTOR RLWWNuclearPlasmaRevolverBallAASharpshooter : RLNuclearPlasmaRevolverBallAA
{
	Damage (240)
}

ACTOR RLWWNuclearPlasmaRevolverBallSSharpshooter : RLNuclearPlasmaRevolverBallS
{
	Damage (240)
}

ACTOR RLWWNuclearPlasmaRevolverBallSSSharpshooter : RLNuclearPlasmaRevolverBallSS
{
	Damage (240)
}

ACTOR RLWWNuclearPlasmaRevolverBallSPSharpshooter : RLNuclearPlasmaRevolverBallSP
{
	Damage (272)
}

ACTOR RLWWNuclearPlasmaRevolverBallSASharpshooter : RLNuclearPlasmaRevolverBallSA
{
	Damage (240)
}

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

Actor RLNuclearPlasmaRevolverSelected : RLPermanentInventory {}
Actor RLNuclearPlasmaRevolverModLimit : RLBasicAssemblyModAmount {}
Actor RLNuclearPlasmaRevolverPowerMod : RLBasicAssemblyModAmount {}
Actor RLNuclearPlasmaRevolverBulkMod : RLBasicAssemblyModAmount {}
Actor RLNuclearPlasmaRevolverAgilityMod : RLBasicAssemblyModAmount {}
Actor RLNuclearPlasmaRevolverFirestormMod : RLBasicAssemblyModAmount {}
Actor RLNuclearPlasmaRevolverSniperMod : RLBasicAssemblyModAmount {}

ACTOR RLPowerNuclearPlasmaRevolverRecharge : Powerup
{
	Powerup.Duration 228
}

ACTOR RLPowerNuclearPlasmaRevolverRecharge2 : Powerup
{
	Powerup.Duration 140
}

ACTOR RLNuclearPlasmaRevolverClip : Ammo
{
   +INVENTORY.IGNORESKILL
   Inventory.MaxAmount 6
   Inventory.Icon ""
}

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

ACTOR RLNuclearPlasmaRevolverPickup : RLBasicAssembledWeaponPickup 17449
{
	//$Sprite NPRVX0
	Tag "Nuclear Plasma Revolver [Pickup]"
	States
	{
	SpawnFrame:
		NPRV 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/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("RLNuclearPlasmaRevolver",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("RLNuclearPlasmaRevolver",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_Print("\ccPicked up a \cvNuclear Plasma Revolver.")
		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("\cv= Nuclear Plasma Revolver =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup_NoPrint:
		"####" "#" 0
		Fail
	PickupSound:
		"####" "#" 0 A_PlaySound("weapons/nuclearplasmarevolverpickup")
		Stop
/*	SetBonusStart:
		"####" "#" 0 A_GiveInventory("RLNuclearWeaponSetBonusWeapon",1)
		"####" "#" 0 A_JumpIfInventory("RLNuclearWeaponSetBonusArmor",1,"SetBonusCheck")
		"####" "#" 0 A_Print("\ccPicked up a \cvNuclear Plasma Revolver.")
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon
	SetBonusCheck:
		"####" "#" 0 A_GiveInventory("RLNuclearWeaponSetBonusActive",1)
		"####" "#" 0 A_Print("\ccPicked up a \cvNuclear Plasma Revolver.\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 RLNuclearPlasmaRevolverPickupModded : RLNuclearPlasmaRevolverPickup
{
	+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:
		NPRV 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("RLNuclearPlasmaRevolver",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("\cv= Nuclear Plasma Revolver =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("RLNuclearPlasmaRevolverModLimit", 1, "NotPickup_Modded")
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cv= Nuclear Plasma Revolver =\n\n\ccYou replace your unmodded\n\ccweapon with the one you picked up.", 5, "CONFONT")
		Goto PickupSound
	NotPickup_Modded:
		"####" "#" 0 A_Print("\cv= Nuclear Plasma Revolver =\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 \cvNuclear Plasma Revolver.")
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon*/
	}
}
