Actor ZamasuVitalityRune : VitalityRune
{
Inventory.PickupMessage "Zamasu Vitality Rune: Regeneration and Resistance"
  States
  {
  Spawn:
	TNT1 A 0 NoDelay A_JumpIf(ACS_NamedExecuteWithResult("TrueHardMode") == 1, "Remove")
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("NexusNoFloat") == 0,2)
	TNT1 A 0 A_ChangeFlag(FLOATBOB,0)
	TNT1 A 0 A_PlaySound("ZamasuRune3/Idle",7,1.0,1)
    TNT1 A 0 A_SpawnItemEx("VitalityRuneFXSpawner")
	ZMRA AAA 10 Bright A_SpawnItemEx("NemesisRuneFlameSpawner",0,0,-20)
    Goto Spawn+3
  Pickup:
	TNT1 A 0 A_JumpIfInventory("RuneArmorResetCooldown",1,"Nope")
	TNT1 A 0 A_JumpIfInventory("TrueLegendaryRuneItem2",1,"Nope")
	TNT1 A 0 A_JumpIfInventory("TrueLegendaryRuneItem",1,"Enhance")
    TNT1 A 0 A_JumpIfInventory("VitalityRuneToken",1,"Nope")
	TNT1 A 0 A_PlaySound("ZamasuRune/Pickup",6)
	TNT1 A 0 A_GiveInventory("ZamasuVitalityRuneProtection",1)
	TNT1 A 0 A_GiveInventory("ZamasuVitalityRuneIronFeet",1)
	TNT1 A 0 ACS_NamedExecuteAlways("RuneRegenerationNexus",0,1)
	TNT1 A 0 A_GiveInventory("ZamasuVitalityRuneToken",1)
	TNT1 A 1 A_StopSound(7)
	Stop
	}
}

Actor ZamasuVitalityRuneProtection : PowerProtection
{
  +INVENTORY.PERSISTENTPOWER
  +INVENTORY.HUBPOWER
  +NOTIMEFREEZE
  Powerup.Duration 0x7FFFFFFF
  +NORADIUSDMG
  DamageFactor "Normal", 0.50
  Damagefactor "PlayerPhase", 0.0
  DamageFactor "PlayerPyro", 0.001
  DamageFactor "Explosion", 0.001
  DamageFactor "Mine", 0.0
  DamageFactor "Slime", 0.0
}

Actor ZamasuVitalityRuneIronFeet : PowerIronFeet
{
  +INVENTORY.HUBPOWER
  +INVENTORY.PERSISTENTPOWER
  +NOTIMEFREEZE
  Powerup.Duration 0x7FFFFFFF
  Powerup.Color "FF FF FF", 0.00 //for some reason I have to define this
  DamageFactor "Slime", 0.0
}

ACTOR ZamasuVitalityRuneArmor : BasicArmorBonus 
{
  Armor.SaveAmount 10
  Armor.MaxSaveAmount 1000
  Armor.SavePercent 75
  Inventory.Icon "ARM2B0"
}

Actor ZamasuVitalityRuneToken : LegendaryRuneItem { }

ACTOR VPlayerSmokeSpawner : LegendaryRedParticleSpawner 
{
Scale 0.01
States 
{
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
	LMKE A 0 A_JumpIfInventory("VitalityRuneToken",1,"Smoking",AAPTR_TARGET)
	Stop
  Smoking:
	FIG1 A 0
	FIG1 AA 0 A_SpawnItemEx("VitalityPlayerSmoke",random(12,-12),random(12,-12),random(-16,16),0,0,random(1,3),0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE,0)
	FIG1 A 1
	Stop
	}
}

ACTOR VitalityPlayerSmoke : LPlayerSmoke
{
RenderStyle Add
States 
{
  Spawn:
	FIG1 ABCDEFGHIJKL 2 Bright A_FadeOut
	Stop
	}	
}

ACTOR VitalityPlayerSmokeNoLight : VitalityPlayerSmoke { }

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

Actor VitalityRuneFX
{
  +NOINTERACTION
  +CLIENTSIDEONLY
  +NOTIMEFREEZE
  +FLOATBOB
  +BRIGHT
  Renderstyle Add
  Scale 1.2
  States
  {
  Spawn:
	TNT1 A 0 NoDelay A_Jump(128,"Shield")
	VRFX A 1 A_FadeOut(0.03)
	Wait
  Shield:
	VRFX B 1 A_FadeOut(0.03)
	Wait
	}
}

ACTOR VitalityRuneFXSpawner : WhiteSparkleSpawner
{
  +NOTIMEFREEZE
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
	TNT1 AA 2 A_SpawnItemEx("VitalityRuneFX",random(-15,15),random(-15,15),random(28,44))
	Stop
	}
}