diff --git a/Tiles/SunkenSea/CyanCoral.png b/Tiles/SunkenSea/CyanCoral.png index 318df78b1c..dedf329ad8 100644 Binary files a/Tiles/SunkenSea/CyanCoral.png and b/Tiles/SunkenSea/CyanCoral.png differ diff --git a/Walls/NavyslateWall.cs b/Walls/NavyslateWall.cs new file mode 100644 index 0000000000..4024292c23 --- /dev/null +++ b/Walls/NavyslateWall.cs @@ -0,0 +1,21 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria.GameContent; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Walls +{ + public class NavyslateWall : ModWall, IVisibleThroughWater + { + int IVisibleThroughWater.WaterMapEntry { get; set; } + + public override void SetStaticDefaults() + { + DustType = 96; + this.AddMapEntryWithWaterVisibility(new Color(11, 40, 43)); + } + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + } +} diff --git a/Walls/NavyslateWall.png b/Walls/NavyslateWall.png new file mode 100644 index 0000000000..bdeabd6610 Binary files /dev/null and b/Walls/NavyslateWall.png differ diff --git a/Walls/NavystoneWall.cs b/Walls/NavystoneWall.cs index 51f5124c88..feedbf7e15 100644 --- a/Walls/NavystoneWall.cs +++ b/Walls/NavystoneWall.cs @@ -13,70 +13,10 @@ namespace CalamityMod.Walls public override void SetStaticDefaults() { - GlowMask = new("CalamityMod/Walls/NavystoneWall_Glow", 36, 36); DustType = 96; this.AddMapEntryWithWaterVisibility(new Color(16, 45, 48)); } - public override void Unload() - { - GlowMask?.Unload(); - GlowMask = null; - } - public static void DrawWallGlow(int wallType, int i, int j, SpriteBatch spriteBatch) - { - if (GlowMask.Texture is null) - return; - - Tile tile = Main.tile[i, j]; - int xLength = 32; - int xOff = 0; - - int xPos = tile.WallFrameX + xOff; - int yPos = tile.WallFrameY; - - Rectangle frame = new Rectangle(xPos, yPos, xLength, 32); - Color drawcolor; - drawcolor = WorldGen.paintColor(tile.WallColor); - drawcolor.A = 255; - Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); - - if (Main.drawToScreen) - zero = Vector2.Zero; - - Vector2 pos = new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero; - Color lightColor = Lighting.GetColor(i, j, Color.White); - - spriteBatch.Draw(TextureAssets.Wall[wallType].Value, pos + new Vector2(-8 + xOff, -8), frame, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - - if (GlowMask.HasContentInFramePos(xPos, yPos)) - { - float brightness = MathHelper.Clamp(0.2f - (j / 680), 0f, 0.2f); - - float time = Main.GameUpdateCount; - float waveScale1 = time * 0.094f; - int scalar = i - (j / 2); - float wave1 = waveScale1 * -50 + scalar * 12; - float wave1angle = 0.30f + 0.25f * MathF.Sin(MathHelper.ToRadians(wave1)); - - drawcolor *= brightness; - - float transparency = 0.02f + (wave1angle / 4); - Color glowColor = Color.White * transparency; - - for (int k = 0; k < 3; k++) - { - //Vector2 offset = new Vector2(Main.rand.NextFloat(-1, 1f), Main.rand.NextFloat(-1, 1f)) * 0.2f * k; - spriteBatch.Draw(GlowMask.Texture, pos + new Vector2(-8 + xOff, -8), frame, glowColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - } - } - } - - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - DrawWallGlow(Type, i, j, spriteBatch); - return false; - } - + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; } } diff --git a/Walls/NavystoneWall.png b/Walls/NavystoneWall.png index 1f7e78021e..5b79d77914 100644 Binary files a/Walls/NavystoneWall.png and b/Walls/NavystoneWall.png differ diff --git a/Walls/NavystoneWall_Glow.png b/Walls/NavystoneWall_Glow.png deleted file mode 100644 index 680f0c9855..0000000000 Binary files a/Walls/NavystoneWall_Glow.png and /dev/null differ diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index 76e7fc6757..87163d9491 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -939,6 +939,17 @@ namespace CalamityMod.World WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType()); } + float horizontalOffsetNoiseWallsinner = CalamityUtils.PerlinNoise2D(X / 80, Y / 80, 5, unchecked(cavePerlinSeedWalls + 1)) * 0.01f; + float cavePerlinValueWallsinner = CalamityUtils.PerlinNoise2D(X / 375f, Y / 375f, 5, cavePerlinSeedWalls) + 0.5f + horizontalOffsetNoiseWallsinner; + float cavePerlinValue2Wallsinner = CalamityUtils.PerlinNoise2D(X / 375f, Y / 375f, 5, unchecked(cavePerlinSeedWalls - 1)) + 0.5f; + float caveNoiseMapWallsinner = (cavePerlinValueWallsinner + cavePerlinValue2Wallsinner) * 0.5f; + float caveCreationThresholdWallsinner = horizontalOffsetNoiseWallsinner * 5.5f + 0.435f; + + if (caveNoiseMapWallsinner * caveNoiseMapWallsinner > caveCreationThresholdWallsinner) + { + WorldGen.PlaceWall(X, Y, ModContent.WallType()); + } + //place walls in the biome using a different "seed" so it differs from the cave generation //this creates a neat effect where walls worm their way through the caverns while leaving openings for the background to show through float horizontalOffsetNoiseWalls = CalamityUtils.PerlinNoise2D(X / 80, Y / 80, 5, unchecked(cavePerlinSeedWalls + 1)) * 0.01f; @@ -952,6 +963,8 @@ namespace CalamityMod.World WorldGen.PlaceWall(X, Y, ModContent.WallType()); } + + Main.tile[X, Y].Get().LiquidType = LiquidID.Water; Main.tile[X, Y].LiquidAmount = byte.MaxValue; }