
ACTOR RLPlasmaShotgun : RLWeapon
{
  Obituary "%o was terrified by %k's plasma shotgun."
  Tag "Plasma Shotgun"
  Weapon.SelectionOrder 20
  Weapon.SlotNumber 6
  Weapon.AmmoUse1 1
  Weapon.AmmoGive1 0
  Weapon.AmmoType1 "RLPlasmaShotgunClip"
  Weapon.AmmoType2 "Cell"
  Inventory.Icon "PLSHICON"
  States
  {
  Ready:
	TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown",1,"MisfirePrevention")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunNanoMod",1,2)
    PSHO A 1 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
    Loop
  NanoRegenCheck:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip",3,2)
    PSHO A 70 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
	Goto NanoRegenCheckBegin
  NanoRegenCheckBegin:
    PSHO A 70 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunBulkMod",1,2)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip", 30, "Ready")
	Goto NanoRegen
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunBulkMod",2,2)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip", 39, "Ready")
	Goto NanoRegen
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunBulkMod",3,2)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip", 48, "Ready")
	Goto NanoRegen
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunBulkMod",4,2)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip", 57, "Ready")
	Goto NanoRegen
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip", 66, "Ready")
	Goto NanoRegen
  NanoRegen:
	TNT1 A 0 A_GiveInventory("RLPlasmaShotgunClip", 1)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunNanoMod",2,2)
    PSHO A 17 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
    Goto NanoRegenCheckBegin+1
    PSHO A 9 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
    Goto NanoRegenCheckBegin+1
	
  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("RLPlasmaShotgunModLimit", 1, "WeaponDropModded")
	TNT1 A 0 A_SpawnItemEx("RLPlasmaShotgunPickup", 0, 0, 40, 12, 0, 0, 0, SXF_SETMASTER)
	Goto WeaponDropRemoval
  WeaponDropModded:
	TNT1 A 2 A_SpawnItemEx("RLPlasmaShotgunPickupModded", 0, 0, 40, 12, 0, 0, 0, SXF_SETMASTER)
  WeaponDropRemoval:
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunNanoMod", 2)
	TNT1 A 0 A_TakeInventory("RLHeavyPlasmaShotgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLPlasmaticShrapnelPlasmaShotgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLNanoShrapnelPlasmaShotgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgunMkIIConfirm",1)
	TNT1 A 0 A_TakeInventory("RLVoltgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 1 A_TakeInventory("RLPlasmaShotgun",1)
	Stop
  AfterModDrop:
    PSHO A 8 A_WeaponReady (16)
    Goto Ready
  MisfirePrevention:
    PSHO 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_GiveInventory("RLDeselectionFunction",1)
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSelected", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
  DeselectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "DeselectRenegade")
    TNT1 A 0 A_Lower
    PSHO A 1 A_Lower
    Loop
  DeselectRenegade:
    TNT1 A 0 A_Lower
    loop
  SelectRenegade: 
    TNT1 A 0 A_Raise
    loop
  SelectSetWeapon:
	TNT1 A 0 A_GiveInventory("RLShotgunTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLEfficientAmmoTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLExoticWeaponToken", 1)
	TNT1 A 0 A_GiveInventory("RLPlasmaShotgunSelected", 1)
    Goto SelectLoop
  SelectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "SelectRenegade")
    TNT1 A 0 A_Raise
    PSHO A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("RLHeavyPlasmaShotgunConfirm",1, "AssembleHeavyPlasmaShotgun")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaticShrapnelPlasmaShotgunConfirm",1, "AssemblePlasmaticShrapnelPlasmaShotgun")
	TNT1 A 0 A_JumpIfInventory("RLNanoShrapnelPlasmaShotgunConfirm",1, "AssembleNanoShrapnelPlasmaShotgun")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunMkIIConfirm",1, "AssemblePlasmaShotgunMkII")
	TNT1 A 0 A_JumpIfInventory("RLVoltgunConfirm",1, "AssembleVoltgun")
	
	PSHO A 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"MeleeRestricted") // Cannot fire in levels that restrict it
	PSHO A 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"SilencedRestricted") // Cannot fire in levels that restrict it
	PSHO A 0 A_JumpIfInventory("RLRestrictionBoomOnly",1,"BoomRestricted") // Cannot fire in levels that restrict it
	PSHO A 0 A_JumpIfInventory("RLRestrictionLowTechOnly",1,"LowTechRestricted") // Cannot fire in levels that restrict it
	PSHO A 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"CunningRestricted") // Cannot fire in levels that restrict it
	
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,2)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip",3, 2)
	Goto Reload
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip",1, 1)
	Goto Reload
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunSniperMod",1,"FireS")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",1,"FireP")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",1,"FireA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegade")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
    Goto FireFinish
  FireRenegade:
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
    Goto FireFinish
  FireP:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",2,"FirePP")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",1,"FirePA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeP")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
    Goto FireFinish
  FireRenegadeP:
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
    Goto FireFinish
  FireA:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",1,"FirePA")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",2,"FireAA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeA")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
    Goto FireFinish
  FireRenegadeA:
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
    Goto FireFinish
  FirePP:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",3,"FirePPP")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",1,"FirePPA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegade")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPSilent", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
    Goto FireFinish
  FireRenegadePP:
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPSilent", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
    Goto FireFinish
  FirePA:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",2,"FirePPA")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",2,"FirePAA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadePA")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
    Goto FireFinish
  FireRenegadePA:
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
    Goto FireFinish
  FireAA:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",1,"FirePAA")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",3,"FireAAA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeAA")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(4,-4), 0, 0, 0, 0, frandom(1,-1))
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(4,-4), 0, 0, 0, 0, frandom(1,-1))
    Goto FireFinish
  FireRenegadeAA:
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(4,-4), 0, 0, 0, 0, frandom(1,-1))
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(4,-4), 0, 0, 0, 0, frandom(1,-1))
    Goto FireFinish
  FirePPP:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",4,"FirePPPP")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",1,"FirePPPA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadePPP")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPP", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPPSilent", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
    Goto FireFinish
  FireRenegadePPP:
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPP", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPPSilent", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
    Goto FireFinish
  FirePPA:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",3,"FirePPPA")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",2,"FirePPAA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadePPA")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPSilent", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
    Goto FireFinish
  FireRenegadePPA:
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPSilent", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
    Goto FireFinish
  FirePAA:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",2,"FirePPAA")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",3,"FirePAAA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadePAA")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(4,-4), 0, 0, 0, 0, frandom(1,-1))
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(4,-4), 0, 0, 0, 0, frandom(1,-1))
    Goto FireFinish
  FireRenegadePAA:
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(4,-4), 0, 0, 0, 0, frandom(1,-1))
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(4,-4), 0, 0, 0, 0, frandom(1,-1))
    Goto FireFinish
  FireAAA:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",1,"FirePAAA")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",4,"FireAAAA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeAAA")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(3.5,-3.5), 0, 0, 0, 0, frandom(0.5,-0.5))
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(3.5,-3.5), 0, 0, 0, 0, frandom(0.5,-0.5))
    Goto FireFinish
  FireRenegadeAAA:
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(3.5,-3.5), 0, 0, 0, 0, frandom(0.5,-0.5))
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(3.5,-3.5), 0, 0, 0, 0, frandom(0.5,-0.5))
    Goto FireFinish
  FirePPPP:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadePPPP")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPPP", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPPPSilent", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
    Goto FireFinish
  FireRenegadePPPP:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPPP", frandom(5,-5), 1, 0, 0, 0, frandom(2,-2))
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPPP", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPPPSilent", frandom(5,-5), 0, 0, 0, 0, frandom(2,-2))
    Goto FireFinish
  FirePPPA:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadePPPA")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPP", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPPSilent", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
    Goto FireFinish
  FireRenegadePPPA:
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPP", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPPSilent", frandom(4.5,-4.5), 0, 0, 0, 0, frandom(1.5,-1.5))
    Goto FireFinish
  FirePPAA:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadePPAA")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", frandom(4,-4), 0, 0, 0, 0, frandom(1,-1))
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPSilent", frandom(4,-4), 0, 0, 0, 0, frandom(1,-1))
    Goto FireFinish
  FireRenegadePPAA:
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", frandom(4,-4), 0, 0, 0, 0, frandom(1,-1))
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPSilent", frandom(4,-4), 0, 0, 0, 0, frandom(1,-1))
    Goto FireFinish
  FirePAAA:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadePAAA")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(3.5,-3.5), 0, 0, 0, 0, frandom(0.5,-0.5))
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(3.5,-3.5), 0, 0, 0, 0, frandom(0.5,-0.5))
    Goto FireFinish
  FireRenegadePAAA:
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(3.5,-3.5), 0, 0, 0, 0, frandom(0.5,-0.5))
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(3.5,-3.5), 0, 0, 0, 0, frandom(0.5,-0.5))
    Goto FireFinish
  FireAAAA:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeAAAA")
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(3,-3), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(3,-3), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeAAAA:
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(3,-3), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(3,-3), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireS:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunSniperMod",2,"FireSS")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",1,"FireSP")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",1,"FireSA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeS")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(3,-3), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(3,-3), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeS:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(3,-3), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(3,-3), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSS:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",1,"FireSSP")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",1,"FireSSA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSS")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(1,-1), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(1,-1), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSS:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(1,-1), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(1,-1), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSP:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunSniperMod",2,"FireSSP")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",2,"FireSPP")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",1,"FireSPA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSP")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(3,-3), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(3,-3), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSP:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(3,-3), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(3,-3), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSA:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunSniperMod",2,"FireSSA")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",1,"FireSPA")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",2,"FireSAA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSA")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(2.5,-2.5), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(2.5,-2.5), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSA:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(2.5,-2.5), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(2.5,-2.5), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSSP:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",2,"FireSSPP")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",1,"FireSSPA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSSP")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(1,-1), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(1,-1), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSSP:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(1,-1), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(1,-1), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSSA:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",1,"FireSSPA")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",2,"FireSSAA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSSA")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(0.5,-0.5), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(0.5,-0.5), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSSA:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(0.5,-0.5), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(0.5,-0.5), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSPP:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunSniperMod",2,"FireSSPP")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",3,"FireSPPP")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",1,"FireSPPA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSPP")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", frandom(3,-3), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPSilent", frandom(3,-3), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSPP:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", frandom(3,-3), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPSilent", frandom(3,-3), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSPA:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunSniperMod",2,"FireSSPA")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",2,"FireSPPA")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",2,"FireSPAA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSPA")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(2.5,-2.5), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(2.5,-2.5), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSPA:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(2.5,-2.5), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(2.5,-2.5), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSAA:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunSniperMod",2,"FireSSAA")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunPowerMod",1,"FireSPAA")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunAgilityMod",3,"FireSAAA")
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSAA")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(2,-2), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(2,-2), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSAA:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 AA 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(2,-2), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(2,-2), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSSPP:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSSPP")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", frandom(1,-1), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPSilent", frandom(1,-1), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSSPP:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", frandom(1,-1), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPSilent", frandom(1,-1), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSSAA:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSSAA")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", 0, 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSSAA:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", 0, 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSSPA:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSSPA")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(0.5,-0.5), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(0.5,-0.5), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSSPA:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(0.5,-0.5), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(0.5,-0.5), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSPPP:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSPPP")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPP", frandom(3,-3), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPPSilent", frandom(3,-3), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSPPP:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPP", frandom(3,-3), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPPSilent", frandom(3,-3), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSPPA:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSPPA")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", frandom(2.5,-2.5), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPSilent", frandom(2.5,-2.5), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSPPA:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallPP", frandom(2.5,-2.5), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPPSilent", frandom(2.5,-2.5), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSPAA:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSPAA")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(2,-2), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(2,-2), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSPAA:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBallP", frandom(2,-2), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallPSilent", frandom(2,-2), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireSAAA:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSAAA")
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(1.5,-1.5), 0, 0, 0, 0, 0)
	TNT1 AAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(1.5,-1.5), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireRenegadeSAAA:
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile ("RLPlasmaShotgunBall", frandom(1.5,-1.5), 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAA 0 A_FireCustomMissile ("RLPlasmaShotgunBallSilent", frandom(1.5,-1.5), 0, 0, 0, 0, 0)
    Goto FireFinish
  FireFinish:
    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("RLFireangelPerk",1,"FireFinishDemo")
    TNT1 A 0 A_TakeInventory ("RLPlasmaShotgunClip", 3, TIF_NOTAKEINFINITE)
	Goto FireFinishAmmoDone
  FireFinishDemo:
    TNT1 A 0 A_TakeInventory ("RLPlasmaShotgunClip", 1, TIF_NOTAKEINFINITE)
	Goto FireFinishAmmoDone
  FireFinishAmmoDone:
    TNT1 A 0 A_PlaySound("weapons/plasmashotgun", CHAN_WEAPON, 1.0, 0, 0.9)
    TNT1 A 0 A_PlaySound("weapons/plasmashotgun2", 7, 1.0, 0, 0.6)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunFirestormMod",2,"FireFinishF2")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunFirestormMod",1,"FireFinishF1")
    PSHO B 5 Bright A_GunFlash
    PSHO CD 5 Bright
    PSHO A 5
    PSHO A 5 A_Refire
    Goto Ready
  FireFinishF1:
    PSHO B 4 Bright A_GunFlash
    PSHO CD 4 Bright
    PSHO A 4
    PSHO A 4 A_Refire
    Goto Ready
  FireFinishF2:
    PSHO B 3 Bright A_GunFlash
    PSHO CD 3 Bright
    PSHO A 3
    PSHO A 3 A_Refire
    Goto Ready
  Reload:
	PSHO A 1 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunBulkMod",1,2)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip", 30, "Ready")
	Goto ReloadStartingAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunBulkMod",2,2)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip", 39, "Ready")
	Goto ReloadStartingAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunBulkMod",3,2)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip", 48, "Ready")
	Goto ReloadStartingAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunBulkMod",4,2)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip", 57, "Ready")
	Goto ReloadStartingAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip", 66, "Ready")
  ReloadStartingAmmoCheck:
	TNT1 A 0 A_JumpIfInventory("Cell", 1, 1)
	Goto Ready
	TNT1 A 0 // Play the reload animation.
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunTechnicalMod",4,"Reload4")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunTechnicalMod",3,"Reload3")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunTechnicalMod",2,"Reload2")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunTechnicalMod",1,"Reload1")
    PSHO A 2
    TNT1 A 0 A_PlaySound("weapons/plasmashotgununload", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    PSHO J 2
    PSHO K 24
    TNT1 A 0 A_PlaySound("weapons/plasmashotgunload", 7)
    PSHO J 2
    PSHO A 2
	Goto ReloadWorking
  Reload1:
    PSHO A 2
    TNT1 A 0 A_PlaySound("weapons/plasmashotgununload", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    PSHO J 2
    PSHO K 21
    TNT1 A 0 A_PlaySound("weapons/plasmashotgunload", 7)
    PSHO J 2
    PSHO A 2
	Goto ReloadWorking
  Reload2:
    PSHO A 2
    TNT1 A 0 A_PlaySound("weapons/plasmashotgununload", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    PSHO J 2
    PSHO K 18
    TNT1 A 0 A_PlaySound("weapons/plasmashotgunload", 7)
    PSHO J 2
    PSHO A 2
	Goto ReloadWorking
  Reload3:
    PSHO A 2
    TNT1 A 0 A_PlaySound("weapons/plasmashotgununload", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    PSHO J 2
    PSHO K 15
    TNT1 A 0 A_PlaySound("weapons/plasmashotgunload", 7)
    PSHO J 2
    PSHO A 2
	Goto ReloadWorking
  Reload4:
    PSHO A 2
    TNT1 A 0 A_PlaySound("weapons/plasmashotgununload", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    PSHO J 2
    PSHO K 12
    TNT1 A 0 A_PlaySound("weapons/plasmashotgunload", 7)
    PSHO J 2
    PSHO A 2
  ReloadWorking:
	TNT1 A 0 A_TakeInventory("Cell", 1)
	TNT1 A 0 A_GiveInventory("RLPlasmaShotgunClip", 1)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunBulkMod",1,2)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip",30,9)
	Goto ReloadWorkingAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunBulkMod",2,2)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip",39,7)
	Goto ReloadWorkingAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunBulkMod",3,2)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip",48,5)
	Goto ReloadWorkingAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunBulkMod",4,2)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip",57,3)
	Goto ReloadWorkingAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunClip",66,2)
  ReloadWorkingAmmoCheck:
	TNT1 A 0 A_JumpIfInventory("Cell",1,2)
	TNT1 A 0
	Goto ReloadFinish
	TNT1 A 0
	Goto ReloadWorking
  ReloadFinish:
    TNT1 A 0 A_PlaySound("weapons/plasmashotgunpump", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunTechnicalMod",4,"ReloadFinish4")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunTechnicalMod",3,"ReloadFinish3")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunTechnicalMod",2,"ReloadFinish2")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunTechnicalMod",1,"ReloadFinish1")
    PSHO E 4
    PSHO F 3
    TNT1 A 0 A_PlaySound("weapons/plasmashotgunspark", 7)
    PSHO F 6 A_GunFlash ("ReloadFlash", GFF_NOEXTCHANGE)
    PSHO F 3
	PSHO E 4
	PSHO A 5
	Goto Ready
  ReloadFinish1:
    PSHO E 3
    PSHO F 3
    TNT1 A 0 A_PlaySound("weapons/plasmashotgunspark", 7)
    PSHO F 6 A_GunFlash ("ReloadFlash", GFF_NOEXTCHANGE)
    PSHO F 3
	PSHO E 3
	PSHO A 4
	Goto Ready
  ReloadFinish2:
    PSHO E 2
    PSHO F 2
    TNT1 A 0 A_PlaySound("weapons/plasmashotgunspark", 7)
    PSHO F 6 A_GunFlash ("ReloadFlash", GFF_NOEXTCHANGE)
    PSHO F 2
	PSHO E 3
	PSHO A 4
	Goto Ready
  ReloadFinish3:
    PSHO E 2
    PSHO F 2
    TNT1 A 0 A_PlaySound("weapons/plasmashotgunspark", 7)
    PSHO F 6 A_GunFlash ("ReloadFlash", GFF_NOEXTCHANGE)
    PSHO F 2
	PSHO E 3
	PSHO A 4
	Goto Ready
  ReloadFinish4:
    PSHO E 2
    PSHO F 2
    TNT1 A 0 A_PlaySound("weapons/plasmashotgunspark", 7)
    PSHO F 6 A_GunFlash ("ReloadFlash", GFF_NOEXTCHANGE)
    PSHO F 2
	PSHO E 2
	PSHO A 2
	Goto Ready
  Flash:
    TNT1 A 4 A_Light2
    TNT1 A 1 A_Light1
    Goto LightDone
  ReloadFlash:
    PSHO G 2 Bright A_Light (3)
    PSHO H 2 Bright A_Light2
    PSHO I 2 Bright A_Light1
    Goto LightDone
  Spawn:
	TNT1 A 0 NoDelay A_SpawnItemEx("RLPlasmaShotgunPickup",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("RLHeavyPlasmaShotgunConfirm",1, "CancelAssembly")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaticShrapnelPlasmaShotgunConfirm",1, "CancelAssembly")
	TNT1 A 0 A_JumpIfInventory("RLNanoShrapnelPlasmaShotgunConfirm",1, "CancelAssembly")
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunMkIIConfirm",1, "CancelAssembly")
	TNT1 A 0 A_JumpIfInventory("RLVoltgunConfirm",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("RLHeavyPlasmaShotgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLPlasmaticShrapnelPlasmaShotgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLNanoShrapnelPlasmaShotgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgunMkIIConfirm",1)
	TNT1 A 0 A_TakeInventory("RLVoltgunConfirm",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("RLPlasmaShotgunModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLHeavyPlasmaShotgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLPlasmaticShrapnelPlasmaShotgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLNanoShrapnelPlasmaShotgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLVoltgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	Goto ScavengerTimeEnd
  ScavengerTime:
	TNT1 A 0 A_GiveInventory("RLScavengingExtraEffects", 1)
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunModLimit",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("RLPlasmaShotgunModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLHeavyPlasmaShotgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLPlasmaticShrapnelPlasmaShotgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLNanoShrapnelPlasmaShotgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLVoltgunConfirm",1)
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSelected", 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("RLPlasmaShotgun",1)
	Stop
  AssembleHeavyPlasmaShotgun:
	TNT1 A 0 A_JumpIfInventory("RLHeavyPlasmaShotgun",1, "AlreadyHaveAssembly")
	TNT1 A 0 A_GiveInventory("RLDangerLevelBasicGiver",1, AAPTR_PLAYER1)
	TNT1 A 0 A_Print("\cvHeavy Plasma Shotgun \c-assembled.")
    TNT1 A 0 A_PlaySound("weapons/assembly", CHAN_ITEM)
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSelected", 1)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLHeavyPlasmaShotgunConfirm",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("RLHeavyPlasmaShotgun",1)
	TNT1 A 0 A_SelectWeapon("RLHeavyPlasmaShotgun")
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgun",1)
	Stop
  AssemblePlasmaticShrapnelPlasmaShotgun:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaticShrapnelPlasmaShotgun",1, "AlreadyHaveAssembly")
	TNT1 A 0 A_GiveInventory("RLDangerLevelBasicGiver",1, AAPTR_PLAYER1)
	TNT1 A 0 A_Print("\cvOvercharged Plasma Shotgun \c-assembled.")
    TNT1 A 0 A_PlaySound("weapons/assembly", CHAN_ITEM)
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSelected", 1)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLPlasmaticShrapnelPlasmaShotgunConfirm",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("RLPlasmaticShrapnelPlasmaShotgun",1)
	TNT1 A 0 A_SelectWeapon("RLPlasmaticShrapnelPlasmaShotgun")
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgun",1)
	Stop
  AssembleNanoShrapnelPlasmaShotgun:
	TNT1 A 0 A_JumpIfInventory("RLNanoShrapnelPlasmaShotgun",1, "AlreadyHaveAssembly")
	TNT1 A 0 A_GiveInventory("RLDangerLevelAdvancedGiver",1, AAPTR_PLAYER1)
	TNT1 A 0 A_Print("\cvNano Plasma Shotgun \c-assembled.")
    TNT1 A 0 A_PlaySound("weapons/assembly", CHAN_ITEM)
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSelected", 1)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLNanoShrapnelPlasmaShotgunConfirm",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("RLNanoShrapnelPlasmaShotgun",1)
	TNT1 A 0 A_SelectWeapon("RLNanoShrapnelPlasmaShotgun")
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgun",1)
	Stop
  AssemblePlasmaShotgunMkII:
	TNT1 A 0 A_JumpIfInventory("RLPlasmaShotgunMkII",1, "AlreadyHaveAssembly")
	TNT1 A 0 A_GiveInventory("RLDangerLevelAdvancedGiver",1, AAPTR_PLAYER1)
	TNT1 A 0 A_Print("\cvPlasma Shotgun Mk. II \c-assembled.")
    TNT1 A 0 A_PlaySound("weapons/assembly", CHAN_ITEM)
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSelected", 1)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgunMkIIConfirm",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("RLPlasmaShotgunMkII",1)
	TNT1 A 0 A_SelectWeapon("RLPlasmaShotgunMkII")
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgun",1)
	Stop
  AssembleVoltgun:
	TNT1 A 0 A_JumpIfInventory("RLVoltgun",1, "AlreadyHaveAssembly")
	TNT1 A 0 A_GiveInventory("RLDangerLevelMasterGiver",1, AAPTR_PLAYER1)
	TNT1 A 0 A_Print("\cvVoltgun \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_JumpIfInventory("RLShellshockPerk",1, 2)
	TNT1 A 0 A_Jump(256, 2)
    TNT1 A 0 A_PlaySound("renegade/laugh", CHAN_VOICE)
    TNT1 A 0 A_PlaySound("weapons/masterassemblyfanfare", CHAN_AUTO)
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSelected", 1)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunModLimit", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunPowerMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunBulkMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunAgilityMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunTechnicalMod", 4)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLPlasmaShotgunNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLVoltgunConfirm",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("RLVoltgun",1)
	TNT1 A 0 A_SelectWeapon("RLVoltgun")
	TNT1 A 0 A_TakeInventory("RLPlasmaShotgun",1)
	Stop
  }
}

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

ACTOR RLPlasmaShotgunBall : PlasmaBall
{
	Species "Player"
	+THRUSPECIES
	+THRUGHOST
	+FORCEXYBILLBOARD
	Radius 4
	Height 2
	Alpha 0.85
	Scale 0.25
	Speed 50
	Damage (5 * random(1,5))
	Decal "RailScorch"
	Damagetype "Plasma"
	SeeSound ""
	DeathSound "weapons/plasmashotgunimpact"
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(CallACS("DRLA_FancyProjectiles") == 1, "Spawn.Fancy")
		Spawn.Normal:
			PLSS AB 6 Bright
			Loop
		Spawn.Fancy:
			PLSS AAAABBBB 1 Bright A_SpawnItemEx("RLPlasmaShotgunFancyTrail")
			Loop
			
	}
}

ACTOR RLPlasmaShotgunFancyTrail
{
	Renderstyle Add
	Scale 0.2
	Alpha 0.3
	+NOINTERACTION
	+FORCEXYBILLBOARD
	States
	{
		Spawn:
			PLFT AAAABBBCCD 1 Bright A_SetScale(scalex - 0.1)
			Stop
	}
}

ACTOR RLPlasmaShotgunBallSilent : RLPlasmaShotgunBall
{
  SeeSound ""
  DeathSound ""
}

ACTOR RLPlasmaShotgunBallP : RLPlasmaShotgunBall
{
  Damage (6 * random(1,5))
}

ACTOR RLPlasmaShotgunBallPSilent : RLPlasmaShotgunBallP
{
  SeeSound ""
  DeathSound ""
}

ACTOR RLPlasmaShotgunBallPP : RLPlasmaShotgunBall
{
  Damage (7 * random(1,5))
}

ACTOR RLPlasmaShotgunBallPPSilent : RLPlasmaShotgunBallPP
{
  SeeSound ""
  DeathSound ""
}

ACTOR RLPlasmaShotgunBallPPP : RLPlasmaShotgunBall
{
  Damage (8 * random(1,5))
}

ACTOR RLPlasmaShotgunBallPPPSilent : RLPlasmaShotgunBallPPP
{
  SeeSound ""
  DeathSound ""
}

ACTOR RLPlasmaShotgunBallPPPP : RLPlasmaShotgunBall
{
  Damage (9 * random(1,5))
}

ACTOR RLPlasmaShotgunBallPPPPSilent : RLPlasmaShotgunBallPPPP
{
  SeeSound ""
  DeathSound ""
}

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

Actor RLPlasmaShotgunSelected : RLPermanentInventory {}

Actor RLPlasmaShotgunModLimit : RLStandardModAmount {}
Actor RLPlasmaShotgunPowerMod : RLStandardModAmount {}
Actor RLPlasmaShotgunBulkMod : RLStandardModAmount {}
Actor RLPlasmaShotgunAgilityMod : RLStandardModAmount {}
Actor RLPlasmaShotgunTechnicalMod : RLStandardModAmount {}
Actor RLPlasmaShotgunNanoMod : RLExoticModAmount {}
Actor RLPlasmaShotgunFirestormMod : RLExoticModAmount {}
Actor RLPlasmaShotgunSniperMod : RLExoticModAmount {}

ACTOR RLPlasmaShotgunClip : Ammo
{
   +INVENTORY.IGNORESKILL
   Inventory.MaxAmount 66
   Inventory.Icon ""
}

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

ACTOR RLPlasmaShotgunPickup : RLExoticWeaponPickup 16906
{
	//$Sprite PSHOX0
	Tag "Plasma Shotgun [Pickup]"
	States
	{
	SpawnFrame:
		PSHO X 4
	SpawnLoop:
		"####" "#" 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	FloorHit:
		"####" "#" 0 A_PlaySound("weapons/gundropmedium")
		"####" "#" 0 A_ScaleVelocity (0.5)
		"####" "#" 0 A_ChangeFlag("SPECIAL", true)
		"####" "#" 0 A_ChangeFlag("THRUACTORS", false)
		"####" "#" 0 A_SetUserVar("user_floorhit", 1)
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Stop
	Pickup:
		"####" "#" 0
		"####" "#" 0 A_JumpIfInventory("RLSynthFireReload",1,"AmmoPickup") // If the player is holding reload, pickup the gun for ammo.
		"####" "#" 0 A_JumpIfInventory("RLPlasmaShotgun",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("RLPlasmaShotgun",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_Print("\ccPicked up a \ctPlasma Shotgun.")
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_Jump(256, "NotPickupNothing")
		Goto NotPickupNothing
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("Cell",0,"NotPickupNothing")
		Goto AmmoPickup
	NotPickupNothing:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\ct= Plasma Shotgun =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup_NoPrint:
		"####" "#" 0
		Fail
	AmmoPickup:
		"####" "#" 0
		"####" "#" 0 A_JumpIfInventory("Cell",0,"NotPickupNothing")
		"####" "#" 1 A_GiveInventory("Cell",30)
		Goto PickupSound
	PickupSound:
		"####" "#" 0 A_PlaySound("weapons/PlasmaShotgunpickup")
		Stop
//==============================================================================
	MarathonStuff:
		"####" "#" 0 A_SpawnItemEx("RLMarathonClip",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
	}
}

ACTOR RLPlasmaShotgunPickupModded : RLPlasmaShotgunPickup
{
	+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:
		PSHO 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("RLPlasmaShotgun",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("RLPlasmaShotgun",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_Print("\ccPicked up a \cbmodded \ctPlasma Shotgun.")
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\ct= Plasma Shotgun =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("RLPlasmaShotgunModLimit", 1, "NotPickup_Modded")
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\ct= Plasma Shotgun =\n\n\ccYou replace your unmodded\n\ccweapon with the one you picked up.", 5, "CONFONT")
		"####" "#" 0 A_GiveInventory("Cell",30)
		Goto PickupSound
	NotPickup_Modded:
		"####" "#" 0 A_Print("\ct= Plasma Shotgun =\n\n\caYou are already carrying a modded\n\caweapon of this type", 5, "CONFONT")
		Fail
	}
}
