Files
CalamityModPublic/Particles/EnchantedParticleSet.cs
2022-01-06 18:30:56 +01:00

26 lines
915 B
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Particles
{
public class ChargingEnergyParticleSet : BaseParticleSet
{
public float InterpolationSpeed;
public float EdgeOffset;
public Color EdgeColor;
public Color CenterColor;
public override int ParticleLifetime => 50;
public ChargingEnergyParticleSet(int setLifetime, int particleSpawnRate, Color edgeColor, Color centerColor, float interpolationSpeed, float edgeOffset) :
base(setLifetime, particleSpawnRate)
{
EdgeColor = edgeColor;
CenterColor = centerColor;
InterpolationSpeed = interpolationSpeed;
EdgeOffset = edgeOffset;
}
public override Particle SpawnParticle() => new EnchantedParticle(Main.rand.NextVector2CircularEdge(1f, 1f) * EdgeOffset, ParticleLifetime, 0.1f, EdgeColor, CenterColor, InterpolationSpeed, EdgeOffset);
}
}