
ACTOR RLHighPowerTristarBlaster : RLHeavyWeapon
{
  Obituary "%o was divided in three by %k's tristar blaster."
  Tag "High Power Tristar Blaster"
  Weapon.SelectionOrder 20
  Weapon.SlotNumber 5
  Weapon.AmmoUse1 1
  Weapon.AmmoGive1 0
  Weapon.AmmoType1 "RLHighPowerTristarBlasterClip"
  Weapon.AmmoType2 "Cell"
  Inventory.Icon "QTRIICON"
  States
  {
  Ready:
	TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown",1,"MisfirePrevention")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterNanoMod",1,"NanoRegenCheck")
    TNT1 A 0 A_GunFlash ("FlashAmmo", GFF_NOEXTCHANGE)
    QTRI A 10 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
    Loop
  NanoRegenCheck:
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterClip",1,"NanoRegenCheckBegin")
    QTRI A 70 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
	Goto NanoRegenCheckBegin
  NanoRegenCheckBegin:
    QTRI A 70 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterBulkMod",1,2)
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterClip", 30, "Ready")
	Goto NanoRegen
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterBulkMod",2,2)
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterClip", 39, "Ready")
	Goto NanoRegen
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterClip", 48, "Ready")
	Goto NanoRegen
  NanoRegen:
    TNT1 A 0 A_GunFlash ("FlashAmmoCharge", GFF_NOEXTCHANGE)
	TNT1 A 0 A_GiveInventory("RLHighPowerTristarBlasterClip", 1)
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterNanoMod",2,3)
    QTRI A 2 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
    QTRI A 15 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
    Goto NanoRegenCheckBegin+1
    QTRI A 2 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
    QTRI A 7 A_WeaponReady (WRF_ALLOWZOOM | WRF_ALLOWRELOAD)
    Goto NanoRegenCheckBegin+1
	
  ScavengerDrop:
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop",1,"WeaponDropConfirm")
	TNT1 A 0 A_GiveInventory("RLScavengerDrop",1)
	TNT1 A 0 A_Print("Press again to drop current weapon,\nor press \crAlt Fire\c- to scrap it to retrieve a Mod Pack.")
	Goto AfterModDrop
  WeaponDropConfirm:
	TNT1 A 0 A_GiveInventory("RLMisfireSpamPreventionCooldown",1)
    TNT1 A 0 A_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 ACS_NamedExecuteWithResult("RLCerberusSetBonusCheck", 1) // Checks for all parts of the set bonus, gives or removes it accordingly - argument is tic delay before checking
	TNT1 A 0 A_TakeInventory("RLScavengerDrop",1)
	TNT1 A 0 A_TakeInventory("RLWeaponDrop",1)
	TNT1 A 0 A_TakeInventory("PowerRLTechnicianBasicDamage", 1)
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterModLimit", 1, "WeaponDropModded")
	TNT1 A 0 A_SpawnItemEx("RLHighPowerTristarBlasterPickup", 0, 0, 40, 8, 0, 0, 0, SXF_SETMASTER)
	Goto WeaponDropRemoval
  WeaponDropModded:
	TNT1 A 2 A_SpawnItemEx("RLHighPowerTristarBlasterPickupModded", 0, 0, 40, 8, 0, 0, 0, SXF_SETMASTER)
  WeaponDropRemoval:
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterModLimit", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterPowerMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterBulkMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterAgilityMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterTechnicalMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 1 A_TakeInventory("RLHighPowerTristarBlaster",1)
	Stop
	
  AfterModDrop:
    TNT1 A 0 A_GunFlash ("FlashAmmo", GFF_NOEXTCHANGE)
    QTRI A 10 A_WeaponReady (WRF_ALLOWRELOAD)
    Goto Ready
  MisfirePrevention:
    TNT1 A 0 A_GunFlash ("FlashAmmo", GFF_NOEXTCHANGE)
    QTRI 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_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
	TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterSelected", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("PowerRLTechnicianBasicDamage", 1)
  DeselectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "DeselectRenegade")
    QTRI 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("RLBasicAssemblyTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLEfficientAmmoTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLAssembledWeaponToken", 1)
	TNT1 A 0 A_GiveInventory("RLHighPowerTristarBlasterSelected", 1)
	TNT1 A 0 A_JumpIfInventory("RLScavengerPerk",1, 1)
    Goto SelectLoop
	TNT1 A 0 A_GiveInventory("PowerRLTechnicianBasicDamage", 1)
    Goto SelectLoop
  SelectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "SelectRenegade")
    QTRI A 1 A_Raise
    Loop
	
  Fire:
	QTRI A 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"MeleeRestricted") // Cannot fire in levels that restrict it
	QTRI A 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"SilencedRestricted") // Cannot fire in levels that restrict it
	QTRI A 0 A_JumpIfInventory("RLRestrictionNoBoom",1,"NoBoomRestricted") // Cannot fire in levels that restrict it
	QTRI A 0 A_JumpIfInventory("RLRestrictionLowTechOnly",1,"LowTechRestricted") // Cannot fire in levels that restrict it
	QTRI A 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"CunningRestricted") // Cannot fire in levels that restrict it
	
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,2)
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterClip",15, 2)
	Goto Reload
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterClip",7, 1)
	Goto Reload
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterFirestormMod",1,"FireF")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterSniperMod",1,"FireS")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterPowerMod",1,"FireP")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterAgilityMod",1,"FireA")
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBall", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBall", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBall", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
  FireP:
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterPowerMod",2,"FirePP")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterAgilityMod",1,"FirePA")
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallP", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallP", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallP", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
  FireA:
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterPowerMod",1,"FirePA")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterAgilityMod",2,"FireAA")
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallA", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallA", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallA", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
  FirePP:
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallPP", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallPP", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallPP", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
  FirePA:
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallPA", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallPA", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallPA", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
  FireAA:
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallAA", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallAA", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallAA", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
  FireS:
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterSniperMod",2,"FireSS")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterFirestormMod",1,"FireFS")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterPowerMod",1,"FireSP")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterAgilityMod",1,"FireSA")
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallS", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallS", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallS", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
  FireSS:
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallSS", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallSS", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallSS", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
  FireSP:
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallSP", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallSP", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallSP", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
  FireSA:
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallSA", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallSA", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallSA", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
  FireF:
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterFirestormMod",2,"FireFF")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterSniperMod",1,"FireFS")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterPowerMod",1,"FireFP")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterAgilityMod",1,"FireFA")
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallF", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallF", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallF", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
  FireFF:
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallFF", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallFF", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallFF", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
  FireFP:
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallFP", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallFP", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallFP", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
  FireFA:
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallFA", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBall", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBall", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
  FireFS:
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallFS", 0, 1)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallFS", 15, 0)
	TNT1 A 0 A_FireCustomMissile ("RLHighPowerTristarBlasterBallFS", -15, 0)
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 6, TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("RLFireangelPerk",1,"FireFinish")
	TNT1 A 0 A_TakeInventory ("RLHighPowerTristarBlasterClip", 8, TIF_NOTAKEINFINITE)
    Goto FireFinish
	
  FireFinish:
    TNT1 A 0 A_SpawnItemEx ("RLBFG9000Recoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 0 A_PlaySound("weapons/highpowertristarblaster", CHAN_WEAPON)
	TNT1 A 0 A_JumpIfInventory("RLCerberusSetBonusActive",1,"FireSetBonus")
    QTRI E 2 Bright A_GunFlash
    QTRI FG 2 Bright
    QTRI HHIJKK 2
    QTRI A 12
    TNT1 A 0 A_GunFlash ("FlashAmmo", GFF_NOEXTCHANGE)
    QTRI A 6 A_Refire
    Goto Ready
  FireSetBonus:
    QTRI E 1 Bright A_GunFlash ("FlashSetBonus")
    QTRI FG 1 Bright
    QTRI HHIJKKA 1
    TNT1 A 0 A_GunFlash ("FlashAmmo", GFF_NOEXTCHANGE)
    QTRI A 6 A_Refire
    Goto Ready
	
  Reload:
    TNT1 A 0 A_GunFlash ("FlashAmmoCharge", GFF_NOEXTCHANGE)
	QTRI A 1 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterBulkMod",1,2)
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterClip", 30, "Ready")
	Goto ReloadStartAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterBulkMod",2,2)
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterClip", 39, "Ready")
	Goto ReloadStartAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterClip", 48, "Ready")
  ReloadStartAmmoCheck:
	TNT1 A 0 A_JumpIfInventory("Cell", 1, 1)
	Goto Ready
    TNT1 A 0 A_GunFlash ("FlashDrop", GFF_NOEXTCHANGE)
	TNT1 A 0 // Play the reload animation.
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterTechnicalMod",2,"Reload2")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterTechnicalMod",1,"Reload1")
    QTRI K 2
    QTRI J 2
    QTRI I 2
    QTRI L 2
    QTRI M 2
    QTRI N 2
    TNT1 A 0 A_PlaySound("weapons/hptristarblasterunload", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLHeavyReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 30
	Goto ReloadWorking
  Reload1:
    QTRI K 2
    QTRI J 2
    QTRI I 2
    QTRI L 2
    QTRI M 2
    QTRI N 2
    TNT1 A 0 A_PlaySound("weapons/hptristarblasterunload", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLHeavyReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 27
	Goto ReloadWorking
  Reload2:
    QTRI K 2
    QTRI J 2
    QTRI I 2
    QTRI L 2
    QTRI M 2
    QTRI N 2
    TNT1 A 0 A_PlaySound("weapons/hptristarblasterunload", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLHeavyReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 24
	Goto ReloadWorking
  ReloadWorking:
	TNT1 A 0 A_TakeInventory("Cell", 1)
	TNT1 A 0 A_GiveInventory("RLHighPowerTristarBlasterClip", 1)
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterBulkMod",1,2)
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterClip",30,5)
	Goto ReloadWorkingAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterBulkMod",2,2)
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterClip",39,3)
	Goto ReloadWorkingAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterClip",48,2)
  ReloadWorkingAmmoCheck:
	TNT1 A 0 A_JumpIfInventory("Cell",1,2)
	TNT1 A 0
	Goto ReloadFinish
	TNT1 A 0
	Goto ReloadWorking
  ReloadFinish:
    TNT1 A 0 A_PlaySound("weapons/hptristarblasterload", 7)
    TNT1 A 0 A_SpawnItemEx ("RLHeavyReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterTechnicalMod",2,"ReloadFinish2")
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterTechnicalMod",1,"ReloadFinish1")
    TNT1 A 16
    QTRI N 2
    QTRI M 2
    QTRI L 2
    QTRI I 2
    QTRI J 2
	QTRI K 2
	QTRI A 2
	Goto Ready
  ReloadFinish1:
    TNT1 A 13
    QTRI N 2
    QTRI M 2
    QTRI L 2
    QTRI I 2
    QTRI J 2
	QTRI K 2
	QTRI A 2
	Goto Ready
  ReloadFinish2:
    TNT1 A 10
    QTRI N 2
    QTRI M 2
    QTRI L 2
    QTRI I 2
    QTRI J 2
	QTRI K 2
	QTRI A 2
	Goto Ready
	
  Flash:
    TNT1 A 2 A_Light1
    TNT1 A 2 A_Light2
    TNT1 A 2 A_Light (3)
    TNT1 A 2 A_Light1
    TNT1 A 0 A_Light0
    Goto LightDone
  FlashSetBonus:
    TNT1 A 1 A_Light1
    TNT1 A 1 A_Light2
    TNT1 A 1 A_Light (3)
    TNT1 A 1 A_Light1
    TNT1 A 0 A_Light0
    Goto LightDone
  FlashAmmo:
    QTRI BCDDDDDDDCB 1 Bright
    Goto LightDone
  FlashAmmoCharge:
    QTRI DDCCBB 1 Bright
    Goto LightDone
  FlashDrop:
    TNT1 A 0 A_Light0
    Goto LightDone
	
  Spawn:
	TNT1 A 0 NoDelay A_SpawnItemEx("RLHighPowerTristarBlasterPickup",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("RLHighPowerTristarBlasterModLimit", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterPowerMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterBulkMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterAgilityMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterTechnicalMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_TakeInventory("PowerRLTechnicianBasicDamage", 1)
	TNT1 A 0 ACS_NamedExecuteWithResult("RLCerberusSetBonusCheck", 1) // Checks for all parts of the set bonus, gives or removes it accordingly - argument is tic delay before checking
	Goto ScavengerTimeEnd
  ScavengerTime:
	TNT1 A 0 A_GiveInventory("RLScavengingExtraEffects", 1)
    TNT1 A 0 A_GiveInventory("RLHighPowerWeaponAssemblyLearntToken", 1) // Assembly is now listed in the HUD menus
	TNT1 A 0 A_JumpIfInventory("RLHighPowerTristarBlasterModLimit",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("RLHighPowerTristarBlasterModLimit", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterPowerMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterBulkMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterAgilityMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterTechnicalMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterSniperMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterFirestormMod", 2)
    TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterNanoMod", 2)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLHighPowerTristarBlasterSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_TakeInventory("PowerRLTechnicianBasicDamage", 1)
	TNT1 A 0 ACS_NamedExecuteWithResult("RLCerberusSetBonusCheck", 1) // Checks for all parts of the set bonus, gives or removes it accordingly - argument is tic delay before checking
  ScavengerContinue:
	TNT1 A 0 A_Jump(256,1,2)
	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("RLHighPowerTristarBlaster",1)
	Stop
  }
}

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

ACTOR RLHighPowerTristarBlasterBall : PlasmaBall
{
	Radius 13
	Height 8
	Alpha 0.85
	Scale 0.45
	Speed 30
	Decal "BlueBFGLightning"
	Damage (random(1,10)*30)
	Damagetype "Plasma"
	Species "Player"
	+THRUSPECIES
	+THRUGHOST
	+FORCEXYBILLBOARD
	SeeSound ""
	DeathSound ""
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(CallACS("DRLA_FancyProjectiles") == 1, "Spawn.Fancy")
			TNT1 A 0 A_Jump (256, "Spawn.Normal")
			Goto Spawn.Normal
		Spawn.Normal:
			BBAL ABCD 2 Bright
			Loop
		Spawn.Fancy:
			BBAL A 2 Bright A_SpawnItemEx("RLHighPowerTristarBlasterFancyTrail",0,0,0,cos(pitch)*20.0,0,0)
			BBAL AAAA 0 A_SpawnItemEx("RLPlasmaFancyTrail", 0,0,0,frandom(-14.0,14.0), frandom(-14.0,14.0), frandom(-7.0,7.0))
			
			BBAL B 2 Bright A_SpawnItemEx("RLHighPowerTristarBlasterFancyTrail",0,0,0,cos(pitch)*20.0,0,0)
			BBAL BBBB 0 A_SpawnItemEx("RLPlasmaFancyTrail", 0,0,0,frandom(-14.0,14.0), frandom(-14.0,14.0), frandom(-7.0,7.0))
			
			BBAL C 2 Bright A_SpawnItemEx("RLHighPowerTristarBlasterFancyTrail",0,0,0,cos(pitch)*20.0,0,0)
			BBAL CCCC 0 A_SpawnItemEx("RLPlasmaFancyTrail", 0,0,0,frandom(-14.0,14.0), frandom(-14.0,14.0), frandom(-7.0,7.0))
			
			BBAL D 2 Bright A_SpawnItemEx("RLHighPowerTristarBlasterFancyTrail",0,0,0,cos(pitch)*20.0,0,0)
			BBAL DDDD 0 A_SpawnItemEx("RLPlasmaFancyTrail", 0,0,0,frandom(-14.0,14.0), frandom(-14.0,14.0), frandom(-7.0,7.0))
			Loop
		Death:
			TNT1 A 0 A_Explode (128,96, 0, 1, 96)
			TNT1 A 0 A_Explode (32,96, XF_HURTSOURCE)
			TNT1 A 0 A_JumpIf(CallACS("DRLA_QuakeNShake") == 0, 3)
			TNT1 A 0 A_Quake (1, 8, 0, 768, "")
			TNT1 A 0 A_Quake (3, 8, 0, 256, "")
			TNT1 A 0 A_PlaySound ("weapons/hptristarblasterhit", 7, 1, 0, 0.5)
			TNT1 A 0 A_PlaySound("weapons/hptristarblasterhit", CHAN_ITEM, 0.05, 0, 0.05)
			TNT1 A 0 A_Jump (256, "DeathAnimation")
			Goto DeathAnimation
		DeathAnimation:
			TNT1 A 0 A_SetScale(1)
			IXPL A 8 Bright
			IXPL B 6 Bright
			IXPL C 4 Bright
			Stop
	}
}

ACTOR RLHighPowerTristarBlasterFancyTrail
{
	Speed 20
	Renderstyle Add
	Scale 0.6
	Alpha 0.15
	+NOINTERACTION
	+FORCEXYBILLBOARD
	States
	{
		Spawn:
			PULS IJKLMNOPQRSRQPONMLKJ 1
			Stop
	}
}

ACTOR RLHighPowerTristarBlasterBallP : RLHighPowerTristarBlasterBall
{
  Damage (random(1,10)*40)
}

ACTOR RLHighPowerTristarBlasterBallA : RLHighPowerTristarBlasterBall
{
  Speed 35
}

ACTOR RLHighPowerTristarBlasterBallPP : RLHighPowerTristarBlasterBall
{
  Damage (random(1,10)*50)
}

ACTOR RLHighPowerTristarBlasterBallPA : RLHighPowerTristarBlasterBall
{
  Speed 35
  Damage (random(1,10)*40)
}

ACTOR RLHighPowerTristarBlasterBallAA : RLHighPowerTristarBlasterBall
{
  Speed 45
}

ACTOR RLHighPowerTristarBlasterBallS : RLHighPowerTristarBlasterBall
{
  States
  {
		Spawn.Normal:
			TNT1 A 0 A_ScaleVelocity(1.10)
			BBAL ABCD 2 Bright
			Loop
		Spawn.Fancy:
			TNT1 A 0 A_ScaleVelocity(1.10)
			BBAL A 2 Bright A_SpawnItemEx("RLHighPowerTristarBlasterFancyTrail",0,0,0,cos(pitch)*20.0,0,0)
			BBAL AAAA 0 A_SpawnItemEx("RLPlasmaFancyTrail", 0,0,0,frandom(-14.0,14.0), frandom(-14.0,14.0), frandom(-7.0,7.0))
			
			BBAL B 2 Bright A_SpawnItemEx("RLHighPowerTristarBlasterFancyTrail",0,0,0,cos(pitch)*20.0,0,0)
			BBAL BBBB 0 A_SpawnItemEx("RLPlasmaFancyTrail", 0,0,0,frandom(-14.0,14.0), frandom(-14.0,14.0), frandom(-7.0,7.0))
			
			TNT1 A 0 A_ScaleVelocity(1.10)
			BBAL C 2 Bright A_SpawnItemEx("RLHighPowerTristarBlasterFancyTrail",0,0,0,cos(pitch)*20.0,0,0)
			BBAL CCCC 0 A_SpawnItemEx("RLPlasmaFancyTrail", 0,0,0,frandom(-14.0,14.0), frandom(-14.0,14.0), frandom(-7.0,7.0))
			
			BBAL D 2 Bright A_SpawnItemEx("RLHighPowerTristarBlasterFancyTrail",0,0,0,cos(pitch)*20.0,0,0)
			BBAL DDDD 0 A_SpawnItemEx("RLPlasmaFancyTrail", 0,0,0,frandom(-14.0,14.0), frandom(-14.0,14.0), frandom(-7.0,7.0))
			Loop
  }
}

ACTOR RLHighPowerTristarBlasterBallSS : RLHighPowerTristarBlasterBall
{
  States
  {
		Spawn.Normal:
			TNT1 A 0 A_ScaleVelocity(1.25)
			BBAL ABCD 2 Bright
			Loop
		Spawn.Fancy:
			TNT1 A 0 A_ScaleVelocity(1.25)
			BBAL A 2 Bright A_SpawnItemEx("RLHighPowerTristarBlasterFancyTrail",0,0,0,cos(pitch)*20.0,0,0)
			BBAL AAAA 0 A_SpawnItemEx("RLPlasmaFancyTrail", 0,0,0,frandom(-14.0,14.0), frandom(-14.0,14.0), frandom(-7.0,7.0))
			
			BBAL B 2 Bright A_SpawnItemEx("RLHighPowerTristarBlasterFancyTrail",0,0,0,cos(pitch)*20.0,0,0)
			BBAL BBBB 0 A_SpawnItemEx("RLPlasmaFancyTrail", 0,0,0,frandom(-14.0,14.0), frandom(-14.0,14.0), frandom(-7.0,7.0))
			
			TNT1 A 0 A_ScaleVelocity(1.25)
			BBAL C 2 Bright A_SpawnItemEx("RLHighPowerTristarBlasterFancyTrail",0,0,0,cos(pitch)*20.0,0,0)
			BBAL CCCC 0 A_SpawnItemEx("RLPlasmaFancyTrail", 0,0,0,frandom(-14.0,14.0), frandom(-14.0,14.0), frandom(-7.0,7.0))
			
			BBAL D 2 Bright A_SpawnItemEx("RLHighPowerTristarBlasterFancyTrail",0,0,0,cos(pitch)*20.0,0,0)
			BBAL DDDD 0 A_SpawnItemEx("RLPlasmaFancyTrail", 0,0,0,frandom(-14.0,14.0), frandom(-14.0,14.0), frandom(-7.0,7.0))
			Loop
  }
}

ACTOR RLHighPowerTristarBlasterBallSP : RLHighPowerTristarBlasterBallS
{
  Damage (random(1,10)*40)
}

ACTOR RLHighPowerTristarBlasterBallSA : RLHighPowerTristarBlasterBallS
{
  Speed 35
}

ACTOR RLHighPowerTristarBlasterBallF : RLHighPowerTristarBlasterBall
{
  States
  {
  Death:
    TNT1 A 0 A_Explode (128,128, 0, 1, 128)
    TNT1 A 0 A_Explode (32,128, XF_HURTSOURCE)
	TNT1 A 0 A_JumpIf(CallACS("DRLA_QuakeNShake") == 0, 3)
    TNT1 A 0 A_Quake (1, 8, 0, 768, "")
    TNT1 A 0 A_Quake (3, 8, 0, 256, "")
    TNT1 A 0 A_PlaySound ("weapons/hptristarblasterhit", 7, 1, 0, 0.5)
    TNT1 A 0 A_PlaySound("weapons/hptristarblasterhit", CHAN_ITEM, 0.05, 0, 0.05)
    TNT1 A 0 A_Jump (256, "DeathAnimation")
	Goto DeathAnimation
  }
}

ACTOR RLHighPowerTristarBlasterBallFF : RLHighPowerTristarBlasterBall
{
  States
  {
  Death:
    TNT1 A 0 A_Explode (128,160, 0, 1, 160)
    TNT1 A 0 A_Explode (32,160, XF_HURTSOURCE)
	TNT1 A 0 A_JumpIf(CallACS("DRLA_QuakeNShake") == 0, 3)
    TNT1 A 0 A_Quake (1, 8, 0, 768, "")
    TNT1 A 0 A_Quake (3, 8, 0, 256, "")
    TNT1 A 0 A_PlaySound ("weapons/hptristarblasterhit", 7, 1, 0, 0.5)
    TNT1 A 0 A_PlaySound("weapons/hptristarblasterhit", CHAN_ITEM, 0.05, 0, 0.05)
    TNT1 A 0 A_Jump (256, "DeathAnimation")
	Goto DeathAnimation
  }
}

ACTOR RLHighPowerTristarBlasterBallFP : RLHighPowerTristarBlasterBallP
{
  States
  {
  Death:
    TNT1 A 0 A_Explode (144,128, 0, 1, 128)
    TNT1 A 0 A_Explode (48,128, XF_HURTSOURCE)
	TNT1 A 0 A_JumpIf(CallACS("DRLA_QuakeNShake") == 0, 3)
    TNT1 A 0 A_Quake (1, 8, 0, 768, "")
    TNT1 A 0 A_Quake (3, 8, 0, 256, "")
    TNT1 A 0 A_PlaySound ("weapons/hptristarblasterhit", 7, 1, 0, 0.5)
    TNT1 A 0 A_PlaySound("weapons/hptristarblasterhit", CHAN_ITEM, 0.05, 0, 0.05)
    TNT1 A 0 A_Jump (256, "DeathAnimation")
	Goto DeathAnimation
  }
}

ACTOR RLHighPowerTristarBlasterBallFA : RLHighPowerTristarBlasterBallA
{
  States
  {
  Death:
    TNT1 A 0 A_Explode (128,128, 0, 1, 128)
    TNT1 A 0 A_Explode (32,128, XF_HURTSOURCE)
	TNT1 A 0 A_JumpIf(CallACS("DRLA_QuakeNShake") == 0, 3)
    TNT1 A 0 A_Quake (1, 8, 0, 768, "")
    TNT1 A 0 A_Quake (3, 8, 0, 256, "")
    TNT1 A 0 A_PlaySound ("weapons/hptristarblasterhit", 7, 1, 0, 0.5)
    TNT1 A 0 A_PlaySound("weapons/hptristarblasterhit", CHAN_ITEM, 0.05, 0, 0.05)
    TNT1 A 0 A_Jump (256, "DeathAnimation")
	Goto DeathAnimation
  }
}

ACTOR RLHighPowerTristarBlasterBallFS : RLHighPowerTristarBlasterBallS
{
  States
  {
  Death:
    TNT1 A 0 A_Explode (128,128, 0, 1, 128)
    TNT1 A 0 A_Explode (32,128, XF_HURTSOURCE)
	TNT1 A 0 A_JumpIf(CallACS("DRLA_QuakeNShake") == 0, 3)
    TNT1 A 0 A_Quake (1, 8, 0, 768, "")
    TNT1 A 0 A_Quake (3, 8, 0, 256, "")
    TNT1 A 0 A_PlaySound ("weapons/hptristarblasterhit", 7, 1, 0, 0.5)
    TNT1 A 0 A_PlaySound("weapons/hptristarblasterhit", CHAN_ITEM, 0.05, 0, 0.05)
    TNT1 A 0 A_Jump (256, "DeathAnimation")
	Goto DeathAnimation
  }
}

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

Actor RLHighPowerTristarBlasterSelected : RLPermanentInventory {}
Actor RLHighPowerTristarBlasterModLimit : RLBasicAssemblyModAmount {}
Actor RLHighPowerTristarBlasterPowerMod : RLBasicAssemblyModAmount {}
Actor RLHighPowerTristarBlasterBulkMod : RLBasicAssemblyModAmount {}
Actor RLHighPowerTristarBlasterAgilityMod : RLBasicAssemblyModAmount {}
Actor RLHighPowerTristarBlasterTechnicalMod : RLBasicAssemblyModAmount {}
Actor RLHighPowerTristarBlasterNanoMod : RLBasicAssemblyModAmount {}
Actor RLHighPowerTristarBlasterFirestormMod : RLBasicAssemblyModAmount {}
Actor RLHighPowerTristarBlasterSniperMod : RLBasicAssemblyModAmount {}

ACTOR RLHighPowerTristarBlasterClip : Ammo
{
   +INVENTORY.IGNORESKILL
   Inventory.MaxAmount 50
   Inventory.Icon ""
}

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

ACTOR RLHighPowerTristarBlasterPickup : RLBasicAssembledWeaponPickup 17417
{
	//$Sprite QTRIX0
	Tag "High Power Tristar Blaster [Pickup]"
	States
	{
	SpawnFrame:
		QTRI 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/gundropbigger")
		"####" "#" 0 A_ScaleVelocity (0.15)
		"####" "#" 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("RLHighPowerTristarBlaster",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 ACS_NamedExecuteWithResult("RLCerberusSetBonusCheck", 1) // Checks for all parts of the set bonus, gives or removes it accordingly - argument is tic delay before checking
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon
	GiveWeapon:
		"####" "#" 0 A_GiveInventory("RLHighPowerTristarBlaster",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_Print("\ccPicked up a \cvHigh Power Tristar 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= High Power Tristar Blaster =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup_NoPrint:
		"####" "#" 0
		Fail
	PickupSound:
		"####" "#" 0 A_PlaySound("weapons/hpTristarBlasterpickup")
		Stop
/*	SetBonusStart:
		"####" "#" 0 A_GiveInventory("RLCerberusSetBonusTristarBlaster",1)
		"####" "#" 0 A_JumpIfInventory("RLCerberusSetBonusBoots",1,"SetBonusCheck")
		"####" "#" 0 A_JumpIfInventory("RLCerberusSetBonusArmor",1,"SetBonusCheck")
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon
	SetBonusCheck:
		"####" "#" 0 A_JumpIfInventory("RLCerberusSetBonusBoots",1,2)
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon
		"####" "#" 0 A_JumpIfInventory("RLCerberusSetBonusArmor",1,2)
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon
		"####" "#" 0 A_GiveInventory("RLCerberusSetBonusActive",1)
		"####" "#" 0 A_Print("\ccPicked up a \cvHigh Power Tristar Blaster.\n\c-= TRINITY GUARDIAN =\n\ccTristar Blaster fires three times faster", 8, "CONFONT")
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon*/
//==============================================================================
	MarathonStuff:
		"####" "#" 0 A_SpawnItemEx("RLMarathonShells",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
	}
}

ACTOR RLHighPowerTristarBlasterPickupModded : RLHighPowerTristarBlasterPickup
{
	+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:
		QTRI 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("RLHighPowerTristarBlaster",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cv= High Power Tristar Blaster =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("RLHighPowerTristarBlasterModLimit", 1, "NotPickup_Modded")
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cv= High Power Tristar Blaster =\n\n\ccYou replace your unmodded\n\ccweapon with the one you picked up.", 5, "CONFONT")
		"####" "#" 0 A_GiveInventory("Cell",30)
		Goto PickupSound
	NotPickup_Modded:
		"####" "#" 0 A_Print("\cv= High Power Tristar Blaster =\n\n\caYou are already carrying a modded\n\caweapon of this type", 5, "CONFONT")
		Fail
	SetBonusStart:
		"####" "#" 0 A_GiveInventory("RLCerberusSetBonusTristarBlaster",1)
		"####" "#" 0 A_JumpIfInventory("RLCerberusSetBonusBoots",1,"SetBonusCheck")
		"####" "#" 0 A_JumpIfInventory("RLCerberusSetBonusArmor",1,"SetBonusCheck")
		"####" "#" 0 A_Print("\ccPicked up a \cbmodded \cvHigh Power Tristar Blaster.")
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon
	}
}
