37 lines
1.4 KiB
C#
37 lines
1.4 KiB
C#
using Terraria.ModLoader;
|
|
using Terraria;
|
|
using Microsoft.Xna.Framework;
|
|
using System;
|
|
|
|
namespace ForgottenWawiTech.Content.Rarities
|
|
{
|
|
public class ProtogenItem : ModRarity
|
|
{
|
|
// Cycles between bright neon blue and vibrant pink/magenta with digital-style pulses
|
|
// to represent Protogen visor displays and cybernetic aesthetic
|
|
public override Color RarityColor
|
|
{
|
|
get
|
|
{
|
|
float time = Main.GlobalTimeWrappedHourly;
|
|
|
|
// Base color cycle: neon blue <-> vibrant pink
|
|
const float cycleHz = 0.9f; // cycles per second
|
|
float t = (float)((Math.Sin(time * cycleHz * MathHelper.TwoPi) + 1f) * 0.5f); // 0..1
|
|
|
|
Color neonBlue = new Color(0, 180, 255); // Bright neon blue
|
|
Color vibrantPink = new Color(255, 0, 180); // Vibrant pink/magenta
|
|
Color baseColor = Color.Lerp(neonBlue, vibrantPink, t);
|
|
|
|
// Digital pulse effect (quick, sharp like LED displays)
|
|
const float pulseHz = 1.5f;
|
|
float s = (float)Math.Sin(time * pulseHz * MathHelper.TwoPi);
|
|
float pulse = (float)Math.Pow(Math.Max(0f, s), 2.5f); // sharper pulse
|
|
float brightness = 1f + 0.2f * pulse; // up to +20% brightness at pulse peak
|
|
|
|
return baseColor * brightness;
|
|
}
|
|
}
|
|
}
|
|
}
|