From d747d3938e1cd7e7447b78eceede4ffc58c08f3b Mon Sep 17 00:00:00 2001 From: Xhack <72313282+energykid@users.noreply.github.com> Date: Sat, 27 Jul 2024 02:29:16 -0400 Subject: [PATCH] "Muzzle flash" effect for HolyBurnOrb and HolyLight projectiles --- NPCs/Providence/Providence.cs | 19 ------------------- Particles/BlastCone.png | Bin 0 -> 636 bytes Projectiles/Boss/HolyBurnOrb.cs | 10 +++++++++- Projectiles/Boss/HolyLight.cs | 7 ++++++- 4 files changed, 15 insertions(+), 21 deletions(-) create mode 100644 Particles/BlastCone.png diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index e9e3144454..b5694aee78 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1295,25 +1295,6 @@ namespace CalamityMod.NPCs.Providence } else if (Main.netMode != NetmodeID.MultiplayerClient) Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, dmgAmt, 0f, Main.myPlayer); - - Color dustColor = Main.hslToRgb(Main.rgbToHsl(nightAI ? new Color(100, 200, 250) : (projectileType == ModContent.ProjectileType() ? Color.Orange : Color.Green)).X, 1f, 0.5f); - dustColor.A = 255; - int maxDust = 3; - for (int j = 0; j < maxDust; j++) - { - int dust = Dust.NewDust(fireFrom, 0, 0, DustID.RainbowMk2, 0f, 0f, 0, dustColor, 1f); - Main.dust[dust].position = fireFrom; - Main.dust[dust].velocity = vector2 * cocoonProjVelocity * (j * 0.5f + 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].scale = 1f + j; - Main.dust[dust].fadeIn = Main.rand.NextFloat() * 2f; - Dust dust2 = Dust.CloneDust(dust); - Dust dust3 = dust2; - dust3.scale /= 2f; - dust3 = dust2; - dust3.fadeIn /= 2f; - dust2.color = new Color(255, 255, 255, 255); - } } // Radial offset diff --git a/Particles/BlastCone.png b/Particles/BlastCone.png new file mode 100644 index 0000000000000000000000000000000000000000..eb2027990fac7e04b2004eec882d93408b53ee4f GIT binary patch literal 636 zcmV-?0)zdDP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0uf0>K~!i%?V8I< z!$1^cXAAgbUxmy<0&aP|%0)5fl_JRY9~`t^e1|KpN5{4QXA>`Qc;I zrYCLA`R8=frd|t7?RML3b%{JoI2OgYBbgt9za3BF%WbC~G)HA(DpS24othaS%E73Z z6*FR8Op8guKA$53p(#GZjT?FVD~ie=rxn{Cy37EPIDck31>X`Y;!rG!dBMK8nC&m( zQCzvPA$&3OQlLGkCrzSs~)Vp%MRF%j<%rONf>j3r@5SDBaXp2C%)sZ)VT?U4t6az5h?T4UHlrVt( z6zs-elrVt(8RW)blrVt(9qh(nlrRA2PZzKoLPAl(0EiseEn%T3#Q=yr1b9 "Projectiles.Boss"; public override string Texture => "CalamityMod/Projectiles/StarProj"; @@ -36,7 +37,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnSpawn(IEntitySource source) { - + } public override void AI() @@ -65,6 +66,13 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.ai[0] == 0f && BossRushEvent.BossRushActive) Projectile.velocity *= 1.25f; + if (!started) + { + Color cl = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255); + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, cl, "CalamityMod/Particles/BlastCone", new Vector2(Main.rand.NextFloat(4f, 7f), 1.5f), Vector2.Zero.AngleTo(Projectile.velocity), 1f, 0f, 30)); + started = true; + } + if (Projectile.ai[0] < 240f) { Projectile.ai[0] += 1f; diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index 70ca5e586a..af177af1c4 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -31,7 +31,12 @@ namespace CalamityMod.Projectiles.Boss public override void OnSpawn(IEntitySource source) { + SoundStyle soundStyle = SoundID.DD2_WitherBeastCrystalImpact; + soundStyle.MaxInstances = 10; + SoundEngine.PlaySound(soundStyle, Projectile.Center); + Color col = new Color(54, 209, 54); + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, col, "CalamityMod/Particles/BlastCone", new Vector2(Main.rand.NextFloat(4f, 7f), 1.5f), Vector2.Zero.AngleTo(Projectile.velocity), 1f, 0f, 30)); } public override void AI() @@ -68,7 +73,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.Kill(); } - Color col = new Color(54, 209, 54, 255); + Color col = new Color(54, 209, 54); GlowOrbParticle p = new GlowOrbParticle(Projectile.Center, Projectile.velocity, false, 25, 1f, col);