Actor LegDemonRune2 : LegDemonRune replaces LegDemonRune
{
  //$Category Powerups/LCA
  //$Sprite LDRNA0
  //$Title "Legendary Demon Rune"
  Inventory.PickupMessage "A surge of Legendary energy goes straight to your bones as you pick up the Legendary Demon Rune."
  Inventory.PickupSound "legendarypowersphere/pickup"
  Inventory.Icon "LDRNM0"
  Inventory.MaxAmount 1
  +INVBAR
  +COUNTITEM
  +INVENTORY.BIGPOWERUP
  +NOTIMEFREEZE
  +FLOAT
  +FLOATBOB
  ActiveSound "legdemonrune/idle"
  Tag "legendary Demon Rune"
  States
  {
  Use:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("INFGetClass") == 1,"Failed")
	TNT1 A 0 A_JumpIfInventory("DPRActionSkillActive",1,"Failed")
	TNT1 A 0 ACS_NamedExecuteWithResult("INFGetPlayerInfo",0)
	TNT1 A 0 ACS_NamedExecuteAlways("INFSetupPlayerLegendaryRev2",0)
	TNT1 A 0 A_GiveInventory("LegDemonRuneGiver2")
	TNT1 A 0 A_PlaySound("legendaryrevenant/see", CHAN_AUTO, 1.0, False, ATTN_NONE)
	Stop  	
  Spawn:
	TNT1 A 0 NoDelay A_JumpIf(ACS_NamedExecuteWithResult("NexusNoFloat") == 0,2)
	TNT1 A 0 A_ChangeFlag(FLOATBOB,0)
	TNT1 A 0 A_SpawnItemEx("LegDemonRuneParticleSpawner",0,0,32,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION) 
	TNT1 AAAAAAAAAAAAA 0 A_SpawnItemEx("ArmorParticleBlue",Random(-12,12),Random(-12,12),Random(16,40),Random(-2,2),Random(-2,2),Random(-2,2),Random(-20,20),SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LDRN ABCDEFGJHIJKL 5 Bright A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	Goto Spawn+2	
  Pickup:
	TNT1 A 1 A_StopSound
	Stop
  Failed:
    TNT1 A 0
	Fail
  }
}

ACTOR LegDemonRuneGiver2 : PowerupGiver
{
Powerup.Duration -80  //80
+INVENTORY.AUTOACTIVATE
+INVENTORY.ALWAYSPICKUP
+NOTIMEFREEZE
Inventory.MaxAmount 1
Powerup.Type "LegendaryPlayer2"
}

ACTOR PowerLegendaryPlayer2 : PowerMorph
{
+NOTIMEFREEZE
PowerMorph.PlayerClass "Demon_LegendaryRevenant2"
PowerMorph.MorphFlash "None"
PowerMorph.UnMorphFlash "None"
PowerMorph.MorphStyle (MRF_FULLHEALTH|MRF_ADDSTAMINA|MRF_NEWTIDBEHAVIOUR|MRF_WHENINVULNERABLE|MRF_LOSEACTUALWEAPON|MRF_UNDOBYDEATH|MRF_UNDOBYDEATHSAVES)
}

ACTOR Demon_LegendaryRevenant2 : PlayerPawn
{
  Speed 1
  Mass 300
  Radius 20
  Height 56
  Health 1350
  Scale 1.1
  Player.MaxHealth 1350
  Player.ForwardMove 1.3
  Player.SideMove 1.3
  Player.JumpZ 10
  BloodColor "Blue"
 Player.SoundClass "LegRevenant"
  Player.DisplayName "Legendary Revenant"
  Player.AttackZOffset 0
  Player.DamageScreenColor Blue, 0.1
  Player.MorphWeapon "LegendaryRevenant-Weapons2"
  DamageFactor "LegendaryPlayer", 0.0
  DamageFactor "LegendaryGuruPlayer", 0.0
  DamageFactor 0.65
  DamageFactor "Legendary1", 0.0
  DamageFactor "Legendary", 0.0
  DamageFactor "LegendaryGuru", 0.0
  DamageFactor "CadaverRocket", 0.0
  SeeSound "legendaryrevenant/see"
  PainSound "legendaryrevenant/pain"
  DeathSound "legendaryrevenant/death"
  ActiveSound "legendaryrevenant/idle"
  MeleeSound "skeleton/melee"
  Species "Player"
  var int user_pnum;
  +THRUSPECIES
  +DONTHARMSPECIES
  +NORADIUSDMG
  +NOSKIN
  +DONTRIP
  +NOPAIN
  +BOSS
  +BOSSDEATH
  +NOTIMEFREEZE
  -PICKUP
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_SetUserVar("user_pnum",ACS_NamedExecuteWithResult("GetPlayerNumber"))
	TNT1 A 0 ACS_NamedExecuteAlways("LegDemonRuneMusic",0,user_pnum)
	LREV A 10 Bright
	Loop
  See:
	TNT1 A 0
	TNT1 A 0 ACS_NamedExecuteAlways("LegDemonRuneMusic",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BonyStep",0,0,0,0)
	LREV AAA 2 Bright
	LREV BBB 2 Bright
	LREV CCC 2 Bright
	LREV DDD 2 Bright
	LREV EEE 2 Bright
	LREV FFF 2 Bright
	TNT1 A 0 A_SpawnItem("BonyStep",0,0,0,0)
	Goto Spawn
  Missile:
	LREV J 1 Bright
	LREV J 0 A_JumpIfInventory("LegRevWeapType",7,2)
	LREV J 0 A_Jump(256,2)
	LREV J 0
	Goto Missile7
	LREV J 0 A_JumpIfInventory("LegRevWeapType",6,2)
	LREV J 0 A_Jump(256,2)
	LREV J 0
	Goto Missile6
	LREV J 0 A_JumpIfInventory("LegRevWeapType",5,2)
	LREV J 0 A_Jump(256,2)
	LREV J 0
	Goto Missile5
	LRDY A 0 A_JumpIfInventory("LegRevWeapType",4,2)
	LRDY A 0 A_Jump(256,2)
	LRDY A 0
	Goto Missile4
	LREV J 0 A_JumpIfInventory("LegRevWeapType",3,2)
	LREV J 0 A_Jump(256,2)
	LREV J 0
	Goto Missile3
	LREV J 0 A_JumpIfInventory("LegRevWeapType",2,2)
	LREV J 0 A_Jump(256,2)
	LREV J 0
	Goto Missile1
	LREV J 0 A_JumpIfInventory("LegRevWeapType",1,2)
	LREV J 0 A_Jump(256,2)
	LREV J 0
	Goto Missile2
	LREV J 1 Bright A_Jump(256,"Missile1")
	Goto Spawn
  Missile1:
	LREV J 1 Bright
	LREV JKK 10 Bright
	Goto Spawn	
  Missile2:
	LREV J 35 Bright
	LREV K 84 Bright
	Goto Spawn
  Missile3:	
	LREV GHI 4 Bright
	Goto See	
  Missile4:
	LREV J 35 Bright
	LREV K 10 Bright
	Goto Spawn	
  Missile5:
	LREV J 80 Bright
	LREV K 10 Bright
	Goto Spawn	
  Missile6:
	LREV GH 5 Bright
	LREV I 3 Bright
	Goto Spawn	
  Missile7:
	LREV G 0
	LREV G 0 A_Jump(127,4)
	LREV GHI 2 Bright
	Goto See
	LREV RST 2 Bright
	Goto See
  Death: 
	LREV LM 7
	LREV N 7 A_Scream
	LREV O 7 A_NoBlocking
	LREV P 7
	LREV Q -1
	Stop
  }
}

Actor LegendaryRevenant-Weapons2 : LegendaryRevenant-Weapons { +WEAPON.NOAUTOFIRE }

Actor LegendaryRevenant-Weapons2 : LegendaryRevenant-Weapons { +WEAPON.NOAUTOFIRE }

Actor PlayerLegRevBall00 : PlayerLegRevBall Replaces PlayerLegRevBall { Damagetype "Players" }

Actor PlayerLegRevBall20 : PlayerLegRevBall2 Replaces PlayerLegRevBall2 { Damagetype "Players" }

Actor PlayerLegRevRocketNex : PlayerLegRevRocket Replaces PlayerLegRevRocket { Damagetype "Players" }

Actor PlayerLegRevFloorDeadHandsNex : PlayerLegRevFloorDeadHands Replaces PlayerLegRevFloorDeadHands
{
Damagetype "Players"
States
{
  Spawn:
	LRHD MNO 2 A_SpawnItemEx("PlayerLRUndeadHand",random(-16,16),random(-16,16))
	Loop
  Death: 
	TNT1 A 0
	TNT1 AAAAAAA 0 A_SpawnItemEx("PlayerLRUndeadHand",random(-48,48),random(-48,48))
	TNT1 A 1
	Stop
	}
}

Actor PlayerLegRevRocketNex : PlayerLRUndeadHand Replaces PlayerLRUndeadHand { Damagetype "Players" }

Actor PlayerLegRevRailgunProjNex : PlayerLegRevRailgunProj Replaces PlayerLegRevRailgunProj { Damagetype "Players" }

Actor PlayerLegRevBall3Nex : PlayerLegRevBall3 Replaces PlayerLegRevBall3
{
Damagetype "Players"
States
{
  Death:
	TNT1 A 0 A_Explode(128,128,0)
	TNT1 A 0 A_SpawnItemEx("BlueParticleSpawner", 0, 0, 0, 0, 0, 0, 0, SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 A 0 A_SpawnItemEx("LNCometDeath",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_PlaySound("lrball3/exp")
	TNT1 AAAAAAAA 0 A_SpawnItemEx("PlayerLegRevSmallBall3",Random(-8,8),Random(-8,8),Random(-8,8),Random(45,70),0,Random(-3,3),Random(170,190),SXF_NOCHECKPOSITION)	
	TNT1 AAAAAAAAAAAAAAAA 0 A_SpawnItemEx("PlayerLegRevSmallBall3",Random(-8,8),Random(-8,8),Random(-8,8),Random(45,70),0,Random(-3,3),Random(-14,14),SXF_NOCHECKPOSITION)
	MMSD A 8 bright A_Explode(38, 140, 0)
	Stop
	}
}

Actor PlayerLegRevSmallBall3Nex : PlayerLegRevSmallBall3 Replaces PlayerLegRevSmallBall3 { Damagetype "Players" }

Actor PlayerLRDashPunchNex : PlayerLRDashPunch Replaces PlayerLRDashPunch { Damagetype "Players" }

Actor PlayerLRPunchNex : PlayerLRPunch Replaces PlayerLRPunch { Damagetype "Players" }

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

Actor PlayerHealth : Inventory
{
  Inventory.Amount 1
  Inventory.MaxAmount 6666
  Inventory.InterHubAmount 120
  -INVENTORY.INVBAR
  -COUNTITEM
}

Actor PlayerArmor: Inventory
{
  Inventory.Amount 1
  Inventory.MaxAmount 6666
  Inventory.InterHubAmount 1200
  -INVENTORY.INVBAR
  -COUNTITEM
}

Actor FakeArmorBonus : ArmorBonus  //Do not put this in spawners
{
Armor.SaveAmount 1
Armor.SavePercent 35
Armor.MaxSaveAmount 6666
Inventory.Pickupmessage ""
Inventory.PickupSound ""
-INVENTORY.ALWAYSPICKUP
-COUNTITEM
States
{
Spawn:
	TNT1 A 0
	TNT1 A 0
	Stop
	}
}

Actor PlayerMorphed : Inventory
{
  Inventory.Amount 1
  Inventory.MaxAmount 1
  Inventory.InterHubAmount 1
  -INVENTORY.INVBAR
  -COUNTITEM
}

//Leg App

ACTOR LegMarkedGiverInception : CustomInventory //Replaces LegMarkedGiverInception
{
+INVENTORY.AUTOACTIVATE
+INVENTORY.ALWAYSPICKUP
+NOTIMEFREEZE
Inventory.MaxAmount 1
States
{
  Use:
    TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("LegAppMorphCheck") == 1,"Failed")
    TNT1 A 0 ACS_NamedExecuteWithResult("INFGetPlayerInfo",0)
	TNT1 A 1 A_GiveInventory("LegMarkedGiver",1)
	Stop
  Failed:
    TNT1 A 1
	Stop
	}
}