
ACTOR RLBurstCannonLaserRifle : RLWeapon
{
  Obituary "%o was marked to death by %k's laser rifle."
  Tag "Burst Laser Rifle"
  Weapon.SelectionOrder 20
  Weapon.SlotNumber 6
  Weapon.AmmoUse1 1
  Weapon.AmmoGive1 0
  Weapon.AmmoType1 "RLBurstCannonLaserRifleClip"
  Weapon.AmmoType2 "Cell"
  Inventory.Icon "LASRICON"
  States
  {
  Ready:
	TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown",1,"MisfirePrevention")
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleNanoMod",1,2)
    LASR A 1 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
    Loop
  NanoRegenCheck:
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleClip",1,2)
    LASR A 70 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
	Goto NanoRegenCheckBegin
  NanoRegenCheckBegin:
    LASR A 70 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleBulkMod",1,2)
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleClip", 80, "Ready")
	Goto NanoRegen
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleClip", 104, "Ready")
	Goto NanoRegen
  NanoRegen:
	TNT1 A 0 A_GiveInventory("RLBurstCannonLaserRifleClip", 1)
    LASR A 17 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
    Goto NanoRegenCheckBegin+1
	
  ReadyAfterFire:
	TNT1 A 0 A_JumpIfInventory("PowerInfiniteAmmo",1,"ReadyAfterFireInfinite")
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleFirestormMod",1,"ReadyAfterFireF")
    LASR RS 3 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWRELOAD | WRF_ALLOWZOOM | WRF_NOBOB)
    LASR S 2 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWRELOAD | WRF_ALLOWZOOM | WRF_NOBOB)
    LASR SR 3 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWRELOAD | WRF_ALLOWZOOM | WRF_NOBOB)
    LASR A 10 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM | WRF_NOBOB)
    Goto Ready
  ReadyAfterFireF:
    LASR R 2 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWRELOAD | WRF_ALLOWZOOM | WRF_NOBOB)
    LASR S 3 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWRELOAD | WRF_ALLOWZOOM | WRF_NOBOB)
    LASR R 2 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWRELOAD | WRF_ALLOWZOOM | WRF_NOBOB)
    LASR A 10 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM | WRF_NOBOB)
    Goto Ready
	
  ReadyAfterFireInfinite:
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleFirestormMod",1,"ReadyAfterFireInfiniteF")
    LASR RS 3 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM | WRF_NOBOB)
    LASR S 2 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM | WRF_NOBOB)
    LASR SR 3 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM | WRF_NOBOB)
    LASR A 10 A_WeaponReady (WRF_ALLOWZOOM | WRF_NOBOB)
    Goto Ready
  ReadyAfterFireInfiniteF:
    LASR R 2 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM | WRF_NOBOB)
    LASR S 3 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM | WRF_NOBOB)
    LASR R 2 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM | WRF_NOBOB)
    LASR A 10 A_WeaponReady (WRF_ALLOWZOOM | WRF_NOBOB)
    Goto Ready
	
  ScavengerDrop:
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop",1,"WeaponDropConfirm")
	TNT1 A 0 A_GiveInventory("RLScavengerDrop",1)
	TNT1 A 0 A_Print("Press again to drop current weapon,\nor press \crAlt Fire\c- to scrap it to retrieve a Mod Pack.")
	Goto AfterModDrop
  WeaponDropConfirm:
	TNT1 A 0 A_GiveInventory("RLMisfireSpamPreventionCooldown",1)
	TNT1 A 0 A_TakeInventory("RLScavengerDrop",1)
	TNT1 A 0 A_TakeInventory("RLWeaponDrop",1)
	TNT1 A 0 A_TakeInventory("PowerRLTechnicianAdvancedDamage", 1)
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleModLimit", 1, "WeaponDropModded")
	TNT1 A 0 A_SpawnItemEx("RLBurstCannonLaserRiflePickup", 0, 0, 40, 12, 0, 0, 0, SXF_SETMASTER)
	Goto WeaponDropRemoval
  WeaponDropModded:
	TNT1 A 2 A_SpawnItemEx("RLBurstCannonLaserRiflePickupModded", 0, 0, 40, 12, 0, 0, 0, SXF_SETMASTER)
  WeaponDropRemoval:
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleModLimit", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRiflePowerMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleBulkMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleAgilityMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleTechnicalMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleFirestormMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleSniperMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleNanoMod", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 1 A_TakeInventory("RLBurstCannonLaserRifle",1)
	Stop
	
  AfterModDrop:
    LASR A 8 A_WeaponReady (16)
    Goto Ready
  MisfirePrevention:
    LASR 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("RLBurstCannonLaserRifleSelected", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("PowerRLTechnicianAdvancedDamage", 1)
	Goto DeselectLoop
  DeselectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "DeselectRenegade")
    TNT1 A 0 A_Lower
    LASR 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("RLAdvancedAssemblyTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLRapidfireTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLAssembledWeaponToken", 1)
	TNT1 A 0 A_GiveInventory("RLBurstCannonLaserRifleSelected", 1)
	TNT1 A 0 A_JumpIfInventory("RLScavengerPerk",1, 1)
    Goto SelectLoop
	TNT1 A 0 A_GiveInventory("PowerRLTechnicianAdvancedDamage", 1)
    Goto SelectLoop
  SelectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "SelectRenegade")
    TNT1 A 0 A_Raise
    LASR A 1 A_Raise
    Loop
	
  Fire:
	LASR A 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"MeleeRestricted") // Cannot fire in levels that restrict it
	LASR A 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"SilencedRestricted") // Cannot fire in levels that restrict it
	LASR A 0 A_JumpIfInventory("RLRestrictionBoomOnly",1,"BoomRestricted") // Cannot fire in levels that restrict it
	LASR A 0 A_JumpIfInventory("RLRestrictionLowTechOnly",1,"LowTechRestricted") // Cannot fire in levels that restrict it
	LASR A 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"CunningRestricted") // Cannot fire in levels that restrict it
	
	TNT1 A 0 A_JumpIfNoAmmo("Reload")
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleSniperMod",1,"FireS")
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRiflePowerMod",1,"FireP")
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleAgilityMod",1,"FireA")
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleBurst",0,2)
	TNT1 A 0 A_JumpIfInventory("RLAmmochainPerk",1,2)
	TNT1 A 0 A_FireBullets (1.5, 1.5, -1, (random(1,7)*10), "RLHeavyLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1.5, 1.5, -1, (random(1,7)*10), "RLHeavyLaserPuff", FBF_NORANDOM)
    Goto FireFinish
  FireP:
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleBurst",0,2)
	TNT1 A 0 A_JumpIfInventory("RLAmmochainPerk",1,2)
	TNT1 A 0 A_FireBullets (1.5, 1.5, -1, (random(1,7)*12), "RLHeavyLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1.5, 1.5, -1, (random(1,7)*12), "RLHeavyLaserPuff", FBF_NORANDOM)
    Goto FireFinish
  FireA:
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleBurst",0,2)
	TNT1 A 0 A_JumpIfInventory("RLAmmochainPerk",1,2)
	TNT1 A 0 A_FireBullets (1, 1, -1, (random(1,7)*10), "RLHeavyLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1, 1, -1, (random(1,7)*10), "RLHeavyLaserPuff", FBF_NORANDOM)
    Goto FireFinish
  FireS:
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleBurst",0,2)
	TNT1 A 0 A_JumpIfInventory("RLAmmochainPerk",1,2)
	TNT1 A 0 A_FireBullets (0, 0, 1, (random(1,7)*10), "RLHeavyLaserPuff", FBF_USEAMMO | FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (0, 0, 1, (random(1,7)*10), "RLHeavyLaserPuff", FBF_NORANDOM)
    Goto FireFinish
	
  FireFinish:
    TNT1 A 0 A_PlaySound("weapons/burstlaserrifle", CHAN_WEAPON)
    LASR B 1 Bright A_GunFlash
	LASR C 1 Bright
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleBurst",0,2)
	TNT1 A 0 A_GiveInventory("RLBurstCannonLaserRifleBurst",1)
    Goto Fire
	TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleBurst",0)
    Goto ReadyAfterFire
	
  Reload:
	LASR A 1 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleBulkMod",1,2)
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleClip", 80, "Ready")
	Goto ReloadStartingAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleClip", 104, "Ready")
  ReloadStartingAmmoCheck:
	TNT1 A 0 A_JumpIfInventory("Cell", 1, 1)
	Goto Ready
	TNT1 A 0 // Play the reload animation.
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleTechnicalMod",1,"Reload1")
    LASR D 1
    LASR E 1
    LASR F 1
    LASR G 1
    LASR H 2
    LASR I 2
    LASR J 2
    TNT1 A 0 A_PlaySound("weapons/burstlaserrifleunload", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    LASR K 2
    LASR L 2
    LASR M 2
    LASR N 2
    LASR O 2
    LASR P 2
    LASR Q 10
    LASR P 2
    LASR O 2
    LASR N 2
    LASR M 2
    LASR L 2
	Goto ReloadWorking
  Reload1:
    LASR D 1
    LASR E 1
    LASR F 1
    LASR G 1
    LASR H 1
    LASR I 1
    LASR J 1
    TNT1 A 0 A_PlaySound("weapons/burstlaserrifleunload", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    LASR K 2
    LASR L 2
    LASR M 2
    LASR N 2
    LASR O 2
    LASR P 2
    LASR Q 10
    LASR P 2
    LASR O 2
    LASR N 2
    LASR M 2
    LASR L 2
  ReloadWorking:
	TNT1 A 0 A_TakeInventory("Cell", 1)
	TNT1 A 0 A_GiveInventory("RLBurstCannonLaserRifleClip", 1)
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleBulkMod",1,2)
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleClip",80,3)
	Goto ReloadWorkingAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleClip",104,2)
  ReloadWorkingAmmoCheck:
	TNT1 A 0 A_JumpIfInventory("Cell",1,2)
	TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleBurst", 0)
	Goto ReloadFinish
	TNT1 A 0
	Goto ReloadWorking
  ReloadFinish:
    TNT1 A 0 A_PlaySound("weapons/burstlaserrifleload", 7)
    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("RLBurstCannonLaserRifleTechnicalMod",1,"ReloadFinish1")
    LASR K 2
    LASR J 2
    LASR I 2
    LASR H 2
    LASR G 1
    LASR F 1
    LASR E 1
    LASR D 1
    LASR A 8
	Goto Ready
  ReloadFinish1:
    LASR K 1
    LASR J 1
    LASR I 1
    LASR H 2
    LASR G 1
    LASR F 1
    LASR E 1
    LASR D 1
    LASR A 8
	Goto Ready
	
  Flash:
    TNT1 A 1 A_Light2
    TNT1 A 1 A_Light1
	TNT1 A 0 A_Light0
    Goto LightDone
	
  Spawn:
	TNT1 A 0 NoDelay A_SpawnItemEx("RLBurstCannonLaserRiflePickup",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION, 0, tid)
    Stop
  Altfire:
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate",1, "ArmorModConversion")
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop",1,"ScavengerTime")
	Goto Ready
  ModDiscombobulation:
	TNT1 A 0 A_Print("Applied Mod pack extracted from discarded weapon.")
	TNT1 A 0 ACS_NamedExecuteAlways("ScavengeMods", 0)
	TNT1 A 3
	TNT1 A 0 A_TakeInventory("RLScavengerDrop",1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleModLimit", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRiflePowerMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleBulkMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleAgilityMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleTechnicalMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleSniperMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleFirestormMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleNanoMod", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_TakeInventory("PowerRLTechnicianAdvancedDamage", 1)
	Goto ScavengerTimeEnd
  ScavengerTime:
	TNT1 A 0 A_GiveInventory("RLScavengingExtraEffects", 1)
    TNT1 A 0 A_GiveInventory("RLBurstCannonAssemblyLearntToken", 1) // Assembly is now listed in the HUD menus
	TNT1 A 0 A_JumpIfInventory("RLBurstCannonLaserRifleModLimit",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("RLBurstCannonLaserRifleModLimit", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRiflePowerMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleBulkMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleAgilityMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleTechnicalMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleSniperMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleFirestormMod", 1)
    TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleNanoMod", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLBurstCannonLaserRifleSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_TakeInventory("PowerRLTechnicianAdvancedDamage", 1)
	TNT1 A 0 A_Jump(256,1,2,3)
	TNT1 A 0 A_FireCustomMissile("DroppedRLBulkMod",0,0,0)
	Goto ScavengerTimeEnd
	TNT1 A 0 A_FireCustomMissile("DroppedRLBulkMod",0,0,0)
	Goto ScavengerTimeEnd
	TNT1 A 0 A_FireCustomMissile("DroppedRLPowerMod",0,0,0)
	Goto ScavengerTimeEnd
  ScavengerTimeEnd:
	TNT1 A 1 A_TakeInventory("RLBurstCannonLaserRifle",1)
	Stop
  }
}

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

Actor RLBurstCannonLaserRifleSelected : RLPermanentInventory {}
Actor RLBurstCannonLaserRifleBurst : RLBurstCannonDefault {}
Actor RLBurstCannonLaserRifleModLimit : RLAdvancedAssemblyModAmount {}
Actor RLBurstCannonLaserRiflePowerMod : RLAdvancedAssemblyModAmount {}
Actor RLBurstCannonLaserRifleBulkMod : RLAdvancedAssemblyModAmount {}
Actor RLBurstCannonLaserRifleAgilityMod : RLAdvancedAssemblyModAmount {}
Actor RLBurstCannonLaserRifleTechnicalMod : RLAdvancedAssemblyModAmount {}
Actor RLBurstCannonLaserRifleFirestormMod : RLAdvancedAssemblyModAmount {}
Actor RLBurstCannonLaserRifleNanoMod : RLAdvancedAssemblyModAmount {}
Actor RLBurstCannonLaserRifleSniperMod : RLAdvancedAssemblyModAmount {}

ACTOR RLBurstCannonLaserRifleClip : Ammo
{
   +INVENTORY.IGNORESKILL
   Inventory.MaxAmount 104
   Inventory.Icon ""
}

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

ACTOR RLBurstCannonLaserRiflePickup : RLAdvancedAssembledWeaponPickup 17611
{
	//$Sprite LASRX0
	Tag "Burst Laser Rifle [Pickup]"
	States
	{
	SpawnFrame:
		LASR 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("RLBurstCannonLaserRifle",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("RLBurstCannonLaserRifle",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_Print("\ccPicked up a \cvBurst Laser Rifle.")
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_Jump(256, "NotPickup")
		Goto NotPickup
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cv= Burst Laser Rifle =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup_NoPrint:
		"####" "#" 0
		Fail
	PickupSound:
		"####" "#" 0 A_PlaySound("weapons/BurstLaserRiflepickup")
		Stop
//==============================================================================
	MarathonStuff:
		"####" "#" 0 A_SpawnItemEx("RLMarathonShells",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
	}
}

ACTOR RLBurstCannonLaserRiflePickupModded : RLBurstCannonLaserRiflePickup
{
	+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:
		LASR 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("RLBurstCannonLaserRifle",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_Print("\ccPicked up a \cbmodded \cvBurst Laser Rifle.")
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cv= Burst Laser Rifle =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("RLBurstCannonLaserRifleModLimit", 1, "NotPickup_Modded")
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cv= Burst Laser Rifle =\n\n\ccYou replace your unmodded\n\ccweapon with the one you picked up.", 5, "CONFONT")
		"####" "#" 0 A_GiveInventory("Cell",80)
		Goto PickupSound
	NotPickup_Modded:
		"####" "#" 0 A_Print("\cv= Burst Laser Rifle =\n\n\caYou are already carrying a modded\n\caweapon of this type", 5, "CONFONT")
		Fail
	}
}
