From 3fdf33ce1f84b9f5be1f68a358fddcdf392acdb3 Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 6 Nov 2023 16:49:34 -0800 Subject: [PATCH] Visual flamethrower changes Dead Suns wind particle reduction for performance and color change and to fit the sprite a bit more and not step on nanoblack's vibes quite as hard Miracle blight made slightly less intense and added some white Fixed the Metaballs on Blood boiler and Dragon's Breath the best I can. --- Buffs/DamageOverTime/MiracleBlight.cs | 40 +++--- Graphics/Metaballs/BloodBoilerMetaball.cs | 6 +- Graphics/Metaballs/BloodBoilerMetaball2.cs | 104 +++++++++++++++ Graphics/Metaballs/DragonsBreathMetaball.cs | 10 +- Graphics/Metaballs/DragonsBreathMetaball2.cs | 127 +++++++++++++++++++ Items/Weapons/Ranged/DragonsBreath.cs | 8 +- Projectiles/Ranged/BloodBoilerFire.cs | 3 +- Projectiles/Ranged/CosmicFire.cs | 32 ++--- Projectiles/Ranged/DeadSunExplosion.cs | 14 +- Projectiles/Ranged/DragonsBreathFlames.cs | 62 ++++----- Projectiles/Ranged/DragonsBreathMag.cs | 7 +- Projectiles/Ranged/PhotovisceratorHoldout.cs | 2 +- 12 files changed, 327 insertions(+), 88 deletions(-) create mode 100644 Graphics/Metaballs/BloodBoilerMetaball2.cs create mode 100644 Graphics/Metaballs/DragonsBreathMetaball2.cs diff --git a/Buffs/DamageOverTime/MiracleBlight.cs b/Buffs/DamageOverTime/MiracleBlight.cs index 1078cd708f..55f3f790de 100644 --- a/Buffs/DamageOverTime/MiracleBlight.cs +++ b/Buffs/DamageOverTime/MiracleBlight.cs @@ -41,31 +41,29 @@ namespace CalamityMod.Buffs.DamageOverTime 2 => Color.Orange, _ => Color.LawnGreen, }; - DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, sparkColor, new Vector2(1, 1), 0, Main.rand.NextFloat(0.09f, 0.17f), 0f, 25); - GeneralParticleHandler.SpawnParticle(pulse); + + if (Main.rand.NextBool(2)) + { + DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool(3) ? Color.White : sparkColor, new Vector2(1, 1), 0, Main.rand.NextFloat(0.09f, 0.17f), 0f, 25); + GeneralParticleHandler.SpawnParticle(pulse); + } float numberOfDusts = 3f; float rotFactor = 360f / numberOfDusts; - if (Player.miscCounter % 4 == 0) + if (Player.miscCounter % 5 == 0) { for (int i = 0; i < numberOfDusts; i++) { - var DustType = Main.rand.Next(4) switch - { - 0 => 219, - 1 => 220, - 2 => 226, - _ => 222, - }; float rot = MathHelper.ToRadians(i * rotFactor); Vector2 offset = new Vector2(0.3f, 0).RotatedBy(rot * Main.rand.NextFloat(0.2f, 0.3f)); Vector2 velOffset = CalamityUtils.RandomVelocity(100f, 70f, 150f, 0.04f); - Dust dust = Dust.NewDustPerfect(Player.Calamity().RandomDebuffVisualSpot + offset, DustType, new Vector2(velOffset.X, velOffset.Y)); + Dust dust = Dust.NewDustPerfect(Player.Calamity().RandomDebuffVisualSpot + offset, 278, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = true; dust.velocity = velOffset; velOffset *= 10; dust.position = Player.Center - velOffset; dust.scale = Main.rand.NextFloat(0.7f, 0.8f); + dust.color = Main.rand.NextBool(3) ? Color.White : sparkColor; } } } @@ -80,31 +78,29 @@ namespace CalamityMod.Buffs.DamageOverTime 2 => Color.Orange, _ => Color.LawnGreen, }; - DirectionalPulseRing pulse = new DirectionalPulseRing(npcSize, Vector2.Zero, sparkColor, new Vector2(1, 1), 0, 0.18f + (0.0000007f * npc.width * npc.height), 0f, 25); - GeneralParticleHandler.SpawnParticle(pulse); + + if (Main.rand.NextBool(2)) + { + DirectionalPulseRing pulse = new DirectionalPulseRing(npcSize, Vector2.Zero, Main.rand.NextBool(3) ? Color.White : sparkColor, new Vector2(1, 1), 0, 0.18f + (0.0000007f * npc.width * npc.height), 0f, 30); + GeneralParticleHandler.SpawnParticle(pulse); + } float numberOfDusts = 2f; float rotFactor = 360f / numberOfDusts; - if (Main.rand.NextBool(3)) + if (Main.rand.NextBool(5)) { for (int i = 0; i < numberOfDusts; i++) { - var DustType = Main.rand.Next(4) switch - { - 0 => 219, - 1 => 220, - 2 => 226, - _ => 222, - }; float rot = MathHelper.ToRadians(i * rotFactor); Vector2 offset = new Vector2(0.3f, 0).RotatedBy(rot * Main.rand.NextFloat(0.2f, 0.3f)); Vector2 velOffset = CalamityUtils.RandomVelocity(100f, 70f, 150f, 0.04f); - Dust dust = Dust.NewDustPerfect(npc.Center + offset, DustType, new Vector2(velOffset.X, velOffset.Y)); + Dust dust = Dust.NewDustPerfect(npc.Center + offset, 278, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = true; dust.velocity = velOffset; velOffset *= 10 + (0.0003f * npc.width * npc.height); dust.position = npc.Center - velOffset; dust.scale = Main.rand.NextFloat(0.7f, 0.8f); + dust.color = Main.rand.NextBool(3) ? Color.White : sparkColor; } } } diff --git a/Graphics/Metaballs/BloodBoilerMetaball.cs b/Graphics/Metaballs/BloodBoilerMetaball.cs index 1a4d4a7942..d5d29fd0c8 100644 --- a/Graphics/Metaballs/BloodBoilerMetaball.cs +++ b/Graphics/Metaballs/BloodBoilerMetaball.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Graphics.Metaballs public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; - public override Color EdgeColor => Color.DarkRed * 0.8f; + public override Color EdgeColor => Color.DarkRed; public override void Update() { @@ -85,7 +85,7 @@ namespace CalamityMod.Graphics.Metaballs public override void DrawInstances() { float pureRedIntensity = 0.15f; - float opacity = 0.25f; + float opacity = 0.5f; Texture2D tex = ModContent.Request("CalamityMod/ExtraTextures/SmallGreyscaleCircle").Value; foreach (BloodBoilerParticle particle in Particles) @@ -95,7 +95,7 @@ namespace CalamityMod.Graphics.Metaballs Vector2 scale = Vector2.One * particle.Size / tex.Size(); float pureRedInterpolant = Utils.GetLerpValue(25f, 60f, particle.Size, true) * pureRedIntensity; - Color drawColor = Color.Lerp(EdgeColor, Color.Red, pureRedInterpolant).MultiplyRGBA(new Color(1f, 1f, 1f, opacity)); + Color drawColor = Color.Lerp(EdgeColor, Color.DarkRed, pureRedInterpolant).MultiplyRGBA(new Color(1f, 1f, 1f, opacity)); Main.spriteBatch.Draw(tex, drawPosition, null, drawColor, 0f, origin, scale, SpriteEffects.None, 0f); } diff --git a/Graphics/Metaballs/BloodBoilerMetaball2.cs b/Graphics/Metaballs/BloodBoilerMetaball2.cs new file mode 100644 index 0000000000..873604126a --- /dev/null +++ b/Graphics/Metaballs/BloodBoilerMetaball2.cs @@ -0,0 +1,104 @@ +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Effects; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Graphics.Metaballs +{ + public class BloodBoilerMetaball2 : Metaball + { + public class BloodBoilerParticle2 + { + public Vector2 Center; + public float Size; + + public BloodBoilerParticle2(Vector2 center, float size) + { + Center = center; + Size = size; + } + + public void Update() + { + // Always slowly shrink the particles. + Size = MathHelper.Clamp(Size - 0.1f, 0f, 200f) * 0.91f; + + // Once sufficiently small, the particles very rapidly shrink. + if (Size < 20f) + Size = Size * 0.8f - 1f; + } + } + + public static List Particles + { + get; + private set; + } = new(); + + public override bool AnythingToDraw => Particles.Any(); + + public override IEnumerable Layers + { + get + { + yield return ModContent.Request("CalamityMod/Projectiles/InvisibleProj").Value; + } + } + + public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + + public override Color EdgeColor => Color.DarkRed; + + public override void Update() + { + // Update all particle instances. + // Once sufficiently small, they vanish. + for (int i = 0; i < Particles.Count; i++) + Particles[i].Update(); + Particles.RemoveAll(p => p.Size <= 2f); + } + + // Copied from Rancor Lava metaballs, since these need to be additive metaballs. + public override void PrepareShaderForTarget(int layerIndex) + { + // Store the shader in an easy to use local variable. + var metaballShader = CalamityShaders.AdditiveMetaballEdgeShader; + + // Calculate the layer scroll offset. This is used to ensure that the texture contents of the given metaball have parallax, rather than being static over the screen + // regardless of world position. + Vector2 screenSize = new(Main.screenWidth, Main.screenHeight); + + // Supply shader parameter values. + metaballShader.Parameters["screenArea"]?.SetValue(screenSize); + metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero); + metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero); + + // Apply the metaball shader. + metaballShader.CurrentTechnique.Passes[0].Apply(); + } + + public static void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size)); + + public override void DrawInstances() + { + float pureRedIntensity = 0.15f; + float opacity = 0.3f; + Texture2D tex = ModContent.Request("CalamityMod/ExtraTextures/SmallGreyscaleCircle").Value; + + foreach (BloodBoilerParticle2 particle in Particles) + { + Vector2 drawPosition = particle.Center - Main.screenPosition; + var origin = tex.Size() * 0.5f; + Vector2 scale = Vector2.One * particle.Size / tex.Size(); + + float pureRedInterpolant = Utils.GetLerpValue(25f, 60f, particle.Size, true) * pureRedIntensity; + Color drawColor = Color.Lerp(EdgeColor, Color.DarkRed, pureRedInterpolant).MultiplyRGBA(new Color(1f, 1f, 1f, opacity)); + + Main.spriteBatch.Draw(tex, drawPosition, null, drawColor, 0f, origin, scale, SpriteEffects.None, 0f); + } + } + } +} diff --git a/Graphics/Metaballs/DragonsBreathMetaball.cs b/Graphics/Metaballs/DragonsBreathMetaball.cs index 6cdfe916a3..e041506bb2 100644 --- a/Graphics/Metaballs/DragonsBreathMetaball.cs +++ b/Graphics/Metaballs/DragonsBreathMetaball.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Graphics.Metaballs { // OrangeRed is FF4500 // new Color(0xFF, 0x3A, 0x0A); - public override Color EdgeColor => Main.rand.NextBool() ? Color.OrangeRed : Color.DarkOrange * 0.65f; + public override Color EdgeColor => Color.Orange; // Flame metaballs never turn white public override void DrawInstances() => DrawInstancesInternal(0.03f, -1f); @@ -21,7 +21,7 @@ namespace CalamityMod.Graphics.Metaballs { private static float whiteSizeThreshold = 72f; - public override Color EdgeColor => Main.rand.NextBool() ? Color.Orange : Color.OrangeRed; + public override Color EdgeColor => Color.Orange; // Laser metaballs very suddenly turn white at a specific size public override void DrawInstances() => DrawInstancesInternal(0.4f, whiteSizeThreshold); @@ -47,7 +47,7 @@ namespace CalamityMod.Graphics.Metaballs Size = MathHelper.Clamp(Size - 0.1f, 0f, 200f) * 0.91f; // Once sufficiently small, the particles very rapidly shrink. - if (Size < 20f) + if (Size < 5f) Size = Size * 0.8f - 1f; } } @@ -115,10 +115,10 @@ namespace CalamityMod.Graphics.Metaballs if (whiteSizeThreshold >= 0f) { float pureWhiteInterpolant = Utils.GetLerpValue(0.8f * whiteSizeThreshold, whiteSizeThreshold, particle.Size, true) * pureWhiteIntensity; - drawColor = Color.Lerp(EdgeColor, Color.White, pureWhiteInterpolant) * opacity; + drawColor = Color.Lerp(EdgeColor, Color.DarkOrange, pureWhiteInterpolant) * opacity; } else - drawColor = Color.Lerp(EdgeColor, new Color(0xE0, 0x70, 0x10), Utils.GetLerpValue(60f, 100f, particle.Size, true) * 0.2f); + drawColor = Color.Lerp(EdgeColor, new Color(0xE0, 0x70, 0x10), Utils.GetLerpValue(60f, 100f, particle.Size, true) * 0.75f); Main.spriteBatch.Draw(tex, drawPosition, null, drawColor, 0f, origin, scale, SpriteEffects.None, 0f); } diff --git a/Graphics/Metaballs/DragonsBreathMetaball2.cs b/Graphics/Metaballs/DragonsBreathMetaball2.cs new file mode 100644 index 0000000000..c07f13e894 --- /dev/null +++ b/Graphics/Metaballs/DragonsBreathMetaball2.cs @@ -0,0 +1,127 @@ +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Effects; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Graphics.Metaballs +{ + public class DragonsBreathFlameMetaball2 : DragonsBreathMetaball + { + // OrangeRed is FF4500 + // new Color(0xFF, 0x3A, 0x0A); + public override Color EdgeColor => Color.OrangeRed; + + // Flame metaballs never turn white + public override void DrawInstances() => DrawInstancesInternal(0.03f, -1f); + } + public class DragonsBreathBeamMetaball2 : DragonsBreathMetaball2 + { + private static float whiteSizeThreshold = 72f; + + public override Color EdgeColor => Color.OrangeRed * 1.2f; + + // Laser metaballs very suddenly turn white at a specific size + public override void DrawInstances() => DrawInstancesInternal(0.4f, whiteSizeThreshold); + } + + public abstract class DragonsBreathMetaball2 : Metaball + { + // Identical behavior to Blood Boiler particles + public class DragonsBreathParticle2 + { + public Vector2 Center; + public float Size; + + public DragonsBreathParticle2(Vector2 center, float size) + { + Center = center; + Size = size; + } + + public void Update() + { + // Always slowly shrink the particles. + Size = MathHelper.Clamp(Size - 0.1f, 0f, 200f) * 0.91f; + + // Once sufficiently small, the particles very rapidly shrink. + if (Size < 20f) + Size = Size * 0.8f - 1f; + } + } + + public List Particles + { + get; + private set; + } = new(); + + public override bool AnythingToDraw => Particles.Any(); + + public override IEnumerable Layers + { + get + { + yield return ModContent.Request("CalamityMod/Projectiles/InvisibleProj").Value; + } + } + + public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + + public override void Update() + { + // Update all particle instances. + // Once sufficiently small, they vanish. + for (int i = 0; i < Particles.Count; i++) + Particles[i].Update(); + Particles.RemoveAll(p => p.Size <= 2f); + } + + // Copied from Rancor Lava metaballs, since these need to be additive metaballs. + public override void PrepareShaderForTarget(int layerIndex) + { + // Store the shader in an easy to use local variable. + var metaballShader = CalamityShaders.AdditiveMetaballEdgeShader; + + // Calculate the layer scroll offset. This is used to ensure that the texture contents of the given metaball have parallax, rather than being static over the screen + // regardless of world position. + Vector2 screenSize = new(Main.screenWidth, Main.screenHeight); + + // Supply shader parameter values. + metaballShader.Parameters["screenArea"]?.SetValue(screenSize); + metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero); + metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero); + + // Apply the metaball shader. + metaballShader.CurrentTechnique.Passes[0].Apply(); + } + + public void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size)); + + internal void DrawInstancesInternal(float opacity, float whiteSizeThreshold) + { + float pureWhiteIntensity = 0.16f; + Texture2D tex = ModContent.Request("CalamityMod/Graphics/Metaballs/MetaballMessy").Value; + + foreach (DragonsBreathParticle2 particle in Particles) + { + Vector2 drawPosition = particle.Center - Main.screenPosition; + var origin = tex.Size() * 0.5f; + Vector2 scale = Vector2.One * particle.Size / tex.Size(); + + Color drawColor; + if (whiteSizeThreshold >= 0f) + { + float pureWhiteInterpolant = Utils.GetLerpValue(0.8f * whiteSizeThreshold, whiteSizeThreshold, particle.Size, true) * pureWhiteIntensity; + drawColor = Color.Lerp(EdgeColor, Color.White, pureWhiteInterpolant) * opacity; + } + else + drawColor = Color.Lerp(EdgeColor, Color.DarkOrange, Utils.GetLerpValue(60f, 100f, particle.Size, true) * 0.3f); + + Main.spriteBatch.Draw(tex, drawPosition, null, drawColor, 0f, origin, scale, SpriteEffects.None, 0f); + } + } + } +} diff --git a/Items/Weapons/Ranged/DragonsBreath.cs b/Items/Weapons/Ranged/DragonsBreath.cs index e8918c0e10..e2877d9aca 100644 --- a/Items/Weapons/Ranged/DragonsBreath.cs +++ b/Items/Weapons/Ranged/DragonsBreath.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Ranged } public override bool CanConsumeAmmo(Item ammo, Player player) => !StrongShotMode && Main.rand.NextFloat() > 0.80f; - public override Vector2? HoldoutOffset() => new Vector2(0, 10.5f); + public override Vector2? HoldoutOffset() => new Vector2(18, 10.5f); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { @@ -81,6 +81,8 @@ namespace CalamityMod.Items.Weapons.Ranged BetweenShotsPause = 0; Item.reuseDelay = BetweenShotsPause; StrongShotMode = true; + DragonsBreathSetUseTime = 2; + DragonsBreathSetUseAnimation = 2; SoundEngine.PlaySound(ScorchedEarth.ShootSound, player.Center); } } @@ -106,7 +108,9 @@ namespace CalamityMod.Items.Weapons.Ranged WeldingShots = 50; WeldSound?.Stop(); StrongShotMode = false; - } + DragonsBreathSetUseTime = 5; + DragonsBreathSetUseAnimation = 9; + } } return false; } diff --git a/Projectiles/Ranged/BloodBoilerFire.cs b/Projectiles/Ranged/BloodBoilerFire.cs index e2c04c97aa..9696e970b2 100644 --- a/Projectiles/Ranged/BloodBoilerFire.cs +++ b/Projectiles/Ranged/BloodBoilerFire.cs @@ -58,7 +58,8 @@ namespace CalamityMod.Projectiles.Ranged } if (Projectile.timeLeft < 296) // The main visual of the projectile and the blood mist it produces before turning around { - BloodBoilerMetaball.SpawnParticle(Projectile.Center, particleSize * 2); + BloodBoilerMetaball2.SpawnParticle(Projectile.Center, particleSize * 2.3f); + BloodBoilerMetaball.SpawnParticle(Projectile.Center, particleSize * 1.7f); if (Main.rand.NextBool(6) && Projectile.ai[1] == 0f) { diff --git a/Projectiles/Ranged/CosmicFire.cs b/Projectiles/Ranged/CosmicFire.cs index a8b5839d7e..3f2b021786 100644 --- a/Projectiles/Ranged/CosmicFire.cs +++ b/Projectiles/Ranged/CosmicFire.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Ranged public ref float Time => ref Projectile.ai[0]; public ref float BounceHits => ref Projectile.ai[1]; - public Color InnerColor = Color.Turquoise; + public Color InnerColor = Color.LightGreen; public override void SetDefaults() { @@ -38,23 +38,23 @@ namespace CalamityMod.Projectiles.Ranged float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); //used for some drawing prevention for when it's offscreen since it makes a fuck load of particles if (Projectile.timeLeft % 3 == 0 && Time > 12f && targetDist < 1400f) { - AltSparkParticle spark = new AltSparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 20, 2.3f, Color.Black); + AltSparkParticle spark = new AltSparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 17, 2.3f, Color.Black); GeneralParticleHandler.SpawnParticle(spark); } - if (Time > 12f && targetDist < 1400f) + if (Main.rand.NextBool(3) && Time > 12f && targetDist < 1400f) { - Particle orb = new GenericBloom(Projectile.Center + Main.rand.NextVector2Circular(10, 10), Projectile.velocity * Main.rand.NextFloat(0.05f, 0.5f), Color.Black, Main.rand.NextFloat(0.2f, 0.45f), Main.rand.Next(12, 16), true, false); + Particle orb = new GenericBloom(Projectile.Center + Main.rand.NextVector2Circular(10, 10), Projectile.velocity * Main.rand.NextFloat(0.05f, 0.5f), Color.Black, Main.rand.NextFloat(0.2f, 0.45f), Main.rand.Next(9, 12), true, false); GeneralParticleHandler.SpawnParticle(orb); } if (Projectile.timeLeft % 3 == 0 && Time > 12f && targetDist < 1400f) { - LineParticle spark2 = new LineParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 20, 1.7f, InnerColor); + LineParticle spark2 = new LineParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 17, 1.7f, InnerColor); GeneralParticleHandler.SpawnParticle(spark2); } - if (Time > 12f && targetDist < 1400f) + if (Main.rand.NextBool(3) && Time > 12f && targetDist < 1400f) { - Particle orb2 = new GenericBloom(Projectile.Center + Main.rand.NextVector2Circular(5, 5), Projectile.velocity * Main.rand.NextFloat(0.05f, 0.5f), InnerColor, Main.rand.NextFloat(0.05f, 0.3f), Main.rand.Next(12, 16), true); + Particle orb2 = new GenericBloom(Projectile.Center + Main.rand.NextVector2Circular(5, 5), Projectile.velocity * Main.rand.NextFloat(0.05f, 0.5f), InnerColor, Main.rand.NextFloat(0.05f, 0.3f), Main.rand.Next(9, 12), true); GeneralParticleHandler.SpawnParticle(orb2); } @@ -62,21 +62,22 @@ namespace CalamityMod.Projectiles.Ranged { for (int i = 0; i <= 18; i++) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 191 : Main.rand.NextBool(4) ? 229 : 156, Projectile.velocity); + int dustStyle = Main.rand.NextBool() ? 66 : 263; + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 191 : dustStyle, Projectile.velocity); dust.scale = Main.rand.NextFloat(1.5f, 2.3f); dust.velocity = Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.3f, 2.1f); dust.noGravity = true; + dust.color = dust.type == dustStyle ? InnerColor : default; } } if (BounceHits > 0f) { - for (int i = 0; i <= 2; i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(4) ? 229 : 156, -Projectile.velocity); - dust.scale = Main.rand.NextFloat(0.7f, 1.3f); - dust.velocity = -Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.3f, 1.7f); - dust.noGravity = true; - } + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? 278 : 263, -Projectile.velocity); + dust.scale = dust.type == 278 ? Main.rand.NextFloat(0.3f, 0.6f) : Main.rand.NextFloat(0.6f, 1.4f); + dust.velocity = -Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.3f, 1.7f); + dust.noGravity = true; + dust.color = InnerColor; + CalamityUtils.HomeInOnNPC(Projectile, false, 600f, 12f, 20f); } } @@ -119,7 +120,6 @@ namespace CalamityMod.Projectiles.Ranged } Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, InnerColor, new Vector2(1f, 1f), Main.rand.NextFloat(5, -5), 0.1f, 0.9f - (BounceHits * 0.25f), 25); GeneralParticleHandler.SpawnParticle(pulse); - Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.MediumSpringGreen, new Vector2(1f, 1f), Main.rand.NextFloat(5, -5), 0.05f, 0.75f - (BounceHits * 0.25f), 25); if (BounceHits == 0f) SoundEngine.PlaySound(DeadSunsWind.Ricochet, Projectile.Center); diff --git a/Projectiles/Ranged/DeadSunExplosion.cs b/Projectiles/Ranged/DeadSunExplosion.cs index d25f4923bd..9b8f99b9ea 100644 --- a/Projectiles/Ranged/DeadSunExplosion.cs +++ b/Projectiles/Ranged/DeadSunExplosion.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Ranged public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public Player Owner => Main.player[Projectile.owner]; public ref float ExplosionRadius => ref Projectile.ai[0]; - public Color color1 = Color.Turquoise; - public Color color2 = Color.Indigo; + public Color color1 = Color.LightGreen; + public Color color2 = Color.Black; public override void SetDefaults() { //These shouldn't matter because its circular @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged GeneralParticleHandler.SpawnParticle(explosion3); Particle orb = new GenericBloom(Projectile.Center, Projectile.velocity, color1, ExplosionRadius * 0.0085f + 0.05f, 10, true); GeneralParticleHandler.SpawnParticle(orb); - Particle orb2 = new GenericBloom(Projectile.Center, Projectile.velocity, color2, ExplosionRadius * 0.006f + 0.05f, 10, true); + Particle orb2 = new GenericBloom(Projectile.Center, Projectile.velocity, color2, ExplosionRadius * 0.006f + 0.05f, 10, true, true); GeneralParticleHandler.SpawnParticle(orb2); float numberOfDusts = ExplosionRadius * 0.1f + 10; float rotFactor = 360f / numberOfDusts; @@ -50,11 +50,11 @@ namespace CalamityMod.Projectiles.Ranged float rot = MathHelper.ToRadians(i * rotFactor); Vector2 offset = (Vector2.UnitX * Main.rand.NextFloat(ExplosionRadius * 0.2f, 3.1f)).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f)); Vector2 velOffset = (Vector2.UnitX * Main.rand.NextFloat(ExplosionRadius * 0.2f, 3.1f)).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f)); - Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, Main.rand.NextBool(4) ? 229 : Projectile.ai[1] == 5 ? 226 : 156, velOffset); - dust.noGravity = dust.type == 226? false : true; - dust.color = dust.type == 226 ? color1 : default; + Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, Main.rand.NextBool(4) ? 263 : Projectile.ai[1] == 5 ? 278 : 66, velOffset); + dust.noGravity = dust.type == 278? false : true; + dust.color = color1; dust.velocity = velOffset; - dust.scale = dust.type == 226 ? Main.rand.NextFloat(0.7f, 1.3f) : Main.rand.NextFloat(1.6f, 2.2f); + dust.scale = dust.type == 278 ? Main.rand.NextFloat(0.7f, 1.3f) : Main.rand.NextFloat(1.6f, 2.2f); } } diff --git a/Projectiles/Ranged/DragonsBreathFlames.cs b/Projectiles/Ranged/DragonsBreathFlames.cs index b824555d8d..8317d628c5 100644 --- a/Projectiles/Ranged/DragonsBreathFlames.cs +++ b/Projectiles/Ranged/DragonsBreathFlames.cs @@ -17,8 +17,9 @@ namespace CalamityMod.Projectiles.Ranged public int Time = 0; public float beamWidth = 1.1f; public bool beamsize = false; - public float bbbBONUSbeamSizeWOAHH = 60; + public float bbbBONUSbeamSizeWOAHH = 50; public bool postHit = false; + public int beamWeldBloomReduction = 0; public ref int audioCooldown => ref Main.player[Projectile.owner].Calamity().DragonsBreathAudioCooldown; public override void SetDefaults() @@ -29,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.ignoreWater = true; Projectile.tileCollide = false; - Projectile.extraUpdates = 5; + Projectile.extraUpdates = 6; Projectile.penetrate = -1; Projectile.timeLeft = 500; Projectile.usesLocalNPCImmunity = true; @@ -54,7 +55,7 @@ namespace CalamityMod.Projectiles.Ranged Time++; if (Projectile.ai[0] == 0) //Fireball Mode { - if (Time == 14) + if (Time == 16) { for (int i = 0; i <= 7; i++) { @@ -83,12 +84,13 @@ namespace CalamityMod.Projectiles.Ranged } if (Time % 5 == 0 && Time > 35f && targetDist < 1400f) { - SparkParticle spark = new SparkParticle(Projectile.Center + Main.rand.NextVector2Circular(1 + (Time * 0.3f), 1 + (Time * 0.3f)), -Projectile.velocity * 0.5f, false, 15, Main.rand.NextFloat(0.3f, 0.5f), Main.rand.NextBool() ? Color.DarkOrange : Color.OrangeRed); + SparkParticle spark = new SparkParticle(Projectile.Center + Main.rand.NextVector2Circular(1 + (Time * 0.3f), 1 + (Time * 0.3f)), -Projectile.velocity * 0.5f, false, 15, Main.rand.NextFloat(0.4f, 0.7f), Main.rand.NextBool() ? Color.DarkOrange : Color.OrangeRed); GeneralParticleHandler.SpawnParticle(spark); } if (targetDist < 1400f) { - ModContent.GetInstance().SpawnParticle(Projectile.Center, Time * Main.rand.NextFloat(0.85f, 0.95f)); + ModContent.GetInstance().SpawnParticle(Projectile.Center, Time * 0.9f); + ModContent.GetInstance().SpawnParticle(Projectile.Center + Projectile.velocity, Time * 0.85f); } Projectile.velocity *= 1.01f; } @@ -96,9 +98,9 @@ namespace CalamityMod.Projectiles.Ranged { if (bbbBONUSbeamSizeWOAHH > 0) bbbBONUSbeamSizeWOAHH -= 0.65f; - Projectile.extraUpdates = 15; + Projectile.extraUpdates = 170; - if (Time > 11) + if (Time > 13) { Dust dust2 = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(8, 8), Main.rand.NextBool(3) ? 162 : 259); dust2.scale = Main.rand.NextFloat(0.3f, 0.5f); @@ -109,10 +111,11 @@ namespace CalamityMod.Projectiles.Ranged } if (targetDist < 1400f) { + ModContent.GetInstance().SpawnParticle(Projectile.Center, beamWidth * 46 + bbbBONUSbeamSizeWOAHH); ModContent.GetInstance().SpawnParticle(Projectile.Center, beamWidth * 45 + bbbBONUSbeamSizeWOAHH); } } - if (Time == 11) + if (Time == 13) { for (int i = 0; i <= 4; i++) { @@ -135,46 +138,45 @@ namespace CalamityMod.Projectiles.Ranged { if (Projectile.ai[0] == 1) { - if (!postHit) + if (beamWeldBloomReduction < 3) { if (audioCooldown == 0) { SoundEngine.PlaySound(DragonsBreath.WeldingBurn, Projectile.Center); audioCooldown = 12; } - float OrbSize = Main.rand.NextFloat(0.5f, 0.8f); + float OrbSize = Main.rand.NextFloat(0.5f, 0.8f) - beamWeldBloomReduction * 0.14f; Particle orb = new GenericBloom(target.Center, Vector2.Zero, Color.OrangeRed, OrbSize + 0.6f, 8, true); GeneralParticleHandler.SpawnParticle(orb); Particle orb2 = new GenericBloom(target.Center, Vector2.Zero, Color.White, OrbSize + 0.2f, 8, true); GeneralParticleHandler.SpawnParticle(orb2); - for (int i = 0; i < 3; i++) + if (!postHit) { - Vector2 SpawnPosition = target.Center + Main.rand.NextVector2Circular(target.width, target.height) * 0.04f; - Vector2 splatterDirection = (Projectile.Center - SpawnPosition).SafeNormalize(Vector2.UnitY); - int sparkLifetime = Main.rand.Next(22, 36); - float sparkScale = Main.rand.NextFloat(0.8f, 1.3f); - Color sparkColor = Main.rand.NextBool(4) ? Color.OrangeRed : Color.Orange; - Vector2 sparkVelocity = splatterDirection.RotatedByRandom(0.6f) * Main.rand.NextFloat(12f, 25f); - SparkParticle spark = new SparkParticle(target.Center, sparkVelocity, true, sparkLifetime, sparkScale, sparkColor); - GeneralParticleHandler.SpawnParticle(spark); + for (int i = 0; i < 3; i++) + { + Vector2 SpawnPosition = target.Center + Main.rand.NextVector2Circular(target.width, target.height) * 0.04f; + Vector2 splatterDirection = (Projectile.Center - SpawnPosition).SafeNormalize(Vector2.UnitY); + int sparkLifetime = Main.rand.Next(22, 36); + float sparkScale = Main.rand.NextFloat(0.8f, 1.3f); + Color sparkColor = Main.rand.NextBool(4) ? Color.OrangeRed : Color.Orange; + Vector2 sparkVelocity = splatterDirection.RotatedByRandom(0.6f) * Main.rand.NextFloat(12f, 25f); + SparkParticle spark = new SparkParticle(target.Center, sparkVelocity, true, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + } + postHit = true; } - postHit = true; + beamWeldBloomReduction++; } target.AddBuff(ModContent.BuffType(), 420); } else if (!postHit) { - for (int i = 0; i <= 3; i++) + for (int i = 0; i <= 6; i++) { - Vector2 dustyVelocity = new Vector2(0, -3.5f); - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 293 : 174); - dust.scale = Main.rand.NextFloat(0.8f, 1.75f); - dust.velocity = dustyVelocity.RotatedByRandom(0.6f) * Main.rand.NextFloat(0.3f, 0.8f); - dust.noGravity = false; - Dust dust2 = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 293 : 174); - dust2.scale = Main.rand.NextFloat(1.1f, 1.9f); - dust2.velocity = dustyVelocity.RotatedByRandom(0.07f) * Main.rand.NextFloat(0.8f, 2.1f); - dust2.noGravity = false; + Dust dust = Dust.NewDustPerfect(Projectile.position - Projectile.velocity * 0.5f, Main.rand.NextBool(3) ? 293 : 174, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.5f, 3.5f), 0, default, Main.rand.NextFloat(1.6f, 2.3f)); + dust.noGravity = true; + Dust dust2 = Dust.NewDustPerfect(Projectile.position - Projectile.velocity * 0.5f, Main.rand.NextBool(3) ? 293 : 174, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(5f)) * Main.rand.NextFloat(0.8f, 5.8f), 0, default, Main.rand.NextFloat(1.6f, 2.3f)); + dust2.noGravity = true; } postHit = true; } diff --git a/Projectiles/Ranged/DragonsBreathMag.cs b/Projectiles/Ranged/DragonsBreathMag.cs index 250f8cdd37..0908d58da1 100644 --- a/Projectiles/Ranged/DragonsBreathMag.cs +++ b/Projectiles/Ranged/DragonsBreathMag.cs @@ -44,6 +44,7 @@ namespace CalamityMod.Projectiles.Ranged } public override void AI() { + Projectile.extraUpdates = 0; Time++; Player Owner = Main.player[Projectile.owner]; if (!TouchedGrass) @@ -64,11 +65,15 @@ namespace CalamityMod.Projectiles.Ranged { if (Main.zenithWorld) { - for (int i = 0; i <= 40; i++) + for (int i = 0; i <= 30; i++) { SparkParticle spark1 = new SparkParticle(Projectile.Center, new Vector2(4, 4).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 2.8f), false, 45, 1.4f, Main.rand.NextBool(4) ? Color.Orange : Color.OrangeRed); GeneralParticleHandler.SpawnParticle(spark1); } + Particle explosion = new DetailedExplosion(Projectile.Center, Vector2.Zero, Color.DarkOrange, Vector2.One, Main.rand.NextFloat(-5, 5), 0f, 2.8f, 33); + GeneralParticleHandler.SpawnParticle(explosion); + Particle explosion2 = new DetailedExplosion(Projectile.Center, Vector2.Zero, Color.OrangeRed, Vector2.One, Main.rand.NextFloat(-5, 5), 0f, 3f, 33, false); + GeneralParticleHandler.SpawnParticle(explosion2); } target.AddBuff(ModContent.BuffType(), 20); } diff --git a/Projectiles/Ranged/PhotovisceratorHoldout.cs b/Projectiles/Ranged/PhotovisceratorHoldout.cs index df5342ed9a..05976bce42 100644 --- a/Projectiles/Ranged/PhotovisceratorHoldout.cs +++ b/Projectiles/Ranged/PhotovisceratorHoldout.cs @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Ranged public void LeftClickAttack(Vector2 armPosition, Vector2 verticalOffset) { - if (Time == 1 || Time % 59 == 0) + if (Time == 1 || Time % 55 == 0) { PhotoUseSound = SoundEngine.PlaySound(Photoviscerator.UseSound, Projectile.Center); }