Vanquisher Arrows Finalization
New on hit visual
This commit is contained in:
1 parent
b5b541f5cb
commit
ccb7aaced0
3 files changed
+59
-5
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 176 KiB |
@@ -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<Texture2D>(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user