ManaDrainStreak moment.
This commit is contained in:
1 parent
562a08ef1f
commit
dfb630d0c7
1 file changed
+5
-5
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user