From ff03ac11d7c768a8b77bac794076d4f892f4f31e Mon Sep 17 00:00:00 2001 From: enamoured_ Date: Fri, 14 Feb 2025 17:33:12 -0600 Subject: [PATCH] light adjustments + brain coral bubble dust probably will change the brain coral thing later but good enough for now --- Projectiles/Typeless/CoralBubble.cs | 12 +++++++++++- Projectiles/Typeless/CoralBubbleSmall.cs | 12 +++++++++++- Tiles/SunkenSea/Ambient/BrainCoral.cs | 13 ++++++++++++- .../SunkenSea/Ambient/LongScarletSeagrass.cs | 2 +- Tiles/SunkenSea/Ambient/SeaAnemone.cs | 19 ++++++++++++++++++- Tiles/SunkenSea/Ambient/SmallBrainCoral.cs | 14 ++++++++++++++ Tiles/SunkenSea/SeaPrism.cs | 2 +- 7 files changed, 68 insertions(+), 6 deletions(-) diff --git a/Projectiles/Typeless/CoralBubble.cs b/Projectiles/Typeless/CoralBubble.cs index 9d4cd5e92e..8162bb748b 100644 --- a/Projectiles/Typeless/CoralBubble.cs +++ b/Projectiles/Typeless/CoralBubble.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; @@ -63,7 +64,16 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { + Vector3 lightCol = new(85f / 255f, 151f / 255f, 196f / 255f); + float brightness = 0.7f; + float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.01f; + brightness *= (float)MathF.Sin(8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); + brightness += 0.4f; + brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f); + lightCol *= brightness; + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + Lighting.AddLight(Projectile.position, lightCol); return false; } diff --git a/Projectiles/Typeless/CoralBubbleSmall.cs b/Projectiles/Typeless/CoralBubbleSmall.cs index d6bc051dae..ec264285ad 100644 --- a/Projectiles/Typeless/CoralBubbleSmall.cs +++ b/Projectiles/Typeless/CoralBubbleSmall.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; @@ -66,7 +67,16 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { + Vector3 lightCol = new(85f / 255f, 151f / 255f, 196f / 255f); + float brightness = 0.7f; + float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.01f; + brightness *= (float)MathF.Sin(8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); + brightness += 0.4f; + brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f); + lightCol *= brightness; + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + Lighting.AddLight(Projectile.position, lightCol); return false; } diff --git a/Tiles/SunkenSea/Ambient/BrainCoral.cs b/Tiles/SunkenSea/Ambient/BrainCoral.cs index f3f73b002f..0732be72d0 100644 --- a/Tiles/SunkenSea/Ambient/BrainCoral.cs +++ b/Tiles/SunkenSea/Ambient/BrainCoral.cs @@ -45,7 +45,18 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient if (Main.tile[i, tileLocationY].LiquidAmount == 255 && Main.tile[i, tileLocationY - 1].LiquidAmount == 255 && Main.tile[i, tileLocationY - 2].LiquidAmount == 255) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(new EntitySource_WorldEvent(), i * 16 + 16, tileLocationY * 16 + 16, 0f, -0.1f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + for (int t = 0; t < 5; t++) + { + Dust dust = Dust.NewDustDirect(new Vector2(i, j + 0.5f) * 16, 16, 16, DustID.BlueTorch, 0, 0, 1, default, 1.5f); + dust.velocity *= 0.2f; + dust.noGravity = true; + dust.noLight = true; + dust.noLightEmittence = true; + } + Dust dust2 = Dust.NewDustDirect(new Vector2(i, j + 0.5f) * 16, 16, 16, DustID.MagicMirror, 0, 0, 1, Color.LightSkyBlue, 0.5f); + dust2.velocity *= 0.2f; + + Projectile.NewProjectile(new EntitySource_WorldEvent(), i * 16 + 16, tileLocationY * 16 + 16, 0f, -0.1f, ModContent.ProjectileType(), 0, 1f, Main.myPlayer); } } } diff --git a/Tiles/SunkenSea/Ambient/LongScarletSeagrass.cs b/Tiles/SunkenSea/Ambient/LongScarletSeagrass.cs index d8aed4c938..7ad803dc08 100644 --- a/Tiles/SunkenSea/Ambient/LongScarletSeagrass.cs +++ b/Tiles/SunkenSea/Ambient/LongScarletSeagrass.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.01f; brightness *= (float)MathF.Sin(-j / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + i); brightness *= (float)MathF.Sin(-i / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + j); - brightness += 0.7f; + brightness += 0.4f; brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f); r = 187f / 255f; g = 43f / 255f; diff --git a/Tiles/SunkenSea/Ambient/SeaAnemone.cs b/Tiles/SunkenSea/Ambient/SeaAnemone.cs index fe95a937cc..d58e4335a6 100644 --- a/Tiles/SunkenSea/Ambient/SeaAnemone.cs +++ b/Tiles/SunkenSea/Ambient/SeaAnemone.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Localization; using Terraria.ModLoader; @@ -10,6 +11,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient { public override void SetStaticDefaults() { + Main.tileLighted[Type] = true; AnimationFrameHeight = 36; Main.tileFrameImportant[Type] = true; Main.tileNoAttach[Type] = true; @@ -26,6 +28,21 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient num = fail ? 1 : 3; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + float brightness = 0.7f; + float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.01f; + brightness *= (float)MathF.Sin(-j / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + i); + brightness *= (float)MathF.Sin(-i / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + j); + brightness += 0.4f; + brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f); + r = 85f / 255f; + b = 151f / 255f; + g = 196f / 255f; + r *= brightness; + g *= brightness; + b *= brightness; + } public override void AnimateTile(ref int frame, ref int frameCounter) { frameCounter++; diff --git a/Tiles/SunkenSea/Ambient/SmallBrainCoral.cs b/Tiles/SunkenSea/Ambient/SmallBrainCoral.cs index 6013e6ac73..97aa5ce3a6 100644 --- a/Tiles/SunkenSea/Ambient/SmallBrainCoral.cs +++ b/Tiles/SunkenSea/Ambient/SmallBrainCoral.cs @@ -46,7 +46,21 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient if (Main.tile[i, tileLocationY].LiquidAmount == 255 && Main.tile[i, tileLocationY - 1].LiquidAmount == 255 && Main.tile[i, tileLocationY - 2].LiquidAmount == 255) { if (Main.netMode != NetmodeID.MultiplayerClient) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + for (int t = 0; t < 5; t++) + { + Dust dust = Dust.NewDustDirect(new Vector2(i, j + 0.5f) * 16, 16, 16, DustID.BlueTorch, 0, 0, 1, default, 1.5f); + dust.velocity *= 0.2f; + dust.noGravity = true; + dust.noLight = true; + dust.noLightEmittence = true; + } + Dust dust2 = Dust.NewDustDirect(new Vector2(i, j + 0.5f) * 16, 16, 16, DustID.MagicMirror, 0, 0, 1, Color.LightSkyBlue, 0.5f); + dust2.velocity *= 0.2f; + Projectile.NewProjectile(new EntitySource_WorldEvent(), i * 16 + 16, tileLocationY * 16 + 16, 0f, -0.1f, ModContent.ProjectileType(), 0, 1f, Main.myPlayer); + } } } } diff --git a/Tiles/SunkenSea/SeaPrism.cs b/Tiles/SunkenSea/SeaPrism.cs index 709464fdae..9d2e787ab4 100644 --- a/Tiles/SunkenSea/SeaPrism.cs +++ b/Tiles/SunkenSea/SeaPrism.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Tiles.SunkenSea { float brightness = 0.9f; Color blue = new Color(162, 216, 218); - Color darkviolet = new Color(18, 67, 116); + Color darkviolet = new Color(18, 78, 96); Color value = Color.Lerp(blue, darkviolet, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f); Color value1 = Color.Lerp(blue, darkviolet, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f); r = (value.R + value1.R) / 800f;