fixed botch tooltip edits (for now) (sorry)

This commit is contained in:
Ozzatron authored and Cameron Ewell committed 2023-07-11 22:14:31 -04:00
1 parent c7d3313b84
commit 51c2aa2193
1 file changed
+34 -33
+34 -33
View File
@@ -235,9 +235,9 @@ namespace CalamityMod.Items
// 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)
{
// Don't add the tooltip if the item is in a social slot
if (item.social)
return;
// Don't add the tooltip if the item is in a social slot
if (item.social)
return;
int defenseIndex = -1;
for (int i = 0; i < tooltips.Count; ++i)
@@ -346,7 +346,7 @@ namespace CalamityMod.Items
if (item.type == ItemID.SpaceGun)
{
int cost = (int)(item.mana * Main.LocalPlayer.manaCost * 0.5f);
int cost = (int)(item.mana * Main.LocalPlayer.manaCost * 0.5f);
EditTooltipByName("UseMana", (line) => line.Text = $"Uses {cost} mana");
}
if (item.healLife > 0 && Main.LocalPlayer.Calamity().healingPotBonus != 1f)
@@ -600,21 +600,25 @@ namespace CalamityMod.Items
// Nightwither immunity pre-Moon Lord and Holy Flames immunity pre-Profaned Guardians and melee speed removal.
if (item.type == ItemID.MoonStone)
{
EditTooltipByNum(1, (line) => line.Text += "\nGrants immunity to Nightwither");
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("melee speed, ", ""));
}
if (item.type == ItemID.SunStone)
{
EditTooltipByNum(1, (line) => line.Text += "\nGrants immunity to Holy Flames");
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("melee speed, ", ""));
}
if (item.type == ItemID.CelestialStone)
{
EditTooltipByNum(2, (line) => line.Text += "\nGrants immunity to Nightwither and Holy Flames");
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace(" melee speed,", ""));
}
if (item.type == ItemID.CelestialShell)
{
EditTooltipByNum(4, (line) => line.Text += "\nGrants immunity to Nightwither and Holy Flames");
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace(" melee speed,", ""));
EditTooltipByNum(1, (line) => line.Text = line.Text.Replace(" melee speed,", ""));
EditTooltipByNum(2, (line) => line.Text = line.Text.Replace(" melee speed,", ""));
EditTooltipByNum(3, (line) => line.Text = line.Text.Replace(" melee speed,", ""));
EditTooltipByNum(4, (line) => line.Text = line.Text.Replace(" melee speed,", ""));
}
// Arcane and Magnet Flower buffs.
if (item.type == ItemID.ArcaneFlower || item.type == ItemID.MagnetFlower)
@@ -674,8 +678,7 @@ namespace CalamityMod.Items
if (item.type == ItemID.BerserkerGlove)
{
EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("12% increased melee speed", ""));
EditTooltipByNum(0, (line) => line.Text += "\n10% increased true melee damage");
EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("12% increased melee speed", "10% increased true melee damage"));
}
if (item.type == ItemID.MechanicalGlove)
@@ -844,9 +847,7 @@ namespace CalamityMod.Items
if (item.type == ItemID.SquireAltShirt)
EditTooltipByNum(0, (line) => line.Text = "30% increased minion damage and increased life regeneration");
if (item.type == ItemID.SquireAltPants)
EditTooltipByNum(0, (line) => line.Text = "10% increased minion damage and melee critical strike chance\n" +
"20% increased movement speed");
EditTooltipByNum(1, (line) => line.Text = "");
EditTooltipByNum(0, (line) => line.Text = "10% increased minion damage and melee critical strike chance");
// Shinobi Infiltrator armor
if (item.type == ItemID.MonkAltHead)
@@ -1167,18 +1168,18 @@ namespace CalamityMod.Items
if (stealthGenBoost > 0)
{
TooltipLine line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Expert");
if (line == null)
line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Price");
if (line == null)
line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Price");
TooltipLine StealthGen = new TooltipLine(Mod, "PrefixStealthGenBoost", "+" + Math.Round(stealthGenBoost * 100f) + "% stealth generation")
{
IsModifier = true
};
if (line == null)
tooltips.Add(StealthGen);
else
tooltips.Insert(tooltips.IndexOf(line), StealthGen);
if (line == null)
tooltips.Add(StealthGen);
else
tooltips.Insert(tooltips.IndexOf(line), StealthGen);
}
}
#endregion
@@ -1193,27 +1194,27 @@ namespace CalamityMod.Items
if (stealthDmgBonus > 0)
{
TooltipLine line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "PrefixShootSpeed");
if (line == null)
line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "PrefixCritChance");
else if (line == null)
line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "PrefixSpeed");
else if (line == null)
line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "PrefixDamage");
if (line == null)
line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "PrefixCritChance");
else if (line == null)
line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "PrefixSpeed");
else if (line == null)
line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "PrefixDamage");
TooltipLine line2 = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Expert");
if (line2 == null)
line2 = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Price");
if (line2 == null)
line2 = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Price");
TooltipLine StealthDmg = new TooltipLine(Mod, "PrefixStealthDamageBoost", "+" + Math.Round(stealthDmgBonus * 100f) + "% stealth strike damage")
{
IsModifier = true
};
// If price/expert line doesn't exist, just add it to the end
if (line2 == null)
tooltips.Add(StealthDmg);
// Otherwise, insert it right before the sell price (or expert line)
else
tooltips.Insert(tooltips.IndexOf(line2), StealthDmg);
// If price/expert line doesn't exist, just add it to the end
if (line2 == null)
tooltips.Add(StealthDmg);
// Otherwise, insert it right before the sell price (or expert line)
else
tooltips.Insert(tooltips.IndexOf(line2), StealthDmg);
}
}
#endregion