From dfb630d0c73000ff0c88f6db2d85e787ff8823bd Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 18 Jul 2023 02:16:41 -0500 Subject: [PATCH] ManaDrainStreak moment. --- Particles/ManaDrainStreak.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Particles/ManaDrainStreak.cs b/Particles/ManaDrainStreak.cs index efaf19d549..559b16f958 100644 --- a/Particles/ManaDrainStreak.cs +++ b/Particles/ManaDrainStreak.cs @@ -18,8 +18,9 @@ namespace CalamityMod.Particles public float FinalDistanceFromPlayer; public Color StartColor; public Color EndColor; + public Vector2 OverridePosition; - public ManaDrainStreak(Player owner, float thickness, Vector2 startVector, float finalDistance, Color colorStart, Color colorEnd, int lifetime, Vector2 position = default) + public ManaDrainStreak(Player owner, float thickness, Vector2 startVector, float finalDistance, Color colorStart, Color colorEnd, int lifetime, Vector2 overridePosition = default) { Owner = owner; Scale = thickness; @@ -31,7 +32,7 @@ namespace CalamityMod.Particles EndColor = colorEnd; Color = colorStart; Lifetime = lifetime; - Position = position; + OverridePosition = overridePosition; } public override void Update() @@ -39,9 +40,8 @@ namespace CalamityMod.Particles if (Owner == null || !Owner.active || Owner.dead) return; - if (Position == default) - Position = Owner.MountedCenter + Rotation.ToRotationVector2() * MathHelper.Lerp(StartDistanceFromPlayer, FinalDistanceFromPlayer, (float)Math.Pow(LifetimeCompletion, 2)); - + Vector2 setPosition = OverridePosition != default ? OverridePosition : Owner.MountedCenter; + Position = setPosition + Rotation.ToRotationVector2() * MathHelper.Lerp(StartDistanceFromPlayer, FinalDistanceFromPlayer, (float)Math.Pow(LifetimeCompletion, 2)); Color = Color.Lerp(StartColor, EndColor, LifetimeCompletion); Lighting.AddLight(Position, Color.ToVector3() * 0.2f); }