
ACTOR RLHeavyPulseBlaster : RLPistolWeapon
{
  Obituary "%o was zoopolooped by %k's heavy blaster."
  Decal BulletChip
  Tag "Heavy Pulse Blaster"
  Weapon.SelectionOrder 1899
  Weapon.SlotNumber 2
  Weapon.AmmoUse1 1
  Weapon.AmmoGive1 0
  Weapon.AmmoType1 "RLHeavyPulseBlasterClip"
  Weapon.AmmoGive2 0
  Weapon.AmmoType2 "RLHeavyPulseBlasterHeat"
  Inventory.Icon "HBLAICON"
  States
  {
  Ready:
	TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown",1,"MisfirePrevention")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",20,4)
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",1,2)
    HBLA C 1 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM | WRF_NOBOB)
	Goto NanoRegenCheckBegin
    HBLA B 1 A_WeaponReady (WRF_ALLOWZOOM | WRF_NOBOB)
	Goto NanoRegenCheckBegin
    HBLA A 1 A_WeaponReady (WRF_ALLOWZOOM)
	Goto NanoRegenCheckBegin
  NanoRegenCheckBegin:
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip", 20, "ReadyCool")
	Goto NanoRegen
  NanoRegenCheckBeginOverheat:
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip", 20, "ReadyCool")
	Goto NanoRegen+1
  NanoRegen:
	HBLA A 0 A_JumpIfInventory("RLRestrictionNoRecharge",1,"RechargeRestricted") // Cannot recharge in levels that restrict it
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterClip", 1)
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",20,9)
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",2,4)
    HBLA AAC 1 A_WeaponReady (WRF_ALLOWZOOM | WRF_NOBOB)
	Goto NanoRegenCheckBegin
    HBLA AAB 1 A_WeaponReady (WRF_ALLOWZOOM | WRF_NOBOB)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterCoolingDown", 1)
	Goto NanoRegenCheckBegin
    HBLA A 3 A_WeaponReady (WRF_ALLOWZOOM)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterCoolingDown", 1)
    Goto NanoRegenCheckBegin
  ReadyCool:
    HBLA A 3 A_WeaponReady (WRF_ALLOWZOOM)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterCoolingDown", 1)
    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("PowerRLTechnicianMasterDamage", 1)
	TNT1 A 0 A_SpawnItemEx("RLHeavyPulseBlasterPickup", 0, 0, 40, 16, 0, 0, 0, SXF_SETMASTER)
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 1 A_TakeInventory("RLHeavyPulseBlaster",1)
	Stop
	
  AfterModDrop:
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterClip", 1)
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",20,"AfterModDrop2")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",2,"AfterModDrop1")
    HBLA AAC 1 A_WeaponReady (WRF_NOBOB)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterCoolingDown", 1)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterClip", 1)
    HBLA AAC 1 A_WeaponReady (WRF_NOBOB)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterCoolingDown", 1)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterClip", 1)
    HBLA AAC 1 A_WeaponReady (WRF_NOBOB)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterCoolingDown", 1)
	Goto NanoRegenCheckBegin
  AfterModDrop1:
    HBLA AAB 1 A_WeaponReady (WRF_NOBOB)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterCoolingDown", 1)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterClip", 1)
    HBLA AAB 1 A_WeaponReady (WRF_NOBOB)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterCoolingDown", 1)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterClip", 1)
    HBLA AAB 1 A_WeaponReady (WRF_NOBOB)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterCoolingDown", 1)
	Goto NanoRegenCheckBegin
  AfterModDrop2:
    HBLA A 3 A_WeaponReady
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterCoolingDown", 1)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterClip", 1)
    HBLA A 3 A_WeaponReady
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterCoolingDown", 1)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterClip", 1)
    HBLA A 3 A_WeaponReady
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterCoolingDown", 1)
    Goto NanoRegenCheckBegin
  MisfirePrevention:
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",20,6)
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",1,3)
    HBLA C 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
	Goto NanoRegenCheckBegin
    HBLA B 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
	Goto NanoRegenCheckBegin
    HBLA A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto NanoRegenCheckBegin
	
  Deselect:
	TNT1 A 0
	TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterSelected", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("PowerRLTechnicianMasterDamage", 1)
  DeselectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "DeselectRenegade")
    TNT1 AA 0 A_Lower
    HBLA C 1 A_Lower
    Loop
  DeselectRenegade:
    TNT1 A 0 A_Lower
    loop
  SelectRenegade: 
    TNT1 A 0 A_Raise
    loop
  SelectSetWeapon:
	TNT1 A 0 A_GiveInventory("RLMasterAssemblyTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLRechargingAmmoWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLPistolTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLAssembledWeaponToken", 1)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterSelected", 1)
	TNT1 A 0 A_JumpIfInventory("RLScavengerPerk",1, 1)
    Goto SelectLoop
	TNT1 A 0 A_GiveInventory("PowerRLTechnicianMasterDamage", 1)
    Goto SelectLoop
  SelectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "SelectRenegade")
    TNT1 AA 0 A_Raise
    HBLA C 1 A_Raise
    Loop
// 8x damage with Scout, half spread
  Overheat:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblasterzap", 7, 0.7, 0, 1.4)
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",20,"Overheat2")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",1,"Overheat1")
    HBLA CRCRCRCRCR 2 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
	Goto NanoRegenCheckBeginOverheat
  Overheat1:
    HBLA BQBQBQBQBQ 2 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
	Goto NanoRegenCheckBeginOverheat
  Overheat2:
    HBLA APAPAPAPAP 2 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    Goto NanoRegenCheckBeginOverheat
  Fire:
	HBLA A 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"MeleeRestricted") // Cannot fire in levels that restrict it
	HBLA A 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"SilencedRestricted") // Cannot fire in levels that restrict it
	HBLA A 0 A_JumpIfInventory("RLRestrictionBoomOnly",1,"BoomRestricted") // Cannot fire in levels that restrict it
	HBLA A 0 A_JumpIfInventory("RLRestrictionLowTechOnly",1,"LowTechRestricted") // Cannot fire in levels that restrict it
	HBLA A 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"CunningRestricted") // Cannot fire in levels that restrict it
	
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterHeat",100,"Overheat")
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",20,"Fire20")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",19,"Fire19")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",18,"Fire18")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",17,"Fire17")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",16,"Fire16")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",15,"Fire15")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",14,"Fire14")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",13,"Fire13")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",12,"Fire12")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",11,"Fire11")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",10,"Fire10")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",9,"Fire9")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",8,"Fire8")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",7,"Fire7")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",6,"Fire6")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",5,"Fire5")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",4,"Fire4")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",3,"Fire3")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",2,"Fire2")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",1,"Fire1")
	Goto MisfirePrevention
  Fire1:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster1", CHAN_WEAPON, 1, 0, 1)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 1)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_RailAttack ((random(1,7)*4), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish
	TNT1 A 0 A_RailAttack (32, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish
  Fire2:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster1", CHAN_WEAPON, 1, 0, 1)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 1)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_RailAttack ((random(1,7)*6), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish
	TNT1 A 0 A_RailAttack (48, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish
  Fire3:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster1", CHAN_WEAPON, 1, 0, 1)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 1)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_RailAttack ((random(1,7)*8), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish
	TNT1 A 0 A_RailAttack (64, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish
  Fire4:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster1", CHAN_WEAPON, 1, 0, 1)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 2)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_RailAttack ((random(1,7)*10), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish
	TNT1 A 0 A_RailAttack (80, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish
  Fire5:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster2", CHAN_WEAPON, 1, 0, 0.8)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 2)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*12), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish1
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (96, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish1
  Fire6:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster2", CHAN_WEAPON, 1, 0, 0.8)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 3)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*14), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish1
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (112, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish1
  Fire7:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster2", CHAN_WEAPON, 1, 0, 0.8)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 3)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*16), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish1
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (128, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish1
  Fire8:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster2", CHAN_WEAPON, 1, 0, 0.8)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 4)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*18), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish1
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (144, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish1
  Fire9:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster2", CHAN_WEAPON, 1, 0, 0.8)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 4)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*20), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish1
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (160, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish1
  Fire10:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster3", CHAN_WEAPON, 1, 0, 0.7)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 5)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*22), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (176, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
  Fire11:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster3", CHAN_WEAPON, 1, 0, 0.7)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 5)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*24), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (192, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
  Fire12:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster3", CHAN_WEAPON, 1, 0, 0.7)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 6)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*26), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (208, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
  Fire13:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster3", CHAN_WEAPON, 1, 0, 0.7)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 6)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*28), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (224, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
  Fire14:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster3", CHAN_WEAPON, 1, 0, 0.7)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 7)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*30), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (240, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
  Fire15:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster4", CHAN_WEAPON, 1, 0, 0.6)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 7)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*32), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (256, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
  Fire16:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster4", CHAN_WEAPON, 1, 0, 0.6)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 8)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*34), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (272, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
  Fire17:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster4", CHAN_WEAPON, 1, 0, 0.6)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 8)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*36), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (288, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
  Fire18:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster4", CHAN_WEAPON, 1, 0, 0.6)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 9)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*38), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (304, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
  Fire19:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster4", CHAN_WEAPON, 1, 0, 0.6)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 9)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*40), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (320, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
  Fire20:
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster5", CHAN_WEAPON, 1, 0, 0.5)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 10)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,3)
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack ((random(1,7)*42), 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
	TNT1 A 0 A_RailAttack (0, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLParticleBeamCannonPuff2", 0,0, 0, 3, 2, 0, "RLHeavyPulseBlasterRing")
	TNT1 A 0 A_RailAttack (336, 0, 1, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto FireFinish2
  FireFinish:
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",20,6)
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",1,3)
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterClip",20, TIF_NOTAKEINFINITE)
    HBLA D 3 Bright A_GunFlash
	Goto FireFinishFinal
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterClip",20, TIF_NOTAKEINFINITE)
    HBLA E 3 Bright A_GunFlash
	Goto FireFinishFinal
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterClip",20, TIF_NOTAKEINFINITE)
    HBLA F 3 Bright A_GunFlash
	Goto FireFinishFinal
  FireFinish1:
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",20,6)
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",1,3)
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterClip",20, TIF_NOTAKEINFINITE)
    HBLA G 3 Bright A_GunFlash
	Goto FireFinishFinal1
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterClip",20, TIF_NOTAKEINFINITE)
    HBLA H 3 Bright A_GunFlash
	Goto FireFinishFinal1
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterClip",20, TIF_NOTAKEINFINITE)
    HBLA I 3 Bright A_GunFlash
	Goto FireFinishFinal1
  FireFinish2:
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",20,6)
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",1,3)
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterClip",20, TIF_NOTAKEINFINITE)
    HBLA J 3 Bright A_GunFlash
	Goto FireFinishFinal2
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterClip",20, TIF_NOTAKEINFINITE)
    HBLA K 3 Bright A_GunFlash
	Goto FireFinishFinal2
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterClip",20, TIF_NOTAKEINFINITE)
    HBLA L 3 Bright A_GunFlash
	Goto FireFinishFinal2
  FireFinishFinal:
    HBLA C 5
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterHeat",100,"Overheat")
	Goto Ready
  FireFinishFinal1:
    HBLA P 2
    HBLA C 5
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterHeat",100,"Overheat")
	Goto Ready
  FireFinishFinal2:
    HBLA MP 2
    HBLA C 5
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterHeat",100,"Overheat")
	Goto Ready
  Flash:
    TNT1 A 2 A_Light2
    TNT1 A 1 A_Light1
    Goto LightDone
	
  Spawn:
	TNT1 A 0 NoDelay A_SpawnItemEx("RLHeavyPulseBlasterPickup",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION, 0, tid)
    Stop
	
  Altfire:
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate",1, "ArmorModConversion")
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop",1,"ScavengerTime")
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",1,1)
	Goto MisfirePrevention
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterHeat",100,"Overheat")
    HBLA A 2
	TNT1 A 0 A_AlertMonsters
    TNT1 A 0 A_PlaySound("weapons/heavypulseblaster1", CHAN_WEAPON, 1, 0, 1)
	TNT1 A 0 A_GiveInventory("RLHeavyPulseBlasterHeat", 1)
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_RailAttack ((random(1,7)*8), 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto AltFireFinish
	TNT1 A 0 A_RailAttack (56, 0, 0, "none", "Red", RGF_NOPIERCING | RGF_SILENT | RGF_FULLBRIGHT, 0, "RLLaserPuff", 0,0, 0, 3, 1, 0)
    Goto AltFireFinish
  AltFireFinish:
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterClip",1, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",20,4)
	TNT1 A 0 A_JumpIfInventory("RLHeavyPulseBlasterClip",1,2)
    HBLA D 3 Bright A_GunFlash
	Goto FireFinishFinal
    HBLA E 3 Bright A_GunFlash
	Goto FireFinishFinal
    HBLA F 3 Bright A_GunFlash
	Goto FireFinishFinal
  ScavengerTime:
	TNT1 A 0 A_GiveInventory("RLScavengingExtraEffects", 1)
    TNT1 A 0 A_GiveInventory("RLPlasmaInfusionAssemblyLearntToken", 1) // Assembly is now listed in the HUD menus
	TNT1 A 0 A_Print("Mod pack extracted from discarded weapon.")
	TNT1 A 0 A_TakeInventory("RLScavengerDrop",1)
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterHeat", 100)
	TNT1 A 0 A_TakeInventory("PowerRLTechnicianMasterDamage", 1)
	TNT1 A 0 A_Jump(256,1,2,3,4)
	TNT1 A 0 A_FireCustomMissile("DroppedRLPowerMod",0,0,0)
	Goto ScavengerTimeEnd
	TNT1 A 0 A_FireCustomMissile("DroppedRLAgilityMod",0,0,0)
	Goto ScavengerTimeEnd
	TNT1 A 0 A_FireCustomMissile("DroppedRLTechnicalMod",0,0,0)
	Goto ScavengerTimeEnd
	TNT1 A 0 A_FireCustomMissile("DroppedRLTechnicalMod",0,0,0)
	Goto ScavengerTimeEnd
  ScavengerTimeEnd:
	TNT1 A 1 A_TakeInventory("RLHeavyPulseBlaster",1)
	Stop
  }
}

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

ACTOR RLHeavyPulseBlasterRing
{   
   +NOINTERACTION
   +NOGRAVITY
   +FORCEXYBILLBOARD
   Translation "112:127=168:191"
   RenderStyle ADD
   Alpha 0.55
   Scale 0.02
   States
   {
   Spawn:
      TNT1 A 0
      SHOK CGKO 1 Bright
      Stop
   }
}

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

Actor RLHeavyPulseBlasterSelected : RLPermanentInventory {}

ACTOR RLHeavyPulseBlasterClip : Ammo
{
   +INVENTORY.IGNORESKILL
   Inventory.MaxAmount 20
   Inventory.Icon ""
}

actor RLHeavyPulseBlasterHeat : Ammo
{
   +INVENTORY.UNTOSSABLE
   +INVENTORY.IGNORESKILL
   Inventory.MaxAmount 100
   Inventory.Icon STTPRCNT
}

ACTOR RLHeavyPulseBlasterCoolingDown : CustomInventory
{
  -COUNTITEM
  +INVENTORY.ALWAYSPICKUP
  Inventory.PickupMessage ""
  Inventory.PickupSound ""
  States
  {
  Spawn:
    TNT1 A 1
    Stop
  Pickup:
    TNT1 A 0 
	TNT1 A 0 A_JumpIfInventory("PowerRLHeavyPulseBlasterCoolingCooldown", 1, "Nothing")
	TNT1 A 0 A_GiveInventory("PowerRLHeavyPulseBlasterCoolingCooldown", 1)
	TNT1 A 0 A_TakeInventory("RLHeavyPulseBlasterHeat", 1)
    Stop
  Nothing:
    TNT1 A 0 
	Stop
  }
}

ACTOR PowerRLHeavyPulseBlasterCoolingCooldown : Powerup
{
	Powerup.Duration 15
}

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

ACTOR RLHeavyPulseBlasterPickup : RLMasterAssembledWeaponPickup
{
	//$Sprite HBLAX0
	Tag "Heavy Pulse Blaster [Pickup]"
	States
	{
	SpawnFrame:
		HBLA X 4
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
	SpawnLoop:
		"####" "#" 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	FloorHit:
		"####" "#" 0 A_PlaySound("weapons/gundropsmall")
		"####" "#" 0 A_ChangeFlag("SPECIAL", true)
		"####" "#" 0 A_ChangeFlag("THRUACTORS", false)
		"####" "#" 0 A_SetUserVar("user_floorhit", 1)
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Stop
	Pickup:
		"####" "#" 0
		"####" "#" 0 A_JumpIfInventory("RLHeavyPulseBlaster",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("RLHeavyPulseBlaster",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_Print("\ccPicked up a \cvHeavy Pulse Blaster.")
		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= Heavy Pulse Blaster =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup_NoPrint:
		"####" "#" 0
		Fail
	PickupSound:
		"####" "#" 0 A_PlaySound("weapons/HeavyPulseBlasterpickup")
		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 RLHeavyPulseBlasterWorldSpawnPickup : RLHeavyPulseBlasterPickup 17802
{
	States
	{
	NoSpecialStartsStuff:
		TNT1 A 0 A_JumpIf(CallACS("DRLA_opengl"), 3) // If enabled, rarity beam will be cyan, rather than blue
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamAssembledWorld", 0, 0, 0, 0, 0, 0, 0, SXF_SETMASTER)
		TNT1 A 0 A_Jump(256,2)
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamAssembledWorldDRPG", 0, 0, 0, 0, 0, 0, 0, SXF_SETMASTER)
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
	SpawnFrame:
		HBLA X 4
		"####" "#" 0 A_GiveInventory("RLMasterItemSpawnMessageSender",1)
		"####" "#" 0 A_PlaySound("weapons/masterspawned", 7, 0.25, 0, 0)
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
		
	GiveWeapon:
		"####" "#" 0 A_GiveInventory("RLHeavyPulseBlaster",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_Print("\ccPicked up a \cvHeavy Pulse Blaster.")
		"####" "#" 0 A_GiveInventory("RLDangerLevelMasterGiver",1, AAPTR_PLAYER1)
		Goto PickupSound
	}
}
