diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal.png b/Tiles/SunkenSea/MediumSeaPrismCrystal.png index dd17c7eb0b..ceef890ebe 100644 Binary files a/Tiles/SunkenSea/MediumSeaPrismCrystal.png and b/Tiles/SunkenSea/MediumSeaPrismCrystal.png differ diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal_Blue.png b/Tiles/SunkenSea/MediumSeaPrismCrystal_Blue.png index dd17c7eb0b..ceef890ebe 100644 Binary files a/Tiles/SunkenSea/MediumSeaPrismCrystal_Blue.png and b/Tiles/SunkenSea/MediumSeaPrismCrystal_Blue.png differ diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal_Green.png b/Tiles/SunkenSea/MediumSeaPrismCrystal_Green.png index 0d9062d94e..e10cc3ce4f 100644 Binary files a/Tiles/SunkenSea/MediumSeaPrismCrystal_Green.png and b/Tiles/SunkenSea/MediumSeaPrismCrystal_Green.png differ diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal_Purple.png b/Tiles/SunkenSea/MediumSeaPrismCrystal_Purple.png index 36c9f2955e..b0d2462bd5 100644 Binary files a/Tiles/SunkenSea/MediumSeaPrismCrystal_Purple.png and b/Tiles/SunkenSea/MediumSeaPrismCrystal_Purple.png differ diff --git a/Tiles/SunkenSea/SeaPrism.cs b/Tiles/SunkenSea/SeaPrism.cs index d8b451de63..d5622cf98d 100644 --- a/Tiles/SunkenSea/SeaPrism.cs +++ b/Tiles/SunkenSea/SeaPrism.cs @@ -21,6 +21,8 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.HasSlopeFrames[Type] = true; Main.tileMerge[Type][ModContent.TileType()] = true; + Main.tileMerge[Type][ModContent.TileType()] = true; + CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); Main.tileLighted[Type] = true; diff --git a/Tiles/SunkenSea/SeaPrismCrystals.cs b/Tiles/SunkenSea/SeaPrismCrystals.cs index dd064e88e7..8c008a9ff8 100644 --- a/Tiles/SunkenSea/SeaPrismCrystals.cs +++ b/Tiles/SunkenSea/SeaPrismCrystals.cs @@ -1,6 +1,7 @@ using System; using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -31,52 +32,51 @@ namespace CalamityMod.Tiles.SunkenSea public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - var tile = Main.tile[i, j]; - bool lessLightDueToLowWater = tile.LiquidAmount > 50 && tile.LiquidType == LiquidID.Water; - int xframe = tile.TileFrameX / 18; - if (xframe > 7 && xframe < 14) - { - //Purple - Color darkviolet = new Color(75, 54, 103); - Color violet = new Color(231, 205, 245); - Color value = Color.Lerp(darkviolet, violet, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.037f + i / 40f) + 1f) / 2f); - Color value1 = Color.Lerp(darkviolet, violet, (MathF.Sin((j - 120) / 50f + Main.GameUpdateCount * 0.014f + -i / 30f) + 1f) / 2f); - r = lessLightDueToLowWater ? 0.36f : 0.48f; - g = lessLightDueToLowWater ? 0.315f : 0.42f; - b = lessLightDueToLowWater ? 0.405f : 0.54f; - r *= (value.R + value1.R) / 300f; - g *= (value.G + value1.G) / 300f; - b *= (value.B + value1.B) / 300f; - - } - else if (xframe >= 14) - { - //Green - Color murkeygreen = new Color(28, 68, 54); - Color lightgreen = new Color(166, 234, 198); - Color value2 = Color.Lerp(murkeygreen, lightgreen, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.027f + i / 40f) + 1f) / 2f); - Color value3 = Color.Lerp(murkeygreen, lightgreen, (MathF.Sin((j - 80) / 50f + Main.GameUpdateCount * 0.034f + -i / 30f) + 1f) / 2f); - r = lessLightDueToLowWater ? 0.225f : 0.3f; - g = lessLightDueToLowWater ? 0.405f : 0.54f; - b = lessLightDueToLowWater ? 0.315f : 0.42f; - r *= (value2.R + value3.R) / 300f; - g *= (value2.G + value3.G) / 300f; - b *= (value2.B + value3.B) / 300f; - } - else - { - //Blue - Color blue = new Color(67, 187, 204); - Color darkviolet = new Color(18, 67, 116); - 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 - 10) / 50f + Main.GameUpdateCount * 0.064f + -i / 30f) + 1f) / 2f); - r = lessLightDueToLowWater ? 0.27f : 0.36f; - g = lessLightDueToLowWater ? 0.405f : 0.54f; - b = lessLightDueToLowWater ? 0.405f : 0.54f; - r *= (value.R + value1.R) / 300f; - g *= (value.G + value1.G) / 300f; - b *= (value.B + value1.B) / 300f; - } + float fade1 = GetFade1(i, j); + float fade2 = GetFade2(i, j); + + Color baseColor = new Color(162, 216, 218); //Blue + Color glow1 = new Color(171, 113, 215); //Purple + Color glow2 = new Color(56, 174, 117); //Green + + Vector3 blended = baseColor.ToVector3(); + + blended = Vector3.Lerp(blended, glow1.ToVector3(), fade1 * 0.5f); + blended = Vector3.Lerp(blended, glow2.ToVector3(), fade2 * 0.5f); + + float brightness = 0.6f; + blended *= brightness; + + r = blended.X; + g = blended.Y; + b = blended.Z; + } + + private static float GetFade1(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.2f) + 1f) / 2f; + } + + private static float GetFade2(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.1f + i * 0.08f - j * 0.05f) + 1f) / 2f; + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Framing.GetTileSafely(i, j); + Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 position = new Vector2(i * 16, j * 16) - Main.screenPosition + offScreen; + + Rectangle sourceRect = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16); + + Texture2D baseTex = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrismCrystals").Value; + spriteBatch.Draw(baseTex, position, sourceRect, Lighting.GetColor(i, j) * 1.5f); + + Texture2D tex1 = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrismCrystals_Purple").Value; + Texture2D tex2 = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrismCrystals_Green").Value; + + spriteBatch.Draw(tex1, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade1(i, j)); + spriteBatch.Draw(tex2, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade2(i, j)); } public override bool CanPlace(int i, int j) diff --git a/Tiles/SunkenSea/SeaPrismCrystals.png b/Tiles/SunkenSea/SeaPrismCrystals.png index c4646c40c6..574fd43f13 100644 Binary files a/Tiles/SunkenSea/SeaPrismCrystals.png and b/Tiles/SunkenSea/SeaPrismCrystals.png differ diff --git a/Tiles/SunkenSea/SeaPrismCrystals_Green.png b/Tiles/SunkenSea/SeaPrismCrystals_Green.png new file mode 100644 index 0000000000..d167aa4b1e Binary files /dev/null and b/Tiles/SunkenSea/SeaPrismCrystals_Green.png differ diff --git a/Tiles/SunkenSea/SeaPrismCrystals_Purple.png b/Tiles/SunkenSea/SeaPrismCrystals_Purple.png new file mode 100644 index 0000000000..52616c685f Binary files /dev/null and b/Tiles/SunkenSea/SeaPrismCrystals_Purple.png differ diff --git a/Walls/SeaPrismWall.cs b/Walls/SeaPrismWall.cs index 9ed4f5c545..333b163bdf 100644 --- a/Walls/SeaPrismWall.cs +++ b/Walls/SeaPrismWall.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Walls Main.wallHouse[Type] = true; DustType = 108; - AddMapEntry(new Color(11, 56, 81)); + AddMapEntry(new Color(27, 123, 131)); } public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; diff --git a/Waters/BasaltGullyLava.cs b/Waters/BasaltGullyLava.cs index d81e1570c5..ba11110a93 100644 --- a/Waters/BasaltGullyLava.cs +++ b/Waters/BasaltGullyLava.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Waters public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 2.48f / 4; - g = 1.29f / 4; - b = 0.48f / 4; + r = 248f / 255; + g = 73f / 255; + b = 73f / 255; } } } diff --git a/Waters/BasaltGullyLava.png b/Waters/BasaltGullyLava.png index 2459b3cf5e..489de52258 100644 Binary files a/Waters/BasaltGullyLava.png and b/Waters/BasaltGullyLava.png differ diff --git a/Waters/BasaltGullyLava_Block.png b/Waters/BasaltGullyLava_Block.png index e1c8be0e19..6fd6bc9bf5 100644 Binary files a/Waters/BasaltGullyLava_Block.png and b/Waters/BasaltGullyLava_Block.png differ diff --git a/Waters/BasaltGullyLava_Slope.png b/Waters/BasaltGullyLava_Slope.png index a6a89147f9..3f4a9dda65 100644 Binary files a/Waters/BasaltGullyLava_Slope.png and b/Waters/BasaltGullyLava_Slope.png differ diff --git a/Waters/BasaltGullyLavaflow.png b/Waters/BasaltGullyLavaflow.png index 791bdd5ff1..162dcce323 100644 Binary files a/Waters/BasaltGullyLavaflow.png and b/Waters/BasaltGullyLavaflow.png differ diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index efcc2c88a0..100bf93ee0 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -1421,26 +1421,28 @@ namespace CalamityMod.World } if (Main.tile[X, Y].TileType == ModContent.TileType()) { + int RandStyle() => WorldGen.genRand.Next(8); + int style = RandStyle(); //Medium Sea Prism down if (WorldGen.genRand.NextBool(9)) { ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 7); + WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style); } if (WorldGen.genRand.NextBool(9)) { ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 5); + WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style); } if (WorldGen.genRand.NextBool(9)) { ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 4); + WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style); } if (WorldGen.genRand.NextBool(9)) { ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 2); + WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style); } } if (Main.tile[X, Y].TileType == ModContent.TileType())