Meld Particle Layering Fixes

Also fixes the homing on antumbra shard when it kills an enemy
This commit is contained in:
Xyk authored and Cameron Ewell committed 2026-02-06 17:02:51 -05:00
1 parent 82f505c710
commit 4716ae5c73
7 files changed
+30 -6

No files matched your search

+4 -2
View File
@@ -1,8 +1,9 @@
using CalamityMod.Items.Materials;
using System;
using CalamityMod.Enums;
using CalamityMod.Items.Materials;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
@@ -90,6 +91,7 @@ namespace CalamityMod.Items.Weapons.Melee
GeneralParticleHandler.SpawnParticle(spark3);
Particle spark2 = new SparkParticle(partPos, partVel, false, 24, partScale * 0.6f, Color.LightGreen);
GeneralParticleHandler.SpawnParticle(spark2);
spark2.DrawLayer = GeneralDrawLayer.AfterEverything;
}
Vector2 dustVel2 = new Vector2(5 * swordDirection, -5).RotatedBy(swingRotation - 1.7f * swordDirection);
+4
View File
@@ -1,5 +1,6 @@
using System;
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
@@ -58,6 +59,7 @@ namespace CalamityMod.Projectiles.Magic
GeneralParticleHandler.SpawnParticle(blastRing);
Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, InnerColor * 0.6f, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.48f * scaler, 0f, 4, true);
GeneralParticleHandler.SpawnParticle(blastRing2);
blastRing2.DrawLayer = GeneralDrawLayer.AfterEverything;
}
Projectile.velocity *= 0.96f;
if (time == 3)
@@ -89,6 +91,7 @@ namespace CalamityMod.Projectiles.Magic
GeneralParticleHandler.SpawnParticle(spark);
Particle spark2 = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.05f, "CalamityMod/Particles/GlowSpark", false, 12, 0.035f * scaling, Color.LightGreen * 0.75f, new Vector2(1.7f - (1 - sharpScaling), 0.9f + (1 - sharpScaling) * 2));
GeneralParticleHandler.SpawnParticle(spark2);
spark2.DrawLayer = GeneralDrawLayer.AfterEverything;
}
if (Main.rand.NextBool(6))
{
@@ -111,6 +114,7 @@ namespace CalamityMod.Projectiles.Magic
{
Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, InnerColor, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.36f, 0f, scalingTimerMax / 2, true);
GeneralParticleHandler.SpawnParticle(blastRing2);
blastRing2.DrawLayer = GeneralDrawLayer.AfterEverything;
}
Projectile.velocity = Vector2.Zero;
}
+2
View File
@@ -1,5 +1,6 @@
using System;
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
@@ -60,6 +61,7 @@ namespace CalamityMod.Projectiles.Ranged
GeneralParticleHandler.SpawnParticle(spark);
Particle spark2 = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.05f, "CalamityMod/Particles/GlowSpark", false, 17, 0.027f, Color.LightGreen, new Vector2(0.6f, 1.3f), true, false);
GeneralParticleHandler.SpawnParticle(spark2);
spark2.DrawLayer = GeneralDrawLayer.AfterEverything;
}
if (Time == 9f)
+4
View File
@@ -1,5 +1,7 @@
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Pets;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
@@ -32,6 +34,7 @@ namespace CalamityMod.Projectiles.Ranged
{
Particle explosion = new DetailedExplosion(Projectile.Center, Vector2.Zero, color1, Vector2.One, Main.rand.NextFloat(-5, 5), 0f, ExplosionRadius * 0.0065f + 0.1f, Main.rand.Next(15, 22));
GeneralParticleHandler.SpawnParticle(explosion);
explosion.DrawLayer = GeneralDrawLayer.AfterEverything;
Particle explosion2 = new DetailedExplosion(Projectile.Center, Vector2.Zero, Color.Black, Vector2.One, Main.rand.NextFloat(-5, 5), 0f, ExplosionRadius * 0.0045f + 0.1f, Main.rand.Next(15, 22), false);
GeneralParticleHandler.SpawnParticle(explosion2);
Particle explosion3 = new DetailedExplosion(Projectile.Center, Vector2.Zero, Color.Black, Vector2.One, Main.rand.NextFloat(-5, 5), 0f, ExplosionRadius * 0.0030f + 0.1f, Main.rand.Next(15, 22), false);
@@ -41,6 +44,7 @@ namespace CalamityMod.Projectiles.Ranged
{
Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, color1, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0, ExplosionRadius * 0.005f + 0.05f, 25);
GeneralParticleHandler.SpawnParticle(blastRing);
blastRing.DrawLayer = GeneralDrawLayer.AfterEverything;
}
float numberOfDusts = ExplosionRadius * 0.1f + 10;
+5 -1
View File
@@ -1,5 +1,6 @@
using System;
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -109,6 +110,7 @@ namespace CalamityMod.Projectiles.Rogue
GeneralParticleHandler.SpawnParticle(spark);
Particle spark2 = new SparkParticle(Projectile.Center, -Projectile.velocity * randVel, false, lifetime, 0.9f, Color.LightGreen);
GeneralParticleHandler.SpawnParticle(spark2);
spark2.DrawLayer = GeneralDrawLayer.AfterEverything;
if (Main.rand.NextBool() && !Projectile.Calamity().stealthStrike)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.FireworksRGB);
@@ -126,10 +128,11 @@ namespace CalamityMod.Projectiles.Rogue
GeneralParticleHandler.SpawnParticle(spark);
Particle spark2 = new SparkParticle(placement, -Projectile.velocity * speed, false, 11, 0.5f, Color.LightGreen);
GeneralParticleHandler.SpawnParticle(spark2);
spark2.DrawLayer = GeneralDrawLayer.AfterEverything;
}
if (closestTarget != null && Projectile.numHits < 1 && closestTarget.CanBeChasedBy(Projectile))
{
CalamityUtils.HomeInOnSelectedNPC(Projectile, chosenTarget, true, 0.95f, 16, 0.96f);
CalamityUtils.HomeInOnSelectedNPC(Projectile, Projectile.Center.ClosestNPCAt(2000), true, 0.95f, 16, 0.96f);
}
}
}
@@ -219,6 +222,7 @@ namespace CalamityMod.Projectiles.Rogue
Particle bolt2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.LightGreen * 0.85f, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 1f, 18);
GeneralParticleHandler.SpawnParticle(bolt2);
bolt2.DrawLayer = GeneralDrawLayer.AfterEverything;
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(45f * (storedVelocity.X > 0 ? 1 : -1));
}
+4 -1
View File
@@ -1,4 +1,6 @@
using CalamityMod.Particles;
using CalamityMod.Enums;
using CalamityMod.Graphics.Renderers;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
@@ -105,6 +107,7 @@ namespace CalamityMod.Projectiles.Rogue
{
Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.LightGreen with { A = 0 }, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), Projectile.ai[1] * 0.5f, Projectile.ai[1] * 0.3f, 15, false);
GeneralParticleHandler.SpawnParticle(blastRing);
blastRing.DrawLayer = GeneralDrawLayer.AfterEverything;
}
}
else
+7 -2
View File
@@ -1,4 +1,6 @@
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Graphics.Renderers;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -151,15 +153,15 @@ namespace CalamityMod.Projectiles.Rogue
internal void Explode(bool big)
{
float sizeBonus = big ? Main.zenithWorld ? 6 : 2 : 1;
float bigExplosionDamage = 3f;
Player Owner = Main.player[Projectile.owner];
Particle orb = new CustomPulse(Projectile.Center, Vector2.Zero, Color.LightGreen with { A = 0 }, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0f, 0.82f * sizeBonus, 11);
GeneralParticleHandler.SpawnParticle(orb);
orb.DrawLayer = GeneralDrawLayer.AfterEverything;
Particle orb2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0f, 0.74f * sizeBonus, 11);
GeneralParticleHandler.SpawnParticle(orb2);
orb2.DrawLayer = GeneralDrawLayer.AfterEverything;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<DestructionExplosion>(), (int)(Projectile.damage * (big ? Main.zenithWorld ? bigExplosionDamage * 4f : bigExplosionDamage : Projectile.Calamity().stealthStrike ? 0.25f : 1f)), Projectile.knockBack * 1.5f, Projectile.owner);
@@ -190,12 +192,15 @@ namespace CalamityMod.Projectiles.Rogue
Particle bolt2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.LightGreen, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 2.56f * 1.3f * sizeBonus, 18);
GeneralParticleHandler.SpawnParticle(bolt2);
bolt2.DrawLayer = GeneralDrawLayer.AfterEverything;
Particle bolt3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.LightGreen, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.3f * sizeBonus, 30);
GeneralParticleHandler.SpawnParticle(bolt3);
bolt3.DrawLayer = GeneralDrawLayer.AfterEverything;
Particle bolt4 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.LightGreen * 0.55f, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.3f * 1.35f * sizeBonus, 30);
GeneralParticleHandler.SpawnParticle(bolt4);
bolt4.DrawLayer = GeneralDrawLayer.AfterEverything;
for (int i = 0; i < 2; i++)
{