From 814eba238825931e051c381c3fbc8f27ad9b601d Mon Sep 17 00:00:00 2001 From: Niko Date: Mon, 10 Nov 2025 00:19:17 +0000 Subject: [PATCH] Added Healthy prefix --- Content/Items/Accessories/SoulOfAvalon.cs | 30 ++++++++++ Content/Items/Accessories/SoulOfAvalon.png | Bin 0 -> 504 bytes Content/Items/Prefixes/Healthy.cs | 55 ++++++++++++++++++ Content/Items/Weapons/Magic/BookOfUnholy.cs | 2 +- Content/Items/Weapons/Magic/ShatteredPrism.cs | 2 +- .../en-US_Mods.ForgottenWawiTech.hjson | 7 +++ 6 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 Content/Items/Accessories/SoulOfAvalon.cs create mode 100644 Content/Items/Accessories/SoulOfAvalon.png create mode 100644 Content/Items/Prefixes/Healthy.cs diff --git a/Content/Items/Accessories/SoulOfAvalon.cs b/Content/Items/Accessories/SoulOfAvalon.cs new file mode 100644 index 0000000..3275403 --- /dev/null +++ b/Content/Items/Accessories/SoulOfAvalon.cs @@ -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; + } + } +} \ No newline at end of file diff --git a/Content/Items/Accessories/SoulOfAvalon.png b/Content/Items/Accessories/SoulOfAvalon.png new file mode 100644 index 0000000000000000000000000000000000000000..9e0cf81e52f4133dbe85453dd9a37993af17b5be GIT binary patch literal 504 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r53?z4+XPOVBbOU@sT!FNbf{DF-NtsjE_3B;! z|NjSy0D+K@p01v+t9x8zR#D@WS?dlQ`1+YJESG!@x4dC7*`C93=UXkhhvvt!hjSLlJ~RwmnP~Bh_e#*cGOJz5H)U2RZk=*d{>S{o z|7E^K_FWXNcxrjXh&wV*Hfp0Ti%!ljhM&t`NT+&77>M@wN(xASbQfH=B6&8`PK|k& o(pT;d?|57xzrgJ7^Ax@sCjQeEzP*#>W`d&2)78&qol`;+07t#pIRF3v literal 0 HcmV?d00001 diff --git a/Content/Items/Prefixes/Healthy.cs b/Content/Items/Prefixes/Healthy.cs new file mode 100644 index 0000000..8c5cc01 --- /dev/null +++ b/Content/Items/Prefixes/Healthy.cs @@ -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().hasHealthyPrefix = true; + } + + public override void ModifyValue(ref float valueMult) + { + valueMult = 1.5f; + } + + public override IEnumerable ModifyTooltips(Item item, IEnumerable 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; + } + } + } +} \ No newline at end of file diff --git a/Content/Items/Weapons/Magic/BookOfUnholy.cs b/Content/Items/Weapons/Magic/BookOfUnholy.cs index 0983954..74211de 100644 --- a/Content/Items/Weapons/Magic/BookOfUnholy.cs +++ b/Content/Items/Weapons/Magic/BookOfUnholy.cs @@ -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; diff --git a/Content/Items/Weapons/Magic/ShatteredPrism.cs b/Content/Items/Weapons/Magic/ShatteredPrism.cs index 73c3f8c..01ef6b5 100644 --- a/Content/Items/Weapons/Magic/ShatteredPrism.cs +++ b/Content/Items/Weapons/Magic/ShatteredPrism.cs @@ -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(); Item.shootSpeed = 30f; diff --git a/Localization/en-US_Mods.ForgottenWawiTech.hjson b/Localization/en-US_Mods.ForgottenWawiTech.hjson index dcd83ab..88947d6 100644 --- a/Localization/en-US_Mods.ForgottenWawiTech.hjson +++ b/Localization/en-US_Mods.ForgottenWawiTech.hjson @@ -94,6 +94,11 @@ Items: { DisplayName: Dev Infinite Mana Tooltip: "" } + + SoulOfAvalon: { + DisplayName: Soul Of Avalon + Tooltip: "" + } } NPCs: { @@ -188,3 +193,5 @@ Projectiles: { ShatteredPrismBeam.DisplayName: Shattered Prism Beam ShatteredPrismHoldout.DisplayName: Shattered Prism Holdout } + +Prefixes.Healthy.DisplayName: Healthy