diff --git a/Dusts/PumplerDust.cs b/Dusts/PumplerDust.cs deleted file mode 100644 index ea6b3fc929..0000000000 --- a/Dusts/PumplerDust.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; - - -namespace CalamityMod.Dusts { - public class PumplerDust : ModDust //TURN THAT INTO A PARTICLE WHEN I REMEMBER - { - public override bool Autoload(ref string name, ref string texture) - { - texture = "CalamityMod/Particles/SmallSmoke"; - return true; - } - public override void OnSpawn(Dust dust) - { - dust.noGravity = true; - dust.frame = new Rectangle(0, 0, 24, 24); - } - - public override Color? GetAlpha(Dust dust, Color lightColor) - { - Color gray = new Color(40, 40, 40); - Color ret; - ret = Color.Lerp(Color.Orange, gray, MathHelper.Clamp((float)(dust.alpha - 100) / 80, 0f, 1f)); - return ret * ((255 - dust.alpha) / 255f); - } - - public override bool Update(Dust dust) - { - dust.velocity *= 0.85f; - - if (dust.alpha < 165) - { - Lighting.AddLight(dust.position, dust.color.ToVector3() * 0.1f); - dust.scale += 0.01f; - dust.alpha += 3; - } - else - { - dust.scale *= 0.975f; - dust.alpha += 2; - } - - dust.position += dust.velocity; - if (dust.alpha >= 255) - dust.active = false; - - return false; - } - } -} \ No newline at end of file diff --git a/Items/Weapons/Melee/BiomeBlade.cs b/Items/Weapons/Melee/BiomeBlade.cs index dc9c92c605..74a6e9e308 100644 --- a/Items/Weapons/Melee/BiomeBlade.cs +++ b/Items/Weapons/Melee/BiomeBlade.cs @@ -490,7 +490,7 @@ namespace CalamityMod.Items.Weapons.Melee Owner.heldProj = projectile.whoAmI; projectile.Center = Owner.Center + new Vector2(16f * Owner.direction, -30 * SwordHeight() + 10f) ; - projectile.rotation = Utils.AngleLerp(-MathHelper.PiOver4, MathHelper.PiOver4 + MathHelper.PiOver2, MathHelper.Clamp(((ChannelTimer - 20f) / 10f), 0f, 1f)); + projectile.rotation = Utils.AngleLerp(-MathHelper.PiOver4, MathHelper.PiOver4 + MathHelper.PiOver2, MathHelper.Clamp(((ChannelTimer - 20f) / 50f), 0f, 1f)); ChannelTimer++; projectile.timeLeft = 60; @@ -498,7 +498,22 @@ namespace CalamityMod.Items.Weapons.Melee { Attune((BiomeBlade)associatedItem.modItem); projectile.timeLeft = 120; - ChanneledState = 2f; + ChanneledState = 2f; //State where it stays invisible doing nothing. Acts as a cooldown + + Color particleColor = (associatedItem.modItem as BiomeBlade).GetAttunementInfo((associatedItem.modItem as BiomeBlade).mainAttunement).color; + + for (int i = 0; i <= 5; i++) + { + Vector2 displace = Vector2.UnitX * 20 * Main.rand.NextFloat(-1f, 1f); + Particle Glow = new GenericBloom(Owner.Bottom + displace, -Vector2.UnitY * Main.rand.NextFloat(1f, 5f), particleColor, 0.02f + Main.rand.NextFloat(0f, 0.2f), 20 + Main.rand.Next(30)); + GeneralParticleHandler.SpawnParticle(Glow); + } + for (int i = 0; i <= 10; i++) + { + Vector2 displace = Vector2.UnitX * 16 * Main.rand.NextFloat(-1f, 1f); + Particle Sparkle = new GenericSparkle(Owner.Bottom + displace, -Vector2.UnitY * Main.rand.NextFloat(1f, 5f), particleColor, particleColor, 0.5f + Main.rand.NextFloat(-0.2f, 0.2f), 20 + Main.rand.Next(30), 1, 2f); + GeneralParticleHandler.SpawnParticle(Sparkle); + } } } diff --git a/Particles/CritSpark.cs b/Particles/CritSpark.cs new file mode 100644 index 0000000000..e41b8cd284 --- /dev/null +++ b/Particles/CritSpark.cs @@ -0,0 +1,55 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class CritSpark : Particle + { + public override string Texture => "CalamityMod/Particles/ThinSparkle"; + public override bool UseAdditiveBlend => true; + public override bool UseCustomDraw => true; + public override bool SetLifetime => true; + + private float Spin; + private float opacity; + private Color Bloom; + private Color LightColor => Bloom * opacity; + private float BloomScale; + + public CritSpark(Vector2 position, Vector2 velocity, Color color, Color bloom, float scale, int lifeTime, float rotationSpeed = 1f, float bloomScale = 1f) + { + Position = position; + Velocity = velocity; + Color = color; + Bloom = bloom; + Scale = scale; + Lifetime = lifeTime; + Rotation = Main.rand.NextFloat(MathHelper.TwoPi); + Spin = rotationSpeed; + BloomScale = bloomScale; + } + + public override void Update() + { + opacity = (float)Math.Sin(MathHelper.PiOver2 + LifetimeCompletion * MathHelper.PiOver2); + Velocity *= 0.80f; + Rotation += Spin * ((Velocity.X > 0) ? 1f : -1f) * (LifetimeCompletion > 0.5 ? 1f : 0.5f); + + Lighting.AddLight(Position, LightColor.R / 255f, LightColor.G / 255f, LightColor.B / 255f); + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + Texture2D sparkTexture = GeneralParticleHandler.GetTexture(Type); + Texture2D bloomTexture = ModContent.GetTexture("CalamityMod/Particles/BloomCircle"); + //Ajust the bloom's texture to be the same size as the star's + float properBloomSize = (float)sparkTexture.Height / (float)bloomTexture.Height; + + spriteBatch.Draw(bloomTexture, Position - Main.screenPosition, null, Bloom * opacity * 0.5f, 0, bloomTexture.Size() / 2f, Scale * BloomScale * properBloomSize, SpriteEffects.None, 0); + spriteBatch.Draw(sparkTexture, Position - Main.screenPosition, null, Color * opacity, Rotation, sparkTexture.Size() / 2f, Scale, SpriteEffects.None, 0); + } + } +} diff --git a/Particles/CritSpark.png b/Particles/CritSpark.png new file mode 100644 index 0000000000..13ee17462d Binary files /dev/null and b/Particles/CritSpark.png differ diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index 2be3028795..bfb5a3153b 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Particles public static class GeneralParticleHandler { private static List particles; - private static int nextVacantIndex; + //List containing the particles to delete + private static List particlesToKill; //Static list for details concerning every particle type private static Dictionary particleTypes; private static Dictionary particleTextures; @@ -26,6 +27,7 @@ namespace CalamityMod.Particles internal static void Load() { particles = new List(); + particlesToKill = new List(); particleTypes = new Dictionary(); particleTextures = new Dictionary(); particleInstances = new List(); @@ -57,6 +59,7 @@ namespace CalamityMod.Particles internal static void Unload() { particles = null; + particlesToKill = null; particleTypes = null; particleTextures = null; particleInstances = null; @@ -87,12 +90,13 @@ namespace CalamityMod.Particles particle.Update(); } //Clear out particles whose time is up - particles.RemoveAll(particle => particle.Time >= particle.Lifetime && particle.SetLifetime); + particles.RemoveAll(particle => (particle.Time >= particle.Lifetime && particle.SetLifetime) || particlesToKill.Contains(particle)); + particlesToKill.Clear(); } public static void RemoveParticle(Particle particle) { - particles.Remove(particle); + particlesToKill.Add(particle); } public static void DrawAllParticles(SpriteBatch sb) diff --git a/Particles/GenericBloom.cs b/Particles/GenericBloom.cs new file mode 100644 index 0000000000..031a426111 --- /dev/null +++ b/Particles/GenericBloom.cs @@ -0,0 +1,43 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class GenericBloom : Particle + { + public override string Texture => "CalamityMod/Particles/Light"; + public override bool UseAdditiveBlend => true; + public override bool SetLifetime => true; + + private float opacity; + private Color BaseColor; + + public GenericBloom(Vector2 position, Vector2 velocity, Color color, float scale, int lifeTime) + { + Position = position; + Velocity = velocity; + BaseColor = color; + Scale = scale; + Lifetime = lifeTime; + Rotation = Main.rand.NextFloat(MathHelper.TwoPi); + } + + public override void Update() + { + opacity = (float)Math.Sin(LifetimeCompletion * MathHelper.Pi); + Color = BaseColor * opacity; + Lighting.AddLight(Position, Color.R / 255f, Color.G / 255f, Color.B / 255f); + Velocity *= 0.95f; + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + Texture2D tex = GeneralParticleHandler.GetTexture(Type); + + spriteBatch.Draw(tex, Position - Main.screenPosition, null, Color * opacity, Rotation, tex.Size() / 2f, Scale, SpriteEffects.None, 0); + } + } +} diff --git a/Particles/HalfIceStar.png b/Particles/HalfIceStar.png new file mode 100644 index 0000000000..1dae18cc57 Binary files /dev/null and b/Particles/HalfIceStar.png differ diff --git a/Particles/HalfStar.png b/Particles/HalfStar.png new file mode 100644 index 0000000000..758e4e84c6 Binary files /dev/null and b/Particles/HalfStar.png differ diff --git a/Particles/MediumMist.png b/Particles/MediumMist.png new file mode 100644 index 0000000000..37f4a196f6 Binary files /dev/null and b/Particles/MediumMist.png differ diff --git a/Particles/MediumMistParticle.cs b/Particles/MediumMistParticle.cs new file mode 100644 index 0000000000..5be71415c8 --- /dev/null +++ b/Particles/MediumMistParticle.cs @@ -0,0 +1,57 @@ +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + + +namespace CalamityMod.Particles { + public class MediumMistParticle : Particle + { + public override string Texture => "CalamityMod/Particles/MediumMist"; + public override int FrameVariants => 3; + public override bool UseAdditiveBlend => true; + + + private float Opacity; + private Color ColorFire; + private Color ColorFade; + private float Spin; + + public MediumMistParticle(Vector2 position, Vector2 velocity, Color colorFire, Color colorFade, float scale, float opacity, float rotationSpeed = 0f) + { + Position = position; + Velocity = velocity; + ColorFire = colorFire; + ColorFade = colorFade; + Scale = scale; + Opacity = opacity; + Rotation = Main.rand.NextFloat(MathHelper.TwoPi); + Spin = rotationSpeed; + Variant = Main.rand.Next(3); + } + + public override void Update() + { + + Rotation += Spin * ((Velocity.X > 0) ? 1f : -1f); + Velocity *= 0.85f; + + if (Opacity > 90) + { + Lighting.AddLight(Position, Color.ToVector3() * 0.1f); + Scale += 0.01f; + Opacity -= 3; + } + else + { + Scale *= 0.975f; + Opacity -= 2; + } + if (Opacity < 0) + Kill(); + + Color = Color.Lerp(ColorFire, ColorFade, MathHelper.Clamp((float)((255 -Opacity) - 100) / 80, 0f, 1f)) * (Opacity / 255f); + + } + } +} \ No newline at end of file diff --git a/Particles/SmallSmokeParticle.cs b/Particles/SmallSmokeParticle.cs new file mode 100644 index 0000000000..08bc36c0a6 --- /dev/null +++ b/Particles/SmallSmokeParticle.cs @@ -0,0 +1,53 @@ +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + + +namespace CalamityMod.Particles { + public class SmallSmokeParticle : Particle + { + public override string Texture => "CalamityMod/Particles/SmallSmoke"; + + private float Opacity; + private Color ColorFire; + private Color ColorFade; + private float Spin; + + public SmallSmokeParticle(Vector2 position, Vector2 velocity, Color colorFire, Color colorFade, float scale, float opacity, float rotationSpeed = 0f) + { + Position = position; + Velocity = velocity; + ColorFire = colorFire; + ColorFade = colorFade; + Scale = scale; + Opacity = opacity; + Rotation = Main.rand.NextFloat(MathHelper.TwoPi); + Spin = rotationSpeed; + } + + public override void Update() + { + + Rotation += Spin * ((Velocity.X > 0) ? 1f : -1f); + Velocity *= 0.85f; + + if (Opacity > 90) + { + Lighting.AddLight(Position, Color.ToVector3() * 0.1f); + Scale += 0.01f; + Opacity -= 3; + } + else + { + Scale *= 0.975f; + Opacity -= 2; + } + if (Opacity < 0) + Kill(); + + Color = Color.Lerp(ColorFire, ColorFade, MathHelper.Clamp((float)((255 -Opacity) - 100) / 80, 0f, 1f)) * (Opacity / 255f); + + } + } +} \ No newline at end of file diff --git a/Particles/SnowflakeSparkle.cs b/Particles/SnowflakeSparkle.cs new file mode 100644 index 0000000000..6e143e6ea6 --- /dev/null +++ b/Particles/SnowflakeSparkle.cs @@ -0,0 +1,61 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class SnowflakeSparkle : Particle + { + public override string Texture => "CalamityMod/Particles/HalfIceStar"; + public override bool UseAdditiveBlend => true; + public override bool UseCustomDraw => true; + public override bool SetLifetime => true; + + private float Spin; + private float opacity; + private Color Bloom; + private Color LightColor => Bloom * opacity; + private float BloomScale; + private int Spokes; + + public SnowflakeSparkle(Vector2 position, Vector2 velocity, Color color, Color bloom, float scale, int lifeTime, float rotationSpeed = 1f, float bloomScale = 1f, int spokes = 3) + { + Position = position; + Velocity = velocity; + Color = color; + Bloom = bloom; + Scale = scale; + Lifetime = lifeTime; + Rotation = Main.rand.NextFloat(MathHelper.TwoPi); + Spin = rotationSpeed; + BloomScale = bloomScale; + Spokes = spokes; + } + + public override void Update() + { + opacity = (float)Math.Sin(LifetimeCompletion * MathHelper.Pi); + Lighting.AddLight(Position, LightColor.R / 255f, LightColor.G / 255f, LightColor.B / 255f); + Velocity *= 0.95f; + Rotation += Spin * ((Velocity.X > 0) ? 1f : -1f); + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + Texture2D spokesTexture = GeneralParticleHandler.GetTexture(Type); + Texture2D bloomTexture = ModContent.GetTexture("CalamityMod/Particles/BloomCircle"); + //Ajust the bloom's texture to be the same size as the star's + float properBloomSize = (float)spokesTexture.Height / (float)bloomTexture.Height; + + spriteBatch.Draw(bloomTexture, Position - Main.screenPosition, null, Bloom * opacity * 0.5f, 0, bloomTexture.Size()/2f, Scale * BloomScale * properBloomSize, SpriteEffects.None, 0); + + for (int i = 0; i < Spokes; i++) + { + float rotation = Rotation + MathHelper.Lerp(0f, MathHelper.Pi, i/(float)Spokes); + spriteBatch.Draw(spokesTexture, Position - Main.screenPosition, null, Color * opacity * 0.5f, Rotation + rotation, spokesTexture.Size() / 2f, Scale, SpriteEffects.None, 0); + } + } + } +} diff --git a/Particles/StoneDebris.png b/Particles/StoneDebris.png new file mode 100644 index 0000000000..9dad21abf4 Binary files /dev/null and b/Particles/StoneDebris.png differ diff --git a/Particles/StoneDebrisParticle.cs b/Particles/StoneDebrisParticle.cs new file mode 100644 index 0000000000..129f0ceb2c --- /dev/null +++ b/Particles/StoneDebrisParticle.cs @@ -0,0 +1,40 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class StoneDebrisParticle : Particle + { + public override string Texture => "CalamityMod/Particles/StoneDebris"; + public override bool SetLifetime => true; + public override int FrameVariants => 5; + + private float Spin; + private float opacity; + Color originalColor; + + public StoneDebrisParticle(Vector2 position, Vector2 velocity, Color color, float scale, int lifeTime, float rotationSpeed = 1f) + { + Position = position; + Velocity = velocity; + Color = color; + originalColor = color; + Scale = scale; + Lifetime = lifeTime; + Rotation = Main.rand.NextFloat(MathHelper.TwoPi); + Spin = rotationSpeed; + Variant = Main.rand.Next(3); + } + + public override void Update() + { + opacity = LifetimeCompletion < 0.5f ? 1f : (float)Math.Sin(LifetimeCompletion * MathHelper.Pi); + Color = originalColor * opacity; + Velocity = Velocity * 0.95f + Vector2.UnitY * 0.1f; + Rotation += Spin * ((Velocity.X > 0) ? 1f : -1f); + } + } +} diff --git a/Particles/StrongBloom.cs b/Particles/StrongBloom.cs new file mode 100644 index 0000000000..8af6bee27c --- /dev/null +++ b/Particles/StrongBloom.cs @@ -0,0 +1,43 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class StrongBloom : Particle + { + public override string Texture => "CalamityMod/Particles/BloomCircle"; + public override bool UseAdditiveBlend => true; + public override bool SetLifetime => true; + + private float opacity; + private Color BaseColor; + + public StrongBloom(Vector2 position, Vector2 velocity, Color color, float scale, int lifeTime) + { + Position = position; + Velocity = velocity; + BaseColor = color; + Scale = scale; + Lifetime = lifeTime; + Rotation = Main.rand.NextFloat(MathHelper.TwoPi); + } + + public override void Update() + { + opacity = (float)Math.Sin(LifetimeCompletion * MathHelper.Pi); + Color = BaseColor * opacity; + Lighting.AddLight(Position, Color.R / 255f, Color.G / 255f, Color.B / 255f); + Velocity *= 0.95f; + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + Texture2D tex = GeneralParticleHandler.GetTexture(Type); + + spriteBatch.Draw(tex, Position - Main.screenPosition, null, Color * opacity, Rotation, tex.Size() / 2f, Scale, SpriteEffects.None, 0); + } + } +} diff --git a/Particles/ThinSparkle.png b/Particles/ThinSparkle.png new file mode 100644 index 0000000000..1d698a9c83 Binary files /dev/null and b/Particles/ThinSparkle.png differ diff --git a/Projectiles/Melee/BrokenBiomeBladeProjectiles.cs b/Projectiles/Melee/BrokenBiomeBladeProjectiles.cs index 9c5d24c9b4..5ae391e777 100644 --- a/Projectiles/Melee/BrokenBiomeBladeProjectiles.cs +++ b/Projectiles/Melee/BrokenBiomeBladeProjectiles.cs @@ -369,6 +369,20 @@ namespace CalamityMod.Projectiles.Melee if (projectile.frameCounter % 5 == 0 && projectile.frame + 1 < Main.projFrames[projectile.type]) projectile.frame++; + if (Main.rand.NextBool()) + { + Particle mist = new MediumMistParticle(Owner.Center + direction * 40 + Main.rand.NextVector2Circular(30f, 30f), Vector2.Zero, new Color(172, 238, 255), new Color(145, 170, 188), Main.rand.NextFloat(0.5f, 1.5f), 245 - Main.rand.Next(50), 0.02f); + mist.Velocity = (mist.Position - Owner.Center) * 0.2f + Owner.velocity; + GeneralParticleHandler.SpawnParticle(mist); + } + + } + + else if (Main.rand.NextFloat(0f, 1f) > 0.75f) + { + Vector2 particlePosition = Owner.Center + (rotation.ToRotationVector2() * 100f * projectile.scale); + Particle snowflake = new SnowflakeSparkle(particlePosition, rotation.ToRotationVector2() * 3f, Color.White, new Color(75, 177, 250), Main.rand.NextFloat(0.3f, 1.5f), 40, 0.5f); + GeneralParticleHandler.SpawnParticle(snowflake); } //Make the owner look like theyre holding the sword bla bla @@ -512,6 +526,27 @@ namespace CalamityMod.Projectiles.Melee PogoCooldown = 30; //Cooldown Main.PlaySound(SoundID.DD2_MonkStaffGroundImpact, projectile.position); + Vector2 hitPosition = Owner.Center + (direction * 84 * projectile.scale); + + for (int i = 0; i < 8; i++) + { + Vector2 hitPositionDisplace = direction.RotatedBy(MathHelper.PiOver2) * Main.rand.NextFloat(-10f, 10f); + Vector2 flyDirection = -direction.RotatedBy(Main.rand.NextFloat(-MathHelper.PiOver4, MathHelper.PiOver4)); + Particle smoke = new SmallSmokeParticle(hitPosition + hitPositionDisplace, flyDirection * 9f, Color.OrangeRed, new Color(130, 130, 130), Main.rand.NextFloat(1.8f, 2.6f), 115 - Main.rand.Next(30)); + GeneralParticleHandler.SpawnParticle(smoke); + + Particle Glow = new StrongBloom(hitPosition - hitPositionDisplace * 3, -direction * 6 * Main.rand.NextFloat(0.5f, 1f), Color.Orange * 0.5f, 0.01f + Main.rand.NextFloat(0f, 0.2f), 20 + Main.rand.Next(40)); + GeneralParticleHandler.SpawnParticle(Glow); + } + for (int i = 0; i < 3; i++) + { + Vector2 hitPositionDisplace = direction.RotatedBy(MathHelper.PiOver2) * Main.rand.NextFloat(-10f, 10f); + Vector2 flyDirection = -direction.RotatedBy(Main.rand.NextFloat(-MathHelper.PiOver4, MathHelper.PiOver4)); + + Particle Rock = new StoneDebrisParticle(hitPosition - hitPositionDisplace * 3, flyDirection * Main.rand.NextFloat(3f, 6f), Color.Beige, 1f + Main.rand.NextFloat(0f, 0.4f), 30 + Main.rand.Next(50), 0.1f); + GeneralParticleHandler.SpawnParticle(Rock); + } + if (Owner.HeldItem.type == ItemType()) (Owner.HeldItem.modItem as BiomeBlade).CanLunge = 1; // Reset the lunge counter on pogo. This should make for more interesting and fun synergies } @@ -729,7 +764,16 @@ namespace CalamityMod.Projectiles.Melee if (Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), projectile.Center - projectileHalfLenght, projectile.Center + projectileHalfLenght, 32, ref collisionPoint)) { if (SnapCoyoteTime > 0f) + { crit = true; + for (int i = 0; i < 3; i++) + { + Vector2 sparkSpeed = Owner.DirectionTo(target.Center).RotatedBy(Main.rand.NextFloat(-MathHelper.PiOver2, MathHelper.PiOver2)) * 9f; + Particle Spark = new CritSpark(target.Center, sparkSpeed, Color.White, Color.LimeGreen, 1f + Main.rand.NextFloat(0, 1f), 30, 0.4f, 0.6f); + GeneralParticleHandler.SpawnParticle(Spark); + } + + } } else damage = (int)(damage * ChainDamageReduction); //If the enemy is hit with the chain of the whip, the damage gets reduced diff --git a/Projectiles/Ranged/PumplerGrenade.cs b/Projectiles/Ranged/PumplerGrenade.cs index f6578cade1..dcfa1c4db2 100644 --- a/Projectiles/Ranged/PumplerGrenade.cs +++ b/Projectiles/Ranged/PumplerGrenade.cs @@ -4,6 +4,7 @@ using Terraria; using Terraria.ModLoader; using Terraria.ID; using CalamityMod.Dusts; +using CalamityMod.Particles; namespace CalamityMod.Projectiles.Ranged { @@ -35,13 +36,10 @@ namespace CalamityMod.Projectiles.Ranged { for (int i = 0; i < 15; i++) { - Dust dust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(15f, 15f), ModContent.DustType()); - dust.velocity = (dust.position - projectile.Center) * 0.2f + projectile.velocity; - dust.scale = Main.rand.NextFloat(0.8f, 1.6f); - dust.alpha = Main.rand.Next(30) + 100; - dust.rotation = Main.rand.NextFloat(6.28f); + Particle smoke = new SmallSmokeParticle(projectile.Center + Main.rand.NextVector2Circular(15f, 15f), Vector2.Zero, Color.Orange, new Color(40, 40, 40), Main.rand.NextFloat(0.8f, 1.6f), 145 - Main.rand.Next(30)); + smoke.Velocity = (smoke.Position - projectile.Center) * 0.2f + projectile.velocity; + GeneralParticleHandler.SpawnParticle(smoke); } - //CalamityUtils.ExplosionGores(projectile.Center, 1); } projectile.Kill(); } diff --git a/Projectiles/Ranged/PumplerHoldout.cs b/Projectiles/Ranged/PumplerHoldout.cs index 182df02321..9b9c23fadf 100644 --- a/Projectiles/Ranged/PumplerHoldout.cs +++ b/Projectiles/Ranged/PumplerHoldout.cs @@ -10,6 +10,7 @@ using Terraria.Graphics.Effects; using System.Collections.Generic; using Terraria.Graphics.Shaders; using CalamityMod.Dusts; +using CalamityMod.Particles; //TY dom for coding condemnation, great reference, would steal code from again :) @@ -128,11 +129,9 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 2 * PumpkinsCharge; i++) { - Dust dust = Dust.NewDustPerfect(tipPosition + Main.rand.NextVector2Circular(10f, 10f), ModContent.DustType()); - dust.velocity = (dust.position - Owner.Center) * 0.3f + Owner.velocity; - dust.scale = Main.rand.NextFloat(0.3f, 0.8f); - dust.alpha = Main.rand.Next(50) + 100; - dust.rotation = Main.rand.NextFloat(6.28f); + Particle smoke = new SmallSmokeParticle(tipPosition + Main.rand.NextVector2Circular(10f, 10f), Vector2.Zero, Color.Orange, new Color(40, 40, 40), Main.rand.NextFloat(0.3f, 0.8f), 145 - Main.rand.Next(50)); + smoke.Velocity = (smoke.Position - Owner.Center) * 0.3f + Owner.velocity; + GeneralParticleHandler.SpawnParticle(smoke); } }