diff --git a/BiomeManagers/AbyssLayer1Biome.cs b/BiomeManagers/AbyssLayer1Biome.cs index 4b6ae7b4a0..5a9ec4a048 100644 --- a/BiomeManagers/AbyssLayer1Biome.cs +++ b/BiomeManagers/AbyssLayer1Biome.cs @@ -36,7 +36,9 @@ namespace CalamityMod.BiomeManagers if (WeakReferenceSupport.InAnySubworld()) return false; - return !player.lavaWet && !player.honeyWet && abyssPosX && playerYTileCoords <= Main.maxTilesY - 200; + int abyssStartHeight = (SulphurousSea.YStart + (int)Main.worldSurface) / 2 + 90; + + return !player.lavaWet && !player.honeyWet && abyssPosX && playerYTileCoords >= abyssStartHeight && playerYTileCoords <= Main.maxTilesY - 200; } //temporarily use sulphur for now @@ -70,7 +72,7 @@ namespace CalamityMod.BiomeManagers int abyssStartHeight = (SulphurousSea.YStart + (int)Main.worldSurface) / 2 + 90; return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && point.Y >= abyssStartHeight && - !player.Calamity().ZoneAbyssLayer2 && !player.Calamity().ZoneAbyssLayer3 && !player.Calamity().ZoneAbyssLayer4; + BiomeTileCounterSystem.Layer1Tiles >= 200 && !player.Calamity().ZoneAbyssLayer2 && !player.Calamity().ZoneAbyssLayer3 && !player.Calamity().ZoneAbyssLayer4; } } } diff --git a/BiomeManagers/AbyssLayer2Biome.cs b/BiomeManagers/AbyssLayer2Biome.cs index 7b17cb7573..87c599324b 100644 --- a/BiomeManagers/AbyssLayer2Biome.cs +++ b/BiomeManagers/AbyssLayer2Biome.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Systems; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -30,9 +31,8 @@ namespace CalamityMod.BiomeManagers public override bool IsBiomeActive(Player player) { - return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && - playerYTileCoords > Main.rockLayer - 10 && - playerYTileCoords <= Main.rockLayer + Main.maxTilesY * 0.143; + return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && BiomeTileCounterSystem.Layer2Tiles >= 200 && + playerYTileCoords > Main.rockLayer - 10 && playerYTileCoords <= Main.rockLayer + Main.maxTilesY * 0.143; } } } diff --git a/BiomeManagers/AbyssLayer3Biome.cs b/BiomeManagers/AbyssLayer3Biome.cs index f7367207b3..59b2011304 100644 --- a/BiomeManagers/AbyssLayer3Biome.cs +++ b/BiomeManagers/AbyssLayer3Biome.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Systems; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -30,9 +31,8 @@ namespace CalamityMod.BiomeManagers public override bool IsBiomeActive(Player player) { - return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && - playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.143 && - playerYTileCoords <= Main.rockLayer + Main.maxTilesY * 0.268; + return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && BiomeTileCounterSystem.Layer3Tiles >= 200 && + playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.143 && playerYTileCoords <= Main.rockLayer + Main.maxTilesY * 0.268; } } } diff --git a/BiomeManagers/AbyssLayer4Biome.cs b/BiomeManagers/AbyssLayer4Biome.cs index e3a817afe1..ea2ba5a6e6 100644 --- a/BiomeManagers/AbyssLayer4Biome.cs +++ b/BiomeManagers/AbyssLayer4Biome.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Systems; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -30,7 +31,7 @@ namespace CalamityMod.BiomeManagers public override bool IsBiomeActive(Player player) { - return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && + return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && BiomeTileCounterSystem.Layer4Tiles >= 200 && playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.268; } } diff --git a/BiomeManagers/SulphurousSeaBiome.cs b/BiomeManagers/SulphurousSeaBiome.cs index 1cbdab5963..af163eb129 100644 --- a/BiomeManagers/SulphurousSeaBiome.cs +++ b/BiomeManagers/SulphurousSeaBiome.cs @@ -57,19 +57,25 @@ namespace CalamityMod.BiomeManagers { Point point = player.Center.ToTileCoordinates(); bool sulphurPosX = false; + if (Abyss.AtLeftSideOfWorld) { if (point.X < 380) + { sulphurPosX = true; + } } else { if (point.X > Main.maxTilesX - 380) + { sulphurPosX = true; + } } return (BiomeTileCounterSystem.SulphurTiles >= 300 || (point.Y < (Main.rockLayer - Main.maxTilesY / 13) && sulphurPosX)) && !player.Calamity().ZoneAbyss; } + public override void SpecialVisuals(Player player, bool isActive) { string biomeName = "CalamityMod:SulphurSea"; diff --git a/Systems/BiomeTileCounterSystem.cs b/Systems/BiomeTileCounterSystem.cs index 64699e6bd6..887c86e5d2 100644 --- a/Systems/BiomeTileCounterSystem.cs +++ b/Systems/BiomeTileCounterSystem.cs @@ -21,6 +21,11 @@ namespace CalamityMod.Systems public static int SunkenSeaTiles = 0; public static int ArsenalLabTiles = 0; + public static int Layer1Tiles = 0; + public static int Layer2Tiles = 0; + public static int Layer3Tiles = 0; + public static int Layer4Tiles = 0; + public override void ResetNearbyTileEffects() { BrimstoneCragTiles = 0; @@ -29,6 +34,11 @@ namespace CalamityMod.Systems SulphurTiles = 0; AbyssTiles = 0; ArsenalLabTiles = 0; + + Layer1Tiles = 0; + Layer2Tiles = 0; + Layer3Tiles = 0; + Layer4Tiles = 0; } public override void TileCountsAvailable(ReadOnlySpan tileCounts) @@ -39,6 +49,11 @@ namespace CalamityMod.Systems SulphurTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; ArsenalLabTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; + Layer1Tiles = tileCounts[ModContent.TileType()]; + Layer2Tiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; + Layer3Tiles = tileCounts[ModContent.TileType()]; + Layer4Tiles = tileCounts[ModContent.TileType()]; + int astralDesertTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; int astralSnowTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; diff --git a/Systems/WorldgenManagementSystem.cs b/Systems/WorldgenManagementSystem.cs index 4b13ef90a6..fc3e17c815 100644 --- a/Systems/WorldgenManagementSystem.cs +++ b/Systems/WorldgenManagementSystem.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Systems } //Vernal pass - int vernalIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Smooth World")); + int vernalIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Muds Walls In Jungle")); if (vernalIndex != -1) { tasks.Insert(vernalIndex + 1, new PassLegacy("Vernal Pass", (progress, config) => diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index ff6ccca291..8e804e2428 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -125,12 +125,10 @@ namespace CalamityMod.World float worldEdgeMargin = (float)Main.maxTilesX * 0.08f; int xLimit = Main.maxTilesX / 2; - int x = Abyss.AtLeftSideOfWorld ? rand.Next(Main.dungeonX + 200, xLimit - 400) : rand.Next(xLimit + 400, Main.dungeonX - 200); + int realX = Abyss.AtLeftSideOfWorld ? rand.Next(SulphurousSea.BiomeWidth + 300, xLimit - 400) : rand.Next(xLimit + 400, Main.maxTilesX - SulphurousSea.BiomeWidth - 300); - while ((float)x > (float)Main.spawnTileX - worldEdgeMargin && (float)x < (float)Main.spawnTileX + worldEdgeMargin) - { - x = Abyss.AtLeftSideOfWorld ? rand.Next(Main.dungeonX + 200, xLimit - 400) : rand.Next(xLimit + 400, Main.dungeonX - 200); - } + //clamp so it doesnt crash hopefully + int x = Utils.Clamp(realX, SulphurousSea.BiomeWidth + 300, Main.maxTilesX - SulphurousSea.BiomeWidth - 300); //world surface = 920 large 740 medium 560 small int y = (int)(Main.worldSurface * 0.5); //Large = 522, Medium = 444, Small = 336 diff --git a/World/BrimstoneCrag.cs b/World/BrimstoneCrag.cs index 9ab1bfb840..82629fa8c8 100644 --- a/World/BrimstoneCrag.cs +++ b/World/BrimstoneCrag.cs @@ -481,7 +481,7 @@ namespace CalamityMod.World public static bool PlaceCragLily(int x, int y, int tileType) { - int minDistance = 10; + int minDistance = 15; int lilyNearby = 0; for (int i = x - minDistance; i < x + minDistance; i++)