
ACTOR RLLonghorn : RLPistolWeapon
{
  Inventory.Pickupsound "weapons/longhornpickup"
  Obituary "%o cast gun on %k and they died to death."
  Decal BulletChip
  Tag "Longhorn Revolver"
  Weapon.Kickback 0
  Weapon.SelectionOrder 11
  Weapon.SlotNumber 2
  Weapon.AmmoUse1 1
  Weapon.AmmoGive1 0
  Weapon.AmmoType1 "RLLonghornClip"
  Weapon.AmmoType2 "Clip"
  Inventory.Icon "LONGICON"
  States
  {
  Ready:
	TNT1 A 0 A_JumpIfInventory("RLLonghornNanoMod",1, "ReadyDualActivation")
	TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown",1,"MisfirePrevention")
    LONG A 1 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
    Loop
  ReadyAfterFire:
    LONG A 1 A_WeaponReady (WRF_NOBOB)
    LONG AAAAAAAAAAAAAAAAAAAAAAAA 1 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD | WRF_NOBOB)
    Goto Ready
  ReadyDualActivation:
	LONG O 1
	TNT1 A 0 A_GunFlash ("ReadyDualRight", GFF_NOEXTCHANGE)
    Goto ReadyDualLeft
	
  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_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 A_JumpIfInventory("RLLonghornModLimit", 1, "WeaponDropModded")
	TNT1 A 0 A_SpawnItemEx("RLLonghornPickup", 0, 0, 40, 16, 0, 0, 0, SXF_SETMASTER)
	Goto WeaponDropRemoval
  WeaponDropModded:
	TNT1 A 2 A_SpawnItemEx("RLLonghornPickupModded", 0, 0, 40, 16, 0, 0, 0, SXF_SETMASTER)
  WeaponDropRemoval:
    TNT1 A 0 A_TakeInventory("RLLonghornModLimit", 1)
    TNT1 A 0 A_TakeInventory("RLLonghornSniperMod", 1)
    TNT1 A 0 A_TakeInventory("RLLonghornFirestormMod", 1)
    TNT1 A 0 A_TakeInventory("RLLonghornNanoMod", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLLonghornSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 1 A_TakeInventory("RLLonghorn",1)
	Stop
	
  AfterModDrop:
	TNT1 A 0 A_JumpIfInventory("RLLonghornNanoMod",1, "DualAfterModDrop")
    LONG A 8 A_WeaponReady (16)
    Goto Ready
  DualAfterModDrop:
    LON2 A 8 A_WeaponReady (16)
    Goto ReadyDualLeft
  MisfirePrevention:
	TNT1 A 0 A_JumpIfInventory("RLLonghornNanoMod",1, "DualMisfirePrevention")
    LONG A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
  DualMisfirePrevention:
    LON2 A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto ReadyDualLeft
	
  Deselect:
	TNT1 A 0
	TNT1 A 0 A_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
	TNT1 A 0 A_TakeInventory("RLLonghornSelected", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
  DeselectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "DeselectRenegade")
	TNT1 A 0 A_JumpIfInventory("RLLonghornNanoMod",1, "DeselectDual")
    TNT1 AA 0 A_Lower
    LONG A 1 A_Lower
    Goto DeselectLoop
  DeselectDual:
    TNT1 AA 0 A_Lower
    LONG O 1 A_Lower
    Goto DeselectLoop
  DeselectRenegade:
    TNT1 A 0 A_Lower
    loop
  SelectRenegade: 
    TNT1 A 0 A_Raise
    loop
  SelectSetWeapon:
	TNT1 A 0 A_GiveInventory("RLPistolTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLMultiAmmoWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLEfficientAmmoTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLLegendaryWeaponToken", 1)
	TNT1 A 0 A_GiveInventory("RLLonghornSelected", 1)
    Goto SelectLoop
  SelectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "SelectRenegade")
	TNT1 A 0 A_JumpIfInventory("RLLonghornNanoMod",1, "SelectDual")
    TNT1 AA 0 A_Raise
    LONG A 1 A_Raise
    Loop
  SelectDual:
    TNT1 AA 0 A_Raise
    LONG O 1 A_Raise
    Loop
	
// 8x damage with Scout, no spread
// holy fucking shit this fucking gun is just dslgfndfklunfgkdf murderkilltacular ten thousand percent
  Fire:
	TNT1 A 0 A_JumpIfInventory("RLLonghornNanoMod",1, "ReadyDualActivation")
	TNT1 A 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"MeleeRestricted") // Cannot fire in levels that restrict it
	TNT1 A 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"SilencedRestricted") // Cannot fire in levels that restrict it
	TNT1 A 0 A_JumpIfInventory("RLRestrictionBoomOnly",1,"BoomRestricted") // Cannot fire in levels that restrict it
	TNT1 A 0 A_JumpIfInventory("RLRestrictionHighTechOnly",1,"HighTechRestricted") // Cannot fire in levels that restrict it
	TNT1 A 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"CunningRestricted") // Cannot fire in levels that restrict it
	
	TNT1 A 0 A_JumpIfInventory("RLLonghornClip", 1, "FireContinue")
	Goto Reload
	
  FireContinue:
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_JumpIfInventory("RLLonghornFirestormMod",1,"FireF")
	TNT1 A 0 A_JumpIfInventory("RLLonghornSniperMod",1,"FireS")
	
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,"FireWW")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,"FireSharpshooter")
	TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegade")
	TNT1 AAAAA 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLInvisibleBulletPuff", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLSuperBulletPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireSharpshooter:
	TNT1 AAAAA 0 A_FireBullets(0, 0, -1, (72), "RLInvisibleBulletPuff", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0, 0, -1, (72), "RLSuperBulletPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireRenegade:
	TNT1 AAAAAAAA 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLInvisibleBulletPuff", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLSuperBulletPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireWW:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,"FireWWSharpshooter")
	TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireWWRenegade")
	TNT1 AAAAA 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLInvisibleBulletPuff", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLSuperBulletPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireWWSharpshooter:
	TNT1 AAAAA 0 A_FireBullets(0, 0, -1, (108), "RLInvisibleBulletPuff", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0, 0, -1, (108), "RLSuperBulletPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireWWRenegade:
	TNT1 AAAAAAAA 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLInvisibleBulletPuff", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLSuperBulletPuff", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
	
  FireS:
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,"FireWWS")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,"FireSharpshooterS")
	TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeS")
	TNT1 AAAAA 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLInvisibleLonghornBulletPuffS", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLLonghornBulletPuffS", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireSharpshooterS:
	TNT1 AAAAA 0 A_FireBullets(0, 0, -1, (72), "RLInvisibleLonghornBulletPuffS", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0, 0, -1, (72), "RLLonghornBulletPuffS", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireRenegadeS:
	TNT1 AAAAAAAA 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLInvisibleLonghornBulletPuffS", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLLonghornBulletPuffS", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireWWS:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,"FireWWSharpshooterS")
	TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireWWRenegadeS")
	TNT1 AAAAA 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLInvisibleLonghornBulletPuffS", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLLonghornBulletPuffS", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireWWSharpshooterS:
	TNT1 AAAAA 0 A_FireBullets(0, 0, -1, (108), "RLInvisibleLonghornBulletPuffS", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0, 0, -1, (108), "RLLonghornBulletPuffS", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireWWRenegadeS:
	TNT1 AAAAAAAA 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLInvisibleLonghornBulletPuffS", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLLonghornBulletPuffS", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
	
  FireF:
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,"FireWWF")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,"FireSharpshooterF")
	TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireRenegadeF")
	TNT1 AAAAA 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLInvisibleLonghornBulletPuffF", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLLonghornBulletPuffF", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireSharpshooterF:
	TNT1 AAAAA 0 A_FireBullets(0, 0, -1, (72), "RLInvisibleLonghornBulletPuffF", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0, 0, -1, (72), "RLLonghornBulletPuffF", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireRenegadeF:
	TNT1 AAAAAAAA 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLInvisibleLonghornBulletPuffF", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLLonghornBulletPuffF", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireWWF:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,"FireWWSharpshooterF")
	TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "FireWWRenegadeF")
	TNT1 AAAAA 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLInvisibleLonghornBulletPuffF", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLLonghornBulletPuffF", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireWWSharpshooterF:
	TNT1 AAAAA 0 A_FireBullets(0, 0, -1, (108), "RLInvisibleLonghornBulletPuffF", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0, 0, -1, (108), "RLLonghornBulletPuffF", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
  FireWWRenegadeF:
	TNT1 AAAAAAAA 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLInvisibleLonghornBulletPuffF", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLLonghornBulletPuffF", FBF_NORANDOM | FBF_USEAMMO)
    Goto FireFinish
	
  FireFinish:
    TNT1 A 0 A_SpawnItemEx ("RLRocketLauncherRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 0 A_PlaySound("weapons/longhorn", CHAN_WEAPON, 0.4, 0, 0.7)
    TNT1 A 0 A_PlaySound("weapons/longhornadd", CHAN_BODY, 0.4, 0, 1.1)
    TNT1 A 0 A_PlaySound("weapons/longhornalt", 6, 0.4, 0, 1.2)
    TNT1 A 0 A_PlaySound("weapons/longhornfar", 7, 0.05, 0, 0.20)
	TNT1 A 0 A_CheckFloor (2)
	TNT1 A 0 A_Jump(256,4)
	TNT1 A 0 A_JumpIfInventory("RLGrapplingSteelBootsToken",1,4)
	TNT1 A 0 A_JumpIfInventory("RLGrapplingProtectiveBootsToken",1,3)
	TNT1 A 0 A_JumpIfInventory("RLGrapplingPlasteelBootsToken",1,2)
    TNT1 A 0 A_ChangeVelocity (Cos(Pitch) * -4, 0, Sin(Pitch) * 4, 1)
    LONG B 1 Bright A_GunFlash
    LONG CCDDEEEFFFGGGHHHHAAAAA 1
    Goto ReadyAfterFire
	
  Reload:
	TNT1 A 0 A_JumpIfInventory("RLLonghornNanoMod",1, "ReadyDualActivation")
	LONG A 1 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
	TNT1 A 0 A_JumpIfInventory("RLLonghornClip", 6, "Ready")
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk", 1, 2)
	TNT1 A 0 A_JumpIfInventory("Clip", 2, "ReloadStart")
	Goto Ready
	TNT1 A 0 A_JumpIfInventory("Clip", 1, "ReloadStart")
	Goto Ready
  ReloadStart:
	TNT1 A 0 // Play the reload animation.
    LONG I 2
    LONG J 2
    LONG K 2
    LONG L 2
    LONG M 2
    LONG N 2
    TNT1 A 0 A_PlaySound("weapons/longhornunload", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 25
	Goto ReloadWorking
  ReloadWorking:
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk", 1, 2)
	TNT1 A 0 A_TakeInventory("Clip", 1)
	TNT1 A 0 A_TakeInventory("Clip", 1)
	TNT1 A 0 A_GiveInventory("RLLonghornClip", 1)
	TNT1 A 0 A_JumpIfInventory("RLLonghornClip",6,"ReloadFinish")
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk", 1, 2)
	TNT1 A 0 A_JumpIfInventory("Clip", 2, "ReloadWorking")
	Goto ReloadFinish
	TNT1 A 0 A_JumpIfInventory("Clip", 1, "ReloadWorking")
	Goto ReloadFinish
  ReloadFinish:
    TNT1 A 0 A_PlaySound("weapons/longhornload", 7)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 3
    LONG N 2
    LONG M 2
    LONG L 2
    LONG K 2
    LONG J 2
    LONG I 2
	Goto ReadyAfterFire
	
  Flash:
    TNT1 A 1 A_Light (5)
    TNT1 A 1 A_Light2
    TNT1 A 1 A_Light1
    TNT1 A 0 A_Light0
    Goto LightDone
	
  FlashDrop:
    TNT1 A 0
	Goto LightDone
	
  Spawn:
	TNT1 A 0 NoDelay A_SpawnItemEx("RLLonghornPickup",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION, 0, tid)
    Stop
	
  Altfire:
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate",1, "ArmorModConversion")
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop",1,"ScavengerTime")
	Goto Ready
  ModDiscombobulation:
	TNT1 A 0 A_Print("Applied Mod pack extracted from discarded weapon.")
	TNT1 A 0 ACS_NamedExecuteAlways("ScavengeMods", 0)
	TNT1 A 3// A_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 A_TakeInventory("RLScavengerDrop",1)
    TNT1 A 0 A_TakeInventory("RLLonghornModLimit", 1)
    TNT1 A 0 A_TakeInventory("RLLonghornSniperMod", 1)
    TNT1 A 0 A_TakeInventory("RLLonghornFirestormMod", 1)
    TNT1 A 0 A_TakeInventory("RLLonghornNanoMod", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLLonghornSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	Goto ScavengerTimeEnd
  ScavengerTime:
	TNT1 A 0 A_GiveInventory("RLScavengingExtraEffects", 1)
	TNT1 A 0 A_JumpIfInventory("RLLonghornModLimit",1,"ModDiscombobulation")
	TNT1 A 0 A_Print("Mod pack extracted from discarded weapon.")
//	TNT1 A 0 A_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 A_TakeInventory("RLScavengerDrop",1)
    TNT1 A 0 A_TakeInventory("RLLonghornModLimit", 1)
    TNT1 A 0 A_TakeInventory("RLLonghornSniperMod", 1)
    TNT1 A 0 A_TakeInventory("RLLonghornFirestormMod", 1)
    TNT1 A 0 A_TakeInventory("RLLonghornNanoMod", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLLonghornSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_FireCustomMissile("DroppedRLFirestormMod",0,0,0)
	Goto ScavengerTimeEnd
  ScavengerTimeEnd:
	TNT1 A 1 A_TakeInventory("RLLonghorn",1)
	Stop
	
// 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, "ReadyDualRightAfterFire")
	Goto ReadyDualRightAfterFire
  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, "ReadyDualRightAfterFire")
	Goto ReadyDualRightAfterFire
  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, "ReadyDualRightAfterFire")
	Goto ReadyDualRightAfterFire
	
//========DUAL ZONE=============================================================

  ReadyDualLeft:
	TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown",1,3)
	TNT1 A 0 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
	TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
    Loop
	
  FireDualLeft:
	TNT1 A 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"ReadyDualLeftAfterFire") // Cannot fire in levels that restrict it
	TNT1 A 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"ReadyDualLeftAfterFire") // Cannot fire in levels that restrict it
	TNT1 A 0 A_JumpIfInventory("RLRestrictionNoBoom",1,"ReadyDualLeftAfterFire") // Cannot fire in levels that restrict it
	TNT1 A 0 A_JumpIfInventory("RLRestrictionHighTechOnly",1,"ReadyDualLeftAfterFire") // Cannot fire in levels that restrict it
	TNT1 A 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"ReadyDualLeftAfterFire") // Cannot fire in levels that restrict it
	
	TNT1 A 0 A_JumpIfInventory("RLLonghornClip", 1, "FireDualLeftContinue")
	Goto ReloadDualLeft
	
  FireDualLeftContinue:
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_TakeInventory("RLLonghornClip", 1, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,"FireWWDualLeft")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,"FireSharpshooterDualLeft")
	TNT1 AAAAA 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLInvisibleBulletPuff", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLSuperBulletPuff", FBF_NORANDOM)
    Goto FireFinishDualLeft
  FireSharpshooterDualLeft:
	TNT1 AAAAA 0 A_FireBullets(0, 0, -1, (72), "RLInvisibleBulletPuff", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0, 0, -1, (72), "RLSuperBulletPuff", FBF_NORANDOM)
    Goto FireFinishDualLeft
  FireWWDualLeft:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,"FireWWSharpshooterDualLeft")
	TNT1 AAAAA 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLInvisibleBulletPuff", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLSuperBulletPuff", FBF_NORANDOM)
    Goto FireFinishDualLeft
  FireWWSharpshooterDualLeft:
	TNT1 AAAAA 0 A_FireBullets(0, 0, -1, (108), "RLInvisibleBulletPuff", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0, 0, -1, (108), "RLSuperBulletPuff", FBF_NORANDOM)
    Goto FireFinishDualLeft
	
  FireFinishDualLeft:
    TNT1 A 0 A_SpawnItemEx ("RLRocketLauncherRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 0 A_PlaySound("weapons/longhorn", CHAN_WEAPON, 0.4, 0, 0.7)
    TNT1 A 0 A_PlaySound("weapons/longhornadd", CHAN_BODY, 0.4, 0, 1.1)
    TNT1 A 0 A_PlaySound("weapons/longhornalt", 6, 0.4, 0, 1.2)
    TNT1 A 0 A_PlaySound("weapons/longhornfar", 7, 0.05, 0, 0.20)
	TNT1 A 0 A_CheckFloor (2)
	TNT1 A 0 A_Jump(256,4)
	TNT1 A 0 A_JumpIfInventory("RLGrapplingSteelBootsToken",1,4)
	TNT1 A 0 A_JumpIfInventory("RLGrapplingProtectiveBootsToken",1,3)
	TNT1 A 0 A_JumpIfInventory("RLGrapplingPlasteelBootsToken",1,2)
    TNT1 A 0 A_ChangeVelocity (Cos(Pitch) * -4, 0, Sin(Pitch) * 4, 1)
    LON2 B 1 Bright A_Light2
    LON2 C 1 A_Light1
    LON2 C 1 A_Light0
    LON2 DDEEEFFFGGGHHHHAAAA 1
    Goto ReadyDualLeftAfterFire
  ReadyDualLeftAfterFire:
// * Yholl breaks down and starts sobbing uncontrollably
    LON2 A 1
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireLeft",1,"FireDualLeft")
    LON2 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualLeft")
    Goto ReadyDualLeft
	
  ReloadDualLeft:
	LON2 A 1
	TNT1 A 0 A_JumpIfInventory("RLLonghornClip", 6, "ReadyDualLeft")
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk", 1, 2)
	TNT1 A 0 A_JumpIfInventory("Clip", 2, "ReloadDualLeftStart")
	Goto ReadyDualLeft
	TNT1 A 0 A_JumpIfInventory("Clip", 1, "ReloadDualLeftStart")
	Goto ReadyDualLeft
  ReloadDualLeftStart:
	TNT1 A 0 // Play the reload animation.
    LON2 I 2
    LON2 J 2
    LON2 K 2
    LON2 L 2
    LON2 M 2
    LON2 N 2
    TNT1 A 0 A_PlaySound("weapons/longhornunload", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 25
	Goto ReloadWorkingDualLeft
  ReloadWorkingDualLeft:
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk", 1, 2)
	TNT1 A 0 A_TakeInventory("Clip", 1)
	TNT1 A 0 A_TakeInventory("Clip", 1)
	TNT1 A 0 A_GiveInventory("RLLonghornClip", 1)
	TNT1 A 0 A_JumpIfInventory("RLLonghornClip",6,"ReloadFinishDualLeft")
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk", 1, 2)
	TNT1 A 0 A_JumpIfInventory("Clip", 2, "ReloadWorkingDualLeft")
	Goto ReloadFinishDualLeft
	TNT1 A 0 A_JumpIfInventory("Clip", 1, "ReloadWorkingDualLeft")
	Goto ReloadFinishDualLeft
  ReloadFinishDualLeft:
    TNT1 A 0 A_PlaySound("weapons/longhornload", 7)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 3
    LON2 N 2
    LON2 M 2
    LON2 L 2
    LON2 K 2
    LON2 J 2
    LON2 I 2
	Goto ReadyDualLeftAfterFire
	
//========FLASH ZONE============================================================

  ReadyDualRight:
	TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown",1,3)
	TNT1 A 0 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
	TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1
    Loop
	
  FireDualRight:
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate",1, "ArmorModConversionDual")
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop",1,"ScavengerTime")
	
	TNT1 A 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"ReadyDualRightAfterFire") // Cannot fire in levels that restrict it
	TNT1 A 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"ReadyDualRightAfterFire") // Cannot fire in levels that restrict it
	TNT1 A 0 A_JumpIfInventory("RLRestrictionNoBoom",1,"ReadyDualRightAfterFire") // Cannot fire in levels that restrict it
	TNT1 A 0 A_JumpIfInventory("RLRestrictionHighTechOnly",1,"ReadyDualRightAfterFire") // Cannot fire in levels that restrict it
	TNT1 A 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"ReadyDualRightAfterFire") // Cannot fire in levels that restrict it
	
	TNT1 A 0 A_JumpIfInventory("RLLonghornClip2", 1, "FireDualRightContinue")
	Goto ReloadDualRight
	
  FireDualRightContinue:
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_TakeInventory("RLLonghornClip2", 1, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorBonus",1,"FireWWDualRight")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,"FireSharpshooterDualRight")
	TNT1 AAAAA 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLInvisibleBulletPuff", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 9*random(1,3), "RLSuperBulletPuff", FBF_NORANDOM)
    Goto FireFinishDualRight
  FireSharpshooterDualRight:
	TNT1 AAAAA 0 A_FireBullets(0, 0, -1, (72), "RLInvisibleBulletPuff", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0, 0, -1, (72), "RLSuperBulletPuff", FBF_NORANDOM)
    Goto FireFinishDualRight
  FireWWDualRight:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,"FireWWSharpshooterDualRight")
	TNT1 AAAAA 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLInvisibleBulletPuff", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0.5, 0.25, -1, 14*random(1,3), "RLSuperBulletPuff", FBF_NORANDOM)
    Goto FireFinishDualRight
  FireWWSharpshooterDualRight:
	TNT1 AAAAA 0 A_FireBullets(0, 0, -1, (108), "RLInvisibleBulletPuff", FBF_NORANDOM)
	TNT1 A 0 A_FireBullets(0, 0, -1, (108), "RLSuperBulletPuff", FBF_NORANDOM)
    Goto FireFinishDualRight
	
  FireFinishDualRight:
    TNT1 A 0 A_SpawnItemEx ("RLRocketLauncherRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 0 A_PlaySound("weapons/longhorn", CHAN_WEAPON, 0.4, 0, 0.7)
    TNT1 A 0 A_PlaySound("weapons/longhornadd", CHAN_BODY, 0.4, 0, 1.1)
    TNT1 A 0 A_PlaySound("weapons/longhornalt", 6, 0.4, 0, 1.2)
    TNT1 A 0 A_PlaySound("weapons/longhornfar", 7, 0.05, 0, 0.20)
	TNT1 A 0 A_CheckFloor (2)
	TNT1 A 0 A_Jump(256,4)
	TNT1 A 0 A_JumpIfInventory("RLGrapplingSteelBootsToken",1,4)
	TNT1 A 0 A_JumpIfInventory("RLGrapplingProtectiveBootsToken",1,3)
	TNT1 A 0 A_JumpIfInventory("RLGrapplingPlasteelBootsToken",1,2)
    TNT1 A 0 A_ChangeVelocity (Cos(Pitch) * -4, 0, Sin(Pitch) * 4, 1)
    LON3 B 1 Bright A_Light2
    LON3 C 1 A_Light1
    LON3 C 1 A_Light0
    LON3 DDEEEFFFGGGHHHHAAAA 1
    Goto ReadyDualRightAfterFire
	
  ReadyDualRightAfterFire:
// * Yholl breaks down and starts sobbing uncontrollably
    LON3 A 1
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_JumpIfInventory("RLSynthFireRight",1,"FireDualRight")
    LON3 A 1 A_JumpIfInventory("RLSynthFireReload",1,"ReloadDualRight")
    TNT1 A 0 A_TakeInventory("RLHellsingARMSCasullNanoFiring", 1)
    Goto ReadyDualRight
	
  ReloadDualRight:
	LON3 A 1
	TNT1 A 0 A_JumpIfInventory("RLLonghornClip2", 6, "ReadyDualRight")
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk", 1, 2)
	TNT1 A 0 A_JumpIfInventory("Clip", 2, "ReloadDualRightStart")
	Goto ReadyDualRight
	TNT1 A 0 A_JumpIfInventory("Clip", 1, "ReloadDualRightStart")
	Goto ReadyDualRight
  ReloadDualRightStart:
	TNT1 A 0 // Play the reload animation.
    LON3 I 2
    LON3 J 2
    LON3 K 2
    LON3 L 2
    LON3 M 2
    LON3 N 2
    TNT1 A 0 A_PlaySound("weapons/longhornunload", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 25
	Goto ReloadWorkingDualRight
  ReloadWorkingDualRight:
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk", 1, 2)
	TNT1 A 0 A_TakeInventory("Clip", 1)
	TNT1 A 0 A_TakeInventory("Clip", 1)
	TNT1 A 0 A_GiveInventory("RLLonghornClip2", 1)
	TNT1 A 0 A_JumpIfInventory("RLLonghornClip2",6,"ReloadFinishDualRight")
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk", 1, 2)
	TNT1 A 0 A_JumpIfInventory("Clip", 2, "ReloadWorkingDualRight")
	Goto ReloadFinishDualRight
	TNT1 A 0 A_JumpIfInventory("Clip", 1, "ReloadWorkingDualRight")
	Goto ReloadFinishDualRight
  ReloadFinishDualRight:
    TNT1 A 0 A_PlaySound("weapons/longhornload", 7)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 3
    LON3 N 2
    LON3 M 2
    LON3 L 2
    LON3 K 2
    LON3 J 2
    LON3 I 2
	Goto ReadyDualRightAfterFire
  }
}

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

actor RLLonghornBulletEffectSniper
{
    Radius 6
    Height 6
    RenderStyle Translucent
	Scale 2.0
    Alpha 0.35
    +FORCEXYBILLBOARD
    +NOINTERACTION
	+NOCLIP
    States
    {
    Spawn:
		TNT1 A 0
//		TNT1 A 0 A_Log ("sniper effect spawn")
		TNT1 A 0 A_Warp (AAPTR_TRACER, 0,0,0, 0, WARPF_NOCHECKPOSITION, "DeathCheckLoop", 0.5)
		Stop
    DeathCheckLoop:
//		BAL1 A 1 Bright
		TNT1 A 1
//		TNT1 A 0 A_Log ("sniper deathcheckloop")
		TNT1 A 0 A_JumpIfInventory ("RLLonghornBulletEffectActive", 1, "DeathCheckHealth", AAPTR_TRACER)
		TNT1 A 0 A_Jump (256, "EffectActivate")
		Goto EffectActivate
    DeathCheckHealth:
//		TNT1 A 0 A_Log ("sniper deathcheckhealth")
		TNT1 A 0 A_JumpIfHealthLower (1, "EffectActivate", AAPTR_TRACER)
		TNT1 A 0 A_Jump (256, "DeathCheckWarp")
		Goto DeathCheckWarp
    DeathCheckWarp:
//		TNT1 A 0 A_Log ("sniper deathcheckwarp")
		TNT1 A 0 A_Warp (AAPTR_TRACER, 0,0,0, 0, WARPF_NOCHECKPOSITION, "DeathCheckLoop", 0.5)
		TNT1 A 0 A_Jump (256, "EffectActivate")
		Goto EffectActivate
    EffectActivate:
		TNT1 A 0 A_Jump (256, 1,2,3,4,5,6)
		TNT1 AAAAAAAAAA 0 A_SpawnItemEx ("RLNoCountHealthBonus", 0,0,0, frandom(-5,5),frandom(-5,5),frandom(-5,5), 0, SXF_NOCHECKPOSITION)
		Stop
    }
}

actor RLLonghornBulletEffectFirestorm : RLLonghornBulletEffectSniper
{
    States
    {
    EffectActivate:
		TNT1 A 0 A_SpawnItemEx ("RLLonghornFirestormExplosion", 0,0,32, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_TRANSFERPOINTERS)
		Stop
    }
}

ACTOR RLLonghornFirestormExplosion : RLExplosion
{
    Scale 1.5
  States
  {
  Spawn:
    TNT1 A 0
	TNT1 A 0 A_GiveToTarget ("RLFireangelBonusCheck", 1)
	TNT1 A 0 A_RadiusGive ("RLFireangelRadiusBonusCheck", 128, RGF_PLAYERS)
	TNT1 A 0 A_SetTranslucent (0.95, 1)
	TNT1 A 0 A_Explode (128, 128, 0)
	TNT1 A 0 A_JumpIf(CallACS("DRLA_QuakeNShake") == 0, 3)
	TNT1 A 0 A_Quake (1, 8, 0, 1024, "")
	TNT1 A 0 A_Quake (6, 8, 0, 512, "")
	TNT1 A 0 A_PlaySound ("weapons/rocklx", 7, 1, 0, 0.5)
	TNT1 A 0 A_PlaySound("weapons/rocklx", CHAN_ITEM, 0.05, 0, 0.05)
	TNT1 A 0 A_Jump (256, "DeathAnimation")
	Goto DeathAnimation
  DeathAnimation:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_FancyProjectiles") == 1, "DeathAnimation.Fancy")
	MEXP AB 4 Bright
	MEXP CD 3 Bright
	MEXP EF 2 Bright
	Stop
  DeathAnimation.Fancy:
	MEXP AAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("RLRocketShrapnel", 0, 0, 0, frandom(-5.0,5.0), frandom(-5.0,5.0), frandom(-5.0,5.0), frandom(0.0,360.0),0,58)
	MEXP AAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("RLBulletPuffShrapnel", 0, 0, 0, frandom(-5.0,5.0), frandom(-5.0,5.0), frandom(-5.0,5.0), frandom(0.0,360.0),0,58)
	MEXP A 1 Bright
	MEXP B 1 Bright
	MEXP B 0 A_SpawnItemEx("RLRocketPuff")
	MEXP C 2 Bright
	MEXP D 2 Bright
	MEXP E 3 Bright
	MEXP F 4 Bright
	Stop
  }
}

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

Actor RLLonghornSelected : RLPermanentInventory {}
Actor RLLonghornModLimit : RLUniqueModAmount {}
Actor RLLonghornNanoMod : RLUniqueModAmount {}
Actor RLLonghornFirestormMod : RLUniqueModAmount {}
Actor RLLonghornSniperMod : RLUniqueModAmount {}

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

ACTOR RLLonghornBulletEffectActive : Powerup
{
	Powerup.Duration -0x7FFFFFFF
}

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

ACTOR RLLonghornPickup : RLLegendaryWeaponPickup
{
	//$Sprite LONGX0
	Tag "Longhorn Revolver [Pickup]"
	States
	{
	SpawnFrame:
		LONG X 4
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
	SpawnLoop:
		"####" "#" 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		Loop
	FloorHit:
//		"####" "#" 0 A_PlaySound("weapons/gundropsmall")
		"####" "#" 0 A_ChangeFlag("SPECIAL", true)
		"####" "#" 0 A_ChangeFlag("THRUACTORS", false)
		"####" "#" 0 A_SetUserVar("user_floorhit", 1)
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Stop
	Pickup:
		"####" "#" 0
		"####" "#" 0 A_JumpIf(CallACS("DRLA_specialstarts") == 1, "GiveAmmo")
		"####" "#" 0 A_JumpIfInventory("RLLonghorn",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("RLLonghorn",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_GiveInventory("RLLegendaryItemFound",1, AAPTR_PLAYER1)
		"####" "#" 0 A_Print("\ccPicked up the \ckLonghorn Revolver.")
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_Jump(256, "NotPickup")
		Goto NotPickup
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\ck= Longhorn Revolver =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup_NoPrint:
		"####" "#" 0
		Fail
	PickupSound:
		"####" "#" 0 A_PlaySound("weapons/Longhornpickup")
		Stop
//==============================================================================
	MarathonStuff:
		"####" "#" 0 A_SpawnItemEx("RLMarathonShells",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
	SuperweaponStuff:
		"####" "#" 0 A_Jump(256, "NoSpecialStartsStuff")
		Goto NoSpecialStartsStuff
	GiveAmmo:
		"####" "#" 0 A_GiveInventory("Clip",12)
		Goto PickupSound
	}
}

ACTOR RLLonghornWorldSpawnPickup : RLLonghornPickup 17307
{
	States
	{
	NoSpecialStartsStuff:
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamLegendaryWorld", 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:
		LONG X 4
		"####" "#" 0 A_GiveInventory("RLLegendaryItemSpawnMessageSender",1)
		"####" "#" 0 A_PlaySound("weapons/legendaryspawned", 7, 0.25, 0, 0)
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
		
	GiveWeapon:
		"####" "#" 0 A_GiveInventory("RLLonghorn",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_GiveInventory("RLLegendaryItemFound",1, AAPTR_PLAYER1)
		"####" "#" 0 A_Print("\ccPicked up the \ckLonghorn Revolver.")
		"####" "#" 0 A_GiveInventory("RLDangerLevelLegendaryGiver",1, AAPTR_PLAYER1)
		Goto PickupSound
	}
}

ACTOR RLLonghornPickupModded : RLLonghornPickup
{
	+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:
		LONG 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("RLLonghorn",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_Print("\ccPicked up a \cbmodded \ckLonghorn Revolver.")
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\ck= Longhorn Revolver =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("RLLonghornModLimit", 1, "NotPickup_Modded")
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\ck= Longhorn Revolver =\n\n\ccYou replace your unmodded\n\ccweapon with the one you picked up.", 5, "CONFONT")
		"####" "#" 0 A_GiveInventory("Clip",24)
		Goto PickupSound
	NotPickup_Modded:
		"####" "#" 0 A_Print("\ck= Longhorn Revolver =\n\n\caYou are already carrying a modded\n\caweapon of this type", 5, "CONFONT")
		Fail
	}
}
