diff --git a/Particles/LargeSpark.png b/Particles/LargeSpark.png new file mode 100644 index 0000000000..781d2bc251 Binary files /dev/null and b/Particles/LargeSpark.png differ diff --git a/Particles/VoidSparkParticle.cs b/Particles/VoidSparkParticle.cs new file mode 100644 index 0000000000..5e4a202129 --- /dev/null +++ b/Particles/VoidSparkParticle.cs @@ -0,0 +1,56 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class VoidSparkParticle : Particle + { + public Color InitialColor; + public bool AffectedByGravity; + public float Ylength = 1f; + public float Xlength = 0.6f; + public override bool SetLifetime => true; + public override bool UseCustomDraw => true; + public override bool UseAdditiveBlend => false; + + public override string Texture => "CalamityMod/Particles/LargeSpark"; + + public VoidSparkParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color) + { + Position = relativePosition; + Velocity = velocity; + AffectedByGravity = affectedByGravity; + Scale = scale; + Lifetime = lifetime; + Color = InitialColor = color; + } + + public override void Update() + { + Scale *= 0.9f; + Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)); + Velocity *= 0.95f; + Ylength *= 1.25f; + Xlength *= 0.7f; + + if (Velocity.Length() < 12f && AffectedByGravity) + { + Velocity.X *= 0.94f; + Velocity.Y += 0.25f; + } + Rotation = Velocity.ToRotation() + MathHelper.PiOver2; + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + Vector2 scale = new Vector2(Xlength, Ylength) * Scale; + Texture2D texture = ModContent.Request(Texture).Value; + + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color, Rotation, texture.Size() * 0.5f, scale, 0, 0f); + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Black, Rotation, texture.Size() * 0.5f, scale * new Vector2(0.85f, 1f), 0, 0f); + } + } +} diff --git a/Projectiles/Ranged/VanquisherArrowProj.cs b/Projectiles/Ranged/VanquisherArrowProj.cs index c7cbc1d332..e05af3b40c 100644 --- a/Projectiles/Ranged/VanquisherArrowProj.cs +++ b/Projectiles/Ranged/VanquisherArrowProj.cs @@ -96,11 +96,9 @@ namespace CalamityMod.Projectiles.Ranged } public override void OnKill(int timeLeft) { - for (int i = 0; i <= 2; i++) - { - Particle pulse = new Particles.PlasmaExplosion(Projectile.Center + Main.rand.NextVector2Circular(60, 60), Vector2.Zero, Main.rand.NextBool() ? Color.Magenta : Color.Cyan, new Vector2(1f, 1f), Main.rand.NextFloat(-2f, 2f), 0f, Main.rand.NextFloat(0.05f, 0.065f), 15); - GeneralParticleHandler.SpawnParticle(pulse); - } + VoidSparkParticle spark2 = new VoidSparkParticle(Projectile.Center, new Vector2(0.1f, 0.1f).RotatedByRandom(100), false, 9, Main.rand.NextFloat(0.15f, 0.25f), Main.rand.NextBool() ? Color.Magenta : Color.Cyan); + GeneralParticleHandler.SpawnParticle(spark2); + if (Projectile.owner == Main.myPlayer) { Projectile.damage = (int)(Projectile.damage * 0.4f);