Added Healthy prefix
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
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> ModifyTooltips(Item item, IEnumerable<TooltipLine> tooltips)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user