trail tweak..

This commit is contained in:
AquaSG committed 2023-08-27 10:17:31 -04:00
1 parent ca964c497f
commit d9b371ae03
2 files changed
+4 -5

No files matched your search

+1 -1
View File
@@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Ranged
if (Projectile.oldPos[oldPositions] != Vector2.Zero) //remove positions that are invalid due to the projectile not being alive long eonugh
{
//Building a better line of trail positions rather than just simply using oldPos. Angled to the side slightly with a log to smooth it out. i is the direction the trail will go, as this is 2 trails rendered at once. the final float is to further exxagerate the gap between the trails.
//Building a better line of trail positions rather than just simply using oldPos. Angled to the side slightly with a log to smooth it out. i is the direction the trail will go, as this is 2 trails rendered at once. the final float is to further exaggerate the gap between the trails.
TrailPositions[oldPositions] = Projectile.oldPos[oldPositions] + ((Projectile.oldRot[oldPositions] + MathHelper.PiOver2 + (MathHelper.Pi/2.5f * i)).ToRotationVector2() * (float)Math.Log(2 * oldPositions + 1, 1.36d) * 2.5f);
}
}
+3 -4
View File
@@ -66,7 +66,6 @@ namespace CalamityMod.Projectiles.Ranged
}
public Color TrailColor(float completionRatio)
{
float opacity = Utils.GetLerpValue(0.7f, 0.3f, completionRatio, true) * Projectile.Opacity;
Color color = Color.White;
color.A = (byte)(int)(Utils.GetLerpValue(0.7f, 0f, completionRatio) * 64);
return color;
@@ -74,8 +73,8 @@ namespace CalamityMod.Projectiles.Ranged
public float TrailWidth(float completionRatio)
{
float widthInterpolant = Utils.GetLerpValue(0f, 0.25f, completionRatio, true) * Utils.GetLerpValue(0.7f, 0.9f, completionRatio, true);
return MathHelper.SmoothStep(3f, 10f, widthInterpolant);
float widthInterpolant = MathHelper.Lerp(0f, completionRatio, completionRatio);
return MathHelper.Lerp(5f, 0f, widthInterpolant);
}
public override bool PreDraw(ref Color lightColor)
@@ -109,7 +108,7 @@ namespace CalamityMod.Projectiles.Ranged
if (Projectile.oldPos[oldPositions] != Vector2.Zero) //remove positions that are invalid due to the projectile not being alive long eonugh
{
//Building a better line of trail positions rather than just simply using oldPos. Angled to the side slightly with a log to smooth it out. i is the direction the trail will go, as this is 2 trails rendered at once. the final float is to further exxagerate the gap between the trails.
//Building a better line of trail positions rather than just simply using oldPos. Angled to the side slightly with a log to smooth it out. i is the direction the trail will go, as this is 2 trails rendered at once. the final float is to further exaggerate the gap between the trails.
//TrailWaveMultipliers is used to create the different amplitudes present in the wiggle
TrailPositions[oldPositions] = Projectile.oldPos[oldPositions] + ((Projectile.oldRot[oldPositions] + MathHelper.PiOver2 + (MathHelper.Pi / 2.5f * i)).ToRotationVector2() * (float)Math.Log(2 * oldPositions + 1, 1.36d) * TrailWaveMultipliers[oldPositions] * 2f);
}