Added Prefix: Invigorating, Dauntless

This commit is contained in:
Flowaria authored and Cameron Ewell committed 2025-10-25 14:22:22 -04:00
1 parent f2f9f3e219
commit 3242a97caf
2 files changed
+66

No files matched your search

@@ -1,8 +1,12 @@
Accessory: {
Cloaked.DisplayName: Cloaked
Silent.DisplayName: Silent
Invigorating.DisplayName: Invigorating
Dauntless.DisplayName: Dauntless
// New modifier effects (this is only positive)
StealthGenTooltip: +{0}% stealth generation
LifeRegenTooltip: +{0} HP/s life regen
MaxLifeBoostTooltip: +{0} max life
}
Weapon: {
+62
View File
@@ -0,0 +1,62 @@
using System.Collections.Generic;
using Terraria;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Prefixes
{
public class Invigorating : ModPrefix, ILocalizedModType
{
public new string LocalizationCategory => "Prefixes.Accessory";
public override PrefixCategory Category => PrefixCategory.Accessory;
public override void ApplyAccessoryEffects(Player player)
{
player.lifeRegen += GetLifeRegenAmount();
}
public LocalizedText LifeRegenTooltip => CalamityUtils.GetText($"{LocalizationCategory}.LifeRegenTooltip");
public override IEnumerable<TooltipLine> GetTooltipLines(Item item)
{
var perSecHP = (GetLifeRegenAmount() / 2.0f).ToString("0.#");
yield return new TooltipLine(Mod, "CalamityMod:PrefixLifeRegenBoost", LifeRegenTooltip.Format(perSecHP))
{
IsModifier = true
};
}
public static int GetLifeRegenAmount()
{
return 2;
}
}
public class Dauntless : ModPrefix, ILocalizedModType
{
public new string LocalizationCategory => "Prefixes.Accessory";
public override PrefixCategory Category => PrefixCategory.Accessory;
public override void ApplyAccessoryEffects(Player player)
{
player.statLifeMax2 += GetHealthBoostAmount();
}
public LocalizedText LifeBoostTooltip => CalamityUtils.GetText($"{LocalizationCategory}.MaxLifeBoostTooltip");
public override IEnumerable<TooltipLine> GetTooltipLines(Item item)
{
yield return new TooltipLine(Mod, "CalamityMod:PrefixMaxLifeBoost", LifeBoostTooltip.Format(GetHealthBoostAmount()))
{
IsModifier = true
};
}
public static int GetHealthBoostAmount()
{
if (DownedBossSystem.downedDoG) return 30;
if (NPC.downedMoonlord) return 25;
if (NPC.downedPlantBoss) return 20;
if (Main.hardMode) return 15;
return 10;
}
}
}