
// This gun is ten tons of absolutely fucked. Like, it does whatever the fuck it wants, even if such a thing is impossible.
// Anyone who wants to try and fix it, good luck, the script fucking this over has eluded both Kyle873 and marrub.
//																								- Yholl

ACTOR RLMarathonShotguns : RLMarathonWeapon
{
  Inventory.Pickupsound "weapons/unique"
  Obituary "%o was murdered by %k's WSTE-M5 shotgun."
  Decal BulletChip
  Tag "WSTE-M5 Shotguns"
  Weapon.Kickback 50
  Weapon.SelectionOrder 11
  Weapon.SlotNumber 3
  Weapon.AmmoUse1 2
  Weapon.AmmoGive1 0
  Weapon.AmmoType1 "RLMarathonShotgunsClip1"
  Weapon.AmmoType2 "Shell"
  Inventory.Icon "WSTEICO2"
  States
  {
  Ready:
	TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown",1,"MisfirePrevention")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsDemonArtifacts",1,"ReadyDualActivation")
    WSTE A 1 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
    Loop
  ReadyDualActivation:
    WSTE R 1
	TNT1 A 0 A_GunFlash ("Flash", GFF_NOEXTCHANGE)
    Goto ReadyLeft
  AfterReload:
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsDemonArtifacts",1,"ReadyDualActivation")
    WSTE A 8 A_WeaponReady (WRF_ALLOWZOOM)
    Goto Ready
	
  ScavengerDrop:
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop",1,"WeaponDropConfirm")
	TNT1 A 0 A_GiveInventory("RLScavengerDrop",1)
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsDemonArtifacts",1, 2)
	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
	TNT1 A 0 A_Print("Press again to drop one of your WSTE-M5s,\n\n\crYou cannot scavenge while dual wielding\c-\nDrop a WSTE-M5 to scavenge a single gun.")
	Goto AfterModDropDual
  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("RLMarathonShotgunsDemonArtifacts",1, "WeaponDropDual")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsModLimit", 1, "WeaponDropModded")
	TNT1 A 0 A_SpawnItemEx("RLMarathonShotgunsPickup", 0, 0, 40, 12, 0, 0, 0, SXF_SETMASTER)
	Goto WeaponDropRemoval
  WeaponDropModded:
	TNT1 A 2 A_SpawnItemEx("RLMarathonShotgunsPickupModded", 0, 0, 40, 12, 0, 0, 0, SXF_SETMASTER)
	Goto WeaponDropRemoval
  WeaponDropRemoval:
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsModLimit", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsPowerMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsBulkMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsAgilityMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsTechnicalMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsSniperMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsFirestormMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsNanoMod", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLMarathonShotgunsSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 1 A_TakeInventory("RLMarathonShotguns",1)
	Stop
  WeaponDropDual:
	TNT1 A 0 A_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 A_SpawnItemEx("RLMarathonShotgunsPickup", 0, 0, 40, 12, 0, 0, 0, SXF_SETMASTER)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsDemonArtifacts", 1)
	Goto AfterModDrop
  AfterModDrop:
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsDemonArtifacts",1,"AfterModDropDual")
    WSTE A 8 A_WeaponReady (WRF_ALLOWRELOAD)
    Goto Ready
  AfterModDropDual:
    WST3 A 8
    Goto ReadyLeft
  MisfirePrevention:
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsDemonArtifacts",1,3)
    WSTE A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
    WSTE R 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsDemonArtifacts",1,"ReadyDualActivation")
    Goto Ready
	
  Deselect:
	TNT1 A 0
	TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
	TNT1 A 0 A_TakeInventory("RLMarathonShotgunsSelected", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
  DeselectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "DeselectRenegade")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsDemonArtifacts",1,"DeselectDual")
    TNT1 AA 0 A_Lower
    WSTE A 1 A_Lower
    Goto DeselectLoop
  DeselectRenegade:
    TNT1 A 0 A_Lower
    loop
  DeselectDual:
    TNT1 AA 0 A_Lower
    WST3 A 1 A_Lower
    loop
  SelectRenegade: 
    TNT1 A 0 A_Raise
    loop
  SelectSetWeapon:
	TNT1 A 0 A_GiveInventory("RLShotgunTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLMultiAmmoWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLUniqueWeaponToken", 1)
	TNT1 A 0 A_GiveInventory("RLMarathonShotgunsSelected", 1)
    Goto SelectLoop
  SelectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "SelectRenegade")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsDemonArtifacts",1,"SelectDual")
    TNT1 AA 0 A_Raise
    WSTE A 1 A_Raise
    Loop
  SelectDual:
    TNT1 AA 0 A_Raise
    WSTE R 1 A_Raise
    Goto SelectDual
  Fire:
	
	WSTE A 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"MeleeRestricted") // Cannot fire in levels that restrict it
	WSTE A 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"SilencedRestricted") // Cannot fire in levels that restrict it
	WSTE A 0 A_JumpIfInventory("RLRestrictionBoomOnly",1,"BoomRestricted") // Cannot fire in levels that restrict it
	WSTE A 0 A_JumpIfInventory("RLRestrictionHighTechOnly",1,"HighTechRestricted") // Cannot fire in levels that restrict it
	WSTE A 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"CunningRestricted") // Cannot fire in levels that restrict it
	
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsDemonArtifacts",1,"ReadyDualActivation")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsClip1", 2, 1)
	Goto Reload
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsNanoMod",1,"FireN")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsFirestormMod",1,"FireF")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsSniperMod",1,"FireS")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsBulkMod",1,"FireB")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsPowerMod",1,"FireP")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsAgilityMod",1,"FireA")
//========  X  =================================================================
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegade")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFire")
	TNT1 A 0 A_FireBullets (8, 8, 10, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinish
  AuthenticFire:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinish
  FireRenegade:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (8, 8, 15, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinish
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinish
//========  P  =================================================================
  FireP:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeP")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireP")
	TNT1 A 0 A_FireBullets (8, 8, 10, random(26,30), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinish
  AuthenticFireP:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBulletP",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinish
  FireRenegadeP:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (8, 8, 15, random(26,30), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinish
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBulletP",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinish
//========  A  =================================================================
  FireA:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeA")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireA")
	TNT1 A 0 A_FireBullets (2, 2, 10, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinish
  AuthenticFireA:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-1,1),0,0,0,0,frandom(-1,1))
    Goto FireFinish
  FireRenegadeA:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (2, 2, 15, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinish
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-1,1),0,0,0,0,frandom(-1,1))
    Goto FireFinish
//========  B  =================================================================
  FireB:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeB")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireB")
	TNT1 A 0 A_FireBullets (8, 8, 16, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinish
  AuthenticFireB:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinish
  FireRenegadeB:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (8, 8, 24, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinish
    TNT1 AAAAAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinish
//========  F  =================================================================
  FireF:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeF")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireF")
	TNT1 A 0 A_FireBullets (8, 8, 10, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishF
  AuthenticFireF:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishF
  FireRenegadeF:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "FireRenegadeAuthenticF")
	TNT1 A 0 A_FireBullets (8, 8, 15, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishF
  FireRenegadeAuthenticF:
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishF
//========  N  =================================================================
  FireN:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeN")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireN")
	TNT1 A 0 A_FireBullets (6, 6, 10, random(20,24), "RLMarathonShotgunPuffN", FBF_NORANDOM)
    Goto FireFinish
  AuthenticFireN:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBulletN",frandom(-3,3),0,0,0,0,frandom(-3,3))
    Goto FireFinish
  FireRenegadeN:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (6, 6, 15, random(20,24), "RLMarathonShotgunPuffN", FBF_NORANDOM)
    Goto FireFinish
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBulletN",frandom(-3,3),0,0,0,0,frandom(-3,3))
    Goto FireFinish
//========  S  =================================================================
  FireS:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeS")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireS")
	TNT1 A 0 A_FireBullets (frandom(0.8,1.4), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
	TNT1 A 0 A_FireBullets (frandom(-1.4,-0.8), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
    Goto FireFinish
  AuthenticFireS:
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(0.4,0.7),0,0,0,0,frandom(-0.2,0.2))
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(-0.7,-0.4),0,0,0,0,frandom(-0.2,0.2))
    Goto FireFinish
  FireRenegadeS:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 5)
	TNT1 A 0 A_FireBullets (frandom(0.8,1.4), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
	TNT1 A 0 A_FireBullets (frandom(-0.4,0.4), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
	TNT1 A 0 A_FireBullets (frandom(-1.4,-0.8), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
    Goto FireFinish
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(0.4,0.7),0,0,0,0,frandom(-0.2,0.2))
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(-0.2,0.2),0,0,0,0,frandom(-0.2,0.2))
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(-0.7,-0.4),0,0,0,0,frandom(-0.2,0.2))
    Goto FireFinish
	
  FireFinish:
    TNT1 A 0 A_JumpIfInventory ("RLRenegadeExtraShot", 1, 2)
	TNT1 A 0 A_TakeInventory("RLMarathonShotgunsClip1", 2)
    TNT1 A 0 A_TakeInventory ("RLRenegadeExtraShot", 1)
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "FireFinishClassicSound")
	Goto FireFinishStandardSound
  FireFinishClassicSound:
    TNT1 A 0 A_PlaySound("marathon/classicshotgun", CHAN_WEAPON, 1, 0, 0.5)
    TNT1 A 0 A_PlaySound("marathon/classicshotgun", 7, 0.05, 0, 0.20)
	Goto FireFinishStandardEnd
  FireFinishStandardSound:
    TNT1 A 0 A_PlaySound("marathon/shotgun", CHAN_WEAPON, 1, 0, 0.5)
    TNT1 A 0 A_PlaySound("marathon/shotgun", 7, 0.05, 0, 0.20)
	Goto FireFinishStandardEnd
  FireFinishStandardEnd:
    TNT1 A 0 A_SpawnItemEx ("RLDoubleShotgunRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    WSTE B 4 Bright A_Light(3)
    WSTE C 4 Bright A_Light2
    WSTE D 4 Bright A_Light1
    TNT1 A 0 A_Light0
    WSTE EE 1 A_Refire ("Reload")
    Goto Ready
  FireFinishF:
    TNT1 A 0 A_JumpIfInventory ("RLRenegadeExtraShot", 1, 2)
	TNT1 A 0 A_TakeInventory("RLMarathonShotgunsClip1", 2)
    TNT1 A 0 A_TakeInventory ("RLRenegadeExtraShot", 1)
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "FireFinishFClassicSound")
	Goto FireFinishFStandardSound
  FireFinishFClassicSound:
    TNT1 A 0 A_PlaySound("marathon/classicshotgun", CHAN_WEAPON, 1, 0, 0.5)
    TNT1 A 0 A_PlaySound("marathon/classicshotgun", 7, 0.05, 0, 0.20)
	Goto FireFinishFStandardEnd
  FireFinishFStandardSound:
    TNT1 A 0 A_PlaySound("marathon/shotgun", CHAN_WEAPON, 1, 0, 0.5)
    TNT1 A 0 A_PlaySound("marathon/shotgun", 7, 0.05, 0, 0.20)
	Goto FireFinishFStandardEnd
  FireFinishFStandardEnd:
    TNT1 A 0 A_SpawnItemEx ("RLDoubleShotgunRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    WSTE B 2 Bright A_Light(3)
    WSTE C 1 Bright A_Light2
    WSTE D 1 Bright A_Light1
    TNT1 A 0 A_Light0
    WSTE EE 1 A_Refire ("Reload")
    Goto Ready
	
  Reload:
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsDemonArtifacts",1,"ReadyDualActivation")
	WSTE A 1 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsClip1", 2, "AfterReload")
	TNT1 A 0 A_JumpIfInventory("Shell", 2, "ReloadSequence")
	Goto AfterReload
  ReloadSequence:
	TNT1 A 0 // Play the reload animation.
    TNT1 A 0 A_SpawnItemEx ("RLShotgunPumpRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsFirestormMod",1,"ReloadF")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsTechnicalMod",1,"Reload1")
    TNT1 A 0 A_PlaySound("marathon/shotgunreload", 7)
    WSTE F 1
    WSTE G 2
    WSTE H 2
    WSTE I 3
    WSTE J 3
	Goto ReloadWorking
  Reload1:
    TNT1 A 0 A_PlaySound("marathon/shotgunreload", 7)
    WSTE F 1
    WSTE G 1
    WSTE H 2
    WSTE I 2
    WSTE J 2
	Goto ReloadWorking
  ReloadF:
    TNT1 A 0 A_PlaySound("marathon/shotgunfastreload", 7)
    WSTE F 1
    WSTE G 1
    WSTE H 1
    WSTE I 1
    WSTE J 1
	Goto ReloadWorking
  ReloadWorking:
	TNT1 A 0 A_TakeInventory("Shell", 2, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_GiveInventory("RLMarathonShotgunsClip1", 2)
	Goto ReloadFinish
  ReloadFinish:
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsFirestormMod",1,"ReloadFinishF")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsTechnicalMod",1,"ReloadFinish1")
    WSTE K 3
    WSTE L 3
    WSTE M 3
    WSTE N 2
    WSTE O 1
    WSTE P 1
    WSTE Q 1
    WSTE A 4
	Goto Ready
  ReloadFinish1:
    WSTE K 2
    WSTE L 2
    WSTE M 2
    WSTE N 2
    WSTE O 1
    WSTE P 1
    WSTE Q 1
    WSTE A 4
	Goto Ready
  ReloadFinishF:
    WSTE K 1
    WSTE L 1
    WSTE M 1
    WSTE N 1
    WSTE O 1
    WSTE P 1
    WSTE Q 1
    WSTE A 4
	Goto Ready
	
  Spawn:
	TNT1 A 0 NoDelay A_SpawnItemEx("RLMarathonShotgunsPickup",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 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("RLMarathonShotgunsModLimit", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsPowerMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsBulkMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsAgilityMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsTechnicalMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsSniperMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsFirestormMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsNanoMod", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLMarathonShotgunsSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	Goto ScavengerTimeEnd
  ScavengerTime:
	TNT1 A 0 A_GiveInventory("RLScavengingExtraEffects", 1)
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsModLimit",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("RLMarathonShotgunsModLimit", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsPowerMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsBulkMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsAgilityMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsTechnicalMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsSniperMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsFirestormMod", 1)
    TNT1 A 0 A_TakeInventory("RLMarathonShotgunsNanoMod", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLMarathonShotgunsSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_GiveInventory("RLEmitScavengedModUnique", 1) // Determines what mods this can generate when scavenged.
	Goto ScavengerTimeEnd
  ScavengerTimeEnd:
	TNT1 A 1 A_TakeInventory("RLMarathonShotguns",1)
	Stop
//========DUAL ZONE=============================================================
  ReadyLeft:
	TNT1 A 0 A_JumpIfInventory("RLSynthFireReload",1,"ReloadLeft")
	TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireLeft")
    WST3 A 1 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    Loop
  ReadyLeftNoReload:
    WST3 A 1 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    Goto ReadyLeft
  DelayLeft:
    WST3 A 8
    Goto ReadyLeft
  FireLeft:
	
	WSTE A 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"ReadyLeftNoReload") // Cannot fire in levels that restrict it
	WSTE A 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"ReadyLeftNoReload") // Cannot fire in levels that restrict it
	WSTE A 0 A_JumpIfInventory("RLRestrictionBoomOnly",1,"ReadyLeftNoReload") // Cannot fire in levels that restrict it
	WSTE A 0 A_JumpIfInventory("RLRestrictionHighTechOnly",1,"ReadyLeftNoReload") // Cannot fire in levels that restrict it
	WSTE A 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"ReadyLeftNoReload") // Cannot fire in levels that restrict it
	
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsClip1", 2, 1)
	Goto ReloadLeft
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsNanoMod",1,"FireNLeft")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsFirestormMod",1,"FireFLeft")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsSniperMod",1,"FireSLeft")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsBulkMod",1,"FireBLeft")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsPowerMod",1,"FirePLeft")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsAgilityMod",1,"FireALeft")
//========  X  =================================================================
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeLeft")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireLeft")
	TNT1 A 0 A_FireBullets (8, 8, 10, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishLeft
  AuthenticFireLeft:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishLeft
  FireRenegadeLeft:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (8, 8, 15, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishLeft
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishLeft
//========  P  =================================================================
  FirePLeft:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadePLeft")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFirePLeft")
	TNT1 A 0 A_FireBullets (8, 8, 10, random(26,30), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishLeft
  AuthenticFirePLeft:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBulletP",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishLeft
  FireRenegadePLeft:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (8, 8, 15, random(26,30), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishLeft
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBulletP",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishLeft
//========  A  =================================================================
  FireALeft:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeALeft")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireALeft")
	TNT1 A 0 A_FireBullets (2, 2, 10, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishLeft
  AuthenticFireALeft:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-1,1),0,0,0,0,frandom(-1,1))
    Goto FireFinishLeft
  FireRenegadeALeft:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (2, 2, 15, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishLeft
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-1,1),0,0,0,0,frandom(-1,1))
    Goto FireFinishLeft
//========  B  =================================================================
  FireBLeft:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeBLeft")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireBLeft")
	TNT1 A 0 A_FireBullets (8, 8, 16, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishLeft
  AuthenticFireBLeft:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishLeft
  FireRenegadeBLeft:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (8, 8, 24, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishLeft
    TNT1 AAAAAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishLeft
//========  F  =================================================================
  FireFLeft:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeFLeft")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireFLeft")
	TNT1 A 0 A_FireBullets (8, 8, 10, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishLeft
  AuthenticFireFLeft:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishLeft
  FireRenegadeFLeft:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "FireRenegadeAuthenticFLeft")
	TNT1 A 0 A_FireBullets (8, 8, 15, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishLeft
  FireRenegadeAuthenticFLeft:
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishLeft
//========  N  =================================================================
  FireNLeft:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeNLeft")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireNLeft")
	TNT1 A 0 A_FireBullets (6, 6, 10, random(20,24), "RLMarathonShotgunPuffN", FBF_NORANDOM)
    Goto FireFinishLeft
  AuthenticFireNLeft:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBulletN",frandom(-3,3),0,0,0,0,frandom(-3,3))
    Goto FireFinishLeft
  FireRenegadeNLeft:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (6, 6, 15, random(20,24), "RLMarathonShotgunPuffN", FBF_NORANDOM)
    Goto FireFinishLeft
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBulletN",frandom(-3,3),0,0,0,0,frandom(-3,3))
    Goto FireFinishLeft
//========  S  =================================================================
  FireSLeft:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSLeft")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireSLeft")
	TNT1 A 0 A_FireBullets (frandom(0.8,1.4), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
	TNT1 A 0 A_FireBullets (frandom(-1.4,-0.8), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
    Goto FireFinishLeft
  AuthenticFireSLeft:
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(0.4,0.7),0,0,0,0,frandom(-0.2,0.2))
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(-0.7,-0.4),0,0,0,0,frandom(-0.2,0.2))
    Goto FireFinishLeft
  FireRenegadeSLeft:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 5)
	TNT1 A 0 A_FireBullets (frandom(0.8,1.4), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
	TNT1 A 0 A_FireBullets (frandom(-0.4,0.4), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
	TNT1 A 0 A_FireBullets (frandom(-1.4,-0.8), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
    Goto FireFinishLeft
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(0.4,0.7),0,0,0,0,frandom(-0.2,0.2))
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(-0.2,0.2),0,0,0,0,frandom(-0.2,0.2))
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(-0.7,-0.4),0,0,0,0,frandom(-0.2,0.2))
    Goto FireFinishLeft
	
  FireFinishLeft:
    TNT1 A 0 A_JumpIfInventory ("RLRenegadeExtraShot", 1, 2)
	TNT1 A 0 A_TakeInventory("RLMarathonShotgunsClip1", 2)
    TNT1 A 0 A_TakeInventory ("RLRenegadeExtraShot", 1)
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "FireFinishLeftClassicSound")
	Goto FireFinishLeftSound
  FireFinishLeftSound:
    TNT1 A 0 A_PlaySound("marathon/shotgun", CHAN_WEAPON, 1, 0, 0.5)
    TNT1 A 0 A_PlaySound("marathon/shotgun", 7, 0.05, 0, 0.20)
	Goto FireFinishLeftSoundDone
  FireFinishLeftClassicSound:
    TNT1 A 0 A_PlaySound("marathon/classicshotgun", CHAN_WEAPON, 1, 0, 0.5)
    TNT1 A 0 A_PlaySound("marathon/classicshotgun", 7, 0.05, 0, 0.20)
	Goto FireFinishLeftSoundDone
	
  FireFinishLeftSoundDone:
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsFirestormMod",1,"FireFinishFLeftSoundDone")
    WST3 B 4 Bright A_Light(3)
    WST3 C 4 Bright A_Light2
    WST3 D 4 Bright A_Light1
    TNT1 A 0 A_Light0
	WST3 EE 1 A_JumpIfInventory("RLSynthFireLeft",1,"ReloadLeft")
    Goto ReadyLeft
  FireFinishFLeftSoundDone:
    WST3 B 2 Bright A_Light(3)
    WST3 C 1 Bright A_Light2
    WST3 D 1 Bright A_Light1
    TNT1 A 0 A_Light0
	WST3 EE 1 A_JumpIfInventory("RLSynthFireLeft",1,"ReloadLeft")
    Goto ReadyLeft
	
  ReloadLeft:
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsClip1", 2, "ReadyLeftNoReload")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsReloading2", 1, 2)
	TNT1 A 0 A_JumpIfInventory("Shell", 2, "ReloadSequenceLeft")
	Goto ReadyLeftNoReload
	TNT1 A 0 A_JumpIfInventory("Shell", 4, "ReloadSequenceLeft")
	Goto ReadyLeftNoReload
  ReloadSequenceLeft:
	TNT1 A 0 // Play the reload animation.
	TNT1 A 0 A_GiveInventory("RLMarathonShotgunsReloading1", 1)
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsFirestormMod",1,"ReloadFLeft")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsTechnicalMod",1,"Reload1Left")
    TNT1 A 0 A_PlaySound("marathon/shotgunreload", 7)
    WST3 F 1
    WST3 G 2
    WST3 H 2
    WST3 I 3
    WST3 J 3
	Goto ReloadWorkingLeft
  Reload1Left:
    TNT1 A 0 A_PlaySound("marathon/shotgunreload", 7)
    WST3 F 1
    WST3 G 1
    WST3 H 2
    WST3 I 2
    WST3 J 2
	Goto ReloadWorkingLeft
  ReloadFLeft:
    TNT1 A 0 A_PlaySound("marathon/shotgunfastreload", 7)
    WST3 F 1
    WST3 G 1
    WST3 H 1
    WST3 I 1
    WST3 J 1
	Goto ReloadWorkingLeft
  ReloadWorkingLeft:
	TNT1 A 0 A_TakeInventory("Shell", 2, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_GiveInventory("RLMarathonShotgunsClip1", 2)
	TNT1 A 0 A_TakeInventory("RLMarathonShotgunsReloading1", 1)
	Goto ReloadFinishLeft
  ReloadFinishLeft:
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsFirestormMod",1,"ReloadFinishFLeft")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsTechnicalMod",1,"ReloadFinish1Left")
    WST3 K 3
    WST3 L 3
    WST3 M 3
    WST3 N 2
    WST3 O 1
    WST3 P 1
    WST3 Q 1
    WST3 A 4
	Goto ReadyLeft
  ReloadFinish1Left:
    WST3 K 2
    WST3 L 2
    WST3 M 2
    WST3 N 2
    WST3 O 1
    WST3 P 1
    WST3 Q 1
    WST3 A 4
	Goto ReadyLeft
  ReloadFinishFLeft:
    WST3 K 1
    WST3 L 1
    WST3 M 1
    WST3 N 1
    WST3 O 1
    WST3 P 1
    WST3 Q 1
    WST3 A 4
	Goto ReadyLeft
//========FLASH ZONE============================================================
  Flash:
    TNT1 A 0
  ReadyRight:
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop",1,"ReadyRightPlsNoDisappearIntoTheWarp")
	TNT1 A 0 A_JumpIfInventory("RLSynthFireReload",1,"ReloadRight")
	TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireRight")
    WST2 A 1
    Loop
  ReadyRightPlsNoDisappearIntoTheWarp: // fuck I'm stoopid
//	TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"ScavengerTime")
    WST2 A 1
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop",1,"ReadyRightPlsNoDisappearIntoTheWarp")
    Goto ReadyRight
  ReadyRightNoReload:
    WST2 A 1
    Goto ReadyRight
  DelayRight:
    WST2 A 8
    Goto ReadyRight
  FireRight:
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate",1, "ArmorModConversionDual")
	
	WSTE A 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"ReadyRightNoReload") // Cannot fire in levels that restrict it
	WSTE A 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"ReadyRightNoReload") // Cannot fire in levels that restrict it
	WSTE A 0 A_JumpIfInventory("RLRestrictionBoomOnly",1,"ReadyRightNoReload") // Cannot fire in levels that restrict it
	WSTE A 0 A_JumpIfInventory("RLRestrictionHighTechOnly",1,"ReadyRightNoReload") // Cannot fire in levels that restrict it
	WSTE A 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"ReadyRightNoReload") // Cannot fire in levels that restrict it
	
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsClip2", 2, 1)
	Goto ReloadRight
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsNanoMod",1,"FireNRight")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsFirestormMod",1,"FireFRight")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsSniperMod",1,"FireSRight")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsBulkMod",1,"FireBRight")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsPowerMod",1,"FirePRight")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsAgilityMod",1,"FireARight")
//========  X  =================================================================
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeRight")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireRight")
	TNT1 A 0 A_FireBullets (8, 8, 10, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishRight
  AuthenticFireRight:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishRight
  FireRenegadeRight:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (8, 8, 15, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishRight
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishRight
//========  P  =================================================================
  FirePRight:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadePRight")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFirePRight")
	TNT1 A 0 A_FireBullets (8, 8, 10, random(26,30), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishRight
  AuthenticFirePRight:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBulletP",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishRight
  FireRenegadePRight:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (8, 8, 15, random(26,30), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishRight
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBulletP",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishRight
//========  A  =================================================================
  FireARight:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeARight")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireARight")
	TNT1 A 0 A_FireBullets (2, 2, 16, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishRight
  AuthenticFireARight:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-1,1),0,0,0,0,frandom(-1,1))
    Goto FireFinishRight
  FireRenegadeARight:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (2, 2, 24, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishRight
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-1,1),0,0,0,0,frandom(-1,1))
    Goto FireFinishRight
//========  B  =================================================================
  FireBRight:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeBRight")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireBRight")
	TNT1 A 0 A_FireBullets (8, 8, 16, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishRight
  AuthenticFireBRight:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishRight
  FireRenegadeBRight:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (8, 8, 24, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishRight
    TNT1 AAAAAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishRight
//========  F  =================================================================
  FireFRight:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeFRight")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireFRight")
	TNT1 A 0 A_FireBullets (8, 8, 10, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishRight
  AuthenticFireFRight:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishRight
  FireRenegadeFRight:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "FireRenegadeAuthenticFRight")
	TNT1 A 0 A_FireBullets (8, 8, 15, random(20,24), "RLMarathonPuff", FBF_NORANDOM)
    Goto FireFinishRight
  FireRenegadeAuthenticFRight:
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBullet",frandom(-4,4),0,0,0,0,frandom(-4,4))
    Goto FireFinishRight
//========  N  =================================================================
  FireNRight:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeNRight")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireNRight")
	TNT1 A 0 A_FireBullets (6, 6, 10, random(20,24), "RLMarathonShotgunPuffN", FBF_NORANDOM)
    Goto FireFinishRight
  AuthenticFireNRight:
    TNT1 AAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBulletN",frandom(-3,3),0,0,0,0,frandom(-3,3))
    Goto FireFinishRight
  FireRenegadeNRight:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 3)
	TNT1 A 0 A_FireBullets (6, 6, 15, random(20,24), "RLMarathonShotgunPuffN", FBF_NORANDOM)
    Goto FireFinishRight
    TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("RLMarathonShotgunBulletN",frandom(-3,3),0,0,0,0,frandom(-3,3))
    Goto FireFinishRight
//========  S  =================================================================
  FireSRight:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeSRight")
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "AuthenticFireSRight")
	TNT1 A 0 A_FireBullets (frandom(0.8,1.4), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
	TNT1 A 0 A_FireBullets (frandom(-1.4,-0.8), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
    Goto FireFinishRight
  AuthenticFireSRight:
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(0.4,0.7),0,0,0,0,frandom(-0.2,0.2))
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(-0.7,-0.4),0,0,0,0,frandom(-0.2,0.2))
    Goto FireFinishRight
  FireRenegadeSRight:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, 5)
	TNT1 A 0 A_FireBullets (frandom(0.8,1.4), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
	TNT1 A 0 A_FireBullets (frandom(-0.4,0.4), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
	TNT1 A 0 A_FireBullets (frandom(-1.4,-0.8), frandom(-0.4,0.4), -1, random(200,240), "RLMarathonPuff", FBF_NORANDOM | FBF_EXPLICITANGLE)
    Goto FireFinishRight
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(0.4,0.7),0,0,0,0,frandom(-0.2,0.2))
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(-0.2,0.2),0,0,0,0,frandom(-0.2,0.2))
    TNT1 A 0 A_FireCustomMissile("RLMarathonShotgunBulletS",frandom(-0.7,-0.4),0,0,0,0,frandom(-0.2,0.2))
    Goto FireFinishRight
	
  FireFinishRight:
    TNT1 A 0 A_JumpIfInventory ("RLRenegadeExtraShot", 1, 2)
	TNT1 A 0 A_TakeInventory("RLMarathonShotgunsClip2", 2)
    TNT1 A 0 A_TakeInventory ("RLRenegadeExtraShot", 1)
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "FireFinishRightClassicSound")
	Goto FireFinishRightSound
  FireFinishRightSound:
    TNT1 A 0 A_PlaySound("marathon/shotgun", CHAN_WEAPON, 1, 0, 0.5)
    TNT1 A 0 A_PlaySound("marathon/shotgun", 7, 0.05, 0, 0.20)
	Goto FireFinishRightSoundDone
  FireFinishRightClassicSound:
    TNT1 A 0 A_PlaySound("marathon/classicshotgun", CHAN_WEAPON, 1, 0, 0.5)
    TNT1 A 0 A_PlaySound("marathon/classicshotgun", 7, 0.05, 0, 0.20)
	Goto FireFinishRightSoundDone
	
  FireFinishRightSoundDone:
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsFirestormMod",1,"FireFinishFRightSoundDone")
    WST2 B 4 Bright A_Light(3)
    WST2 C 4 Bright A_Light2
    WST2 D 4 Bright A_Light1
    TNT1 A 0 A_Light0
	WST2 EE 1 A_JumpIfInventory("RLSynthFireRight",1,"ReloadRight")
    Goto ReadyRight
  FireFinishFRightSoundDone:
    WST2 B 2 Bright A_Light(3)
    WST2 C 1 Bright A_Light2
    WST2 D 1 Bright A_Light1
    TNT1 A 0 A_Light0
	WST2 EE 1 A_JumpIfInventory("RLSynthFireRight",1,"ReloadRight")
    Goto ReadyRight
	
  ReloadRight:
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsClip2", 2, "ReadyRightNoReload")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsReloading1", 1, 2)
	TNT1 A 0 A_JumpIfInventory("Shell", 2, "ReloadSequenceRight")
	Goto ReadyRightNoReload
	TNT1 A 0 A_JumpIfInventory("Shell", 4, "ReloadSequenceRight")
	Goto ReadyRightNoReload
  ReloadSequenceRight:
	TNT1 A 0 // Play the reload animation.
	TNT1 A 0 A_GiveInventory("RLMarathonShotgunsReloading2", 1)
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsFirestormMod",1,"ReloadFRight")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsTechnicalMod",1,"Reload1Right")
    TNT1 A 0 A_PlaySound("marathon/shotgunreload", 6)
    WST2 F 1
    WST2 G 2
    WST2 H 2
    WST2 I 3
    WST2 J 3
	Goto ReloadWorkingRight
  Reload1Right:
    TNT1 A 0 A_PlaySound("marathon/shotgunreload", 6)
    WST2 F 1
    WST2 G 1
    WST2 H 2
    WST2 I 2
    WST2 J 2
	Goto ReloadWorkingRight
  ReloadFRight:
    TNT1 A 0 A_PlaySound("marathon/shotgunfastreload", 6)
    WST2 F 1
    WST2 G 1
    WST2 H 1
    WST2 I 1
    WST2 J 1
	Goto ReloadWorkingRight
  ReloadWorkingRight:
	TNT1 A 0 A_TakeInventory("Shell", 2, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_GiveInventory("RLMarathonShotgunsClip2", 2)
	TNT1 A 0 A_TakeInventory("RLMarathonShotgunsReloading2", 1)
	Goto ReloadFinishRight
  ReloadFinishRight:
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsFirestormMod",1,"ReloadFinishFRight")
	TNT1 A 0 A_JumpIfInventory("RLMarathonShotgunsTechnicalMod",1,"ReloadFinish1Right")
    WST2 K 3
    WST2 L 3
    WST2 M 3
    WST2 N 2
    WST2 O 1
    WST2 P 1
    WST2 Q 1
    WST2 A 4
	Goto ReadyRight
  ReloadFinish1Right:
    WST2 K 2
    WST2 L 2
    WST2 M 2
    WST2 N 2
    WST2 O 1
    WST2 P 1
    WST2 Q 1
    WST2 A 4
	Goto ReadyRight
  ReloadFinishFRight:
    WST2 K 1
    WST2 L 1
    WST2 M 1
    WST2 N 1
    WST2 O 1
    WST2 P 1
    WST2 Q 1
    WST2 A 4
	Goto ReadyRight
// Redefined here slightly differently because dual wielding ohnoes
  ArmorModConversionDual:
	"####" "#" 0 A_JumpIfInventory("RLArmorModItemBlue",1, "ArmorModConversionDualBlue")
	"####" "#" 0 A_JumpIfInventory("RLArmorModItemRed",1, "ArmorModConversionDualRed")
	"####" "#" 0 A_TakeInventory("RLArmorModItemActivate",1)
	"####" "#" 0 A_TakeInventory("RLArmorModItemInInventory",1)
	"####" "#" 0 A_TakeInventory("RLArmorModItem",1)
	"####" "#" 0 A_GiveInventory("RLArmorModItemBlue",1)
	"####" "#" 0 A_PlaySound("hud/assemblyconfirm", 5)
	"####" "#" 0 A_Print("Armor Mod converted to \chCombat \c-Mode.")
	"####" "#" 0 A_Jump(256, "DelayRight")
	Goto DelayRight
  ArmorModConversionDualBlue:
	"####" "#" 0 A_TakeInventory("RLArmorModItemActivate",1)
	"####" "#" 0 A_TakeInventory("RLArmorModItemInInventory",1)
	"####" "#" 0 A_TakeInventory("RLArmorModItemBlue",1)
	"####" "#" 0 A_GiveInventory("RLArmorModItemRed",1)
	"####" "#" 0 A_PlaySound("hud/assemblyconfirm", 5)
	"####" "#" 0 A_Print("Armor Mod converted to \cgCommando \c-Mode.")
	"####" "#" 0 A_Jump(256, "DelayRight")
	Goto DelayRight
  ArmorModConversionDualRed:
	"####" "#" 0 A_TakeInventory("RLArmorModItemActivate",1)
	"####" "#" 0 A_TakeInventory("RLArmorModItemInInventory",1)
	"####" "#" 0 A_TakeInventory("RLArmorModItemRed",1)
	"####" "#" 0 A_GiveInventory("RLArmorModItem",1)
	"####" "#" 0 A_PlaySound("hud/assemblyconfirm", 5)
	"####" "#" 0 A_Print("Armor Mod converted to \cdSecurity \c-Mode.")
	"####" "#" 0 A_Jump(256, "DelayRight")
	Goto DelayRight
  NoDualScavenging:
	TNT1 A 0 A_Print("You cannot scrap both guns at once, drop one first.", 6, "CONFONT")
	TNT1 A 0 A_TakeInventory("RLScavengerDrop", 1)
	Goto DelayRight
  FlashDrop:
    TNT1 A 0
	Goto LightDone
  }
}

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

Actor RLMarathonShotgunsSelected : RLPermanentInventory {}

// This isn't actually a demon artifact, it's been renamed to this so that both guns
// can be stored in DRPG's locker successfully.
Actor RLMarathonShotgunsDemonArtifacts : RLPermanentInventory {}

Actor RLMarathonShotgunsReloading1 : RLPermanentInventory {}
Actor RLMarathonShotgunsReloading2 : RLPermanentInventory {}
Actor RLMarathonShotgunsModLimit : RLUniqueModAmount {}
Actor RLMarathonShotgunsPowerMod : RLUniqueModAmount {}
Actor RLMarathonShotgunsBulkMod : RLUniqueModAmount {}
Actor RLMarathonShotgunsAgilityMod : RLUniqueModAmount {}
Actor RLMarathonShotgunsTechnicalMod : RLUniqueModAmount {}
Actor RLMarathonShotgunsNanoMod : RLUniqueModAmount {}
Actor RLMarathonShotgunsFirestormMod : RLUniqueModAmount {}
Actor RLMarathonShotgunsSniperMod : RLUniqueModAmount {}

ACTOR RLMarathonShotgunsClip1 : Ammo
{
   +INVENTORY.IGNORESKILL
   Inventory.MaxAmount 2
   Inventory.Icon ""
}

ACTOR RLMarathonShotgunsClip2 : Ammo
{
   +INVENTORY.IGNORESKILL
   Inventory.MaxAmount 2
   Inventory.Icon ""
}

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

ACTOR RLMarathonShotgunsPickup : RLUniqueWeaponPickup
{
	//$Sprite WSTEX0
	Tag "WSTE-M5 Shotgun [Pickup]"
	Scale 0.3
	States
	{
	SpawnFrame:
		WSTE X 4
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
	SpawnLoop:
		"####" "#" 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	FloorHit:
		"####" "#" 0 A_PlaySound("weapons/gundropmedium")
		"####" "#" 0 A_ScaleVelocity (0.5)
		"####" "#" 0 A_ChangeFlag("SPECIAL", true)
		"####" "#" 0 A_ChangeFlag("THRUACTORS", false)
		"####" "#" 0 A_SetUserVar("user_floorhit", 1)
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Stop
	Pickup:
		"####" "#" 0
		"####" "#" 0 A_JumpIfInventory("RLMarathonShotgunsDemonArtifacts",1,2)
		"####" "#" 0 A_JumpIfInventory("RLMarathonShotguns",1,"DualPickup") // If the player already has this weapon, they are given the second one
		"####" "#" 0 A_JumpIfInventory("RLWeaponLimit",0,"NotPickupLimit") // The absolute max limit check for weapons
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon
	GiveWeapon:
		"####" "#" 0 A_GiveInventory("RLMarathonShotguns",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_GiveInventory("RLUniqueItemFound",1, AAPTR_PLAYER1)
		"####" "#" 0 A_Print("\ccPicked up a \cdWSTE-M5 Shotgun.")
		Goto PickupSound
	DualPickup:
		"####" "#" 0 A_GiveInventory("RLMarathonShotgunsDemonArtifacts",1)
		"####" "#" 0 A_Print("\ccPicked up a second \cdWSTE-M5 Shotgun.")
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_Jump(256, "NotPickup")
		Goto NotPickup
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cd= WSTE-M5 Shotgun =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup_NoPrint:
		"####" "#" 0
		Fail
	PickupSound:
		"####" "#" 0 A_PlaySound("marathon/pickup")
		Stop
//==============================================================================
	MarathonStuff:
		"####" "#" 0 A_SpawnItemEx("RLMarathonShells",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
	SuperweaponStuff:
		"####" "#" 0 A_Jump(256, "NoSpecialStartsStuff")
		Goto NoSpecialStartsStuff
	}
}

ACTOR RLMarathonShotgunsWorldSpawnPickup : RLMarathonShotgunsPickup 17121
{
	States
	{
	NoSpecialStartsStuff:
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamUniqueWorld", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		"####" "#" 0 A_Jump(256, "SpawnFrame")
		Goto SpawnFrame
		
	SpawnFrame:
		TNT1 A 4
		"####" "#" 0 A_GiveInventory("RLUniqueItemSpawnMessageSender",1)
		"####" "#" 0 A_PlaySound("weapons/uniquespawned", 7, 0.25, 0, 0)
		"####" "#" 0 A_Jump(256, "SpawnLoopWaiting")
		Goto SpawnLoopWaiting
	SpawnLoopWaiting:
		"####" "#" 1
		"####" "#" 0 A_CheckSight ("SpawnLoopWaiting")
		Goto CanSeeSpawn
	CanSeeSpawn:
		"####" "#" 1
		"####" "#" 0 A_CheckRange (512, "SpawnLoopWaiting")
		Goto TeleportIn
	TeleportIn:
		"####" "#" 0 A_SetScale (0.00,0.3)
		"####" "#" 0 A_PlaySound ("marathon/teleportin", 7, 1, 0, 0.7)
		WSTE S 1 Bright A_SetScale (scalex+0.02,0.3)
		"####" "#" 0 A_JumpIf (scalex >= 0.3, "FinishTeleport")
		WSTE T 1 Bright A_SetScale (scalex+0.02,0.3)
		"####" "#" 0 A_JumpIf (scalex >= 0.3, "FinishTeleport")
		WSTE U 1 Bright A_SetScale (scalex+0.02,0.3)
		"####" "#" 0 A_JumpIf (scalex >= 0.3, "FinishTeleport")
		WSTE V 1 Bright A_SetScale (scalex+0.02,0.3)
		"####" "#" 0 A_JumpIf (scalex >= 0.3, "FinishTeleport")
		Goto TeleportIn+2
	FinishTeleport:
		"####" "#" 0 A_SetScale (0.3,0.3)
		"####" "#" 0 A_ChangeFlag("SPECIAL", true)
		"####" "#" 0 A_ChangeFlag("THRUACTORS", false)
		Goto SpawnLoopVisible
	SpawnLoopVisible:
		WSTE X 1
		Loop
		
	PickupSound:
		"####" "#" 0 A_PlaySound("marathon/pickup")
		"####" "#" 0 A_GiveInventory("RLDangerLevelUniqueGiver",1, AAPTR_PLAYER1)
		Stop
	}
}

ACTOR RLMarathonShotgunsPickupModded : RLMarathonShotgunsPickup
{
	+INVENTORY.TRANSFER
	States
	{
	Spawn:
		TNT1 A 0 NoDelay ACS_NamedExecuteAlways("GetWeaponMods", 0)
		TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 0, "NoSpecialStartsStuff")
		"####" "#" 0 A_Jump(256, "SpecialStartsStuff")
		Goto SpecialStartsStuff
		
	SpawnFrame:
		WSTE 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("RLMarathonShotguns",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_Print("\ccPicked up a \cbmodded \cdWSTE-M5 Shotgun.")
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cd= WSTE-M5 Shotgun =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("RLMarathonShotgunsModLimit", 1, "NotPickup_Modded")
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cd= WSTE-M5 Shotgun =\n\n\ccYou replace your unmodded\n\ccweapon with the one you picked up.", 5, "CONFONT")
		"####" "#" 0 A_GiveInventory("Shell",4)
		Goto PickupSound
	NotPickup_Modded:
		"####" "#" 0 A_Print("\cd= WSTE-M5 Shotgun =\n\n\caYou are already carrying a modded\n\caweapon of this type", 5, "CONFONT")
		Fail
	}
}
