Actor LegendaryRune : CustomInventory
{
  +FLOATBOB
  +COUNTITEM
  //+INVENTORY.AUTOACTIVATE
  +NOTIMEFREEZE
  ActiveSound "Pickups/Legruneidle"
  Inventory.PickupMessage "Legendary Rune obtained!  That's 3 runes in 1!"
  Inventory.Amount 1
  Inventory.MaxAmount 1
  States
  {
  Spawn:
    TNT1 A 0 A_CustomMissile ("YellowSparkleSpawner", 0, 0, random(0,-360), 2, random(0,360))
    TNT1 A 0 A_LoopActiveSound
	LGRN AAAAAA 10 Bright A_CustomMissile ("LegendaryRuneFlameSpawner", -20, 0, random(0,-360), 2, random(0,360)) 
    Loop
  Pickup:
    TNT1 A 0
    TNT1 A 0 A_JumpIfInventory("LegendaryRuneItem",1,"Nope")//avoid picking it when u got it already
	TNT1 A 0 A_PlaySound("Pickups/Legrune")
	TNT1 A 0 A_GiveInventory("LegRuneDoubleDamage",1)
    TNT1 A 0 A_GiveInventory("LegDoubleFiringSpeed",1)
    TNT1 A 0 A_GiveInventory("LegProtection",1)
	TNT1 A 0 A_GiveInventory("LegIronFeet",1)//The new power
	TNT1 A 0 A_GiveInventory("LegendaryRuneItem",1)
	TNT1 A 1 A_StopSound
	Stop
  Nope:
	LGRN A 1
	Stop	
  }
}

ACTOR LegendaryRuneFlame : LegendarySphereFlame
{
Scale 0.1
States
{
Spawn:
LMKE ABCDEFGHIJKL 2 Bright A_FadeOut
Stop
}
}

ACTOR LegendaryRuneFlameSpawner : LegendarySphereFlameSpawner
{
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "Toaster")
    TNT1 AAAAAA 0 A_SpawnItemEx("LegendaryRuneFlame",random(20,-20),random(20,-20),random(20,40),0,0,random(2,6),0,128,0)
    TNT1 A 0
    Stop
  Toaster:
    TNT1 A 0
	Stop
  }
}


Actor LegRuneDoubleDamage : PowerDamage
{
	+INVENTORY.HUBPOWER
	+INVENTORY.PERSISTENTPOWER
    +NOTIMEFREEZE
	DamageFactor "Normal", 2
	Powerup.Duration 0x7FFFFFFF
}

Actor LegDoubleFiringSpeed : PowerDoubleFiringSpeed
{
	+INVENTORY.HUBPOWER
	+INVENTORY.PERSISTENTPOWER
    +NOTIMEFREEZE
	Powerup.Duration 0x7FFFFFFF
}

Actor LegProtection : PowerProtection
{
	+INVENTORY.PERSISTENTPOWER
	+INVENTORY.HUBPOWER
	+NORADIUSDMG
    +NOTIMEFREEZE
	Powerup.Duration 0x7FFFFFFF
	DamageFactor "Normal", 0.75
	ActiveSound "Pickups/LegProtectionActive"
}

Actor LegIronFeet : PowerIronFeet
{
	+INVENTORY.HUBPOWER
	+INVENTORY.PERSISTENTPOWER
    +NOTIMEFREEZE
	Powerup.Duration 0x7FFFFFFF
	Powerup.Color "FF 40 00", 0.01
}

ACTOR LegendaryRuneItem : Weapon {
	Weapon.SelectionOrder 99999
	+WEAPON.NOALERT
	+INVENTORY.UNDROPPABLE
	+WEAPON.CHEATNOTWEAPON
	+WEAPON.NO_AUTO_SWITCH
    +NOTIMEFREEZE
	States {
	Spawn:
	TNT1 A 0
	Ready:
	TNT1 A 0
	Deselect:
	TNT1 A 0
	Select:
	TNT1 A 0
	Fire:
	TNT1 A 0
	Stop
	}
}

/*Actor LegendaryRuneItem : Inventory
{
  Inventory.MaxAmount 1
}*\