From 4fa5b6c9d47c68e9548fe4203be7dc1e4b5042ef Mon Sep 17 00:00:00 2001 From: Xyk Date: Sun, 1 Oct 2023 20:46:09 -0700 Subject: [PATCH] Lighting and particle adjustments Added a nolight function for the GenericBloom particle Adjusted Absorber dust light and sprite Adjusted Arc Nova Diffuser's charge light so its green and scales with how charged it is Adjusted Arc Nova Diffuser's charge shot to stop trying to spawn particles offscreen --- Dusts/AbsorberDust.cs | 9 +++------ Dusts/AbsorberDust.png | Bin 2948 -> 2948 bytes ...Mods.CalamityMod.Items.Weapons.Magic.hjson | 4 ++-- Particles/GenericBloom.cs | 9 +++++++-- Projectiles/Healing/AbsorberAura.cs | 3 +-- Projectiles/Ranged/ArcNovaDiffuserHoldout.cs | 8 ++++++-- Projectiles/Ranged/NovaChargedShot.cs | 16 ++++++++++------ 7 files changed, 29 insertions(+), 20 deletions(-) diff --git a/Dusts/AbsorberDust.cs b/Dusts/AbsorberDust.cs index 8c6bd63fef..eae51e2aad 100644 --- a/Dusts/AbsorberDust.cs +++ b/Dusts/AbsorberDust.cs @@ -21,12 +21,9 @@ namespace CalamityMod.Dusts } if (!dust.noLight) { - float strength = dust.scale * 1.4f; - if (strength > 1f) - { - strength = 1f; - } - Lighting.AddLight(dust.position, 1.43f * strength, 1.88f * strength, 1.43f * strength); + float strength = dust.scale * 1.8f; + Vector3 DustLight = new Vector3(0.149f, 0.245f, 0.195f); + Lighting.AddLight(dust.position, DustLight * strength); } return true; } diff --git a/Dusts/AbsorberDust.png b/Dusts/AbsorberDust.png index 9150eb4a80da586b35ffa62992ddbd64add43712..71259576204688d30459b5ddd4d907730a25f777 100644 GIT binary patch delta 157 zcmZn>ZxP?{fvZ08WpCtvNeKywU8a{LG=n*U1rFq&IsgP49zM=wE8$(Dxn!SoCu6f~ z;*leJ{__BV_9yj+-+3Hc4Oln5vjPe5^q0paI$U>{<@9RzLZxP?{fvbMu>A%1J^8i7$h_s|;Fh{V!@7o=XK#*wo+LEn=cZuebebSwb&8`dY z9eDs&IQ`T0N8foITMbx~>a0LIdDff7COTYqnC0|p_e2SU2$5O&p1;o@IB=lgQo2~( wd4Uj);0a5godpUUFnD_{3}NV%a1K$1>)e}<{$6?EIs*`Ry85}Sb4q9e0OA`&5dZ)H diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index d429af66e7..8f7b5d76a0 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -496,8 +496,8 @@ MadAlchemistsCocktailGlove: { Fires a variety of high-velocity flasks Press to throw a prismatic flask that inflicts many debuffs Red flasks explode violently - Blue flasks contain poison gas - Green flasks summon lunar flares + Blue flasks contain poison gas + Green flasks summon lunar flares Purple flasks explode into homing shrapnel ''' } diff --git a/Particles/GenericBloom.cs b/Particles/GenericBloom.cs index 56d96bec10..9cd4d2b52b 100644 --- a/Particles/GenericBloom.cs +++ b/Particles/GenericBloom.cs @@ -14,8 +14,9 @@ namespace CalamityMod.Particles private float opacity; private Color BaseColor; + private bool ProduceLight; - public GenericBloom(Vector2 position, Vector2 velocity, Color color, float scale, int lifeTime) + public GenericBloom(Vector2 position, Vector2 velocity, Color color, float scale, int lifeTime, bool produceLight = true) { Position = position; Velocity = velocity; @@ -23,13 +24,17 @@ namespace CalamityMod.Particles Scale = scale; Lifetime = lifeTime; Rotation = Main.rand.NextFloat(MathHelper.TwoPi); + ProduceLight = produceLight; } 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); + if (ProduceLight) + { + Lighting.AddLight(Position, Color.R / 255f, Color.G / 255f, Color.B / 255f); + } Velocity *= 0.95f; } diff --git a/Projectiles/Healing/AbsorberAura.cs b/Projectiles/Healing/AbsorberAura.cs index 37e717607d..505f68fc7b 100644 --- a/Projectiles/Healing/AbsorberAura.cs +++ b/Projectiles/Healing/AbsorberAura.cs @@ -37,13 +37,12 @@ namespace CalamityMod.Projectiles.Healing Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; - Projectile.timeLeft = 2710; + Projectile.timeLeft = 1810; } public override void AI() { Framecounter++; - for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) { Player player = Main.player[playerIndex]; diff --git a/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs b/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs index e8465066fc..2d0f7334e1 100644 --- a/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs +++ b/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs @@ -174,10 +174,14 @@ namespace CalamityMod.Projectiles.Ranged SparkParticle spark2 = new SparkParticle((tipPosition -Projectile.velocity * 4) + Main.rand.NextVector2Circular(12, 12), -Projectile.velocity * Main.rand.NextFloat(16.1f, 30.8f), false, Main.rand.Next(2, 7), Main.rand.NextFloat(particleScale / 350f, particleScale / 270f), Main.rand.NextBool(4) ? Color.Chartreuse : Color.Lime); GeneralParticleHandler.SpawnParticle(spark2); } - Particle orb = new GenericBloom(tipPosition, Projectile.velocity, Color.Lime, particleScale / 270f, 2); + Particle orb = new GenericBloom(tipPosition, Projectile.velocity, Color.Lime, particleScale / 270f, 2, false); GeneralParticleHandler.SpawnParticle(orb); - Particle orb2 = new GenericBloom(tipPosition, Projectile.velocity, Color.White, particleScale / 400f, 2); + Particle orb2 = new GenericBloom(tipPosition, Projectile.velocity, Color.White, particleScale / 400f, 2, false); GeneralParticleHandler.SpawnParticle(orb2); + + float strength = particleScale / 45f; + Vector3 DustLight = new Vector3(0.000f, 0.255f, 0.000f); + Lighting.AddLight(tipPosition, DustLight * strength); } // Full charge dusts diff --git a/Projectiles/Ranged/NovaChargedShot.cs b/Projectiles/Ranged/NovaChargedShot.cs index 8fba23f6ff..9c031426af 100644 --- a/Projectiles/Ranged/NovaChargedShot.cs +++ b/Projectiles/Ranged/NovaChargedShot.cs @@ -39,14 +39,18 @@ namespace CalamityMod.Projectiles.Ranged Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(-3, 3), 107); dust.noGravity = true; dust.scale = 1.2f; - if (Main.rand.NextBool()) + if (Time < 120) { - Vector2 trailPos = Projectile.Center + Main.rand.NextVector2Circular(10, 10); - float trailScale = Main.rand.NextFloat(0.8f, 1.2f); - Color trailColor = Main.rand.NextBool(3) ? Color.Chartreuse : Color.Lime; - Particle Trail = new SparkParticle(trailPos, Projectile.velocity * 0.2f, false, 60, trailScale, trailColor); - GeneralParticleHandler.SpawnParticle(Trail); + if (Main.rand.NextBool()) + { + Vector2 trailPos = Projectile.Center + Main.rand.NextVector2Circular(10, 10); + float trailScale = Main.rand.NextFloat(0.8f, 1.2f); + Color trailColor = Main.rand.NextBool(3) ? Color.Chartreuse : Color.Lime; + Particle Trail = new SparkParticle(trailPos, Projectile.velocity * 0.2f, false, 60, trailScale, trailColor); + GeneralParticleHandler.SpawnParticle(Trail); + } } + } public override bool PreDraw(ref Color lightColor)