From daa254f13aebbb01bd8d8e976e008e5fed8aee75 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 31 Mar 2020 16:54:17 -0400 Subject: [PATCH] flexible hotkey tooltips/duke scales tooltip tweak --- Items/Accessories/AsgardianAegis.cs | 15 ++++++++++++++- Items/Accessories/AstralArcanum.cs | 15 ++++++++++++++- Items/Accessories/CelestialJewel.cs | 15 ++++++++++++++- Items/Accessories/DukeScales.cs | 2 +- Items/Accessories/ElysianAegis.cs | 15 ++++++++++++++- Items/Accessories/MomentumCapacitor.cs | 15 ++++++++++++++- Items/Accessories/SandCloak.cs | 15 ++++++++++++++- Items/Accessories/SpectralVeil.cs | 15 ++++++++++++++- Items/NormalityRelocator.cs | 16 +++++++++++++++- 9 files changed, 114 insertions(+), 9 deletions(-) diff --git a/Items/Accessories/AsgardianAegis.cs b/Items/Accessories/AsgardianAegis.cs index 75c5db5880..e720df5661 100644 --- a/Items/Accessories/AsgardianAegis.cs +++ b/Items/Accessories/AsgardianAegis.cs @@ -3,6 +3,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Accessories "+40 max life\n" + "Grants a supreme holy flame dash\n" + "Can be used to ram enemies\n" + - "Press N to activate buffs to all damage, crit chance, and defense\n" + + "This line is modified below\n" + "Activating this buff will reduce your movement speed and increase enemy aggro\n" + "10% damage reduction while submerged in liquid\n" + "Toggle visibility of this accessory to enable/disable the dash"); @@ -35,6 +36,18 @@ namespace CalamityMod.Items.Accessories item.Calamity().customRarity = CalamityRarity.DarkBlue; } + public override void ModifyTooltips(List list) + { + string hotkey = CalamityMod.AegisHotKey.GetAssignedKeys().Count > 0 ? CalamityMod.AegisHotKey.GetAssignedKeys()[0] : "N"; + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip5") + { + line2.text = "Press " + hotkey + " to activate buffs to all damage, crit chance, and defense"; + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/AstralArcanum.cs b/Items/Accessories/AstralArcanum.cs index 28e8d6abaf..b4242a258c 100644 --- a/Items/Accessories/AstralArcanum.cs +++ b/Items/Accessories/AstralArcanum.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Accessories "If this effect triggers you get healed for the projectile's damage\n" + "Boosts life regen even while under the effects of a damaging debuff\n" + "While under the effects of a damaging debuff you will gain 20 defense\n" + - "Press O to toggle teleportation UI"); + "This line is modified below"); } public override void SetDefaults() @@ -29,6 +30,18 @@ namespace CalamityMod.Items.Accessories item.Calamity().customRarity = CalamityRarity.PureGreen; } + public override void ModifyTooltips(List list) + { + string hotkey = CalamityMod.AstralArcanumUIHotkey.GetAssignedKeys().Count > 0 ? CalamityMod.AstralArcanumUIHotkey.GetAssignedKeys()[0] : "O"; + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip6") + { + line2.text = "Press " + hotkey + " to toggle teleportation UI"; + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/CelestialJewel.cs b/Items/Accessories/CelestialJewel.cs index 2dc5e37891..e166bf55f5 100644 --- a/Items/Accessories/CelestialJewel.cs +++ b/Items/Accessories/CelestialJewel.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Potions; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Accessories DisplayName.SetDefault("Celestial Jewel"); Tooltip.SetDefault("Boosts life regen even while under the effects of a damaging debuff\n" + "While under the effects of a damaging debuff you will gain 20 defense\n" + - "Press P to teleport to a random location"); + "This line is modified below"); } public override void SetDefaults() @@ -25,6 +26,18 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } + public override void ModifyTooltips(List list) + { + string hotkey = CalamityMod.AstralTeleportHotKey.GetAssignedKeys().Count > 0 ? CalamityMod.AstralTeleportHotKey.GetAssignedKeys()[0] : "P"; + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip2") + { + line2.text = "Press " + hotkey + " to teleport to a random location"; + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/DukeScales.cs b/Items/Accessories/DukeScales.cs index 37afd9fa6d..b9f6ae81d3 100644 --- a/Items/Accessories/DukeScales.cs +++ b/Items/Accessories/DukeScales.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Old Duke's Scales"); Tooltip.SetDefault("While under the effects of a damaging debuff, you gain 10% increased damage and 5% crit\n" + - "For every 25% of lost life, you gain an additional 6% increased damage and 3% crit\n" + + "For every 25% of lost life, you gain 6% increased damage and 3% crit\n" + "This will max out at 18% increased damage and 9% crit when under 25% life\n" + "Provides immunity to poisoned, venom, and sulphruic poisoning"); } diff --git a/Items/Accessories/ElysianAegis.cs b/Items/Accessories/ElysianAegis.cs index 3878dac3fd..9753df4253 100644 --- a/Items/Accessories/ElysianAegis.cs +++ b/Items/Accessories/ElysianAegis.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Buffs.DamageOverTime; +using System.Collections.Generic; using Terraria; using Terraria.ModLoader; @@ -16,7 +17,7 @@ namespace CalamityMod.Items.Accessories "+40 max life and increased life regen\n" + "Grants a supreme holy flame dash\n" + "Can be used to ram enemies\n" + - "Press N to activate buffs to all damage, crit chance, and defense\n" + + "This line is modified below\n" + "Activating this buff will reduce your movement speed and increase enemy aggro\n" + "Toggle visibility of this accessory to enable/disable the dash"); } @@ -32,6 +33,18 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } + public override void ModifyTooltips(List list) + { + string hotkey = CalamityMod.AegisHotKey.GetAssignedKeys().Count > 0 ? CalamityMod.AegisHotKey.GetAssignedKeys()[0] : "N"; + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip5") + { + line2.text = "Press " + hotkey + " to activate buffs to all damage, crit chance, and defense"; + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/MomentumCapacitor.cs b/Items/Accessories/MomentumCapacitor.cs index 3eee5c26c7..d68a30a91e 100644 --- a/Items/Accessories/MomentumCapacitor.cs +++ b/Items/Accessories/MomentumCapacitor.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using System.Collections.Generic; using Terraria; using Terraria.ModLoader; @@ -9,7 +10,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Momentum Capacitor"); - Tooltip.SetDefault("Pressing U, for the cost of 30% of max stealth, causes an energy field to appear at the cursor position\n" + + Tooltip.SetDefault("This line is modified below\n" + "Rogue projectiles that enter the field get a constant acceleration and 15% damage boost\n" + "These boosts can only happen to a projectile once\n" + "There can only be one field"); @@ -24,6 +25,18 @@ namespace CalamityMod.Items.Accessories item.rare = 6; } + public override void ModifyTooltips(List list) + { + string hotkey = CalamityMod.MomentumCapacitatorHotkey.GetAssignedKeys().Count > 0 ? CalamityMod.MomentumCapacitatorHotkey.GetAssignedKeys()[0] : "U"; + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Press " + hotkey + " to consume 30% of your maximum stealth to create an energy field at the cursor position"; + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/SandCloak.cs b/Items/Accessories/SandCloak.cs index 1cb283751d..0ed37811c0 100644 --- a/Items/Accessories/SandCloak.cs +++ b/Items/Accessories/SandCloak.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,7 +12,7 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Sand Cloak"); Tooltip.SetDefault("+1 defense and 5% increased movement speed\n" + - "Press C to consume 25% of your maximum stealth to create a protective dust veil which provides +6 defense and +2 life regen\n" + + "This line is modified below\n" + "This effect has a 30 second cooldown before it can be used again"); } @@ -24,6 +25,18 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } + public override void ModifyTooltips(List list) + { + string hotkey = CalamityMod.SandCloakHotkey.GetAssignedKeys().Count > 0 ? CalamityMod.SandCloakHotkey.GetAssignedKeys()[0] : "C"; + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "Press " + hotkey + " to consume 25% of your maximum stealth to create a protective dust veil which provides +6 defense and +2 life regen"; + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { player.statDefense += 1; diff --git a/Items/Accessories/SpectralVeil.cs b/Items/Accessories/SpectralVeil.cs index 177b1e58df..cc854ea423 100644 --- a/Items/Accessories/SpectralVeil.cs +++ b/Items/Accessories/SpectralVeil.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,7 +12,7 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Spectral Veil"); Tooltip.SetDefault("The inside of the cloak is full of teeth...\n" + - "Press Z to consume 25% of your maximum stealth to perform a short range teleport and render you momentarily invulnerable\n" + + "This line is modified below\n" + "Teleportation is disabled while Chaos State is active\n" + "If you dodge something while invulnerable, you instantly gain full stealth"); } @@ -25,6 +26,18 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } + public override void ModifyTooltips(List list) + { + string hotkey = CalamityMod.SpectralVeilHotKey.GetAssignedKeys().Count > 0 ? CalamityMod.SpectralVeilHotKey.GetAssignedKeys()[0] : "Z"; + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "Press " + hotkey + " to consume 25% of your maximum stealth to perform a short range teleport and render you momentarily invulnerable"; + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().spectralVeil = true; diff --git a/Items/NormalityRelocator.cs b/Items/NormalityRelocator.cs index 4d3af2df0b..1340fb5786 100644 --- a/Items/NormalityRelocator.cs +++ b/Items/NormalityRelocator.cs @@ -1,6 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Ores; +using System.Collections.Generic; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -14,7 +15,7 @@ namespace CalamityMod.Items { DisplayName.SetDefault("Normality Relocator"); Tooltip.SetDefault("I'll be there in the blink of an eye\n" + - "Press Z to teleport to the position of the mouse\n" + + "This line is modified below\n" + "Teleportation is disabled while Chaos State is active\n" + "Boosts movement and fall speed by 10%\n" + "Works while in the inventory"); @@ -30,6 +31,19 @@ namespace CalamityMod.Items item.Calamity().customRarity = CalamityRarity.Dedicated; } + public override void ModifyTooltips(List list) + { + string hotkey = CalamityMod.NormalityRelocatorHotKey.GetAssignedKeys().Count > 0 ? CalamityMod.NormalityRelocatorHotKey.GetAssignedKeys()[0] : "Z"; + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "Press " + hotkey + " to teleport to the position of the mouse"; + } + } + } + + public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity();