navystone sprite and kept old one for wall variety

This commit is contained in:
Heart-Plus-Up committed 2025-09-12 21:09:04 -07:00
1 parent c469a5db95
commit f159eba67b
7 files changed
+35 -61

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

+21
View File
@@ -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;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

+1 -61
View File
@@ -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;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

+13
View File
@@ -939,6 +939,17 @@ namespace CalamityMod.World
WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType<Navystone>());
}
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<NavyslateWall>());
}
//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<NavystoneWall>());
}
Main.tile[X, Y].Get<LiquidData>().LiquidType = LiquidID.Water;
Main.tile[X, Y].LiquidAmount = byte.MaxValue;
}