From 2cdd89ff2c22b9a9fe1dc0ca221189081fefd656 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 26 Oct 2024 03:58:10 +0700 Subject: [PATCH] Localization resumes (part 1) --- Items/CalamityGlobalItemTooltip.cs | 468 ++++++++---------- .../Fishing/BrimstoneCragCatches/Bloodfin.cs | 20 +- .../Fishing/SunkenSeaCatches/SerpentsBite.cs | 10 +- Items/Tools/BobbitHook.cs | 12 +- .../en-US/Mods.CalamityMod.Common.hjson | 19 + .../Mods.CalamityMod.Items.Accessories.hjson | 8 +- .../Mods.CalamityMod.Items.Fishing.hjson | 10 +- .../en-US/Mods.CalamityMod.Items.Pets.hjson | 10 +- .../Mods.CalamityMod.Items.Potions.hjson | 42 +- .../Mods.CalamityMod.Items.SummonItems.hjson | 50 +- .../en-US/Mods.CalamityMod.Items.Tools.hjson | 7 +- .../Mods.CalamityMod.Vanilla.Armor.hjson | 5 + .../en-US/Mods.CalamityMod.Vanilla.hjson | 223 +++++++++ Projectiles/Typeless/BobbitHead.cs | 47 +- Projectiles/Typeless/SerpentsBiteHook.cs | 47 +- Utilities/DrawingUtils.cs | 3 +- 16 files changed, 557 insertions(+), 424 deletions(-) create mode 100644 Localization/en-US/Mods.CalamityMod.Common.hjson diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 572ffa6f82..26d9e386e6 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -432,9 +432,11 @@ namespace CalamityMod.Items // These functions are shorthand to invoke ApplyTooltipEdits using the above predicates. void EditTooltipByNum(int lineNum, Action action) => ApplyTooltipEdits(tooltips, LineNum(lineNum), action); void EditTooltipByName(string lineName, Action action) => ApplyTooltipEdits(tooltips, LineName(lineName), action); + string EditedTooltip(string key) => CalamityUtils.GetTextValue($"Vanilla.EditedTooltip.{key}"); + LocalizedText GetEditedTooltip(string key) => CalamityUtils.GetText($"Vanilla.EditedTooltip.{key}"); // For items such as a Copper Helmet which literally have no tooltips at all, add a custom "Tooltip0" which mimics the vanilla Tooltip0. - void AddTooltip(string text) + void AddTooltip(string key) { // Don't add the tooltip if the item is in a social slot if (item.social) @@ -447,8 +449,44 @@ namespace CalamityMod.Items defenseIndex = i; break; } - tooltips.Insert(defenseIndex + 1, new TooltipLine(CalamityMod.Instance, "Tooltip0", text)); + tooltips.Insert(defenseIndex + 1, new TooltipLine(CalamityMod.Instance, "Tooltip0", CalamityUtils.GetTextValue($"Vanilla.AddedTooltip.{key}"))); } + string AddedTooltip(string key) => "\n" + CalamityUtils.GetTextValue($"Vanilla.AddedTooltip.{key}"); + LocalizedText GetAddedTooltip(string key) => CalamityUtils.GetText($"Vanilla.AddedTooltip.{key}"); + #endregion + + // Exact life regen descriptions + #region Life Regen Clarity Tooltips + bool isCampfire = item.type == ItemID.Campfire || item.type == ItemID.CursedCampfire || item.type == ItemID.DemonCampfire || item.type == ItemID.FrozenCampfire || item.type == ItemID.IchorCampfire || item.type == ItemID.RainbowCampfire || item.type == ItemID.UltraBrightCampfire || item.type == ItemID.BoneCampfire || item.type == ItemID.DesertCampfire || item.type == ItemID.CoralCampfire || item.type == ItemID.CorruptCampfire || item.type == ItemID.CrimsonCampfire || item.type == ItemID.HallowedCampfire || item.type == ItemID.JungleCampfire || item.type == ItemID.MushroomCampfire || item.type == ItemID.ShimmerCampfire; + if (isCampfire) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("Campfires")); + + if (item.type == ItemID.HeartLantern) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("HeartLantern")); + + if (item.type == ItemID.BottledHoney) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("BottledHoney")); + + if (item.type == ItemID.ShinyStone) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ShinyStone")); + + if (item.type == ItemID.BandofRegeneration) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("BandofRegeneration")); + + if (item.type == ItemID.CharmofMyths) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("CharmofMyths")); + + if (item.type == ItemID.RegenerationPotion) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("RegenerationPotion")); + + if (item.type == ItemID.SoulDrain) + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("SoulDrain")); + + if (item.type == ItemID.HamBat) + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("HamBat")); + + if (item.type == ItemID.AegisCrystal) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("AegisCrystal")); #endregion // Numerous random tooltip edits which don't fit into another category @@ -456,7 +494,7 @@ namespace CalamityMod.Items // Lilies of Finality 512 edit if (item.type == ModContent.ItemType()) - EditTooltipByName("Damage", (line) => line.Text = LiliesOfFinality.TheNumber + " summon damage"); + EditTooltipByName("Damage", (line) => line.Text = LiliesOfFinality.TheNumber + Language.GetTextValue("LegacyTooltip.53")); // Apparently 612 is a homestuck reference if (item.type == ModContent.ItemType()) @@ -465,111 +503,67 @@ namespace CalamityMod.Items // Master Mode items also drop in Revengeance // Only affects vanilla and Calamity items if (item.master && (item.type < ItemID.Count || item.ModItem?.Mod is CalamityMod)) - EditTooltipByName("Master", (line) => line.Text += " or Revengeance"); + EditTooltipByName("Master", (line) => line.Text = EditedTooltip("MasterExclusive")); // Add a tooltip about Slimed's effects if (item.type == ItemID.SlimeGun) - EditTooltipByNum(0, (line) => line.Text += "\nSlimed enemies take more damage from fire-based debuffs"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("SlimeGun")); // Replace the meme tooltip with a useful one. if (item.type == ItemID.GelBalloon) - EditTooltipByNum(0, (line) => line.Text = "Throws a mixture of slime and sparkling crystals" - + "\nSlimed enemies take more damage from fire-based debuffs"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("GelBalloon")); // Flesh Knuckles giving extra max life. if (item.type == ItemID.FleshKnuckles || item.type == ItemID.HeroShield || item.type == ItemID.BerserkerGlove) - EditTooltipByNum(0, (line) => line.Text += "\nMax life increased by 45"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("FleshKnucklesLine")); // Rod of Discord cannot be used multiple times to hurt yourself if (item.type == ItemID.RodofDiscord) - EditTooltipByNum(1, (line) => line.Text += "\nTeleportation is disabled while Chaos State is active"); + EditTooltipByNum(1, (line) => line.Text += AddedTooltip("RodofDiscord")); // Indicate that the Ankh Shield provides sandstorm wind push immunity if (item.type == ItemID.AnkhShield) - EditTooltipByNum(1, (line) => line.Text += ", including Mighty Wind"); + { + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("AnkhShield1")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("AnkhShield2")); + } // If Early Hardmode Rework is enabled: Remind users that ores will NOT spawn when an altar is smashed. if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && (item.type == ItemID.Pwnhammer || item.type == ItemID.Hammush)) - EditTooltipByNum(0, (line) => line.Text += "\nDemon Altars now drop Souls of Night instead of generating ores when destroyed" + - "\nHardmode ores now generate after defeating Mechanical Bosses for the first time"); - - // Exact life regen descriptions - bool isCampfire = item.type == ItemID.Campfire || item.type == ItemID.CursedCampfire || item.type == ItemID.DemonCampfire || item.type == ItemID.FrozenCampfire || item.type == ItemID.IchorCampfire || item.type == ItemID.RainbowCampfire || item.type == ItemID.UltraBrightCampfire || item.type == ItemID.BoneCampfire || item.type == ItemID.DesertCampfire || item.type == ItemID.CoralCampfire || item.type == ItemID.CorruptCampfire || item.type == ItemID.CrimsonCampfire || item.type == ItemID.HallowedCampfire || item.type == ItemID.JungleCampfire || item.type == ItemID.MushroomCampfire || item.type == ItemID.ShimmerCampfire; - if (isCampfire) - EditTooltipByNum(0, (line) => line.Text = "Life regen is increased by 0.5 HP/s when near a campfire"); - - if (item.type == ItemID.HeartLantern) - EditTooltipByNum(0, (line) => line.Text = "Grants +1 HP/s life regeneration when placed nearby"); - - if (item.type == ItemID.BottledHoney) - EditTooltipByNum(0, (line) => line.Text = "Grants +1 HP/s life regen for a short time" + - "\nGrants an additional +1 HP/s life regen while inflicted with a damaging debuff"); - - if (item.type == ItemID.ShinyStone) - EditTooltipByNum(0, (line) => line.Text = "Grants +2 HP/s life regen and accelerates natural life regen when not moving"); - - if (item.type == ItemID.BandofRegeneration) - EditTooltipByNum(0, (line) => line.Text = "Grants +1 HP/s life regeneration"); - - if (item.type == ItemID.CharmofMyths) - EditTooltipByNum(0, (line) => line.Text = "Grants +1 HP/s life regeneration and reduces the cooldown of healing potions by 25%"); - - if (item.type == ItemID.RegenerationPotion) - EditTooltipByNum(0, (line) => line.Text = "Provides +2 HP/s life regeneration"); - - if (item.type == ItemID.SoulDrain) - EditTooltipByNum(0, (line) => line.Text += "\nThis grants +1.5 HP/s life regen and accelerates natural life regen" + - "\nLife drain stacks based on the number of enemies being hit"); - - if (item.type == ItemID.HamBat) - EditTooltipByNum(1, (line) => line.Text = "Defeating enemies temporarily grants +3 HP/s life regen"); - - if (item.type == ItemID.AegisCrystal) - EditTooltipByNum(0, (line) => line.Text = "Permanently boosts natural life regeneration"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("Pwnhammer")); // Warmth Potion reduces debuff durations if (item.type == ItemID.WarmthPotion) - { - string immunityLine = "\nGreatly reduces the duration of Chilled, Frozen, and Glacial State"; - EditTooltipByNum(0, (line) => line.Text += immunityLine); - } + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("WarmthPotion")); // Nerfed Archery Potion tooltip if (item.type == ItemID.ArcheryPotion) - EditTooltipByNum(0, (line) => line.Text = "20% increased arrow speed and 5% increased arrow damage"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ArcheryPotion")); // Buffed Ironskin Potion tooltip if (item.type == ItemID.IronskinPotion) - EditTooltipByNum(0, (line) => line.Text = "Increase defense by " + CalamityUtils.GetScalingDefense(-1)); + EditTooltipByNum(0, (line) => line.Text = GetEditedTooltip("IronskinPotion").Format(CalamityUtils.GetScalingDefense(-1))); // Nerfed Swiftness Potion tooltip if (item.type == ItemID.SwiftnessPotion) - EditTooltipByNum(0, (line) => line.Text = "15% increased movement speed"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); // Hand Warmer has a side bonus with Snow armor if (item.type == ItemID.HandWarmer) - { - string extraLine = "\nProvides a regeneration boost while wearing the Snow armor"; - EditTooltipByNum(0, (line) => line.Text += extraLine); - } + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("HandWarmer")); // Golden Fishing Rod inherently contains High Test Fishing Line if (item.type == ItemID.GoldenFishingRod) - EditTooltipByName("NeedsBait", (line) => line.Text += "\nIts fishing line will never break"); + EditTooltipByName("NeedsBait", (line) => line.Text += AddedTooltip("GoldenFishingRod")); // Information about graveyards // There are no item sets for tombstones wtf if (item.type == ItemID.Tombstone || item.type == ItemID.GraveMarker || item.type == ItemID.CrossGraveMarker || item.type == ItemID.Headstone || item.type == ItemID.Gravestone || item.type == ItemID.Obelisk || item.type == ItemID.RichGravestone1 || item.type == ItemID.RichGravestone2 || item.type == ItemID.RichGravestone3 || item.type == ItemID.RichGravestone4 || item.type == ItemID.RichGravestone5) - EditTooltipByName("Material", (line) => line.Text += "\n13 of any tombstone turns the surrounding area into a graveyard" - + "\nGraveyards have various new item sales and recipes"); + EditTooltipByName("Material", (line) => line.Text += AddedTooltip("Tombstones")); // Eternity Crystal notifies the player that they can accelerate the invasion if (item.type == ItemID.DD2ElderCrystal) - EditTooltipByNum(0, (line) => line.Text += "\nOnce placed you can right click the crystal to skip waves or increase the spawn rate of the invaders"); - - // Aerial Bane is no longer the real bane of aerial enemies (50% dmg bonus removed) - if (item.type == ItemID.DD2BetsyBow) - EditTooltipByNum(0, (line) => line.Text = "Shoots splitting arrows"); + EditTooltipByNum(0, (line) => line.Text += Lang.SupportGlyphs(AddedTooltip("DD2ElderCrystal"))); // Modify item speed tooltips to use a new scale designed to more accurately reflect practical distributions of item speeds. // Due to the higher complexity of the action, the actual logic is delegated to its own method. @@ -577,146 +571,112 @@ namespace CalamityMod.Items EditTooltipByName("Speed", (line) => RedistributeSpeedTooltips(item, line)); if (item.healLife > 0 && Main.LocalPlayer.Calamity().healingPotionMultiplier != 1f) - { - int healAmt = (int)(item.healLife * Main.LocalPlayer.Calamity().healingPotionMultiplier); - EditTooltipByName("HealLife", (line) => line.Text = $"Restores {healAmt} life"); - } + EditTooltipByName("HealLife", (line) => line.Text = Language.GetOrRegister("CommonItemTooltip.RestoresLife").Format((int)(item.healLife * Main.LocalPlayer.Calamity().healingPotionMultiplier))); #endregion // For boss summon item clarity - #region Boss Summon Tooltip Edits - + #region Boss Summon Clarity Tooltips if (item.type == ItemID.Abeemination) - { - EditTooltipByNum(0, (line) => line.Text += " when used in the Jungle\n"); - EditTooltipByNum(0, (line) => line.Text += "Enrages outside the Underground Jungle"); - } + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("Abeemination")); if (item.type == ItemID.BloodySpine) - { - EditTooltipByNum(0, (line) => line.Text += " when used in the Crimson\n"); - EditTooltipByNum(0, (line) => line.Text += "Enrages outside the Underground Crimson"); - } + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("BloodySpine")); if (item.type == ItemID.ClothierVoodooDoll) - { - EditTooltipByNum(0, (line) => line.Text += "\nWhile equipped, summons Skeletron when the Clothier is killed during nighttime\n"); - EditTooltipByNum(0, (line) => line.Text += "Enrages during the day"); - } + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ClothierVoodooDoll")); if (item.type == ItemID.DeerThing) - EditTooltipByNum(0, (line) => line.Text += " when used in the Snow or Ice biome"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("DeerThing")); if (item.type == ItemID.GuideVoodooDoll) - EditTooltipByNum(0, (line) => line.Text += "\nSummons the Wall of Flesh if thrown into lava in the underworld while the Guide is alive"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("GuideVoodooDoll")); if (item.type == ItemID.LihzahrdPowerCell) - { - EditTooltipByNum(0, (line) => line.Text += " to summon the Golem\n"); - EditTooltipByNum(0, (line) => line.Text += "Enrages outside the Jungle Temple"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("LihzahrdPowerCell")); - } + if (item.type == ItemID.MechanicalEye) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MechanicalEye")); - if (item.type == ItemID.MechanicalEye || item.type == ItemID.MechanicalSkull || item.type == ItemID.MechanicalWorm || item.type == ItemID.SuspiciousLookingEye) - { - EditTooltipByNum(0, (line) => line.Text += " when used during nighttime\n"); - EditTooltipByNum(0, (line) => line.Text += "Enrages during the day"); - } + if (item.type == ItemID.MechanicalSkull) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MechanicalSkull")); + + if (item.type == ItemID.MechanicalWorm) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MechanicalWorm")); if (item.type == ItemID.QueenSlimeCrystal) - EditTooltipByNum(0, (line) => line.Text += " when used in the Hallow"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("QueenSlimeCrystal")); + + if (item.type == ItemID.SuspiciousLookingEye) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SuspiciousLookingEye")); if (item.type == ItemID.TruffleWorm) - { - EditTooltipByName("Consumable", (line) => line.Text += "\nSummons Duke Fishron if used as bait in the Ocean\n"); - EditTooltipByName("Consumable", (line) => line.Text += "Enrages outside the Ocean"); - } + EditTooltipByName("Consumable", (line) => line.Text += AddedTooltip("TruffleWorm")); if (item.type == ItemID.WormFood) - { - EditTooltipByNum(0, (line) => line.Text += " when used in the Corruption\n"); - EditTooltipByNum(0, (line) => line.Text += "Enrages outside the Underground Corruption"); - } + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("WormFood")); #endregion // Brain of Confusion, Black Belt and Master Ninja Gear have guaranteed dodges with a fixed cooldown. #region Guaranteed Dodge Tooltips - string beltDodgeLine = "Grants the ability to dodge attacks\n" + - "Attacks that deal less than 5% of your max life in damage will not be dodged\n" + - $"The dodge has a cooldown that ranges between {BalancingConstants.BeltDodgeCooldownMin / 60 } and {BalancingConstants.BeltDodgeCooldownMax / 60} seconds depending on the dodged attack's damage\n" + - "The cooldown is shared with all other dodges and reflects"; if (item.type == ItemID.BlackBelt) - EditTooltipByNum(0, (line) => line.Text = beltDodgeLine); + EditTooltipByNum(0, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BeltDodgeCooldownMin / 60, BalancingConstants.BeltDodgeCooldownMax / 60)); if (item.type == ItemID.MasterNinjaGear) - EditTooltipByNum(1, (line) => line.Text = beltDodgeLine); + EditTooltipByNum(1, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BeltDodgeCooldownMin / 60, BalancingConstants.BeltDodgeCooldownMax / 60)); - string brainDodgeLine = "Grants the ability to dodge attacks\n" + - "Attacks that deal less than 5% of your max life in damage will not be dodged\n" + - $"The dodge has a cooldown that ranges between {BalancingConstants.BrainDodgeCooldownMin / 60} and {BalancingConstants.BrainDodgeCooldownMax / 60} seconds depending on the dodged attack's damage\n" + - "The cooldown is shared with all other dodges and reflects"; if (item.type == ItemID.BrainOfConfusion) - EditTooltipByNum(0, (line) => line.Text = brainDodgeLine); + EditTooltipByNum(0, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BrainDodgeCooldownMin / 60, BalancingConstants.BrainDodgeCooldownMax / 60)); #endregion - // Other melee weapon tooltips - #region Other Melee Tooltips + // Weapon changes + #region Weapon changes + // Aerial Bane is no longer the real bane of aerial enemies (50% dmg bonus removed) + if (item.type == ItemID.DD2BetsyBow) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("DD2BetsyBow")); // Death Sickle inflict Whispering Death if (item.type == ItemID.DeathSickle) - EditTooltipByNum(0, (line) => line.Text += "\nInflicts Whispering Death on hit"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("DeathSickle")); #endregion // Light pets, accessories, and other items which boost the player's Abyss light stat #region Abyss Light Tooltips - // +1 to Abyss light level - string abyssSmallLightLine = "\nProvides a small amount of light in the abyss"; - if (item.type == ItemID.CrimsonHeart || item.type == ItemID.ShadowOrb || item.type == ItemID.MagicLantern || item.type == ItemID.JellyfishNecklace || item.type == ItemID.MiningHelmet || item.type == ItemID.UltrabrightHelmet) - EditTooltipByNum(0, (line) => line.Text += abyssSmallLightLine); + EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel1")); if (item.type == ItemID.JellyfishDivingGear || item.type == ItemID.Magiluminescence) - EditTooltipByNum(1, (line) => line.Text += abyssSmallLightLine); + EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel1")); // +2 to Abyss light level - string abyssMediumLightLine = "\nProvides a moderate amount of light in the abyss"; - if (item.type == ItemID.ShinePotion) - EditTooltipByName("BuffTime", (line) => line.Text += abyssMediumLightLine); - + EditTooltipByName("BuffTime", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel2")); if (item.type == ItemID.FairyBell || item.type == ItemID.DD2PetGhost) - EditTooltipByNum(0, (line) => line.Text += abyssMediumLightLine); + EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel2")); // +3 to Abyss light level - string abyssLargeLightLine = "\nProvides a large amount of light in the abyss"; - if (item.type == ItemID.WispinaBottle || item.type == ItemID.PumpkingPetItem || item.type == ItemID.GolemPetItem || item.type == ItemID.FairyQueenPetItem) - EditTooltipByNum(0, (line) => line.Text += abyssLargeLightLine); + EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel3")); if (item.type == ItemID.SuspiciousLookingTentacle) - EditTooltipByNum(1, (line) => line.Text += abyssLargeLightLine); + EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel3")); #endregion // Accessories and other items which boost the player's ability to breathe in the Abyss #region Abyss Breath Tooltips // Moderate breath boost - string abyssModerateBreathLine = "\nModerately reduces breath loss in the abyss"; - if (item.type == ItemID.DivingHelmet) - EditTooltipByNum(0, (line) => line.Text += abyssModerateBreathLine); + EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel2")); if (item.type == ItemID.ArcticDivingGear) - EditTooltipByNum(1, (line) => line.Text += abyssSmallLightLine + abyssModerateBreathLine); + EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel1") + "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel2")); // Great breath boost - string abyssGreatBreathLine = "\nGreatly reduces breath loss in the abyss"; - if (item.type == ItemID.GillsPotion) - EditTooltipByName("BuffTime", (line) => line.Text += abyssGreatBreathLine); + EditTooltipByName("BuffTime", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel3")); if (item.type == ItemID.NeptunesShell || item.type == ItemID.MoonShell) - EditTooltipByNum(1, (line) => line.Text += abyssGreatBreathLine); + EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel3")); if (item.type == ItemID.CelestialShell) - EditTooltipByNum(4, (line) => line.Text += abyssModerateBreathLine); + EditTooltipByNum(4, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel3")); #endregion // Flasks apply to Rogue weapons @@ -745,147 +705,132 @@ namespace CalamityMod.Items // Various mining speed nerfs if (item.type == ItemID.MiningPotion) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25", "15")); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); if (item.type == ItemID.AncientChisel) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25", "15")); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); if (item.type == ItemID.HandOfCreation) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25", "15")); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); // Frozen Turtle Shell rebalance. if (item.type == ItemID.FrozenTurtleShell) - EditTooltipByNum(0, (line) => line.Text = "Puts a shell around the owner when below 50% life that reduces damage by 15%"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); if (item.type == ItemID.FrozenShield) - EditTooltipByNum(1, (line) => line.Text = "Puts a shell around the owner when below 50% life that reduces damage by 15%"); + EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("25%", "15%")); // Ale and Sake rebalance and Alcohol Poisoning. if (item.type == ItemID.Ale || item.type == ItemID.Sake) - { - EditTooltipByNum(0, (line) => line.Text = "Increases melee damage by 10% and reduces defense by 5%\n" + - "Counts as an alcohol for Alcohol Poisoning\n" + - "Drinking more than 3 different alcohols might not end well with your liver"); - } + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("AleSake")); //Flame Waker Boots buff. if (item.type == ItemID.FlameWakerBoots) - { - EditTooltipByNum(0, (line) => line.Text = "Multiplies all fire-based debuff damage by 1.25x\n" + - "All attacks light enemies on fire\n" + - "'Never get cold feet again'"); - } + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlameWakerBoots")); // Hellfire Treads buff. if (item.type == ItemID.HellfireTreads) - { - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("fire blocks", "the Burning and On Fire! debuffs")); - EditTooltipByNum(2, (line) => line.Text += "\nMultiplies all fire-based debuff damage by 1.5x, does not stack with downgrades\n" + - "All attacks inflict Hellfire"); - } + EditTooltipByNum(2, (line) => line.Text += AddedTooltip("HellfireTreads")); // Fairy Boots buff. if (item.type == ItemID.FairyBoots) - EditTooltipByNum(2, (line) => line.Text += "\nFairies can spawn at any time on the surface and spawn far more frequently\n" + - "Nearby fairies grant +2 HP/s life regen, 10 defense and 10% movement speed\n" + - "Fairies are immune to damage and will no longer flee"); + EditTooltipByNum(2, (line) => line.Text += AddedTooltip("FairyBoots")); // Reduced Nightwither and Daybroken damage, and melee speed removal. if (item.type == ItemID.MoonStone) { - EditTooltipByNum(2, (line) => line.Text += "\nReduces the damage of the Nightwither debuff"); - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("melee speed, ", "")); + EditTooltipByNum(2, (line) => line.Text += AddedTooltip("MoonStone")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SunMoonStones")); } if (item.type == ItemID.SunStone) { - EditTooltipByNum(2, (line) => line.Text += "\nReduces the damage of the Daybroken debuff"); - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("melee speed, ", "")); + EditTooltipByNum(2, (line) => line.Text += AddedTooltip("SunStone")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SunMoonStones")); } if (item.type == ItemID.CelestialStone) { - EditTooltipByNum(2, (line) => line.Text += "\nReduces the damage of the Nightwither and Daybroken debuffs"); - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace(" melee speed,", "")); + EditTooltipByNum(2, (line) => line.Text += AddedTooltip("CelestialStone")); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SunMoonStones")); } if (item.type == ItemID.CelestialShell) { - EditTooltipByNum(4, (line) => line.Text += "\nReduces the damage of the Nightwither and Daybroken debuffs"); - EditTooltipByNum(2, (line) => line.Text = line.Text.Replace(" melee speed,", "")); + EditTooltipByNum(4, (line) => line.Text += AddedTooltip("CelestialStone")); + EditTooltipByNum(2, (line) => line.Text = EditedTooltip("SunMoonStones")); } // Mana Flower tinker buffs. if (item.type == ItemID.MagnetFlower) - EditTooltipByNum(0, (line) => line.Text = "10% reduced mana cost"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MagnetFlower")); if (item.type == ItemID.ArcaneFlower || item.type == ItemID.ManaCloak) - EditTooltipByNum(0, (line) => line.Text = "12% reduced mana cost"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ArcaneFlowerManaCloak")); if (item.type == ItemID.ArcaneFlower) - EditTooltipByNum(2, (line) => line.Text += "\n5% increased magic damage"); + EditTooltipByNum(2, (line) => line.Text += AddedTooltip("ArcaneFlower")); // Magiluminescence nerf and clear explanation of what it actually does. if (item.type == ItemID.Magiluminescence) - EditTooltipByNum(0, (line) => line.Text = "Increases movement acceleration and deceleration by 1.75x\n" + - "Increases movement speed by 1.15x. This bonus applies to running boot accessories"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("Magiluminescence")); // Frog Leg and all upgrades get clear explanations of what they actually do. if (item.type == ItemID.FrogLeg) - EditTooltipByNum(0, (line) => line.Text = "Increases jump speed by " + (int)(BalancingConstants.VanillaFrogLegJumpSpeedBoost * 20f) + "% and allows auto-jump"); + EditTooltipByNum(0, (line) => line.Text = GetEditedTooltip("FrogLeg").Format((int)(BalancingConstants.VanillaFrogLegJumpSpeedBoost * 20f))); if (item.type == ItemID.FrogFlipper || item.type == ItemID.FrogWebbing) - EditTooltipByNum(1, (line) => line.Text = "Increases jump speed by " + (int)(BalancingConstants.VanillaFrogLegJumpSpeedBoost * 20f) + "% and allows auto-jump"); + EditTooltipByNum(1, (line) => line.Text = GetEditedTooltip("FrogLeg").Format((int)(BalancingConstants.VanillaFrogLegJumpSpeedBoost * 20f))); if (item.type == ItemID.FrogGear) - EditTooltipByNum(2, (line) => line.Text = "Increases jump speed by " + (int)(BalancingConstants.VanillaFrogLegJumpSpeedBoost * 20f) + "% and allows auto-jump"); + EditTooltipByNum(2, (line) => line.Text = GetEditedTooltip("FrogLeg").Format((int)(BalancingConstants.VanillaFrogLegJumpSpeedBoost * 20f))); if (item.type == ItemID.AmphibianBoots) - EditTooltipByNum(1, (line) => line.Text = "Increases jump speed by " + (int)(BalancingConstants.AmphibianBootsJumpSpeedBoost * 20f) + "% and allows auto-jump"); + EditTooltipByNum(1, (line) => line.Text = GetEditedTooltip("FrogLeg").Format((int)(BalancingConstants.AmphibianBootsJumpSpeedBoost * 20f))); // Soaring Insignia nerf and clear explanation of what it actually does. if (item.type == ItemID.EmpressFlightBooster) { - EditTooltipByNum(0, (line) => line.Text = "Increases wing flight time by 25%"); - EditTooltipByNum(1, (line) => line.Text = "Increases movement and jump speed by 10% and acceleration by 1.1x"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("EmpressFlightBooster1")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("EmpressFlightBooster2")); } // Rifle Scope visibility change if (item.type == ItemID.RifleScope) { - EditTooltipByNum(0, (line) => line.Text = "Increase view range for guns (Right click to zoom out)"); - EditTooltipByNum(1, (line) => line.Text = "The scope effect can be toggled with visibility"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("RifleScope1")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("RifleScope2")); } // Sniper Scope rebalance and visibility change if (item.type == ItemID.SniperScope) { - EditTooltipByNum(1, (line) => line.Text = "7% increased ranged damage and critical strike chance"); - EditTooltipByNum(0, (line) => line.Text += "\nThe scope effect can be toggled with visibility"); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SniperScope")); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("RifleScope")); } // Recon Scope visibility change if (item.type == ItemID.ReconScope) - EditTooltipByNum(0, (line) => line.Text += "\nThe scope effect can be toggled with visibility"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("RifleScope")); // Magic Quiver if (item.type == ItemID.MagicQuiver) - EditTooltipByNum(0, (line) => line.Text = "Increases arrow damage by 5% and greatly increases arrow speed"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MagicQuiver")); // Molten Quiver if (item.type == ItemID.MoltenQuiver) { - EditTooltipByNum(0, (line) => line.Text = "Increases arrow damage by 7% and greatly increases arrow speed"); - EditTooltipByNum(2, (line) => line.Text += " and all arrows inflict Hellfire"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MoltenQuiver1")); + EditTooltipByNum(2, (line) => line.Text = EditedTooltip("MoltenQuiver2")); } // Magic Power Potion nerf if (item.type == ItemID.MagicPowerPotion) - EditTooltipByNum(0, (line) => line.Text = "10% increased magic damage"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MagicPowerPotion")); // Featherfall Potion being stupid broken with Aero Stone if (item.type == ItemID.FeatherfallPotion) - EditTooltipByNum(0, (line) => line.Text = "Slows falling speed\n" + "Disables all airborne flight recovery"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("FeatherfallPotion")); // Magic Hat nerf if (item.type == ItemID.MagicHat) - EditTooltipByNum(0, (line) => line.Text = "6% increased magic critical strike chance"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MagicHat")); // Gem Robe nerfs if (item.type == ItemID.AmethystRobe) @@ -919,116 +864,107 @@ namespace CalamityMod.Items EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("12%", "10%")); if (item.type == ItemID.TitanGlove) - EditTooltipByNum(0, (line) => line.Text += "\n10% increased true melee damage"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("TitanGloveLine")); if (item.type == ItemID.PowerGlove) { - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("12% increased melee speed", "10% increased melee speed, does not stack with downgrades")); - EditTooltipByNum(0, (line) => line.Text += "\n10% increased true melee damage"); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("PowerGlove")); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("TitanGloveLine")); } if (item.type == ItemID.BerserkerGlove) - { - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("12% increased melee speed", "10% increased true melee damage")); - } + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("BerserkerGlove")); if (item.type == ItemID.MechanicalGlove) - { - string extraLine = "\n10% increased true melee damage"; - string extraLine2 = "\n12% increased melee speed, does not stack with downgrades" + extraLine; - EditTooltipByNum(1, (line) => line.Text = "12% increased melee damage" + extraLine2); - } + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("MechanicalGlove") + AddedTooltip("TitanGloveLine")); if (item.type == ItemID.FireGauntlet) { - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("fire damage", "Hellfire")); - string extraLine = "\n10% increased true melee damage"; - string extraLine2 = "\n14% increased melee speed, does not stack with downgrades" + extraLine; - EditTooltipByNum(1, (line) => line.Text = "14% increased melee damage" + extraLine2); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FireGauntlet1")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("FireGauntlet2") + AddedTooltip("TitanGloveLine")); } // On Fire! debuff immunities - if (item.type == ItemID.ObsidianSkull || item.type == ItemID.AnkhShield || item.type == ItemID.ObsidianSkullRose || item.type == ItemID.MoltenCharm) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("fire blocks", "the Burning and On Fire! debuffs")); + if (item.type == ItemID.ObsidianSkull || item.type == ItemID.ObsidianSkullRose || item.type == ItemID.MoltenCharm) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ObsidianSkullLine")); - if (item.type == ItemID.ObsidianHorseshoe || item.type == ItemID.ObsidianShield || item.type == ItemID.ObsidianWaterWalkingBoots || item.type == ItemID.LavaWaders || item.type == ItemID.LavaSkull || item.type == ItemID.MoltenSkullRose) - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("fire blocks", "the Burning and On Fire! debuffs")); + if (item.type == ItemID.ObsidianHorseshoe || item.type == ItemID.ObsidianShield || item.type == ItemID.ObsidianWaterWalkingBoots || item.type == ItemID.LavaSkull || item.type == ItemID.MoltenSkullRose) + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("ObsidianSkullLine")); + + if (item.type == ItemID.LavaWaders) + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("LavaWaders")); if (item.type == ItemID.TerrasparkBoots) - EditTooltipByNum(3, (line) => line.Text += "\nImmunity to the On Fire! debuff"); + EditTooltipByNum(3, (line) => line.Text = EditedTooltip("LavaWaders")); // Ozzatron 23NOV2023: Removed tooltip edits for Magma Skull and Molten Skull Rose, as they were invalid after vanilla tooltip changes. // Yoyo Glove/Bag apply a 0.5x damage multiplier on the second yoyo if (item.type == ItemID.YoyoBag || item.type == ItemID.YoYoGlove) - EditTooltipByNum(0, (line) => line.Text += "\nSecondary yoyos will do 50% less damage"); - - // Falcon Blade +20% move speed while holding - if (item.type == ItemID.FalconBlade) - EditTooltipByName("Knockback", (line) => line.Text += "\nHolding this item grants +20% increased movement speed"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("YoyoGlove")); //Gi 10% melee speed into 10% jump speed replacement if (item.type == ItemID.Gi) - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("melee", "jump")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("Gi")); #endregion // Pre-Hardmode ore armor tooltip edits #region Pre-Hardmode Ore Armor // Copper if (item.type == ItemID.CopperHelmet) - AddTooltip("5% increased damage"); + AddTooltip("CopperHelmet"); if (item.type == ItemID.CopperChainmail) - AddTooltip("3% increased critical strike chance"); + AddTooltip("CopperChainmail"); if (item.type == ItemID.CopperGreaves) - AddTooltip("5% increased movement speed"); + AddTooltip("CopperGreaves"); // Tin if (item.type == ItemID.TinHelmet) - AddTooltip("3% increased critical strike chance"); + AddTooltip("TinHelmet"); if (item.type == ItemID.TinChainmail) - AddTooltip("+0.5 HP/s life regen"); + AddTooltip("TinChainmail"); if (item.type == ItemID.TinGreaves) - AddTooltip("5% increased movement speed"); + AddTooltip("TinGreaves"); // Iron if (item.type == ItemID.IronHelmet || item.type == ItemID.AncientIronHelmet || item.type == ItemID.IronChainmail || item.type == ItemID.IronGreaves) - AddTooltip("Increases damage reduction by 3%"); + AddTooltip("IronPieces"); // Lead if (item.type == ItemID.LeadHelmet || item.type == ItemID.LeadChainmail || item.type == ItemID.LeadGreaves) - AddTooltip("Increases damage reduction by 2%"); + AddTooltip("LeadPieces"); // Silver if (item.type == ItemID.SilverHelmet) - AddTooltip("5% increased critical strike chance"); + AddTooltip("SilverHelmet"); if (item.type == ItemID.SilverChainmail) - AddTooltip("+1 HP/s life regen"); + AddTooltip("SilverChainmail"); if (item.type == ItemID.SilverGreaves) - AddTooltip("8% increased movement speed"); + AddTooltip("SilverGreaves"); // Tungsten if (item.type == ItemID.TungstenHelmet) - AddTooltip("7% increased damage"); + AddTooltip("TungstenHelmet"); if (item.type == ItemID.TungstenChainmail) - AddTooltip("+0.5 HP/s life regen"); + AddTooltip("TungstenChainmail"); if (item.type == ItemID.TungstenGreaves) - AddTooltip("8% increased movement speed"); + AddTooltip("TungstenGreaves"); // Gold if (item.type == ItemID.GoldHelmet || item.type == ItemID.AncientGoldHelmet) - AddTooltip("6% increased damage"); + AddTooltip("GoldHelmet"); if (item.type == ItemID.GoldChainmail) - AddTooltip("Increases damage reduction by 5%"); + AddTooltip("GoldChainmail"); if (item.type == ItemID.GoldGreaves) - AddTooltip("10% increased movement speed"); + AddTooltip("GoldGreaves"); // Platinum if (item.type == ItemID.PlatinumHelmet) - AddTooltip("6% increased damage"); + AddTooltip("PlatinumHelmet"); if (item.type == ItemID.PlatinumChainmail) - AddTooltip("3% increased critical strike chance"); + AddTooltip("PlatinumChainmail"); if (item.type == ItemID.PlatinumGreaves) - AddTooltip("10% increased movement speed"); + AddTooltip("PlatinumGreaves"); // Jungle if (item.type == ItemID.JungleHat || item.type == ItemID.AncientCobaltHelmet) @@ -1046,7 +982,7 @@ namespace CalamityMod.Items { string newTooltip = line.Text.Replace("3%", "6%"); // Chest piece has 2 regen instead of 1 - newTooltip += item.type == ItemID.CrimsonScalemail ? "\n+1 HP/s life regen" : "\n+0.5 HP/s life regen"; + newTooltip += item.type == ItemID.CrimsonScalemail ? AddedTooltip("CrimsonBreastplate") : AddedTooltip("CrimsonOtherPieces"); line.Text = newTooltip; }); } @@ -1060,35 +996,35 @@ namespace CalamityMod.Items #region Hardmode Ore Armor // Cobalt if (item.type == ItemID.CobaltHat) - EditTooltipByNum(0, (line) => line.Text = $"Increases maximum mana by {CobaltArmorSetChange.MaxManaBoost + 40}"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("40", $"{CobaltArmorSetChange.MaxManaBoost + 40}")); // Palladium if (item.type == ItemID.PalladiumBreastplate) - EditTooltipByNum(0, (line) => line.Text = $"{PalladiumArmorSetChange.ChestplateDamagePercentageBoost + 3}% increased damage"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("3%", $"{PalladiumArmorSetChange.ChestplateDamagePercentageBoost + 3}%")); if (item.type == ItemID.PalladiumLeggings) - EditTooltipByNum(0, (line) => line.Text = $"{PalladiumArmorSetChange.LeggingsDamagePercentageBoost + 2}% increased damage"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("2%", $"{PalladiumArmorSetChange.LeggingsDamagePercentageBoost + 2}%")); // Mythril if (item.type == ItemID.MythrilHood) - EditTooltipByNum(0, (line) => line.Text = $"Increases maximum mana by {MythrilArmorSetChange.MaxManaBoost + 60}"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("60", $"{MythrilArmorSetChange.MaxManaBoost + 60}")); // Orichalcum if (item.type == ItemID.OrichalcumBreastplate) - EditTooltipByNum(0, (line) => line.Text = $"{OrichalcumArmorSetChange.ChestplateCritChanceBoost + 6}% increased critical strike chance"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("6%", $"{OrichalcumArmorSetChange.ChestplateCritChanceBoost + 6}%")); // Adamantite if (item.type == ItemID.AdamantiteHeadgear) - EditTooltipByNum(0, (line) => line.Text = $"Increases maximum mana by {AdamantiteArmorSetChange.MaxManaBoost + 80}"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("80", $"{AdamantiteArmorSetChange.MaxManaBoost + 80}")); // Titanium if (item.type == ItemID.TitaniumMask) - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("9", "14")); + EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("9%", "14%")); // Solar Flare if (item.type == ItemID.SolarFlareHelmet) EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("26%", "20%")); if (item.type == ItemID.SolarFlareHelmet || item.type == ItemID.SolarFlareBreastplate || item.type == ItemID.SolarFlareLeggings) - EditTooltipByNum(1, (line) => line.Text = "Grants +1 HP/s life regeneration"); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SolarFlarePieces")); // Vortex if (item.type == ItemID.VortexHelmet) @@ -1162,22 +1098,22 @@ namespace CalamityMod.Items item.type == ItemID.PirateMap || item.type == ItemID.SnowGlobe || item.type == ItemID.MechanicalEye || item.type == ItemID.MechanicalWorm || item.type == ItemID.MechanicalSkull || item.type == ItemID.NaughtyPresent || item.type == ItemID.PumpkinMoonMedallion || item.type == ItemID.SolarTablet || item.type == ItemID.SolarTablet || item.type == ItemID.CelestialSigil) - EditTooltipByNum(0, (line) => line.Text += "\nNot consumable"); + EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.NotConsumable")); #endregion // Add mentions of what Calamity ores vanilla pickaxes can mine #region Pickaxe New Ore Tooltips if (item.type == ItemID.GoldPickaxe || item.type == ItemID.PlatinumPickaxe) - EditTooltipByNum(0, (line) => line.Text = "Can mine Demonite, Crimtane, Meteorite, Sea Prisms and Sea Prism Crystals"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("GoldPickaxe")); if (item.type == ItemID.Picksaw) - EditTooltipByNum(0, (line) => line.Text += "\nCan mine Scoria Ore located in the Abyss"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("Picksaw")); if (item.type == ItemID.SolarFlarePickaxe || item.type == ItemID.VortexPickaxe || item.type == ItemID.NebulaPickaxe || item.type == ItemID.StardustPickaxe) - EditTooltipByName("Material", (line) => line.Text += "\nCan mine Uelibloom Ore"); + EditTooltipByName("Material", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.CanMineUelibloom")); if (item.type == ItemID.SolarFlareDrill || item.type == ItemID.VortexDrill || item.type == ItemID.NebulaDrill || item.type == ItemID.StardustDrill) - EditTooltipByName("TileBoost", (line) => line.Text += "\nCan mine Uelibloom Ore"); + EditTooltipByName("TileBoost", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.CanMineUelibloom")); #endregion // Rebalances and information about vanilla set bonuses @@ -1187,16 +1123,16 @@ namespace CalamityMod.Items // Gladiator if (item.type == ItemID.GladiatorHelmet) - EditTooltipByName("Defense", (line) => line.Text += $"\n{GladiatorArmorSetChange.HelmetRogueDamageBoostPercent}% increased rogue damage"); + EditTooltipByName("Defense", (line) => line.Text += "\n" +CalamityUtils.GetText("Common.RogueDamage").Format(GladiatorArmorSetChange.HelmetRogueDamageBoostPercent)); if (item.type == ItemID.GladiatorBreastplate) - EditTooltipByName("Defense", (line) => line.Text += $"\n{GladiatorArmorSetChange.ChestplateRogueCritBoostPercent}% increased rogue critical strike chance"); + EditTooltipByName("Defense", (line) => line.Text += "\n" +CalamityUtils.GetText("Common.RogueCrit").Format(GladiatorArmorSetChange.ChestplateRogueCritBoostPercent)); if (item.type == ItemID.GladiatorLeggings) - EditTooltipByName("Defense", (line) => line.Text += $"\n{GladiatorArmorSetChange.LeggingRogueVelocityBoostPercent}% increased rogue velocity"); + EditTooltipByName("Defense", (line) => line.Text += "\n" +CalamityUtils.GetText("Common.RogueVelocity").Format(GladiatorArmorSetChange.LeggingRogueVelocityBoostPercent)); // Forbidden (UNLESS you are wearing the Circlet, which is Summon/Rogue and does not get this line) if ((item.type == ItemID.AncientBattleArmorHat || item.type == ItemID.AncientBattleArmorShirt || item.type == ItemID.AncientBattleArmorPants) && !Main.LocalPlayer.Calamity().forbiddenCirclet) - EditTooltipByName("SetBonus", (line) => line.Text += "\nMinions no longer deal less damage while wielding magic weapons"); + EditTooltipByName("SetBonus", (line) => line.Text = CalamityUtils.GetText($"Vanilla.Armor.SetBonus.Forbidden").Format(Language.GetTextValue(Main.ReversedUpDownArmorSetBonuses ? "Key.UP" : "Key.DOWN"))); #endregion // Provide the full stats of every vanilla set of wings @@ -1335,20 +1271,8 @@ namespace CalamityMod.Items // Provide the full stats of every vanilla grappling hook #region Grappling Hook Stat Tooltips - // This function produces a "stat sheet" for a grappling hook from the raw stats. - string HookStatsTooltip(float reach, float launch, float reel, float pull) - { - StringBuilder sb = new StringBuilder(128); - sb.Append('\n'); - sb.Append($"Reach: {reach:N3} tiles\n"); - sb.Append($"Launch Velocity: {launch:N2}\n"); - sb.Append($"Reelback Velocity: {reel:N2}\n"); - sb.Append($"Pull Velocity: {pull:N2}"); - return sb.ToString(); - } - // This function is shorthand for appending a stat sheet to a grappling hook. - void AddGrappleStats(float r, float l, float e, float p) => EditTooltipByName("Equipable", (line) => line.Text += HookStatsTooltip(r, l, e, p)); + void AddGrappleStats(float r, float l, float e, float p) => EditTooltipByName("Equipable", (line) => line.Text += "\n" + CalamityUtils.GetText("Common.GrappleStats").Format(r.ToString(), l.ToString(), e.ToString(), p.ToString())); if (item.type == ItemID.GrapplingHook) AddGrappleStats(18.75f, 11.5f, 11f, 11f); @@ -1469,7 +1393,7 @@ namespace CalamityMod.Items #region Accessory Prefix Rebalance Tooltips // Turns a number into a string of increased DR. - string DRString(float percent) => $"\n+{percent:N2}% damage reduction"; + string DRString(float percent) => "\n" + GetAddedTooltip("DefensePrefix").Format(percent.ToString()); switch (item.prefix) { @@ -1490,7 +1414,7 @@ namespace CalamityMod.Items (line) => line.Text = line.Text.Replace("4", CalamityUtils.GetScalingDefense(item.prefix).ToString()) + DRString(1f)); return; case PrefixID.Lucky: - EditTooltipByName("PrefixAccCritChance", (line) => line.Text += "\n+0.05 luck"); + EditTooltipByName("PrefixAccCritChance", (line) => line.Text += AddedTooltip("LuckyPrefix")); return; } #endregion diff --git a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index 6364413988..fd4d653f7e 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -2,6 +2,7 @@ using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Fishing.BrimstoneCragCatches @@ -10,7 +11,9 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches { public new string LocalizationCategory => "Items.Fishing"; public static int BuffType = ModContent.BuffType(); - public static int BuffDuration = 600; + public static int BuffDuration = 10; + + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(BuffDuration); public override void SetStaticDefaults() { @@ -20,24 +23,15 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public override void SetDefaults() { - Item.width = 44; - Item.height = 36; - Item.maxStack = 9999; - Item.useTurn = true; + Item.DefaultToHealingPotion(38, 36, 240); + Item.useStyle = ItemUseStyleID.EatFood; Item.value = Item.sellPrice(gold: 5); Item.rare = ModContent.RarityType(); - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.EatFood; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.healLife = 240; - Item.potion = true; } public override void OnConsumeItem(Player player) { - player.AddBuff(BuffType, BuffDuration); + player.AddBuff(BuffType, CalamityUtils.SecondsToFrames(BuffDuration)); } } } diff --git a/Items/Fishing/SunkenSeaCatches/SerpentsBite.cs b/Items/Fishing/SunkenSeaCatches/SerpentsBite.cs index 51ce7fc457..1b25431204 100644 --- a/Items/Fishing/SunkenSeaCatches/SerpentsBite.cs +++ b/Items/Fishing/SunkenSeaCatches/SerpentsBite.cs @@ -1,5 +1,6 @@ using CalamityMod.Projectiles.Typeless; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; @@ -8,13 +9,20 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches public class SerpentsBite : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Fishing"; + + public static float Reach = 28.125f; + public static float LaunchSpeed = 18f; + public static float ReelbackSpeed = 14f; + public static float PullSpeed = 12f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(Reach.ToString(), LaunchSpeed.ToString(), ReelbackSpeed.ToString(), PullSpeed.ToString()); + public override void SetDefaults() { // Instead of copying these values, we can clone and modify the ones we want to copy Item.CloneDefaults(ItemID.AmethystHook); Item.width = 30; Item.height = 32; - Item.shootSpeed = SerpentsBiteHook.LaunchSpeed; // how quickly the hook is shot. + Item.shootSpeed = LaunchSpeed; // how quickly the hook is shot. Item.shoot = ProjectileType(); Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; diff --git a/Items/Tools/BobbitHook.cs b/Items/Tools/BobbitHook.cs index 34c55f4352..d4e9e27084 100644 --- a/Items/Tools/BobbitHook.cs +++ b/Items/Tools/BobbitHook.cs @@ -1,9 +1,8 @@ using CalamityMod.Projectiles.Typeless; using CalamityMod.Rarities; -using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; - using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Tools @@ -11,13 +10,20 @@ namespace CalamityMod.Items.Tools public class BobbitHook : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Tools"; + + public static float Reach = 40f; + public static float LaunchSpeed = 25f; + public static float ReelbackSpeed = 28f; + public static float PullSpeed = 24f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(Reach.ToString(), LaunchSpeed.ToString(), ReelbackSpeed.ToString(), PullSpeed.ToString()); + public override void SetDefaults() { // Instead of copying these values, we can clone and modify the ones we want to copy Item.CloneDefaults(ItemID.AmethystHook); Item.width = 30; Item.height = 32; - Item.shootSpeed = BobbitHead.LaunchSpeed; // How quickly the hook is shot. + Item.shootSpeed = LaunchSpeed; // How quickly the hook is shot. Item.shoot = ProjectileType(); Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; Item.rare = RarityType(); diff --git a/Localization/en-US/Mods.CalamityMod.Common.hjson b/Localization/en-US/Mods.CalamityMod.Common.hjson new file mode 100644 index 0000000000..2033fa3d59 --- /dev/null +++ b/Localization/en-US/Mods.CalamityMod.Common.hjson @@ -0,0 +1,19 @@ +AbyssLightLevel1: Provides a small amount of light in the abyss +AbyssLightLevel2: Provides a moderate amount of light in the abyss +AbyssLightLevel3: Provides a large amount of light in the abyss +AbyssBreathLevel1: Slightly reduces breath loss in the abyss +AbyssBreathLevel2: Moderately reduces breath loss in the abyss +AbyssBreathLevel3: Greatly reduces breath loss in the abyss +AlcoholWarning: Drinking more than 3 different alcohols might not end well with your liver +CanMineUelibloom: Can mine Uelibloom Ore +NotConsumable: Not consumable +RogueDamage: "{0}% increased rogue damage" +RogueCrit: "{0}% increased rogue critical strike chance" +RogueVelocity: "{0}% increased rogue velocity" +GrappleStats: + ''' + Reach: {0} tiles + Launch Velocity: {1} + Reelback Velocity: {2} + Pull Velocity: {3} + ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index a39b718568..6312122e3e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -303,7 +303,7 @@ BlazingCore: { Upon shattering, holy stars spiral outwards and you only take 1 damage After shattering, this damage reduction effect goes on cooldown Damage parried whilst on cooldown summons additional healing stars, and will not be reduced - Provides a moderate amount of light in the Abyss + {$Common.AbyssLightLevel2} ''' } @@ -826,7 +826,7 @@ GiantPearl: { You have a light aura around you Enemies within the aura are slowed down You release homing prism shards while an enemy is slowed - Provides a small amount of light in the abyss + {$Common.AbyssLightLevel1} ''' } @@ -1046,7 +1046,7 @@ LumenousAmulet: { ''' Attacks inflict Crush Depth and you are immune to it and Riptide While in the abyss you gain 25% increased max life - Provides a moderate amount of light in the abyss + {$Common.AbyssLightLevel2} ''' } @@ -1814,7 +1814,7 @@ TheCamper: { You deal 90% less damage unless stationary Standing still grants buffs depending on held item, and creates a damaging aura around you While moving, you regenerate health as if standing still - Provides a small amount of light in the Abyss + {$Common.AbyssLightLevel1} 'In rest may we find victory' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson index d3c1dfc482..cf8aa9a644 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson @@ -57,7 +57,7 @@ Bloodfin: { ''' Grants a buff that grants +2.5 HP/s life regen This buff directly restores HP if below 75% health - 10 second duration + {$CommonItemTooltip.SecondDuration} 'The wonders of angiogenesis' ''' } @@ -163,13 +163,7 @@ RustedJingleBell: { SerpentsBite: { DisplayName: Serpent's Bite - Tooltip: - ''' - Reach: 28.125 - Launch Velocity: 18 - Reelback Velocity: 14 - Pull Velocity: 12 - ''' + Tooltip: "{$Common.GrappleStats}" } Serpentuna: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson index ba0af93915..06dae2e293 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson @@ -36,7 +36,7 @@ ChromaticOrb: { Tooltip: ''' Summons an ancient dragon light pet that highlights nearby enemies and danger sources - Provides a small amount of light in the abyss + {$Common.AbyssLightLevel1} 'It glows warmly in your hand' ''' } @@ -56,7 +56,7 @@ EnchantedButterfly: { Tooltip: ''' Summons a mysterious dragonfly light pet - Provides a small amount of light in the abyss + {$Common.AbyssLightLevel1} 'Feed him butterflies to keep him strong!' ''' } @@ -106,7 +106,7 @@ LittleLight: { Tooltip: ''' Summons a small construct that follows you and provides a great amount of light - Provides a large amount of light in the abyss + {$Common.AbyssLightLevel3} 'It's been looking for you for a long time' ''' } @@ -136,7 +136,7 @@ RadiatingCrystal: { Tooltip: ''' Summons a radiator light pet - Provides a small amount of light in the abyss + {$Common.AbyssLightLevel1} 'The crystal contains traces of holothurin' ''' } @@ -184,7 +184,7 @@ ThiefsDime: { Tooltip: ''' Summons Goldie the rogue coin to collect nearby coins and light your way - Provides a small amount of light in the abyss + {$Common.AbyssLightLevel1} 'Once worthless treasure, now a relic of a thief's companionship' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index b381adf69a..32f960cfb7 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -172,7 +172,7 @@ BloodyMary: { ''' 10% increased damage and movement speed during a Blood Moon Reduces life regen by 2 HP/s and defense by 4% - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'Extra spicy... and bloody!'] ''' } @@ -183,7 +183,7 @@ CaribbeanRum: { ''' Increases life regen by 1 HP/s, movement speed by 10% and wing flight time by 20% Makes you floaty and reduces defense by 10% - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'Why is the rum gone?'] ''' } @@ -194,7 +194,7 @@ CinnamonRoll: { ''' Increases mana regeneration rate and multiplies all fire-based debuff damage by 1.5x Reduces defense by 10% - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'A great-tasting cinnamon whiskey with a touch of cream soda.'] ''' } @@ -206,7 +206,7 @@ Everclear: { 25% increased damage Reduces life regen by 5 HP/s and defense by 30% Counts as 2 alcohols for Alcohol Poisoning - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'This is the most potent booze I have, be careful with it.'] ''' } @@ -217,7 +217,7 @@ EvergreenGin: { ''' Multiplies all sickness and water-related debuff damage by 1.25x Reduces life regen by 0.5 HP/s - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'It tastes like a Christmas tree, if you can imagine that.'] ''' } @@ -228,7 +228,7 @@ FabsolsVodka: { ''' 8% increased damage, but lowers defense by 5% Increases immune time after being struck - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} This magical liquor is highly sought by those with a refined palate ''' } @@ -239,7 +239,7 @@ Fireball: { ''' Multiplies all fire-based debuff damage by 1.25x Reduces life regen by 0.5 HP/s - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'A great-tasting cinnamon whiskey.'] ''' } @@ -249,7 +249,7 @@ GrapeBeer: { Tooltip: ''' Reduces defense by 3% for 15 seconds - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'This crap is abhorrent, but you might like it.'] ''' } @@ -260,7 +260,7 @@ Margarita: { ''' Halves the duration of most harmful debuffs Reduces defense by 6% and life regen by 0.5 HP/s - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} 3 minute duration [c/B00BA5:'One of the best drinks ever created, enjoy it while it lasts.'] ''' @@ -272,7 +272,7 @@ Moonshine: { ''' Increases defense by 10 and damage reduction by 3% Reduces life regen by 0.5 HP/s - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'This stuff is pretty strong, but I'm sure you can handle it.'] ''' } @@ -283,7 +283,7 @@ MoscowMule: { ''' Increases damage by 9%, knockback by 50% and critical strike chance by 3% Reduces life regen by 2 HP/s - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'I once heard the copper mug can be toxic and I told 'em, 'listen, dummy, I'm already poisoning myself!''] ''' } @@ -305,7 +305,7 @@ OldFashioned: { ''' Multiplies most non-weapon, non-debuff damage by {0}x Multiplies all weapon damage by {1}x - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'An old favorite of mine.'] ''' } @@ -315,7 +315,7 @@ RedWine: { Tooltip: ''' Reduces life regen by 0.5 HP/s for 15 seconds - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'Too dry for my taste.'] ''' } @@ -326,7 +326,7 @@ Rum: { ''' Increases life regen by 1 HP/s and movement speed by 10% Reduces defense by 5% - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'Sweet and potent, just how I like it.'] ''' } @@ -337,7 +337,7 @@ Screwdriver: { ''' Multiplies piercing projectile damage by 1.05x Reduces life regen by 0.5 HP/s - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'Do you have a screw loose?'] ''' } @@ -349,7 +349,7 @@ StarBeamRye: { Increases max mana by 50, magic damage by 8%, and reduces mana usage by 10% Reduces defense by 6% and life regen by 1 HP/s - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'Made from some stuff I found near the Astral Meteor crash site. Don't worry, it's safe, trust me...'] ''' } @@ -360,7 +360,7 @@ Tequila: { ''' Increases knockback by 10%, crit chance by 4% and defense by 5 during daytime Reduces life regen by 0.5 HP/s - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'Great for mixing up daytime drinks.'] ''' } @@ -371,7 +371,7 @@ TequilaSunrise: { ''' Increases knockback by 20%, crit chance by 8% and defense by 10 during daytime Reduces life regen by 1 HP/s - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'The greatest daytime drink I've ever had.'] ''' } @@ -382,7 +382,7 @@ Vodka: { ''' Increases damage by 6% and critical strike chance by 2% Reduces life regen by 0.5 HP/s and defense by 5% - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'The number one alcohol for creating great mixed drinks.'] ''' } @@ -393,7 +393,7 @@ Whiskey: { ''' Increases damage by 4%, knockback by 20% and critical strike chance by 2% Reduces defense by 5% - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'The burning sensation makes it tastier.'] ''' } @@ -404,7 +404,7 @@ WhiteWine: { ''' Increases magic damage by 8% Reduces defense by 6% and life regen by 0.5 HP/s - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} [c/B00BA5:'I drank a full barrel of this stuff once in one night, I couldn't remember who I was the next day.'] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index 01cfba0221..e136cb4a9c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -4,7 +4,7 @@ Abombination: { ''' Summons the Plaguebringer Goliath when used in the Jungle Enrages outside the Jungle - Not consumable + {$Common.NotConsumable} 'Radio capable of emitting a frequency recognized by the Plague nanovirus.' ''' } @@ -15,7 +15,7 @@ AstralChunk: { ''' Summons Astrum Aureus when used in the Astral Infection Enrages during the day while outside the Astral Infection - Not consumable + {$Common.NotConsumable} 'The Infection's fortress has found another target.' ''' } @@ -35,7 +35,7 @@ BloodyWormFood: { ''' Summons the Perforator Hive when used in the Crimson Enrages outside the Underground Crimson - Not consumable + {$Common.NotConsumable} 'Do not play with your food, they won't play with theirs.' ''' } @@ -45,7 +45,7 @@ CausticTear: { Tooltip: ''' Causes an acidic downpour in the Sulphurous Sea - Not consumable + {$Common.NotConsumable} ''' } @@ -54,7 +54,7 @@ CeremonialUrn: { Tooltip: ''' Use at the Altar of the Accursed to summon the Supreme Witch, Calamitas - Not consumable + {$Common.NotConsumable} 'The Witch will not allow it to happen once again.' ''' } @@ -65,7 +65,7 @@ CharredIdol: { ''' Summons the Brimstone Elemental when used in the Brimstone Crags Enrages outside the Brimstone Crags - Not consumable + {$Common.NotConsumable} 'Anything under her gaze shall be scorched beyond recognition.' ''' } @@ -75,7 +75,7 @@ CosmicWorm: { Tooltip: ''' Summons the Devourer of Gods - Not consumable + {$Common.NotConsumable} 'The Nameless Serpent has set out for you.' ''' } @@ -87,7 +87,7 @@ CryoKey: { ''' [SPAWN] Enrages outside the tundra - Not consumable + {$Common.NotConsumable} 'A key for a glacial prison.' ''' SpawnNormal: Summons Cryogen when used in the tundra @@ -99,7 +99,7 @@ DeathWhistle: { Tooltip: ''' Summons the Ravager - Not consumable + {$Common.NotConsumable} 'One of the few sounds the flesh golem still recognizes.' ''' } @@ -110,7 +110,7 @@ DecapoditaSprout: { ''' Summons Crabulon when used in the Mushroom biome Enrages outside the Underground Mushroom biome - Not consumable + {$Common.NotConsumable} 'Bristling with the spores of a unique, parasitic strain.' ''' } @@ -121,7 +121,7 @@ DesertMedallion: { ''' Summons the Desert Scourge when used in the Desert Enrages outside the Desert - Not consumable + {$Common.NotConsumable} 'The Scourge seeks for another meal.' ''' } @@ -131,7 +131,7 @@ EidolonTablet: { Tooltip: ''' Summons the Lunatic Cultist - Not consumable + {$Common.NotConsumable} 'An aged artifact venerated by the Dragon Cult.' ''' } @@ -142,7 +142,7 @@ ExoticPheromones: { ''' Summons Dragonfolly when used in the Jungle Enrages outside the Jungle - Not consumable + {$Common.NotConsumable} 'Pheromones used for hunting Draconic Offshoots.' ''' } @@ -154,7 +154,7 @@ EyeofDesolation: { ''' Summons the Calamitas Clone when used during nighttime[GFB] Enrages during the day - Not consumable + {$Common.NotConsumable} 'She is here.' ''' GFBInfo: Creates a square arena of blocks, with you at its center @@ -167,7 +167,7 @@ MarkofProvidence: { An ornate sigil of the Profaned Flame Hatred yet burns upon its brow [SPAWN] - Not consumable + {$Common.NotConsumable} ''' SpawnInfo: Such power attracts otherworldly beings SpawnVoid: @@ -184,7 +184,7 @@ MartianDistressRemote: { Tooltip: ''' Summons the Martian Madness - Not consumable + {$Common.NotConsumable} ''' } @@ -193,7 +193,7 @@ NecroplasmicBeacon: { Tooltip: ''' Summons Polterghast when used in the Dungeon - Not consumable + {$Common.NotConsumable} 'The wails of the spirits disturbed something far more terrifying.' ''' } @@ -208,7 +208,7 @@ OverloadedSludge: { Tooltip: ''' Summons the Slime God - Not consumable + {$Common.NotConsumable} 'Writhing and bloated with the pus of Gods long dead.' ''' } @@ -219,7 +219,7 @@ Portabulb: { ''' Summons Plantera when used in the Jungle Enrages outside the Underground Jungle - Not consumable + {$Common.NotConsumable} ''' } @@ -230,7 +230,7 @@ ProfanedCore: { Summons Providence when used in the Hallow or Underworld Unique drop changes depending on the biome fought in Enrages when fought during nighttime - Not consumable + {$Common.NotConsumable} 'The heart of Her Guardians, Her wicked wrath shall burn upon whoever now wields it.' ''' } @@ -240,7 +240,7 @@ ProfanedShard: { Tooltip: ''' [SPAWN] - Not consumable + {$Common.NotConsumable} 'Her Guardians seek the holder of such vast stolen power.' ''' SpawnNormal: @@ -256,7 +256,7 @@ SandstormsCore: { Tooltip: ''' Summons the Great Sand Shark when used in the [BIOME] - Not consumable + {$Common.NotConsumable} ''' } @@ -266,7 +266,7 @@ Seafood: { ''' Summons the Aquatic Scourge when used in the Sulphurous Sea Enrages outside the Sulphurous Sea - Not consumable + {$Common.NotConsumable} 'Large bait for a large catch. Beware the monsters of the seas.' ''' } @@ -287,7 +287,7 @@ Teratoma: { ''' Summons the Hive Mind when used in the Corruption Enrages outside the Underground Corruption - Not consumable + {$Common.NotConsumable} 'An exquisitely hideous tumor for those diseased in the head.' ''' } @@ -304,7 +304,7 @@ YharonEgg: { ''' Summons Yharon, Dragon of Rebirth Enrages outside the fire walls - Not consumable + {$Common.NotConsumable} 'A symbol of the Dragon watching over and waiting for you.' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson index a0f7a6e3ff..d3dc035ccd 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson @@ -72,10 +72,7 @@ BobbitHook: { Tooltip: ''' Retracts upon attaching to a tile with extreme speeds - Reach: 40 - Launch Velocity: 25 - Reelback Velocity: 28 - Pull Velocity: 24 + {$Common.GrappleStats} ''' } @@ -124,7 +121,7 @@ Gelpick: { GenesisPickaxe: { DisplayName: Genesis Pickaxe - Tooltip: Can mine Uelibloom Ore + Tooltip: "{$Common.CanMineUelibloom}" } Grax: { diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson index ac86be70b0..4f7221a84d 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson @@ -41,6 +41,11 @@ SetBonus: { Cold enemies will deal reduced contact damage to the player Provides immunity to the Chilled, Frozen, Frostburn and Glacial State debuffs ''' + Forbidden: + ''' + {$LegacyTooltip.48} {$ArmorSetBonus.Forbidden} + Minions no longer deal less damage while wielding magic weapons + ''' Frost: ''' Melee and ranged attacks inflict Frostbite diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 72448ef62f..8ac4b8ef7d 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -1,3 +1,226 @@ +DodgeInfo: + ''' + Grants the ability to dodge attacks + Attacks that deal less than 5% of your max life in damage will not be dodged + The dodge has a cooldown that ranges between {0} and {1} seconds depending on the dodged attack's damage + The cooldown is shared with all other dodges and reflects + ''' + +AddedTooltip: { + TruffleWorm: + ''' + Summons Duke Fishron if used as bait in the Ocean + Enrages outside the Ocean + ''' + SlimeGun: Slimed enemies take more damage from fire-based debuffs + FleshKnucklesLine: Max life increased by 45 + RodofDiscord: Teleportation is disabled while Chaos State is active + Pwnhammer: + ''' + Demon Altars now drop Souls of Night instead of generating ores when destroyed + nHardmode ores now generate after defeating Mechanical Bosses for the first time + ''' + // Life Drain + SoulDrain: + ''' + This grants +1.5 HP/s life regen and accelerates natural life regen + Life drain stacks based on the number of enemies being hit + ''' + WarmthPotion: Greatly reduces the duration of Chilled, Frozen, and Glacial State + HandWarmer: Provides a regeneration boost while wearing the Snow armor + GoldenFishingRod: Its fishing line will never break + Tombstones: + ''' + 13 of any tombstone turns the surrounding area into a graveyard + Graveyards have various new item sales and recipes + ''' + DD2ElderCrystal: while the wave is complete to skip the timer + DeathSickle: Inflicts Whispering Death on hit + HellfireTreads: + ''' + Multiplies all fire-based debuff damage by 1.5x, does not stack with downgrades + All attacks inflict Hellfire + ''' + FairyBoots: + ''' + Fairies can spawn at any time on the surface and spawn far more frequently + Nearby fairies grant +2 HP/s life regen, 10 defense and 10% movement speed + Fairies are immune to damage and will no longer flee + ''' + MoonStone: Reduces the damage of the Nightwither debuff + SunStone: Reduces the damage of the Daybroken debuff + CelestialStone: Reduces the damage of the Nightwither and Daybroken debuffs + ArcaneFlower: 5% increased magic damage + RifleScope: The scope effect can be toggled with visibility + FeatherfallPotion: Disables all airborne flight recovery + TitanGloveLine: 10% increased true melee damage + YoyoGlove: Secondary yoyos will do 50% less damage + DefensePrefix: +{0}% damage reduction + LuckyPrefix: +0.05 luck + /* + Armor + */ + CopperHelmet: 5% increased damage + CopperChainmail: 3% increased critical strike chance + CopperGreaves: 5% increased movement speed + TinHelmet: 3% increased critical strike chance + TinChainmail: +0.5 HP/s life regen + TinGreaves: 5% increased movement speed + IronPieces: Increases damage reduction by 3% + LeadPieces: Increases damage reduction by 2% + SilverHelmet: 5% increased critical strike chance + SilverChainmail: +1 HP/s life regen + SilverGreaves: 8% increased movement speed + TungstenHelmet: 7% increased damage + TungstenChainmail: +0.5 HP/s life regen + TungstenGreaves: 8% increased movement speed + GoldHelmet: 6% increased damage + GoldChainmail: Increases damage reduction by 5% + GoldGreaves: 10% increased movement speed + PlatinumHelmet: 6% increased damage + PlatinumChainmail: 3% increased critical strike chance + PlatinumGreaves: 10% increased movement speed + CrimsonBreastplate: +1 HP/s life regen + CrimsonOtherPieces: +0.5 HP/s life regen + SolarFlarePieces: Grants +1 HP/s life regeneration + Picksaw: Can mine Scoria Ore located in the Abyss +} + +EditedTooltip: { + /* + Boss Summons + */ + Abeemination: + ''' + Summons the Queen Bee when used in the Jungle + Enrages outside the Underground Jungle + ''' + BloodySpine: + ''' + Summons the Brain of Cthulhu when used in the Crimson + Enrages outside the Underground Crimson + ''' + ClothierVoodooDoll: + ''' + While equipped, summons Skeletron when the Clothier is killed during nighttime + Enrages during the day + 'You are a terrible person' + ''' + DeerThing: Summons Deerclops when used in the Snow or Ice biome + GuideVoodooDoll: + ''' + Summons the Wall of Flesh if thrown into lava in the underworld while the Guide is alive + 'You are a terrible person' + ''' + LihzahrdPowerCell: + ''' + Summons the Golem when used at the Lihzahrd Altar + Enrages outside the Jungle Temple + ''' + MechanicalEye: + ''' + Summons The Twins when used during nighttime + Enrages during the day + ''' + MechanicalSkull: + ''' + Summons Skeletron Prime when used during nighttime + Enrages during the day + ''' + MechanicalWorm: + ''' + Summons The Destroyer when used during nighttime + Enrages during the day + ''' + QueenSlimeCrystal: Summons Queen Slime when used in the Hallow + SuspiciousLookingEye: + ''' + Summons the Eye of Cthulhu when used during nighttime + Enrages during the day + ''' + WormFood: + ''' + Summons the Eater of Worlds when used in the Corruption + Enrages outside the Underground Corruption + ''' + MasterExclusive: Master or Revengeance + // Sparkle Slime Balloon + GelBalloon: + ''' + Throws a mixture of slime and sparkling crystals + Slimed enemies take more damage from fire-based debuffs + ''' + AnkhShield1: Grants immunity to knockback + AnkhShield2: Grants immunity to most debuffs, including Mighty Wind + Campfires: Life regen is increased by 0.5 HP/s when near a campfire + HeartLantern: Grants +1 HP/s life regeneration when placed nearby + BottledHoney: + ''' + Grants +1 HP/s life regen for a short time + Grants an additional +1 HP/s life regen while inflicted with a damaging debuff + ''' + ShinyStone: Grants +2 HP/s life regen and accelerates natural life regen when not moving + BandofRegeneration: Grants +1 HP/s life regeneration + CharmofMyths: Grants +1 HP/s life regeneration and reduces the cooldown of healing potions by 25% + RegenerationPotion: Provides +2 HP/s life regeneration + HamBat: Defeating enemies temporarily grants +3 HP/s life regen + // Arcane Crystal + AegisCrystal: Permanently boosts natural life regeneration + ArcheryPotion: 20% increased arrow speed and 5% increased arrow damage + IronskinPotion: Increase defense by {0} + // Aerial Bane + DD2BetsyBow: Shoots a tight spread of 6 splitting arrows + AleSake: + ''' + Increases melee damage by 10% and reduces defense by 5% + Counts as an alcohol for Alcohol Poisoning + {$Common.AlcoholWarning} + ''' + FlameWakerBoots: + ''' + Multiplies all fire-based debuff damage by 1.25x + All attacks light enemies on fire + 'Never get cold feet again' + ''' + SunMoonStones: critical strike chance, life regeneration, + MagnetFlower: 10% reduced mana cost + ArcaneFlowerManaCloak: 12% reduced mana cost + Magiluminescence: + ''' + Increases movement acceleration and deceleration by 1.75x + Increases movement speed by 1.15x. This bonus applies to running boot accessories + ''' + FrogLeg: Increases jump speed by {0}% and allows auto-jump + // Soaring Insignia + EmpressFlightBooster1: Increases wing flight time by 25% + EmpressFlightBooster2: Increases movement and jump speed by 10% and acceleration by 1.1x + RifleScope1: Increase view range for guns (Right click to zoom out) + RifleScope2: The scope effect can be toggled with visibility + SniperScope: 7% increased ranged damage and critical strike chance + MagicQuiver: Increases arrow damage by 5% and greatly increases arrow speed + MoltenQuiver1: Increases arrow damage by 7% and greatly increases arrow speed + MoltenQuiver2: Lights wooden arrows ablaze and all arrows inflict Hellfire + MagicPowerPotion: 10% increased magic damage + MagicHat: 6% increased magic critical strike chance + PowerGlove: 10% increased melee speed, does not stack with downgrades + BerserkerGlove: 10% increased true melee damage + MechanicalGlove: + ''' + 12% increased melee damage + 12% increased melee speed, does not stack with downgrades + ''' + FireGauntlet1: Increases melee knockback and melee attacks inflict Hellfire + FireGauntlet2: + ''' + 14% increased melee damage + 14% increased melee speed, does not stack with downgrades + ''' + ObsidianSkullLine: Grants immunity to the Burning and On Fire! debuffs + LavaWaders: Grants immunity to the Burning and On Fire! debuffs, and 7 seconds of immunity to lava + Gi: 10% increased movement and jump speed + GoldPickaxe: Can mine Demonite, Crimtane, Meteorite, Sea Prisms, and Sea Prism Crystals +} + // Buff Descriptions BuffDescription: { Banner: You have increased damage and defense against the following: diff --git a/Projectiles/Typeless/BobbitHead.cs b/Projectiles/Typeless/BobbitHead.cs index c49a121a9c..58add5c52b 100644 --- a/Projectiles/Typeless/BobbitHead.cs +++ b/Projectiles/Typeless/BobbitHead.cs @@ -1,5 +1,7 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Tools; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,14 +12,15 @@ namespace CalamityMod.Projectiles.Typeless public class BobbitHead : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Typeless"; - public const float PullSpeed = 24f; - public const float ReelbackSpeed = 28f; - public const float LaunchSpeed = 25f; - public const float GrappleRangInTiles = 40f; - public override void SetDefaults() - { - Projectile.CloneDefaults(ProjectileID.GemHookAmethyst); - } + + public static Asset Chain; + public override void Load() => Chain = Request("CalamityMod/Projectiles/Typeless/BobbitHookChain"); + + public override void SetDefaults() => Projectile.CloneDefaults(ProjectileID.GemHookAmethyst); + + public override float GrappleRange() => BobbitHook.Reach * 16f; + public override void GrappleRetreatSpeed(Player player, ref float speed) => speed = BobbitHook.ReelbackSpeed; + public override void GrapplePullSpeed(Player player, ref float speed) => speed = BobbitHook.PullSpeed; // Use this hook for hooks that can have multiple hooks mid-flight: Dual Hook, Web Slinger, Fish Hook, Static Hook, Lunar Hook public override bool? CanUseGrapple(Player player) @@ -36,31 +39,9 @@ namespace CalamityMod.Projectiles.Typeless } return true; } + public override void NumGrappleHooks(Player player, ref int numHooks) => numHooks = 1; - // Amethyst Hook is 300, Static Hook is 600, 16f = 1 tile - public override float GrappleRange() => GrappleRangInTiles * 16f; - - public override void NumGrappleHooks(Player player, ref int numHooks) - { - numHooks = 1; - } - - // default is 11, Lunar is 24 - public override void GrappleRetreatSpeed(Player player, ref float speed) - { - speed = ReelbackSpeed; - } - - public override void GrapplePullSpeed(Player player, ref float speed) - { - speed = PullSpeed; - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawHook(Projectile, Request("CalamityMod/Projectiles/Typeless/BobbitHookChain").Value); - return true; - } + public override bool PreDraw(ref Color lightColor) => Projectile.DrawHook(Chain.Value); public override void AI() { diff --git a/Projectiles/Typeless/SerpentsBiteHook.cs b/Projectiles/Typeless/SerpentsBiteHook.cs index 1737fa6531..7f5b8feb07 100644 --- a/Projectiles/Typeless/SerpentsBiteHook.cs +++ b/Projectiles/Typeless/SerpentsBiteHook.cs @@ -1,5 +1,7 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Fishing.SunkenSeaCatches; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,14 +12,15 @@ namespace CalamityMod.Projectiles.Typeless public class SerpentsBiteHook : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Typeless"; - public const float PullSpeed = 12f; - public const float ReelbackSpeed = 14f; - public const float LaunchSpeed = 18f; - public const float GrappleRangInTiles = 28.125f; - public override void SetDefaults() - { - Projectile.CloneDefaults(ProjectileID.GemHookAmethyst); - } + + public static Asset Chain; + public override void Load() => Chain = Request("CalamityMod/Projectiles/Typeless/SerpentsBiteChain"); + + public override void SetDefaults() => Projectile.CloneDefaults(ProjectileID.GemHookAmethyst); + + public override float GrappleRange() => SerpentsBite.Reach * 16f; + public override void GrappleRetreatSpeed(Player player, ref float speed) => speed = SerpentsBite.ReelbackSpeed; + public override void GrapplePullSpeed(Player player, ref float speed) => speed = SerpentsBite.PullSpeed; // Use this hook for hooks that can have multiple hooks mid-flight: Dual Hook, Web Slinger, Fish Hook, Static Hook, Lunar Hook public override bool? CanUseGrapple(Player player) @@ -36,31 +39,9 @@ namespace CalamityMod.Projectiles.Typeless } return true; } + public override void NumGrappleHooks(Player player, ref int numHooks) => numHooks = 2; - // Amethyst Hook is 300, Static Hook is 600, 16f = 1 tile - public override float GrappleRange() => GrappleRangInTiles * 16f; - - public override void NumGrappleHooks(Player player, ref int numHooks) - { - numHooks = 2; - } - - // default is 11, Lunar is 24 - public override void GrappleRetreatSpeed(Player player, ref float speed) - { - speed = ReelbackSpeed; - } - - public override void GrapplePullSpeed(Player player, ref float speed) - { - speed = PullSpeed; - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawHook(Projectile, Request("CalamityMod/Projectiles/Typeless/SerpentsBiteChain").Value); - return true; - } + public override bool PreDraw(ref Color lightColor) => Projectile.DrawHook(Chain.Value); public override void AI() { diff --git a/Utilities/DrawingUtils.cs b/Utilities/DrawingUtils.cs index 092f151764..08bf4b543b 100644 --- a/Utilities/DrawingUtils.cs +++ b/Utilities/DrawingUtils.cs @@ -458,7 +458,7 @@ namespace CalamityMod return new Rectangle(0, item.height * frame, item.width, item.height); } - public static void DrawHook(this Projectile projectile, Texture2D hookTexture, float angleAdditive = 0f) + public static bool DrawHook(this Projectile projectile, Texture2D hookTexture, float angleAdditive = 0f) { Player player = Main.player[projectile.owner]; Vector2 center = projectile.Center; @@ -485,6 +485,7 @@ namespace CalamityMod hookTexture.Size() / 2, 1f, SpriteEffects.None, 0f); } } + return true; } internal static void IterateDisco(ref Color c, ref float aiParam, in byte discoIter = 7)