38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
using Terraria.ModLoader;
|
|
using Terraria;
|
|
using Microsoft.Xna.Framework;
|
|
using System;
|
|
|
|
namespace ForgottenWawiTech.Content.Rarities
|
|
{
|
|
public class CorruptedItem : ModRarity
|
|
{
|
|
public override Color RarityColor
|
|
{
|
|
get
|
|
{
|
|
float time = Main.GlobalTimeWrappedHourly;
|
|
|
|
// Base color cycle: bright cyan <-> deep teal with glitchy pulsing
|
|
const float cycleHz = 0.8f;
|
|
float t = (float)((Math.Sin(time * cycleHz * MathHelper.TwoPi) + 1f) * 0.5f);
|
|
|
|
Color brightCyan = new Color(0, 255, 255);
|
|
Color deepTeal = new Color(0, 128, 160);
|
|
Color baseColor = Color.Lerp(deepTeal, brightCyan, t);
|
|
|
|
// Add shimmer effect
|
|
const float shimmerHz = 2.0f;
|
|
float shimmer = (float)((Math.Sin(time * shimmerHz * MathHelper.TwoPi) + 1f) * 0.5f);
|
|
float brightness = 1f + 0.15f * shimmer;
|
|
|
|
// Add occasional "glitch" spikes in brightness
|
|
const float glitchHz = 3.7f;
|
|
float glitch = (float)Math.Pow(Math.Max(0f, Math.Sin(time * glitchHz * MathHelper.TwoPi)), 8f);
|
|
brightness += glitch * 0.4f; // Sharp brightness spikes
|
|
|
|
return baseColor * brightness;
|
|
}
|
|
}
|
|
}
|
|
} |