Actor TrueLegendaryWeaponSphere : TrueLegAmmoSphere
{
Inventory.MaxAmount 3
Inventory.InterhubAmount 3
Inventory.Icon "TLW3K0"
Inventory.UseSound "truelegweaponsphere/use"
Inventory.PickupMessage "\c[X5]True legendary Weapon Sphere\c-"
Inventory.PickupSound "wem/pickup"
Tag "True legendary Weapon Sphere - Turn all yellow weapons into blue, temporarily!"
Scale 0.24
Renderstyle Add
States
{
  Spawn:
	TNT1 A 0 NoDelay A_JumpIf(ACS_NamedExecuteWithResult("NexusNoFloat") == 0,2)
	TNT1 A 0 A_ChangeFlag(FLOATBOB,0)
    TNT1 A 0 A_CustomMissile ("BlueSparkleSpawner", -20, 0, random(0,-360), 2, random(0,360))
	TLW3 AAAA 10 Bright A_CustomMissile ("TrueLegendarySphereFlameSpawner", -20, 0, random(0,-360), 2, random(0,360))
	TNT1 A 0 A_CustomMissile ("BlueSparkleSpawner", -20, 0, random(0,-360), 2, random(0,360))
	TNT1 A 0 A_CustomMissile ("TrueLegendarySphereFlameSpawner", -20, 0, random(0,-360), 2, random(0,360))
	TLW3 BCDEFGHIJ 3 Bright
    Goto Spawn+2
  Use:
    TNT1 A 0
	TNT1 A 0 A_JumpIfInventory("TrueLegWeaponSphereToken",1,"Nope")
	TNT1 A 1 ACS_NamedExecuteAlways("TrueLegWeaponSphereActive",0)
	Stop
  Nope:
    TNT1 A 0
	TNT1 A 0 ACS_NamedLockedExecute("PowerRegenMessage",0)
	TNT1 A 1
	Fail
}
}

Actor TrueLegWeaponSphereTimer : PowerDoubleDamage
{
DamageFactor "nothing", 1.0
Powerup.duration -60
}

Actor TrueLegWeaponSphereGiver : PowerupGiver
{
  -COUNTITEM
  +INVENTORY.AUTOACTIVATE
  -INVENTORY.ALWAYSPICKUP
  -INVENTORY.INVBAR
  Inventory.Amount 0
  Inventory.MaxAmount 0
  Powerup.Type "TrueLegWeaponSphereTimer"
  Powerup.Duration -60
  Powerup.Color None 0.0
}

ACTOR TrueLegWeaponSphereToken : Inventory { Inventory.MaxAmount 1 }

Actor TrueLegendaryWeaponSphereSpawner : NemesisHKSummoner Replaces TrueLegUpgradeSpawnerWeak
{
States
{
  Spawn:
   TNT1 A 0
   TNT1 A 1 A_Jump(255,"Death")
   Loop
  Death:
   //TNT1 A 0 A_SpawnItemEx("TeleportFog")
   TNT1 A 5 A_SpawnItemEx("TrueLegendaryWeaponSphere",Random(-5,5),Random(-5,5),0,Random(-5,5),Random(-5,5))
   TNT1 A 1 A_Fall
   Stop
	}
}

Actor TrueLegendaryWeaponSphereSpawner2 : TrueLegendaryWeaponSphereSpawner Replaces TrueLegUpgradeSpawnerMedium
{
States
{
  Death:
   TNT1 A 0 A_SpawnItemEx("TrueLegendaryWeaponSphere",Random(-5,5),Random(-5,5),0,Random(-5,5),Random(-5,5))
   TNT1 A 5 A_SpawnItemEx("TrueLegendaryWeaponSphere",Random(-5,5),Random(-5,5),0,Random(-5,5),Random(-5,5))
   TNT1 A 1 A_Fall
   Stop
	}
}

Actor TrueLegendaryWeaponSphereSpawner3 : TrueLegendaryWeaponSphereSpawner Replaces TrueLegUpgradeSpawnerStrong
{
States
{
  Death:
   TNT1 A 0 A_SpawnItemEx("TrueLegendaryWeaponSphere",Random(-5,5),Random(-5,5),0,Random(-5,5),Random(-5,5))
   TNT1 A 0 A_SpawnItemEx("TrueLegendaryWeaponSphere",Random(-5,5),Random(-5,5),0,Random(-5,5),Random(-5,5))
   TNT1 A 5 A_SpawnItemEx("TrueLegendaryWeaponSphere",Random(-5,5),Random(-5,5),0,Random(-5,5),Random(-5,5))
   TNT1 A 1 A_Fall
   Stop
	}
}

Actor INFLegendaryWeaponsUpgrade : TrueLegendaryWeaponSphereSpawner Replaces TrueLegendaryWeaponsUpgrade {}