Added Healthy prefix

This commit is contained in:
2025-11-10 00:19:17 +00:00
parent a73cf0965d
commit 814eba2388
6 changed files with 94 additions and 2 deletions
+30
View File
@@ -0,0 +1,30 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace ForgottenWawiTech.Content.Items.Accessories
{
public class SoulOfAvalon : ModItem
{
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 1;
}
public override void SetDefaults()
{
Item.width = 28;
Item.height = 28;
Item.value = Item.buyPrice(platinum: 50);
Item.rare = ItemRarityID.Purple;
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.statDefense += 200;
player.statLifeMax2 += 1000;
player.endurance += 1;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

+55
View File
@@ -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;
}
}
}
}
+1 -1
View File
@@ -12,7 +12,7 @@ namespace ForgottenWawiTech.Content.Items.Weapons.Magic
public override void SetDefaults()
{
Item.damage = 10000;
Item.mana = 0; // Temp value for development
Item.mana = 30;
Item.crit = 100;
Item.DamageType = DamageClass.Magic;
Item.width = 40;
@@ -14,7 +14,7 @@ namespace ForgottenWawiTech.Content.Items.Weapons.Magic
public override void SetDefaults() {
Item.CloneDefaults(ItemID.LastPrism);
Item.mana = 4;
Item.damage = 2000;
Item.damage = 500;
Item.shoot = ModContent.ProjectileType<ShatteredPrismHoldout>();
Item.shootSpeed = 30f;