Files
ForgottenWawiTech/Content/Items/Prefixes/Healthy.cs
T
2025-11-10 00:35:53 +00:00

56 lines
1.6 KiB
C#

using Terraria;
using Terraria.ModLoader;
using System.Collections.Generic;
namespace ForgottenWawiTech.Content.Items.Prefixes
{
public class Healthy : ModPrefix
{
public override PrefixCategory Category => PrefixCategory.Accessory;
public override void SetStats(ref float damageMult, ref float knockbackMult, ref float useTimeMult,
ref float scaleMult, ref float shootSpeedMult, ref float manaMult, ref int critBonus)
{
}
public override void Apply(Item item)
{
item.GetGlobalItem<HealthyPrefixGlobalItem>().hasHealthyPrefix = true;
}
public override void ModifyValue(ref float valueMult)
{
valueMult = 1.5f;
}
public override IEnumerable<TooltipLine> GetTooltipLines(Item item)
{
yield return new TooltipLine(Mod, "HealthyPrefix", "+20 Max HP")
{
IsModifier = true,
IsModifierBad = false
};
yield return new TooltipLine(Mod, "HealthyPrefixRegen", "+3 HP/s")
{
IsModifier = true,
IsModifierBad = false
};
}
}
public class HealthyPrefixGlobalItem : GlobalItem
{
public bool hasHealthyPrefix = false;
public override bool InstancePerEntity => true;
public override void UpdateAccessory(Item item, Player player, bool hideVisual)
{
if (hasHealthyPrefix)
{
player.lifeRegen += 3;
player.statLifeMax2 += 20;
}
}
}
}