Clear water, sea prism visuals and some other stuff

This commit is contained in:
Heart-Plus-Up committed 2025-08-18 10:25:26 -07:00
1 parent 72cb172947
commit f903c1730e
35 files changed
+200 -28

No files matched your search

@@ -0,0 +1,31 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Walls;
using CalamityMod.Items.Placeables.SunkenSea;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables.FurnitureBasalt
{
public class BasaltSlab : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 200;
}
public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.FurnitureBasalt.BasaltSlab>());
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<Basalt>(1).
AddTile(TileID.WorkBenches).
DisableDecraft().
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

@@ -4643,3 +4643,8 @@ ShellTrimBrickWall: {
DisplayName: Shell Trim Brick Wall
Tooltip: ""
}
BasaltSlab: {
DisplayName: Basalt Slab
Tooltip: ""
}
+57
View File
@@ -0,0 +1,57 @@
using CalamityMod.Systems;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Tiles.SunkenSea;
namespace CalamityMod.Tiles.FurnitureBasalt
{
public class BasaltSlab : ModTile
{
public override void SetStaticDefaults()
{
TileID.Sets.GeneralPlacementTiles[Type] = false;
TileID.Sets.HasSlopeFrames[Type] = true;
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
Main.tileShine2[Type] = true;
Main.tileBlendAll[Type] = true;
Main.tileLargeFrames[Type] = 1;
CalamityUtils.MergeWithGeneral(Type);
CalamityUtils.MergeWithDesert(Type);
DustType = DustID.Ash;
HitSound = SoundID.Tink;
AddMapEntry(new Color(58, 55, 70));
MinPick = 110;
//Stone merges
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<Runestone>(), "CalamityMod/Tiles/Merges/RunestoneMerge");
//Sand merges
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<VolcanicSand>(), "CalamityMod/Tiles/Merges/VolcanicSandMerge");
this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge");
this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge");
this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge");
//Normal merges
this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge");
this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge");
this.RegisterUniversalMerge(TileID.Ash, "CalamityMod/Tiles/Merges/AshMerge");
this.RegisterUniversalMerge(TileID.Mud, "CalamityMod/Tiles/Merges/MudMerge");
}
public override bool CreateDust(int i, int j, ref int type)
{
Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 1, 0f, 0f, 1, new Color(100, 100, 100), 1f);
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

+1
View File
@@ -15,6 +15,7 @@ namespace CalamityMod.Tiles.SunkenSea
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
Main.tileBlendAll[Type] = true;
CalamityUtils.MergeWithGeneral(Type);
CalamityUtils.MergeWithDesert(Type);
+1
View File
@@ -15,6 +15,7 @@ namespace CalamityMod.Tiles.SunkenSea
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
Main.tileShine2[Type] = false;
Main.tileBlendAll[Type] = true;
CalamityUtils.MergeWithGeneral(Type);
CalamityUtils.MergeWithDesert(Type);
+1
View File
@@ -16,6 +16,7 @@ namespace CalamityMod.Tiles.SunkenSea
Main.tileBlockLight[Type] = true;
TileID.Sets.HasSlopeFrames[Type] = true;
Main.tileBlendAll[Type] = true;
CalamityUtils.MergeWithGeneral(Type);
Main.tileShine[Type] = 3500;
+3 -3
View File
@@ -36,9 +36,9 @@ namespace CalamityMod.Tiles.SunkenSea
{
if (!Main.tile[i - 1, j].HasTile || !Main.tile[i + 1, j].HasTile || !Main.tile[i, j - 1].HasTile || !Main.tile[i, j + 1].HasTile)
{
r = 0.59f;
g = 0.81f;
b = 0.32f;
r = 139f / 255f;
g = 206f / 255f;
b = 56f / 255f;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

+1
View File
@@ -14,6 +14,7 @@ namespace CalamityMod.Tiles.SunkenSea
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
Main.tileBlendAll[Type] = true;
CalamityUtils.MergeWithGeneral(Type);
TileID.Sets.HasSlopeFrames[Type] = true;
+1
View File
@@ -14,6 +14,7 @@ namespace CalamityMod.Tiles.SunkenSea
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
Main.tileBlendAll[Type] = true;
CalamityUtils.MergeWithGeneral(Type);
TileID.Sets.HasSlopeFrames[Type] = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

+47 -13
View File
@@ -10,6 +10,8 @@ using Terraria.Enums;
using Terraria.ObjectData;
using CalamityMod.Items.Weapons.Melee;
using Terraria.GameContent;
using CalamityMod.Systems;
using Microsoft.Xna.Framework.Graphics;
namespace CalamityMod.Tiles.SunkenSea
{
@@ -70,20 +72,52 @@ 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;
float fade1 = GetFade1(i, j);
float fade2 = GetFade2(i, j);
//Blue
Color blue = new Color(202, 236, 238);
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;
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<Texture2D>("CalamityMod/Tiles/SunkenSea/MediumSeaPrismCrystal_Blue").Value;
spriteBatch.Draw(baseTex, position, sourceRect, Lighting.GetColor(i, j) * 1.5f);
Texture2D tex1 = ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/MediumSeaPrismCrystal_Purple").Value;
Texture2D tex2 = ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/MediumSeaPrismCrystal_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 void KillMultiTile(int i, int j, int frameX, int frameY)
{
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

+52 -12
View File
@@ -1,6 +1,7 @@
using System;
using CalamityMod.Systems;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -17,11 +18,11 @@ namespace CalamityMod.Tiles.SunkenSea
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = false;
TileID.Sets.HasSlopeFrames[Type] = true;
Main.tileMerge[Type][ModContent.TileType<MediumSeaPrismCrystal>()] = true;
CalamityUtils.MergeWithGeneral(Type);
CalamityUtils.MergeWithDesert(Type);
Main.tileLighted[Type] = true;
Main.tileShine[Type] = 5000;
Main.tileShine2[Type] = true;
TileID.Sets.ChecksForMerge[Type] = true;
@@ -48,22 +49,61 @@ namespace CalamityMod.Tiles.SunkenSea
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
float brightness = 0.9f;
Color blue = new Color(162, 216, 218);
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;
g = (value.G + value1.G) / 800f;
b = (value.B + value1.B) / 800f;
r *= brightness;
g *= brightness;
b *= brightness;
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;
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame);
}
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 bool PreDraw(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;
int frameX = tile.TileFrameX + (i % 8 * subsheetWidth);
int frameY = tile.TileFrameY + (j % 8 * subsheetHeight);
Rectangle sourceRect = new Rectangle(frameX, frameY, 16, 16);
Texture2D baseTex = ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/SeaPrism_Blue").Value;
spriteBatch.Draw(baseTex, position, sourceRect, Lighting.GetColor(i, j) * 1.5f);
Texture2D tex1 = ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/SeaPrism_Purple").Value;
Texture2D tex2 = ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/SeaPrism_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));
return true;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 KiB

After

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 579 B

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 560 B

After

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 B

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB