Files
CalamityModPublic/Rarities/ColorTool.cs
T
CongratsIsTrash fba6275306 1 - Why are these CatalystMod
2 - Decreased the number of Gold Coins in the surface and shimmer shrines
2025-05-25 10:54:49 -04:00

48 lines
1.8 KiB
C#

using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Items
{
public sealed class ColorTool : GlobalItem
{
public static int RarityCosmicPurple => ModContent.GetInstance<CosmicPurple>().Type;
public static int RarityBurnishedAuric => ModContent.GetInstance<BurnishedAuric>().Type;
public static int RarityCalamityRed => ModContent.GetInstance<CalamityRed>().Type;
public override bool PreDrawTooltipLine(Item Item, DrawableTooltipLine line, ref int yOffset)
{
if (line.Mod == "Terraria" && line.Name == "ItemName")
{
if (Item.rare == RarityCosmicPurple)
{
CosmicPurple.Draw(Item, line);
return false;
}
if (Item.rare == RarityBurnishedAuric)
{
BurnishedAuric.Draw(Item, line);
return false;
}
if (Item.rare == RarityCalamityRed)
{
CalamityRed.Draw(Item, line);
return false;
}
}
return true;
}
public static Color colorLerps(Color[] colors, float time)
{
int index = (int)time;
return Color.Lerp(colors[index % colors.Length], colors[(index + 1) % colors.Length], time % 1f);
}
public static Color Rainbowing(float position) => colorLerps(
new Color[] { new Color(255, 50, 50, 255), new Color(255, 128, 50, 255), new Color(230, 255, 50, 255), new Color(80, 255, 60, 255),
new Color(50, 80, 250, 255), new Color(200, 50, 250, 255),new Color(255, 50, 230, 255), }, position);
}
}