MOre sunken sea gen and also tiles + merges

This commit is contained in:
Heart-Plus-Up committed 2025-02-21 22:07:41 -07:00
1 parent 213f03cc88
commit a4aaa43b53
43 files changed
+567 -207

No files matched your search

+4 -4
View File
@@ -15,10 +15,10 @@ namespace CalamityMod.Backgrounds
if (Main.dedServ)
return;
SSBG0 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG0");
SSBG1 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG1");
SSBG2 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG2");
SSBG3 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG3");
SSBG0 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
SSBG1 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
SSBG2 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
SSBG3 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
}
public override void FillTextureArray(int[] textureSlots)
@@ -3,7 +3,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables.SunkenSea
{
public class RuneSand : ModItem, ILocalizedModType
public class Dunesand : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
@@ -12,6 +12,6 @@ namespace CalamityMod.Items.Placeables.SunkenSea
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<Shellstone>();
}
public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.SunkenSea.RuneSand>());
public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.SunkenSea.Dunesand>());
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 251 B

+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.Items.Placeables.SunkenSea
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<RuneSand>();
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<Dunesand>();
}
public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.SunkenSea.Shellstone>());
@@ -3565,8 +3565,8 @@ Runestone: {
Tooltip: ""
}
RuneSand: {
DisplayName: Runesand
Dunesand: {
DisplayName: Dunesand
Tooltip: ""
}
+2 -2
View File
@@ -55,8 +55,8 @@ namespace CalamityMod.Systems
public override void TileCountsAvailable(ReadOnlySpan<int> tileCounts)
{
BrimstoneCragTiles = tileCounts[ModContent.TileType<InfernalSuevite>()] + tileCounts[ModContent.TileType<BrimstoneSlag>()];
SunkenSeaTiles = tileCounts[ModContent.TileType<EutrophicSand>()] + tileCounts[ModContent.TileType<HardenedEutrophicSand>()] + tileCounts[ModContent.TileType<Navystone>()] + tileCounts[ModContent.TileType<Limestone>()] + tileCounts[ModContent.TileType<PolypSand>()] + tileCounts[ModContent.TileType<RuneSand>()] + tileCounts[ModContent.TileType<Runestone>()] + tileCounts[ModContent.TileType<Shellstone>()];
SunkenSeaShoresTiles = tileCounts[ModContent.TileType<Runestone>()] + tileCounts[ModContent.TileType<RuneSand>()];
SunkenSeaTiles = tileCounts[ModContent.TileType<EutrophicSand>()] + tileCounts[ModContent.TileType<HardenedEutrophicSand>()] + tileCounts[ModContent.TileType<Navystone>()] + tileCounts[ModContent.TileType<Limestone>()] + tileCounts[ModContent.TileType<PolypSand>()] + tileCounts[ModContent.TileType<Dunesand>()] + tileCounts[ModContent.TileType<Runestone>()] + tileCounts[ModContent.TileType<Shellstone>()];
SunkenSeaShoresTiles = tileCounts[ModContent.TileType<Runestone>()] + tileCounts[ModContent.TileType<Dunesand>()];
SunkenSeaPolypTiles = tileCounts[ModContent.TileType<Limestone>()] + tileCounts[ModContent.TileType<PolypSand>()];
SunkenSeaReefsTiles = tileCounts[ModContent.TileType<Shellstone>()] + tileCounts[ModContent.TileType<EutrophicSand>()] + tileCounts[ModContent.TileType<YellowCoral>()] + tileCounts[ModContent.TileType<OrangeCoral>()] + tileCounts[ModContent.TileType<CyanCoral>()] + tileCounts[ModContent.TileType<LimeCoral>()] + tileCounts[ModContent.TileType<MagentaCoral>()];
SunkenSeaBurrowsTiles = tileCounts[ModContent.TileType<Navystone>()] + tileCounts[ModContent.TileType<HardenedEutrophicSand>()];
+16
View File
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CalamityMod.Systems;
using CalamityMod.Tiles.SunkenSea;
using Terraria.ModLoader;
namespace CalamityMod.Tiles.Merges
{
public sealed class PolypSandMerge : TileBlendTexture
{
public override int TileType => ModContent.TileType<PolypSand>();
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

+17
View File
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CalamityMod.Systems;
using Terraria.ID;
using CalamityMod.Tiles.SunkenSea;
using Terraria.ModLoader;
namespace CalamityMod.Tiles.Merges
{
public sealed class RunestoneMerge : TileBlendTexture
{
public override int TileType => ModContent.TileType<Runestone>();
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

+16
View File
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CalamityMod.Systems;
using CalamityMod.Tiles.SunkenSea;
using Terraria.ModLoader;
namespace CalamityMod.Tiles.Merges
{
public sealed class ScarletSeaGrassTileMerge : TileBlendTexture
{
public override int TileType => ModContent.TileType<ScarletSeaGrassTile>();
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

+16
View File
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CalamityMod.Systems;
using CalamityMod.Tiles.SunkenSea;
using Terraria.ModLoader;
namespace CalamityMod.Tiles.Merges
{
public sealed class ShellstoneMerge : TileBlendTexture
{
public override int TileType => ModContent.TileType<Shellstone>();
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@@ -0,0 +1,136 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace CalamityMod.Tiles.SunkenSea.Ambient
{
public class RefractiveHangingCoral : ModTile
{
public override void SetStaticDefaults()
{
Main.tileCut[Type] = true;
Main.tileSolid[Type] = false;
Main.tileNoFail[Type] = true;
Main.tileNoAttach[Type] = true;
TileID.Sets.IsVine[Type] = true;
TileID.Sets.VineThreads[Type] = true;
AddMapEntry(new Color(136, 206, 215));
DustType = DustID.Grass;
HitSound = SoundID.Grass;
}
public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem)
{
Tile tile = Framing.GetTileSafely(i, j + 1);
if (tile.HasTile && tile.TileType == Type)
{
WorldGen.KillTile(i, j + 1);
}
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
Tile tileAbove = Framing.GetTileSafely(i, j - 1);
int type = -1;
if (tileAbove.HasTile && !tileAbove.BottomSlope)
{
type = tileAbove.TileType;
}
if (type == ModContent.TileType<Shellstone>() || type == Type)
{
return true;
}
WorldGen.KillTile(i, j);
return true;
}
public override void NearbyEffects(int i, int j, bool closer)
{
// Baby blue
if (closer && Main.rand.NextBool(1200))
{
Dust dust;
dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, DustID.Firefly, 0.23255825f, 10f, 0, new Color(106, 154, 238), 1.5f)];
dust.noGravity = true;
dust.noLight = true;
dust.fadeIn = 2.5813954f;
}
// Light Cyan
if (closer && Main.rand.NextBool(1200))
{
Dust dust;
dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, DustID.Firefly, 0.23255825f, 10f, 0, new Color(136, 206, 215), 1.7f)];
dust.noGravity = true;
dust.noLight = true;
dust.fadeIn = 2.5813954f;
}
//Mint Green
if (closer && Main.rand.NextBool(1200))
{
Dust dust;
dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, DustID.Firefly, 0.23255825f, 10f, 0, new Color(163, 252, 195), 1.4f)];
dust.noGravity = true;
dust.noLight = true;
dust.fadeIn = 2.5813954f;
}
//Lilac
if (closer && Main.rand.NextBool(1200))
{
Dust dust;
dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, DustID.Firefly, 0.23255825f, 10f, 0, new Color(236, 194, 252), 1.6f)];
dust.noGravity = true;
dust.noLight = true;
dust.fadeIn = 2.5813954f;
}
//Dim Lilac
if (closer && Main.rand.NextBool(1200))
{
Dust dust;
dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, DustID.Firefly, 0.23255825f, 10f, 0, new Color(192, 170, 233), 1.3f)];
dust.noGravity = true;
dust.noLight = true;
dust.fadeIn = 2.5813954f;
}
}
public override void RandomUpdate(int i, int j)
{
Tile tileBelow = Framing.GetTileSafely(i, j + 1);
if (WorldGen.genRand.NextBool(5) && !tileBelow.HasTile && tileBelow.LiquidType != LiquidID.Lava)
{
bool PlaceVine = false;
int Test = j;
while (Test > j - 10)
{
Tile testTile = Framing.GetTileSafely(i, Test);
if (testTile.BottomSlope)
{
break;
}
else if (!testTile.HasTile || testTile.TileType != ModContent.TileType<Shellstone>())
{
Test--;
continue;
}
PlaceVine = true;
break;
}
if (PlaceVine)
{
tileBelow.TileType = Type;
tileBelow.HasTile = true;
WorldGen.SquareTileFrame(i, j + 1, true);
if (Main.dedServ)
{
NetMessage.SendTileSquare(-1, i, j + 1, 3, TileChangeType.None);
}
}
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

+10 -7
View File
@@ -34,11 +34,19 @@ namespace CalamityMod.Tiles.SunkenSea
MinPick = 100;
// 02JUN2024: Ozzatron: RuneSand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<RuneSand>(), out tileAdjacency);
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<Runestone>(), "CalamityMod/Tiles/Merges/RunestoneMerge");
this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge");
this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge");
this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge");
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.Ash, "CalamityMod/Tiles/Merges/MudMerge");
}
public override bool CreateDust(int i, int j, ref int type)
@@ -53,10 +61,5 @@ namespace CalamityMod.Tiles.SunkenSea
frameYOffset = j % 4 * sheetHeight;
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
// 02JUN2024: Ozzatron: unclear if this is the correct framing strategy for Basalt
return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame);
}
}
}
+9 -5
View File
@@ -26,13 +26,17 @@ namespace CalamityMod.Tiles.SunkenSea
TileID.Sets.CanBeDugByShovel[Type] = true;
// 02JUN2024: Ozzatron: RuneSand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<RuneSand>(), out tileAdjacency);
// 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<Shellstone>(), out secondTileAdjacency);
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<Runestone>(), "CalamityMod/Tiles/Merges/RunestoneMerge");
this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge");
this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge");
this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge");
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.Ash, "CalamityMod/Tiles/Merges/MudMerge");
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
+1 -5
View File
@@ -32,11 +32,7 @@ namespace CalamityMod.Tiles.SunkenSea
TileID.Sets.CanBeDugByShovel[Type] = true;
// 02JUN2024: Ozzatron: RuneSand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<RuneSand>(), out tileAdjacency);
// 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<Shellstone>(), out secondTileAdjacency);
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
}
+2 -2
View File
@@ -26,8 +26,8 @@ namespace CalamityMod.Tiles.SunkenSea
DustType = 121;
AddMapEntry(new Color(136, 129, 154));
// 02JUN2024: Ozzatron: RuneSand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<RuneSand>(), out tileAdjacency);
// 02JUN2024: Ozzatron: Dunesand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<Dunesand>(), out tileAdjacency);
// 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<Shellstone>(), out secondTileAdjacency);
@@ -6,7 +6,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Tiles.SunkenSea
{
public class RuneSand : ModTile
public class Dunesand : ModTile
{
public override void SetStaticDefaults()
{
File renamed without changes.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

+3 -1
View File
@@ -27,7 +27,6 @@ namespace CalamityMod.Tiles.SunkenSea
CalamityUtils.MergeWithDesert(Type); // Tile blends with sandstone, which it is set to merge with here
Main.tileShine[Type] = 1800;
Main.tileShine2[Type] = true;
TileID.Sets.ChecksForMerge[Type] = true;
TileID.Sets.CanBeDugByShovel[Type] = true;
@@ -35,6 +34,9 @@ namespace CalamityMod.Tiles.SunkenSea
DustType = 108;
AddMapEntry(new Color(158, 203, 234));
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge");
this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge");
this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge");
+1 -5
View File
@@ -27,11 +27,7 @@ namespace CalamityMod.Tiles.SunkenSea
TileID.Sets.CanBeDugByShovel[Type] = true;
// 02JUN2024: Ozzatron: RuneSand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<RuneSand>(), out tileAdjacency);
// 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<Shellstone>(), out secondTileAdjacency);
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
}
+4 -5
View File
@@ -1,4 +1,5 @@
using CalamityMod.Systems;
using CalamityMod.Tiles.Merges;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -22,11 +23,9 @@ namespace CalamityMod.Tiles.SunkenSea
DustType = 22;
AddMapEntry(new Color(154, 119, 119));
// 02JUN2024: Ozzatron: RuneSand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<RuneSand>(), out tileAdjacency);
// 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<Shellstone>(), out secondTileAdjacency);
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<ScarletSeaGrassTile>(), "CalamityMod/Tiles/Merges/ScarletSeaGrassTile");
this.RegisterUniversalMerge(ModContent.TileType<PolypSand>(), "CalamityMod/Tiles/Merges/PolypSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
}
+1 -5
View File
@@ -32,11 +32,7 @@ namespace CalamityMod.Tiles.SunkenSea
TileID.Sets.CanBeDugByShovel[Type] = true;
// 02JUN2024: Ozzatron: RuneSand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<RuneSand>(), out tileAdjacency);
// 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<Shellstone>(), out secondTileAdjacency);
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
}
+1 -1
View File
@@ -24,7 +24,7 @@ namespace CalamityMod.Tiles.SunkenSea
AddMapEntry(new Color(17, 53, 77));
HitSound = SoundID.Tink;
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge");
this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge");
this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge");
+1 -5
View File
@@ -27,11 +27,7 @@ namespace CalamityMod.Tiles.SunkenSea
TileID.Sets.CanBeDugByShovel[Type] = true;
// 02JUN2024: Ozzatron: RuneSand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<RuneSand>(), out tileAdjacency);
// 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<Shellstone>(), out secondTileAdjacency);
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
}
+9 -5
View File
@@ -26,13 +26,17 @@ namespace CalamityMod.Tiles.SunkenSea
TileID.Sets.CanBeDugByShovel[Type] = true;
// 02JUN2024: Ozzatron: RuneSand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<RuneSand>(), out tileAdjacency);
// 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<Shellstone>(), out secondTileAdjacency);
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<Runestone>(), "CalamityMod/Tiles/Merges/RunestoneMerge");
this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge");
this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge");
this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge");
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.Ash, "CalamityMod/Tiles/Merges/MudMerge");
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
+1
View File
@@ -33,6 +33,7 @@ namespace CalamityMod.Tiles.SunkenSea
DustType = 147;
AddMapEntry(new Color(221, 180, 182));
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge");
this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge");
this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge");
+1 -4
View File
@@ -27,10 +27,7 @@ namespace CalamityMod.Tiles.SunkenSea
TileID.Sets.CanBeDugByShovel[Type] = true;
// 02JUN2024: Ozzatron: RuneSand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<RuneSand>(), out tileAdjacency);
// 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<Shellstone>(), out secondTileAdjacency);
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge");
this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge");
this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge");
+1
View File
@@ -34,6 +34,7 @@ namespace CalamityMod.Tiles.SunkenSea
DustType = 147;
AddMapEntry(new Color(187, 43, 44));
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge");
this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge");
this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge");
+1
View File
@@ -32,6 +32,7 @@ namespace CalamityMod.Tiles.SunkenSea
MinPick = 55;
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
}
public override void NumDust(int i, int j, bool fail, ref int num)
+21 -6
View File
@@ -1,4 +1,5 @@
using CalamityMod.Systems;
using CalamityMod.Tiles.SunkenSea.Ambient;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -24,18 +25,32 @@ namespace CalamityMod.Tiles.SunkenSea
DustType = 17;
AddMapEntry(new Color(113, 117, 160));
// 02JUN2024: Ozzatron: RuneSand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<RuneSand>(), out tileAdjacency);
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge");
this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge");
this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge");
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame);
}
public override void RandomUpdate(int i, int j)
{
Tile Tile = Framing.GetTileSafely(i, j);
Tile Below = Framing.GetTileSafely(i, j + 1);
Tile Above = Framing.GetTileSafely(i, j - 1);
if (!Below.HasTile && Below.LiquidType <= 0 && !Tile.BottomSlope)
{
if (Main.rand.NextBool(10))
{
Below.TileType = (ushort)ModContent.TileType<RefractiveHangingCoral>();
Below.HasTile = true;
WorldGen.SquareTileFrame(i, j + 1, true);
if (Main.dedServ)
{
NetMessage.SendTileSquare(-1, i, j + 1, 3, TileChangeType.None);
}
}
}
}
}
}
+4
View File
@@ -19,6 +19,10 @@ namespace CalamityMod.Tiles.SunkenSea
HitSound = SoundID.Tink;
DustType = 17;
AddMapEntry(new Color(156, 191, 199));
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<Runestone>(), "CalamityMod/Tiles/Merges/RunestoneMerge");
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
+11 -2
View File
@@ -27,13 +27,22 @@ namespace CalamityMod.Tiles.SunkenSea
TileID.Sets.CanBeDugByShovel[Type] = true;
// 02JUN2024: Ozzatron: RuneSand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<RuneSand>(), out tileAdjacency);
// 02JUN2024: Ozzatron: Dunesand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<Dunesand>(), out tileAdjacency);
// 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<Shellstone>(), out secondTileAdjacency);
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<Runestone>(), "CalamityMod/Tiles/Merges/RunestoneMerge");
this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge");
this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge");
this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge");
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.Ash, "CalamityMod/Tiles/Merges/MudMerge");
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
+1 -5
View File
@@ -27,11 +27,7 @@ namespace CalamityMod.Tiles.SunkenSea
TileID.Sets.CanBeDugByShovel[Type] = true;
// 02JUN2024: Ozzatron: RuneSand has no merge
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<RuneSand>(), out tileAdjacency);
// 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined
// TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<Shellstone>(), out secondTileAdjacency);
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
this.RegisterUniversalMerge(ModContent.TileType<Navystone>(), "CalamityMod/Tiles/Merges/NavystoneMerge");
}
+2 -2
View File
@@ -443,7 +443,7 @@ namespace CalamityMod
TileType<BlackPearlPile>(),
TileType<WhitePearlPile>(),
TileType<Shellstone>(),
TileType<RuneSand>(),
TileType<Dunesand>(),
TileType<Navystone>(),
TileType<EutrophicSand>(),
TileType<SulphurousShale>(),
@@ -523,7 +523,7 @@ namespace CalamityMod
TileType<WhitePearlPile>(),
TileType<Shellstone>(),
TileType<Runestone>(),
TileType<RuneSand>(),
TileType<Dunesand>(),
TileType<EutrophicSand>(),
TileType<Navystone>(),
TileType<SeaPrism>(),
Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 KiB

After

Width:  |  Height:  |  Size: 398 KiB

+2 -2
View File
@@ -26,8 +26,8 @@ namespace CalamityMod.Walls
WallID.Sets.Conversion.Grass[Type] = true;
AddMapEntry(new Color(104, 24, 24));
this.AddMapEntryWithWaterVisibility(new Color(87, 20, 38));
AddMapEntry(new Color(103, 24, 24));
this.AddMapEntryWithWaterVisibility(new Color(89, 49, 108));
if (!Main.dedServ)
{
leafTexture = ModContent.Request<Texture2D>("CalamityMod/Walls/ScarletSeaGrassWall_Leaves");
Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

+267 -128
View File
@@ -9,6 +9,7 @@ using Microsoft.Xna.Framework;
using ReLogic.Threading;
using ReLogic.Utilities;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.WorldBuilding;
@@ -30,15 +31,14 @@ namespace CalamityMod.World
/*
ena todo
fix the fucking forest being shaved
fix the fucking forest being shaved (done - HPU)
cut a half oval out of the top of forest in anticipation of structure placement
change the type of noise both reefs and forest use (reefs more jagged, forest more flat)
cut a curve out of the top of shores (the desert part)
change the type of noise both reefs and forest use (reefs more jagged, forest more flat) (done - HPU)
cut a curve out of the top of shores (the desert part) (done - HPU)
extend basalt to hell - DONE
convert normal terrain blocks below basalt into basalt
convert normal terrain blocks below basalt into basalt (maybe??? - HPU)
BLOTCHES EVERYWHERE
*/
public static void NormalForLoop(int fromInclusive, int toExclusive, int step, Action<int> action)
{
for (int i = fromInclusive; i < toExclusive; i += step)
@@ -81,7 +81,7 @@ namespace CalamityMod.World
//
// Places a trapezoid of circles to serve as the main area for the biome.
//
const float steepness = 15f;
const float steepness = 25f;
static float trapezoidLateralSteep(float x)
{
if (x <= 1f / steepness)
@@ -91,14 +91,14 @@ namespace CalamityMod.World
else
return -steepness * x + steepness;
}
ForLoop.Invoke(startPosX - biomeSize - 20, startPosX + biomeSize + 20, 15, (X) =>
ForLoop.Invoke(startPosX - biomeSize - 5, startPosX + biomeSize + 20, 15, (X) =>
{
float height = MathHelper.Lerp(
startPosY + 35, //top
startPosY - 15, //bottom
trapezoidLateralSteep(Utils.GetLerpValue(startPosX - biomeSize - 20, startPosX + biomeSize + 20, X)));
for (int Y = startPosY + 50; Y >= height; Y -= 10)
for (int Y = startPosY + 25; Y >= height; Y -= 10)
{
ShapeData circle = new ShapeData();
WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(30), Actions.Chain(new GenAction[]
@@ -114,14 +114,14 @@ namespace CalamityMod.World
// Makes the bottom borders of the Timeless Shores curved downwards.
//
const int totalCuveDepth = 90;
ForLoop.Invoke(startPosX - biomeSize - 20, startPosX - biomeSize + 200, 10, (x) =>
ForLoop.Invoke(startPosX - biomeSize - 10, startPosX - biomeSize + 200, 10, (x) =>
{
int curveDepth = (int)MathHelper.Lerp(
totalCuveDepth,
0f,
MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 17, startPosX - biomeSize + 200, x, true)));
for (int y = startPosY + 25; y <= startPosY + 50 + curveDepth; y += 5)
for (int y = startPosY + 50; y <= startPosY + 70 + curveDepth; y += 5)
{
ShapeData circle = new();
WorldUtils.Gen(new Point(x, y), new Shapes.Slime(30), Actions.Chain(new GenAction[]
@@ -132,14 +132,14 @@ namespace CalamityMod.World
WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), new Actions.SetTile((ushort)ModContent.TileType<Runestone>()));
}
});
ForLoop.Invoke(startPosX + biomeSize - 200, startPosX + biomeSize + 20, 5, (x) =>
ForLoop.Invoke(startPosX + biomeSize - 200, startPosX + biomeSize + 10, 5, (x) =>
{
int curveDepth = (int)MathHelper.Lerp(
totalCuveDepth,
0f,
MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 20, startPosX + biomeSize - 200, x, true)));
for (int y = startPosY + 50; y <= startPosY + 50 + curveDepth; y += 5)
for (int y = startPosY + 50; y <= startPosY + 70 + curveDepth; y += 5)
{
ShapeData circle = new();
WorldUtils.Gen(new Point(x, y), new Shapes.Slime(30), Actions.Chain(new GenAction[]
@@ -153,7 +153,7 @@ namespace CalamityMod.World
//clear a smaller square out of the center where the biomes stuff will be
//Added curves to the top of the biome via curve depth -hpu 02/19/25
ForLoop.Invoke(startPosX - biomeSize + 35, startPosX + biomeSize - 35, 1, (X) =>
ForLoop.Invoke(startPosX - biomeSize + 10, startPosX + biomeSize - 10, 1, (X) =>
{
int curveDepth = (int)MathHelper.Lerp(
totalCuveDepth,
@@ -183,26 +183,29 @@ namespace CalamityMod.World
//
// Places slopes at the sides of the shores to actually make shores.
//
ForLoop.Invoke(startPosX - biomeSize + 20, startPosX - biomeSize + 200, 20, (moundX) =>
ForLoop.Invoke(startPosX - biomeSize - 15, startPosX - biomeSize + 200, 20, (moundX) =>
{
int RandomX = Main.rand.Next(15, 20);
ShapeData mound = new();
GenAction blotchMod = new Modifiers.Blotches().Output(mound);
int moundY = startPosY + 60;
int moundY = startPosY + 75;
int moundHeight = (int)MathHelper.Lerp(60f, 5f, MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize + 27, startPosX - biomeSize + 200, moundX)));
WorldUtils.Gen(new Point(moundX, moundY), new Shapes.Mound(30, moundHeight), blotchMod);
WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.SetTile((ushort)ModContent.TileType<Runestone>()));
WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.SetTile((ushort)ModContent.TileType<Runestone>()));
WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.PlaceWall((ushort)ModContent.WallType<RunestoneWall>()));
});
ForLoop.Invoke(startPosX + biomeSize - 200, startPosX + biomeSize - 20, 20, (moundX) =>
ForLoop.Invoke(startPosX + biomeSize - 200, startPosX + biomeSize - 15, 20, (moundX) =>
{
ShapeData mound = new();
GenAction blotchMod = new Modifiers.Blotches().Output(mound);
int moundY = startPosY + 60;
int moundY = startPosY + 75;
int moundHeight = (int)MathHelper.Lerp(60f, 5f, MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize - 27, startPosX + biomeSize - 200, moundX)));
WorldUtils.Gen(new Point(moundX, moundY), new Shapes.Mound(30, moundHeight), blotchMod);
WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.SetTile((ushort)ModContent.TileType<Runestone>()));
});
//
// Makes a large platform in the middle of the Timeless Shores.
@@ -219,7 +222,7 @@ namespace CalamityMod.World
{
WorldUtils.Gen(new Point(platformX, platformY), new Shapes.Circle(5), Actions.Chain(new GenAction[]
{
new Actions.Clear(), // Clears all tiles and walls.
new Actions.ClearTile(), // Clears all tiles
new Actions.PlaceTile((ushort)ModContent.TileType<Runestone>()) // Places tiles.
}));
}
@@ -229,44 +232,76 @@ namespace CalamityMod.World
float interpolator = CalamityUtils.Convert01To010(Utils.GetLerpValue(startPosX - platformSize / 2, startPosX + platformSize / 2, x, true));
int elevation = (int)MathHelper.Lerp(4f, 1f, interpolator);
WorldUtils.Gen(new Point(x, startPosY + platformHeight - 7), new Shapes.Circle(elevation), Actions.Chain(new GenAction[] { new Actions.Clear(), }));
});
const int furthestDistanceFromCenter = 100;
const int shortestDistanceFromCenter = 60;
const int holeStart = 10;
const int holeDepth = 80;
// Platu
ForLoop.Invoke(startPosX - biomeSize, startPosX + biomeSize, 100, (wallPillarX) =>
{
int randomDisplacement = WorldGen.genRand.Next(-27, 46);
int RandomX = Main.rand.Next(15, 20);
int RandomH = Main.rand.Next(20, 35);
for (int wallPillarY = startPosY + RandomH; wallPillarY <= startPosY + 60; wallPillarY += 10)
{
// Along the height of the pillar, it becomes shorter the more closer to the center we get.
int pillarWidth = (int)(CalamityUtils.Convert01To010(Utils.GetLerpValue(startPosY - RandomH, startPosY + 45, wallPillarY)) * 25);
ShapeData rectangle = new ShapeData();
GenAction blotchFilter = new Modifiers.Blotches(1, 0.4);
GenAction ditherFilter = new Modifiers.Dither(Math.Min(Utils.GetLerpValue(startPosY + 30, startPosY + 70, wallPillarY) + 0.25, 1));
WorldUtils.Gen(new Point(randomDisplacement + wallPillarX + pillarWidth / 2, wallPillarY), new Shapes.Circle(RandomX - pillarWidth + 3, RandomX), Actions.Chain(new GenAction[]
{
blotchFilter.Output(rectangle), // Applies a blotch filter to the rectangle.
}));
WorldUtils.Gen(new Point(randomDisplacement + wallPillarX + pillarWidth / 4, wallPillarY), new ModShapes.All(rectangle), Actions.Chain(new GenAction[]
{
new Actions.SetTile((ushort)ModContent.TileType<Runestone>())
}))
;
}
});
//
// Makes a hole into the actual Sunken Sea at the botoom-left and bottom-right of the middle platform of the Timeless Shores.
//
const int furthestDistanceFromCenter = 55;
const int shortestDistanceFromCenter = 35;
const int holeStart = 50;
const int holeDepth = 32;
//Makes a hole into the actual Sunken Sea at the bottom - left and bottom-right of the middle platform of the Timeless Shores.
ForLoop.Invoke(startPosX - furthestDistanceFromCenter, startPosX - shortestDistanceFromCenter, 1, (holeX) =>
{
for (int holeY = startPosY + holeStart; holeY <= startPosY + holeStart + holeDepth; holeY += 3)
for (int holeY = startPosY + holeStart; holeY <= startPosY + holeDepth; holeY += 1)
{
ShapeData circle = new();
ShapeData circle = new ShapeData();
GenAction blotchFilter = new Modifiers.Blotches(6, 1.9);
// As the hole gets deeper, we want the holes to be bigger and more blurry, so it's not so monotonous.
int sizeIncrement = (int)Utils.Remap(holeY, startPosY + holeStart, startPosY + holeStart + holeDepth, 1, 5);
//WorldUtils.Gen(new Point(holeX, holeY), new Shapes.Circle(2, 3), Actions.Chain(new GenAction[]
//{
// blotchFilter.Output(circle), // Applies a blotch filter to the rectangle.
//}));
// may or may not be useful later
//GenAction dither = new Modifiers.RadialDither(2 * sizeIncrement, 5 * sizeIncrement);
WorldUtils.Gen(new Point(holeX, holeY), new Shapes.Tail(sizeIncrement, new Vector2D(6,20)), Actions.Chain(new GenAction[]
WorldUtils.Gen(new Point(holeX / 2, holeY / 2), new Shapes.Circle(2, 3), Actions.Chain(new GenAction[]
{
new Actions.ClearTile(), // The shape removes tiles.
new Actions.SetLiquid() // The shape adds liquid (Default to max water).
}));
}
});
ForLoop.Invoke(startPosX + shortestDistanceFromCenter, startPosX + furthestDistanceFromCenter, 1, (holeX) =>
ForLoop.Invoke(startPosX - furthestDistanceFromCenter, startPosX + furthestDistanceFromCenter, 1, (holeX) =>
{
for (int holeY = startPosY + holeStart; holeY <= startPosY + holeStart + holeDepth; holeY += 3)
for (int holeY = startPosY + holeStart; holeY <= startPosY + holeDepth; holeY += 1)
{
ShapeData circle = new();
ShapeData circle = new ShapeData();
GenAction blotchFilter = new Modifiers.Blotches(6, 1.9);
// As the hole gets deeper, we want the holes to be bigger and more blurry, so it's not so monotonous.
int sizeIncrement = (int)Utils.Remap(holeY, startPosY + holeStart, startPosY + holeStart + holeDepth, 1, 20);
//WorldUtils.Gen(new Point(holeX, holeY), new Shapes.Circle(2, 3), Actions.Chain(new GenAction[]
//{
// blotchFilter.Output(circle), // Applies a blotch filter to the rectangle.
//}));
WorldUtils.Gen(new Point(holeX, holeY), new Shapes.Tail(sizeIncrement, new Vector2D(6, 20)), Actions.Chain(new GenAction[]
WorldUtils.Gen(new Point(holeX / 2, holeY / 2), new Shapes.Circle(2, 3), Actions.Chain(new GenAction[]
{
new Actions.ClearTile(), // The shape removes tiles.
new Actions.SetLiquid() // The shape adds liquid (Default to max water).
@@ -283,35 +318,15 @@ namespace CalamityMod.World
Main.tile[WaterX, WaterY].LiquidAmount = byte.MaxValue;
}
});
//place layer of sand on valid runestone blocks
ForLoop.Invoke(startPosX - biomeSize, startPosX + biomeSize, 1, (X) =>
{
for (int Y = startPosY - 50; Y <= startPosY + 50; Y++)
{
bool canPlaceSand = false;
if (Main.tile[X, Y].TileType == ModContent.TileType<Runestone>() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile &&
!Main.tile[X, Y - 3].HasTile && !Main.tile[X, Y - 4].HasTile && !Main.tile[X, Y - 5].HasTile)
{
canPlaceSand = true;
}
if (canPlaceSand)
{
PlaceSand(X, Y, 5, ModContent.TileType<RuneSand>());
}
}
});
//
// Generates pillars made out of walls at random points in the Timeless Shores.
//
ForLoop.Invoke(startPosX - biomeSize, startPosX + biomeSize, 100, (wallPillarX) =>
ForLoop.Invoke(startPosX - (biomeSize / 2) - furthestDistanceFromCenter, startPosX + (biomeSize / 2) + furthestDistanceFromCenter, 100, (wallPillarX) =>
{
int randomDisplacementX = WorldGen.genRand.Next(-40, 80);
int randomDisplacementX = WorldGen.genRand.Next(-10, 10);
int RandomX = Main.rand.Next(3, 6);
for (int wallPillarY = startPosY - 75; wallPillarY <= startPosY + 120; wallPillarY += 10)
for (int wallPillarY = startPosY - 75; wallPillarY <= startPosY + 80; wallPillarY += 10)
{
// Along the height of the pillar, it becomes shorter the more closer to the center we get.
int pillarWidth = (int)(CalamityUtils.Convert01To010(Utils.GetLerpValue(startPosY - 75, startPosY + 50, wallPillarY)) * 25);
@@ -329,7 +344,8 @@ namespace CalamityMod.World
WorldUtils.Gen(new Point(randomDisplacementX + wallPillarX + pillarWidth / 2, wallPillarY), new ModShapes.All(rectangle), Actions.Chain(new GenAction[]
{
new Actions.PlaceWall((ushort)ModContent.WallType<RunestoneWall>()) // The shape places walls.
}));
}))
;
}
});
@@ -357,7 +373,7 @@ namespace CalamityMod.World
new Modifiers.OnlyTiles(TileID.Sand, TileID.HardenedSand),
new Modifiers.Dither(ditherStrength + 0f),
new Actions.ClearTile(),
new Actions.PlaceTile((ushort)ModContent.TileType<RuneSand>()),
new Actions.PlaceTile((ushort)ModContent.TileType<Dunesand>()),
}));
// changing these makes the walls dither higher up than tiles, to prevent the biome from changing earlier than expected. still looks nice imo :)
interpolator = Utils.GetLerpValue(startPosY - 90, startPosY - 200, y, true);
@@ -381,6 +397,15 @@ namespace CalamityMod.World
new Actions.ClearTile(),
new Actions.PlaceTile((ushort)ModContent.TileType<Runestone>()),
}));
interpolator = Utils.GetLerpValue(startPosY - 90, startPosY - 150, y, true);
ditherStrength = MathHelper.Lerp(0f, 0f, interpolator);
WorldUtils.Gen(new Point(x, y + curveDepth + curveDepth2), new Shapes.Circle(15), Actions.Chain(new GenAction[]
{
new Modifiers.OnlyTiles((ushort)ModContent.TileType<Basalt>()),
new Modifiers.Dither(ditherStrength),
new Actions.ClearTile(),
new Actions.PlaceTile((ushort)ModContent.TileType<Runestone>()),
}));
if (Main.tile[x, y].Get<LiquidData>().LiquidType == LiquidID.Lava)
WorldUtils.Gen(new Point(x, y), new Shapes.Rectangle(5, 5), new Actions.SetLiquid(LiquidID.Lava, 0));
@@ -394,6 +419,64 @@ namespace CalamityMod.World
}));
}
}
//place layer of sand on valid runestone blocks
ForLoop.Invoke(startPosX - biomeSize, startPosX + biomeSize, 1, (X) =>
{
for (int Y = startPosY - 100; Y <= startPosY + 100; Y++)
{
bool canPlaceSand = false;
if (Main.tile[X, Y].TileType == ModContent.TileType<Runestone>() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile &&
!Main.tile[X, Y - 3].HasTile && !Main.tile[X, Y - 4].HasTile && !Main.tile[X, Y - 5].HasTile)
{
canPlaceSand = true;
}
if (canPlaceSand)
{
PlaceSand(X, Y, 5, ModContent.TileType<Dunesand>());
}
//clean tiles that are sticking out (aka tiles only attached to one tile on one side)
bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile;
bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile;
bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile;
bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile;
if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp)
{
WorldGen.KillTile(X, Y);
}
//kill random single floating tiles
if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile)
{
WorldGen.KillTile(X, Y);
}
//Timeless Shores ambiant tiles
if (Main.tile[X, Y].TileType == ModContent.TileType<Dunesand>())
{
//Driftwood Ambiance
if (WorldGen.genRand.NextBool(150))
{
ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType<DriftwoodAmbient1>(), (ushort)ModContent.TileType<DriftwoodAmbient2>(), (ushort)ModContent.TileType<DriftwoodAmbient3>(), (ushort)ModContent.TileType<DriftwoodAmbient4>(), (ushort)ModContent.TileType<DriftwoodAmbient5>(), (ushort)ModContent.TileType<DriftwoodAmbient6>() };
WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(DriftwoodPiles));
}
}
if (Main.tile[X, Y].TileType == ModContent.TileType<Runestone>())
{
//Driftwood Ambiance
if (WorldGen.genRand.NextBool(150))
{
ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType<DriftwoodAmbient1>(), (ushort)ModContent.TileType<DriftwoodAmbient2>(), (ushort)ModContent.TileType<DriftwoodAmbient3>(), (ushort)ModContent.TileType<DriftwoodAmbient4>(), (ushort)ModContent.TileType<DriftwoodAmbient5>(), (ushort)ModContent.TileType<DriftwoodAmbient6>() };
WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(DriftwoodPiles));
}
}
}
});
//slope tiles
@@ -486,7 +569,7 @@ namespace CalamityMod.World
}
}
});
bool runonce = false;
bool runonce = false; // this is used to make the wall on the left side go boom on the second run
//generate the actual caverns
for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++)
{
@@ -654,7 +737,7 @@ namespace CalamityMod.World
int cavePerlinSeed = WorldGen.genRand.Next();
int cavePerlinSeedWalls = WorldGen.genRand.Next();
Point origin = new Point(startPosX, startPosY);
Point origin = new Point(startPosX, startPosY - 200);
Vector2 center = origin.ToVector2() * 16f + new Vector2(8f);
float angle = MathHelper.Pi * 0.15f;
@@ -674,9 +757,10 @@ namespace CalamityMod.World
//place the polyp forest caverns
for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++)
{
for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++)
for (int Y = (int)(origin.Y + verticalRadius * 0.4f) + 3; Y >= origin.Y - verticalRadius - 3; Y--)
{
if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, false, Y > origin.Y))
// Modify this part so that the generation happens from bottom to top
if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, false, Y < origin.Y))
{
float percent = dist / constant;
float blurPercent = 0.98f;
@@ -684,10 +768,11 @@ namespace CalamityMod.World
//biome "blending" on the edges (disabled for now)
if (percent > blurPercent)
{
if (Main.tile[X, Y].HasTile && Main.tile[X, Y].TileType != ModContent.TileType<Limestone>())
{
ShapeData circle = new ShapeData();
GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
GenAction blotchMod = new Modifiers.Blotches(4, 0.7);
WorldUtils.Gen(new Point(X, Y), new Shapes.Slime(WorldGen.genRand.Next(1, 3)), Actions.Chain(new GenAction[]
{
blotchMod.Output(circle)
@@ -898,7 +983,7 @@ namespace CalamityMod.World
ShapeData circle = new ShapeData();
GenAction blotchMod = new Modifiers.Blotches(10, 0.4);
WorldUtils.Gen(new Point(X, Y + 5), new Shapes.Slime(20), Actions.Chain(new GenAction[]
WorldUtils.Gen(new Point(X, Y + 5), new Shapes.Rectangle(10, 10), Actions.Chain(new GenAction[]
{
blotchMod.Output(circle)
}));
@@ -1085,49 +1170,73 @@ namespace CalamityMod.World
//basalt biome underneath the sunken sea
public static void PlaceBasaltGully(int startPosX, int startPosY)
{
int biomeSize = 200 + (Main.maxTilesX / 180);
int biomeSize = 250 + (Main.maxTilesX / 180);
int XLeft = GenVars.UndergroundDesertLocation.Left + 40;
int XRight = GenVars.UndergroundDesertLocation.Right - 70;
int XLeft = GenVars.UndergroundDesertLocation.Left + 53;
int XRight = GenVars.UndergroundDesertLocation.Right - 53;
//place circles of basalt along the 2 edges of the area
for (int Y = startPosY - 120; Y <= Main.maxTilesY - 230; Y += 20)
{
ShapeData circle = new ShapeData();
GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
//for (int Y = startPosY - 50; Y <= Main.maxTilesY - 200; Y += 20)
//{
// ShapeData circle = new ShapeData();
// GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
int radius = WorldGen.genRand.Next(30, 45);
int RandomX = Main.rand.Next(-25, 25);
// int radius = WorldGen.genRand.Next(30, 45);
// int RandomX = Main.rand.Next(-25, 25);
WorldUtils.Gen(new Point(XLeft, Y), new Shapes.Slime(radius), Actions.Chain(new GenAction[]
{
blotchMod.Output(circle)
}));
// WorldUtils.Gen(new Point(XLeft, Y), new Shapes.Rectangle(radius, (radius)), Actions.Chain(new GenAction[]
// {
// blotchMod.Output(circle)
// }));
WorldUtils.Gen(new Point(XLeft, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[]
{
new Actions.Clear(),
new Actions.PlaceTile((ushort)ModContent.TileType<Basalt>()),
new Actions.PlaceWall(WallID.LavaUnsafe1)
}));
// WorldUtils.Gen(new Point(XLeft, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[]
// {
// new Actions.Clear(),
// new Actions.PlaceTile((ushort)ModContent.TileType<Basalt>()),
// new Actions.PlaceWall(WallID.LavaUnsafe1)
// }));
WorldUtils.Gen(new Point(XRight, Y), new Shapes.Slime(radius), Actions.Chain(new GenAction[]
{
blotchMod.Output(circle)
}));
// WorldUtils.Gen(new Point(XRight, Y), new Shapes.Rectangle(radius, (radius)), Actions.Chain(new GenAction[]
// {
// blotchMod.Output(circle)
// }));
WorldUtils.Gen(new Point(XRight, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[]
{
new Actions.Clear(),
new Actions.PlaceTile((ushort)ModContent.TileType<Basalt>()),
new Actions.PlaceWall(WallID.LavaUnsafe1)
}));
}
// WorldUtils.Gen(new Point(XRight, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[]
// {
// new Actions.Clear(),
// new Actions.PlaceTile((ushort)ModContent.TileType<Basalt>()),
// new Actions.PlaceWall(WallID.LavaUnsafe1)
// }));
//}
//place blocks of basalt all the way down to hell, here it just places one block and wall so it doesnt hurt preformance
ForLoop.Invoke(startPosX - biomeSize - 25, startPosX + biomeSize + 25, 1, (X) =>
{
for (int Y = startPosY - 30; Y <= Main.maxTilesY - 250; Y++)
//const int totalCuveDepth = -120;
//const int totalCuveDepth2 = 120;
int basaltbordernoise = Main.rand.Next(180, 185);
int basaltbordernoisetop = Main.rand.Next(145, 150);
const int totalCuveDepth = -220;
const int totalCuveDepth2 = 80;
int curveDepth = (int)MathHelper.Lerp(
totalCuveDepth,
0f,
MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 20, startPosX + biomeSize - 200, X, true)));
int curveDepth2 = (int)MathHelper.Lerp(
totalCuveDepth,
0f,
MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 20, startPosX - biomeSize + 200, X, true)));
int curveDepthtop = (int)MathHelper.Lerp(
totalCuveDepth2,
0f,
MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 20, startPosX + biomeSize - 200, X, true)));
int curveDepth2top = (int)MathHelper.Lerp(
totalCuveDepth2,
0f,
MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 20, startPosX - biomeSize + 200, X, true)));
for (int Y = startPosY - basaltbordernoisetop + curveDepthtop + curveDepth2top; Y <= Main.maxTilesY - basaltbordernoise + curveDepth + curveDepth2; Y++)
{
Main.tile[X, Y].ClearEverything();
WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType<Basalt>());
@@ -1135,31 +1244,10 @@ namespace CalamityMod.World
}
});
//place another wall of circles along the bottom of the biome so it doesnt just end unnaturally
ForLoop.Invoke(startPosX - biomeSize, startPosX + biomeSize, 20, (X) =>
{
int Y = Main.maxTilesY - 230;
ShapeData circle = new ShapeData();
GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
WorldUtils.Gen(new Point(X, Y), new Shapes.Slime(25), Actions.Chain(new GenAction[]
{
blotchMod.Output(circle)
}));
WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[]
{
new Actions.Clear(),
new Actions.PlaceTile((ushort)ModContent.TileType<Basalt>()),
new Actions.PlaceWall(WallID.LavaUnsafe1)
}));
});
//place caverns and lava
for (int X = startPosX - biomeSize - (Main.maxTilesX / 25); X <= startPosX + biomeSize + (Main.maxTilesX / 25); X++)
{
for (int Y = startPosY; Y <= Main.maxTilesY - 210; Y++)
for (int Y = startPosY; Y <= Main.maxTilesY - 190; Y++)
{
if (Main.tile[X, Y].TileType == ModContent.TileType<Basalt>())
{
@@ -1290,7 +1378,7 @@ namespace CalamityMod.World
}));
}
//Timeless Shores ambiant tiles
if (Main.tile[X, Y].TileType == ModContent.TileType<RuneSand>())
if (Main.tile[X, Y].TileType == ModContent.TileType<Dunesand>())
{
//Driftwood Ambiance
if (WorldGen.genRand.NextBool(5))
@@ -1479,6 +1567,13 @@ namespace CalamityMod.World
}
if (Main.tile[X, Y].TileType == ModContent.TileType<ScarletSeaGrassTile>())
{
if (WorldGen.genRand.NextBool(100) && !Main.tile[X - 1, Y].HasTile)
WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(7), Actions.Chain(new GenAction[]
{
new Modifiers.OnlyTiles((ushort)ModContent.TileType<ScarletSeaGrassTile>(),(ushort)ModContent.TileType<PolypSand>()),
new Actions.ClearTile(),
new Actions.PlaceTile((ushort)ModContent.TileType<PinkPearlPile>()),
}));
//BranchCoralsOnSand
if (WorldGen.genRand.NextBool(55))
{
@@ -1570,6 +1665,13 @@ namespace CalamityMod.World
//radiant reefs ambient tiles
if (Main.tile[X, Y].TileType == ModContent.TileType<EutrophicSand>())
{
if (WorldGen.genRand.NextBool(100) && !Main.tile[X - 1, Y].HasTile)
WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(7), Actions.Chain(new GenAction[]
{
new Modifiers.OnlyTiles((ushort)ModContent.TileType<EutrophicSand>()),
new Actions.ClearTile(),
new Actions.PlaceTile((ushort)ModContent.TileType<WhitePearlPile>()),
}));
//Driftwood Ambiance
if (WorldGen.genRand.NextBool(15))
{
@@ -1617,6 +1719,17 @@ namespace CalamityMod.World
WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(MiscCorals));
}
}
if (Main.tile[X, Y].TileType == ModContent.TileType<Shellstone>() && Main.tile[X, Y].Slope == 0 && !Main.tile[X, Y + 1].HasTile && !Main.tile[X, Y + 2].HasTile)
{
if (WorldGen.genRand.NextBool(1))
{
WorldGen.PlaceTile(X, Y + 1, (ushort)ModContent.TileType<RefractiveHangingCoral>());
}
}
if (Main.tile[X, Y].TileType == ModContent.TileType<RefractiveHangingCoral>())
{
CalamityUtils.GrowVines(X, Y, WorldGen.genRand.Next(1, 4), (ushort)ModContent.TileType<RefractiveHangingCoral>());
}
//grow depth vines on navystone
if (Main.tile[X, Y].TileType == ModContent.TileType<Navystone>() && Main.tile[X, Y].Slope == 0 && !Main.tile[X, Y + 1].HasTile && !Main.tile[X, Y + 2].HasTile)
@@ -1652,6 +1765,26 @@ namespace CalamityMod.World
WorldGen.PlaceTile(X - 2, Y, WorldGen.genRand.Next(WallCorals), true, false, -1, 0);
}
}
if (Main.tile[X, Y].TileType == ModContent.TileType<VolcanicSand>())
{
if (WorldGen.genRand.NextBool(100) && !Main.tile[X - 1, Y].HasTile)
WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(7), Actions.Chain(new GenAction[]
{
new Modifiers.OnlyTiles((ushort)ModContent.TileType<VolcanicSand>()),
new Actions.ClearTile(),
new Actions.PlaceTile((ushort)ModContent.TileType<BlackPearlPile>()),
}));
}
if (Main.tile[X, Y].TileType == ModContent.TileType<HardenedEutrophicSand>())
{
if (WorldGen.genRand.NextBool(60) && !Main.tile[X - 1, Y].HasTile)
WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(7), Actions.Chain(new GenAction[]
{
new Modifiers.OnlyTiles((ushort)ModContent.TileType<HardenedEutrophicSand>()),
new Actions.ClearTile(),
new Actions.PlaceTile((ushort)ModContent.TileType<WhitePearlPile>()),
}));
}
}
}
}
@@ -1702,6 +1835,7 @@ namespace CalamityMod.World
ShapeData circle3 = new ShapeData();
GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
GenAction blotchMod2 = new Modifiers.Blotches(1, 0.1);
//first circle of navystone
WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(radius), Actions.Chain(new GenAction[]
@@ -1728,7 +1862,7 @@ namespace CalamityMod.World
//clear out the middle of the circle
WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(radius - 9), Actions.Chain(new GenAction[]
{
blotchMod.Output(circle3)
blotchMod2.Output(circle3)
}));
WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle3), Actions.Chain(new GenAction[]
{
@@ -1755,6 +1889,11 @@ namespace CalamityMod.World
(ushort)ModContent.TileType<Basalt>(),
(ushort)ModContent.TileType<VolcanicSand>(),
(ushort)ModContent.TileType<ScarletSeaGrassTile>(),
(ushort)ModContent.TileType<CyanCoral>(),
(ushort)ModContent.TileType<MagentaCoral>(),
(ushort)ModContent.TileType<OrangeCoral>(),
(ushort)ModContent.TileType<YellowCoral>(),
(ushort)ModContent.TileType<LimeCoral>(),
};
void getAttachedPoints(int x, int y, List<Point> points)