Actor TrueLegendaryRuneIt : TrueLegendaryRune replaces TrueLegendaryRune
{
  Inventory.PickupMessage "\c[l5]You have obtained the True Legendary Rune - a relic of ultimate wrath."
  States
  {
  Spawn:
	TNT1 A 0 NoDelay A_JumpIf(ACS_NamedExecuteWithResult("TrueHardMode") == 1, "Remove")
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("NoTrueLegRune") == 1, "Remove")
	TNT1 A 0 A_PlaySound("TrueLegRune/Idle",7,1.0,1)
	TNT1 A 0 A_SpawnItemEx("BlueSparkleSpawner")
	TGRN A 3 Bright A_CustomMissile("TrueLegendaryRuneFlameSpawner", -20, 0, random(0,-360), 2, random(0,360))
	Loop
  Pickup:
	TNT1 A 0 A_JumpIfInventory("RuneArmorResetCooldown",1,"Nope")
	TNT1 A 0 A_JumpIfInventory("TrueLegendaryRuneUpgradeToken",1,"Done")
	TNT1 A 0 A_JumpIfInventory("TrueLegendaryRuneItem2",1,"Nope")
	TNT1 A 0 A_JumpIfInventory("TrueLegendaryRuneItem",1,"Nope")
	TNT1 A 0 A_PlaySound("TrueLegRune/Pickup",6)
	
	TNT1 A 0 A_TakeInventory("LegendaryRuneToken",1)
	TNT1 A 0 A_TakeInventory("AgilityRuneToken",1)
	TNT1 A 0 A_TakeInventory("VitalityRuneToken",1) //removes the regen too
	
	TNT1 A 0 A_TakeInventory("LegendaryRuneDoubleDamage",1)
	//TNT1 A 0 A_TakeInventory("LegendaryRuneDrain",1)
	
	TNT1 A 0 A_TakeInventory("VitalityRuneProtection",1)
	//TNT1 A 0 A_TakeInventory("VitalityRuneIronFeet",1)
	
	//TNT1 A 0 A_TakeInventory("AgilityRuneRage",1)
	//TNT1 A 0 A_TakeInventory("AgilityRuneSpeed",1)
	
	
	TNT1 A 0 A_GiveInventory("TrueLegRuneDamage",1)
	TNT1 A 0 A_GiveInventory("LegendaryRuneDrain",1)
	
	TNT1 A 0 A_GiveInventory("VitalityRuneIronFeet",1)
	TNT1 A 0 A_GiveInventory("TrueLegProtection",1)
	TNT1 A 0 ACS_NamedExecuteAlways("RuneRegeneration",0,2)
	
	TNT1 A 0 A_GiveInventory("AgilityRuneRage",1)
	TNT1 A 0 A_GiveInventory("AgilityRuneSpeed",1)
	
	TNT1 A 0 A_GiveInventory("TrueLegendaryRuneItem",1)
	TNT1 A 0 A_GiveInventory("TrueLegendaryRuneCheck",1)
	
	TNT1 A 1 A_StopSound(7)
	Stop
  Done:
	TNT1 A 0 A_PlaySound("TrueLegRune/Pickup",6)
	TNT1 A 0 A_Print("\c[l5]The True Legendary Rune has reached its full power!")
	TNT1 A 0 A_TakeInventory("LegendaryRuneToken",1)
	TNT1 A 0 A_TakeInventory("AgilityRuneToken",1)
	TNT1 A 0 A_TakeInventory("VitalityRuneToken",1) //removes the regen too
	TNT1 A 0 A_TakeInventory("TrueLegendaryRuneItem",1)
	TNT1 A 0 A_TakeInventory("TrueLegendaryRuneUpgradeToken",1)
	
	TNT1 A 0 A_TakeInventory("LegendaryRuneDoubleDamage",1)
	//TNT1 A 0 A_TakeInventory("LegendaryRuneDrain",1)
	
	TNT1 A 0 A_TakeInventory("VitalityRuneProtection",1)
	//TNT1 A 0 A_TakeInventory("VitalityRuneIronFeet",1)
	
	//TNT1 A 0 A_TakeInventory("AgilityRuneRage",1)
	TNT1 A 0 A_TakeInventory("AgilityRuneSpeed",1)
	
	TNT1 A 0 A_TakeInventory("TrueLegRuneDamage",1)
	TNT1 A 0 A_TakeInventory("TrueLegProtection",1)
	

	TNT1 A 0 A_GiveInventory("TrueLegRuneDamage2",1)
	TNT1 A 0 A_GiveInventory("LegendaryRuneDrain",1)
	
	TNT1 A 0 A_GiveInventory("VitalityRuneIronFeet",1)
	TNT1 A 0 A_GiveInventory("TrueLegProtection2",1)
	TNT1 A 0 ACS_NamedExecuteAlways("RuneRegeneration",0,3)
	
	TNT1 A 0 A_GiveInventory("AgilityRuneRage",1)
	TNT1 A 0 A_GiveInventory("TrueLegSpeed",1)
	
	TNT1 A 0 A_GiveInventory("TrueLegendaryBFGUpgrade",1)
	
	TNT1 A 0 A_GiveInventory("TrueLegendaryRuneItem2",1)

	TNT1 A 1 A_StopSound(7)
	Stop
	}
}

Actor TrueLegendaryRune2It : TrueLegendaryRune2 replaces TrueLegendaryRune2
{
  Inventory.PickupMessage "\c[l5]Fully upgraded True Legendary Rune obtained! Destroy all who oppose you!"
  States
  {
  Spawn:
	TNT1 A 0 NoDelay A_JumpIf(ACS_NamedExecuteWithResult("TrueHardMode") == 1, "Remove")
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("NoTrueLegRune") == 1, "Remove")
	TNT1 A 0 A_PlaySound("TrueLegRune/Idle",7,1.0,1)
	TNT1 A 0 A_CustomMissile("BlueSparkleSpawner", 0, 0, random(0,-360), 2, random(0,360))
	TGRN B 3 Bright A_CustomMissile("TrueLegendaryRuneFlameSpawner", -20, 0, random(0,-360), 2, random(0,360))
	Loop
  Pickup:
	TNT1 A 0 A_JumpIfInventory("RuneArmorResetCooldown",1,"Nope")
	TNT1 A 0 A_JumpIfInventory("TrueLegendaryRuneItem2",1,"Nope")
	TNT1 A 0 A_PlaySound("TrueLegRune/Pickup",6)
	TNT1 A 0 A_TakeInventory("LegendaryRuneToken",1)
	TNT1 A 0 A_TakeInventory("AgilityRuneToken",1)
	TNT1 A 0 A_TakeInventory("VitalityRuneToken",1) //removes the regen too
	TNT1 A 0 A_TakeInventory("TrueLegendaryRuneItem",1)
	TNT1 A 0 A_TakeInventory("TrueLegendaryRuneUpgradeToken",1)
	
	TNT1 A 0 A_TakeInventory("LegendaryRuneDoubleDamage",1)
	//TNT1 A 0 A_TakeInventory("LegendaryRuneDrain",1)
	
	TNT1 A 0 A_TakeInventory("VitalityRuneProtection",1)
	//TNT1 A 0 A_TakeInventory("VitalityRuneIronFeet",1)
	
	//TNT1 A 0 A_TakeInventory("AgilityRuneRage",1)
	TNT1 A 0 A_TakeInventory("AgilityRuneSpeed",1)
	
	TNT1 A 0 A_TakeInventory("TrueLegRuneDamage",1)
	TNT1 A 0 A_TakeInventory("TrueLegProtection",1)
	

	TNT1 A 0 A_GiveInventory("TrueLegRuneDamage2",1)
	TNT1 A 0 A_GiveInventory("LegendaryRuneDrain",1)
	
	TNT1 A 0 A_GiveInventory("VitalityRuneIronFeet",1)
	TNT1 A 0 A_GiveInventory("TrueLegProtection2",1)
	TNT1 A 0 ACS_NamedExecuteAlways("RuneRegeneration",0,3)
	
	TNT1 A 0 A_GiveInventory("AgilityRuneRage",1)
	TNT1 A 0 A_GiveInventory("TrueLegSpeed",1)
	
	TNT1 A 0 A_GiveInventory("TrueLegendaryBFGUpgrade",1)
	
	TNT1 A 0 A_GiveInventory("TrueLegendaryRuneItem2",1)
	TNT1 A 0 A_GiveInventory("TrueLegendaryRuneCheck",1)

	TNT1 A 1 A_StopSound(7)
	Stop
	}
}

ACTOR TrueLegendaryRuneFlame : LegendaryRuneFlame
{
  States
  {
  Spawn:
	LBG1 ABCDEFGHIJKL 2 Bright A_FadeOut
	Stop
	}
}

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

Actor TrueLegRuneDamage : PowerDamage //Wondering why this is here? In extremely old versions of this mod (Extra Complex), the true leg rune was nerfed, nowadays it is no longer nerfed.
{
  +INVENTORY.HUBPOWER
  +INVENTORY.PERSISTENTPOWER
  +NOTIMEFREEZE
  DamageFactor "Normal", 2.4 //2.4
  DamageFactor "PlayerDTech", 1.8 //1.8
  DamageFactor "PlayerDTRG", 1.25 //1.25
  DamageFactor "Legendary", 2.0 //2.0
  DamageFactor "LegendaryGuru", 1.06
  DamageFactor "LegendaryGuruPlayer", 1.06
  DamageFactor "PlayerNemesisPlasma", 1.6 //1.6
  DamageFactor "PlayerDevBall", 1.25 //1.25
  DamageFactor "PlayerDevBall2", 1.25 //1.25
  DamageFactor "PDTBFG", 1.5 //1.5
  DamageFactor "PlayerDevTracer", 2.0 //2.0
  DamageFactor "PlayerPyro", 1.1
  DamageFactor "PlayerBHole", 1.1
  DamageFactor "DiscoBFG", 1.9 //1.9
  Powerup.Duration 0x7FFFFFFD
}

Actor TrueLegRuneDamage2 : PowerDamage 
{
  +INVENTORY.HUBPOWER
  +INVENTORY.PERSISTENTPOWER
  +NOTIMEFREEZE
  DamageFactor "Normal", 3 //3
  DamageFactor "PlayerDTech", 2.5 //2.5
  DamageFactor "PlayerDTRG", 1.35
  DamageFactor "Legendary", 2.5 //2.5
  DamageFactor "LegendaryGuru", 1.1
  DamageFactor "LegendaryGuruPlayer", 1.1
  DamageFactor "PlayerNemesisPlasma", 2.0 //2.0
  DamageFactor "PlayerDevBall", 1.5 //1.5
  DamageFactor "PlayerDevBall2", 1.5 //1.5
  DamageFactor "PDTBFG", 1.5 //1.5
  DamageFactor "PlayerDevTracer", 2.0 //2.0
  DamageFactor "PlayerPyro", 1.1
  DamageFactor "PlayerBHole", 1.1
  Powerup.Duration 0x7FFFFFFD
}

Actor TrueLegProtection : PowerProtection
{
  +INVENTORY.PERSISTENTPOWER
  +INVENTORY.HUBPOWER
  +NOTIMEFREEZE
  +NORADIUSDMG
  +DONTBLAST
  Powerup.Duration 0x7FFFFFFD
  DamageFactor "Normal", 0.65
  DamageFactor "PDTRifle", 0.0
  DamageFactor "PHellComet", 0.0
  Damagefactor "PlayerPhase", 0.0
  DamageFactor "PlayerPyro", 0.015
  DamageFactor "Explosion", 0.15
  DamageFactor "Mine", 0.15
  DamageFactor "Slime", 0.0
}

Actor TrueLegProtection2 : TrueLegProtection
{
  +DONTRIP
  DamageFactor "Normal", 0.65
  DamageFactor "Explosion", 0.01
  DamageFactor "Legendary", 0.4
  DamageFactor "PyroShot", 0.01
  DamageFactor "RST", 0.1
  DamageFactor "C0mm4nder", 0.25
  DamageFactor "HFCyb3r", 0.25
  DamageFactor "Terminator", 0.25
  DamageFactor "Term", 0.25
  DamageFactor "T3rm", 0.25
  DamageFactor "PDTBFG", 0.05
  DamageFactor "PlayerDTBFG10KBall", 0.05
  DamageFactor "DTBFG10KBall", 0.05
  DamageFactor "BFG10K", 0.05
  DamageFactor "PlayerDevBall", 0.05
  DamageFactor "PlayerDevBall2", 0.05
  DamageFactor "PlayerPyro", 0.005
  DamageFactor "Explosion", 0.05
  DamageFactor "Mine", 0.05
}

ACTOR TrueLegSpeed : PowerSpeed
{
  +INVENTORY.HUBPOWER
  +INVENTORY.PERSISTENTPOWER
  +NOTIMEFREEZE
  Speed 1.5
  Powerup.Duration 0x7FFFFFFD
}

Actor TrueLegDoubleFiringSpeed : PowerDoubleFiringSpeed
{ //This is here because the regular leg double firing speed fucks up if you have the leg rune before you pick up the TLR
+NOTIMEFREEZE
+INVENTORY.HUBPOWER
+INVENTORY.PERSISTENTPOWER
Powerup.Duration 0x7FFFFFFF
}

ACTOR LegArmorRegenBonus : BasicArmorBonus 
{
+INVENTORY.AUTOACTIVATE
+INVENTORY.ALWAYSPICKUP
Armor.SaveAmount 2
Armor.MaxSaveAmount 200
Armor.SavePercent 200
DamageFactor "PDTBFG", 0.1
DamageFactor "PDTBFGTracer", 0.1
DamageFactor "Cyber10K", 0.01
DamageFactor "Legendary", 0.1
DamageFactor "Legendary1", 0.1
DamageFactor "LegendaryGuru", 0.1
DamageFactor "BFGSplash", 0.35
DamageFactor "BFGSpray", 0.35
DamageFactor "Explosion", 0.5
DamageFactor "Plasma", 0.5
Inventory.Icon "LEGAA0"
}

ACTOR LegArmorRegenBonus2 : LegArmorRegenBonus 
{
Armor.SaveAmount 1
Armor.MaxSaveAmount 500
}

Actor TrueLegendaryRuneItem : LegendaryRuneItem { }
Actor TrueLegendaryRuneItem2 : LegendaryRuneItem { }

Actor TrueLegendaryRuneUpgradeToken : GenericLegRuneToken { }





ACTOR LPlayerSmokeSpawner2 : LPlayerSmokeSpawner replaces LPlayerSmokeSpawner
{
States 
{
Spawn:
	TNT1 A 0
	LMKE A 0 A_JumpIfInventory("LegendaryRuneToken",1,"Smoking",AAPTR_TARGET)
	LMKE A 0 A_JumpIfInventory("TrueLegendaryRuneItem",1,"Smoking2",AAPTR_TARGET)
	LMKE A 0 A_JumpIfInventory("TrueLegendaryRuneItem2",1,"Smoking3",AAPTR_TARGET)
	Stop
Smoking2:
	LBG1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "Toaster")
	LBG1 AA 0 Bright A_SpawnItemEx("TrueLPlayerSmoke",random(12,-12),random(12,-12),random(-16,16),0,0,random(1,3),0,128,0)
	LBG1 A 1
	Stop
Smoking3:
	LBG1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "Toaster")
	LBG1 A 0 Bright A_SpawnItemEx("VitalityPlayerSmoke",random(12,-12),random(12,-12),random(-16,16),0,0,random(1,3),0,128,0)
	LBG1 A 0 Bright A_SpawnItemEx("AgilityPlayerSmoke",random(12,-12),random(12,-12),random(-16,16),0,0,random(1,3),0,128,0)
	LBG1 A 0 Bright A_SpawnItemEx("LPlayerSmoke",random(12,-12),random(12,-12),random(-16,16),0,0,random(1,3),0,128,0)
	LBG1 A 0 Bright A_SpawnItemEx("TrueLPlayerSmoke",random(12,-12),random(12,-12),random(-16,16),0,0,random(1,3),0,128,0)
	LMKE A 1
	LBG1 A 1
	Stop
}
}

ACTOR TrueLPlayerSmoke : LPlayerSmoke
{
States 
{
Spawn:
	LBG1 ABCDEFGHIJKL 2 Bright A_FadeOut
	Stop
}
}
