diff --git a/BiomeManagers/AbyssIcon.png b/BiomeManagers/AbyssIcon.png deleted file mode 100644 index 0fab848b86..0000000000 Binary files a/BiomeManagers/AbyssIcon.png and /dev/null differ diff --git a/BiomeManagers/AbyssLayer1Biome.cs b/BiomeManagers/AbyssLayer1Biome.cs index 80842c3696..9a459ae69b 100644 --- a/BiomeManagers/AbyssLayer1Biome.cs +++ b/BiomeManagers/AbyssLayer1Biome.cs @@ -16,18 +16,18 @@ namespace CalamityMod.BiomeManagers int y = Main.maxTilesY; int genLimit = x / 2; int abyssChasmY = y - 250; - int abyssChasmX = Abyss.AtLeftSideOfWorld ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135); + int abyssChasmX = Abyss.AtLeftSideOfWorld ? genLimit - (genLimit - 135) + 35 : genLimit + (genLimit - 135) - 35; bool abyssPosX = false; - bool abyssPosY = point.Y <= abyssChasmY; + bool abyssPosY = point.Y >= (Main.rockLayer - Main.maxTilesY / 13); if (Abyss.AtLeftSideOfWorld) { - if (point.X < abyssChasmX + 80) + if (point.X < abyssChasmX + 125) abyssPosX = true; } else { - if (point.X > abyssChasmX - 80) + if (point.X > abyssChasmX - 125) abyssPosX = true; } @@ -36,16 +36,13 @@ namespace CalamityMod.BiomeManagers if (WeakReferenceSupport.InAnySubworld()) return false; - return point.Y > SulphurousSea.YStart + SulphurousSea.BlockDepth - 78 && - !player.lavaWet && - !player.honeyWet && - abyssPosY && - abyssPosX; + return !player.lavaWet && !player.honeyWet && abyssPosY && abyssPosX; } - public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AbyssWater"); + //temporarily use sulphur for now + public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/SulphuricDepthsWater"); public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; - public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon"; + public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer1Icon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1"; public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1"; @@ -61,13 +58,14 @@ namespace CalamityMod.BiomeManagers public override void SetStaticDefaults() { - DisplayName.SetDefault("Abyss: First Layer"); + DisplayName.SetDefault("Sulphuric Depths"); } public override bool IsBiomeActive(Player player) { return MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && - playerYTileCoords <= (Main.rockLayer + Main.maxTilesY * 0.03); + playerYTileCoords >= Main.rockLayer - Main.maxTilesY / 15 && + playerYTileCoords <= Main.rockLayer - 22; } } } diff --git a/BiomeManagers/AbyssLayer1Icon.png b/BiomeManagers/AbyssLayer1Icon.png new file mode 100644 index 0000000000..5d7fc7648e Binary files /dev/null and b/BiomeManagers/AbyssLayer1Icon.png differ diff --git a/BiomeManagers/AbyssLayer2Biome.cs b/BiomeManagers/AbyssLayer2Biome.cs index 2b9ca90238..1388f43a10 100644 --- a/BiomeManagers/AbyssLayer2Biome.cs +++ b/BiomeManagers/AbyssLayer2Biome.cs @@ -17,22 +17,22 @@ namespace CalamityMod.BiomeManagers } } - public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AbyssWater"); + public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/UpperAbyssWater"); public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; - public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon"; + public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer2Icon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23"; public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23"; public override void SetStaticDefaults() { - DisplayName.SetDefault("Abyss: Second Layer"); + DisplayName.SetDefault("Upper Abyss"); } public override bool IsBiomeActive(Player player) { return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && - playerYTileCoords > (Main.rockLayer + Main.maxTilesY * 0.03) && - playerYTileCoords <= (Main.rockLayer + Main.maxTilesY * 0.14); + playerYTileCoords > Main.rockLayer - 22 && + playerYTileCoords <= Main.rockLayer + Main.maxTilesY * 0.145; } } } diff --git a/BiomeManagers/AbyssLayer2Icon.png b/BiomeManagers/AbyssLayer2Icon.png new file mode 100644 index 0000000000..dda3a08249 Binary files /dev/null and b/BiomeManagers/AbyssLayer2Icon.png differ diff --git a/BiomeManagers/AbyssLayer3Biome.cs b/BiomeManagers/AbyssLayer3Biome.cs index cbd29d5c81..57acbda920 100644 --- a/BiomeManagers/AbyssLayer3Biome.cs +++ b/BiomeManagers/AbyssLayer3Biome.cs @@ -17,22 +17,22 @@ namespace CalamityMod.BiomeManagers } } - public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AbyssWater"); + public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/MiddleAbyssWater"); public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; - public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon"; + public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer3Icon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23"; public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23"; public override void SetStaticDefaults() { - DisplayName.SetDefault("Abyss: Third Layer"); + DisplayName.SetDefault("Lower Abyss"); } public override bool IsBiomeActive(Player player) { return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && - playerYTileCoords > (Main.rockLayer + Main.maxTilesY * 0.14) && - playerYTileCoords <= (Main.rockLayer + Main.maxTilesY * 0.26); + playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.145 && + playerYTileCoords <= Main.rockLayer + Main.maxTilesY * 0.262; } } } diff --git a/BiomeManagers/AbyssLayer3Icon.png b/BiomeManagers/AbyssLayer3Icon.png new file mode 100644 index 0000000000..9469ac6600 Binary files /dev/null and b/BiomeManagers/AbyssLayer3Icon.png differ diff --git a/BiomeManagers/AbyssLayer4Biome.cs b/BiomeManagers/AbyssLayer4Biome.cs index 9368527844..8f6b830864 100644 --- a/BiomeManagers/AbyssLayer4Biome.cs +++ b/BiomeManagers/AbyssLayer4Biome.cs @@ -17,21 +17,21 @@ namespace CalamityMod.BiomeManagers } } - public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AbyssWater"); + public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/VoidWater"); public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; - public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon"; + public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer4Icon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer4"; public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer4"; public override void SetStaticDefaults() { - DisplayName.SetDefault("Abyss: Fourth Layer"); + DisplayName.SetDefault("The Void"); } public override bool IsBiomeActive(Player player) { return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && - playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.26; + playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.262; } } } diff --git a/BiomeManagers/AbyssLayer4Icon.png b/BiomeManagers/AbyssLayer4Icon.png new file mode 100644 index 0000000000..9edb4373c6 Binary files /dev/null and b/BiomeManagers/AbyssLayer4Icon.png differ diff --git a/BiomeManagers/SulphurousSeaIcon.png b/BiomeManagers/SulphurousSeaIcon.png index 1c2d2afb05..c2bbafa753 100644 Binary files a/BiomeManagers/SulphurousSeaIcon.png and b/BiomeManagers/SulphurousSeaIcon.png differ diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 38dd4dd9cc..0afda36f12 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -834,14 +834,16 @@ namespace CalamityMod.ILEditing initialColor.TopRightColor = SelectLavaColor(initialTexture, initialColor.TopRightColor, liquidType == 1); initialColor.BottomLeftColor = SelectLavaColor(initialTexture, initialColor.BottomLeftColor, liquidType == 1); initialColor.BottomRightColor = SelectLavaColor(initialTexture, initialColor.BottomRightColor, liquidType == 1); - if (liquidType == ModContent.Find("CalamityMod/SulphuricWater").Slot) - SelectSulphuricWaterColor(x, y, ref initialColor); - if (liquidType == ModContent.Find("CalamityMod/SunkenSeaWater").Slot) - SelectSulphuricWaterColor(x, y, ref initialColor); - - if (liquidType == ModContent.Find("CalamityMod/AbyssWater").Slot) + if (liquidType == ModContent.Find("CalamityMod/SunkenSeaWater").Slot || + liquidType == ModContent.Find("CalamityMod/SulphuricWater").Slot || + liquidType == ModContent.Find("CalamityMod/SulphuricDepthsWater").Slot || + liquidType == ModContent.Find("CalamityMod/UpperAbyssWater").Slot || + liquidType == ModContent.Find("CalamityMod/MiddleAbyssWater").Slot || + liquidType == ModContent.Find("CalamityMod/VoidWater").Slot) + { SelectSulphuricWaterColor(x, y, ref initialColor); + } // Apply any extra color conditions. initialColor = ExtraColorChangeConditions?.Invoke(initialColor, liquidType, new(x, y)) ?? initialColor; @@ -967,8 +969,7 @@ namespace CalamityMod.ILEditing orig(self, x, y, out outputColor); Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y); - if (tile.LiquidAmount <= 0 || tile.HasTile || Main.waterStyle != ModContent.Find("CalamityMod/SulphuricWater").Slot && - Main.waterStyle != ModContent.Find("CalamityMod/SunkenSeaWater").Slot) + if (tile.LiquidAmount <= 0 || tile.HasTile || Main.waterStyle != ModContent.Find("CalamityMod/SulphuricWater").Slot) return; Tile above = CalamityUtils.ParanoidTileRetrieval(x, y - 1); diff --git a/Items/Placeables/GloomTorch.png b/Items/Placeables/GloomTorch.png new file mode 100644 index 0000000000..d82c0d6d0c Binary files /dev/null and b/Items/Placeables/GloomTorch.png differ diff --git a/Projectiles/Enemy/ToxicMinnowCloud.cs b/Projectiles/Enemy/ToxicMinnowCloud.cs index 472e568e58..955f5cb2e2 100644 --- a/Projectiles/Enemy/ToxicMinnowCloud.cs +++ b/Projectiles/Enemy/ToxicMinnowCloud.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Enemy public override void SetStaticDefaults() { DisplayName.SetDefault("Toxic Cloud"); - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Projectile.type] = 10; } public override void SetDefaults() diff --git a/Tiles/Abyss/AbyssGravel.cs b/Tiles/Abyss/AbyssGravel.cs index fbe7d4d4b9..66c4c42473 100644 --- a/Tiles/Abyss/AbyssGravel.cs +++ b/Tiles/Abyss/AbyssGravel.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Tiles.Abyss Tile up2 = Main.tile[i, j - 2]; //place kelp - if (WorldGen.genRand.Next(8) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + if (WorldGen.genRand.Next(8) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) { up.TileType = (ushort)ModContent.TileType(); up.HasTile = true; diff --git a/Tiles/Abyss/PlantyMush.cs b/Tiles/Abyss/PlantyMush.cs index 459056b6aa..d55f5dac5b 100644 --- a/Tiles/Abyss/PlantyMush.cs +++ b/Tiles/Abyss/PlantyMush.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Tiles.Abyss Tile up2 = Main.tile[i, j - 2]; //place kelp - if (WorldGen.genRand.Next(5) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + if (WorldGen.genRand.Next(5) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) { up.TileType = (ushort)ModContent.TileType(); up.HasTile = true; diff --git a/Tiles/Abyss/Voidstone.cs b/Tiles/Abyss/Voidstone.cs index e2e1f9fea0..6640ef6b14 100644 --- a/Tiles/Abyss/Voidstone.cs +++ b/Tiles/Abyss/Voidstone.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Tiles.Abyss Tile up2 = Main.tile[i, j - 2]; //place kelp - if (WorldGen.genRand.Next(25) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + if (WorldGen.genRand.Next(25) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) { up.TileType = (ushort)ModContent.TileType(); up.HasTile = true; diff --git a/Tiles/Crags/GloomTorch.png b/Tiles/Crags/GloomTorch.png new file mode 100644 index 0000000000..6ff4c4ab25 Binary files /dev/null and b/Tiles/Crags/GloomTorch.png differ diff --git a/Tiles/Crags/GloomTorchGlowmask.png b/Tiles/Crags/GloomTorchGlowmask.png new file mode 100644 index 0000000000..5f01acab9c Binary files /dev/null and b/Tiles/Crags/GloomTorchGlowmask.png differ diff --git a/Waters/MiddleAbyssWater.cs b/Waters/MiddleAbyssWater.cs new file mode 100644 index 0000000000..1c7f8250f8 --- /dev/null +++ b/Waters/MiddleAbyssWater.cs @@ -0,0 +1,28 @@ +using Microsoft.Xna.Framework; +using Terraria.ModLoader; + +namespace CalamityMod.Waters +{ + public class MiddleAbyssWater : ModWaterStyle + { + public override int ChooseWaterfallStyle() + { + return ModContent.Find("CalamityMod/MiddleAbyssWaterflow").Slot; + } + + public override int GetSplashDust() + { + return 33; + } + + public override int GetDropletGore() + { + return 713; + } + + public override Color BiomeHairColor() + { + return Color.Blue; + } + } +} diff --git a/Waters/MiddleAbyssWater.png b/Waters/MiddleAbyssWater.png new file mode 100644 index 0000000000..2f87227da3 Binary files /dev/null and b/Waters/MiddleAbyssWater.png differ diff --git a/Waters/MiddleAbyssWater_Block.png b/Waters/MiddleAbyssWater_Block.png new file mode 100644 index 0000000000..911499c8db Binary files /dev/null and b/Waters/MiddleAbyssWater_Block.png differ diff --git a/Waters/MiddleAbyssWaterflow.cs b/Waters/MiddleAbyssWaterflow.cs new file mode 100644 index 0000000000..6d7deb015d --- /dev/null +++ b/Waters/MiddleAbyssWaterflow.cs @@ -0,0 +1,8 @@ +using Terraria.ModLoader; +namespace CalamityMod.Waters +{ + public class MiddleAbyssWaterflow : ModWaterfallStyle + { + + } +} diff --git a/Waters/MiddleAbyssWaterflow.png b/Waters/MiddleAbyssWaterflow.png new file mode 100644 index 0000000000..bb2d5b743b Binary files /dev/null and b/Waters/MiddleAbyssWaterflow.png differ diff --git a/Waters/SulphuricDepthsWater.cs b/Waters/SulphuricDepthsWater.cs new file mode 100644 index 0000000000..63ab09da0a --- /dev/null +++ b/Waters/SulphuricDepthsWater.cs @@ -0,0 +1,28 @@ +using Microsoft.Xna.Framework; +using Terraria.ModLoader; + +namespace CalamityMod.Waters +{ + public class SulphuricDepthsWater : ModWaterStyle + { + public override int ChooseWaterfallStyle() + { + return ModContent.Find("CalamityMod/SulphuricDepthsWaterflow").Slot; + } + + public override int GetSplashDust() + { + return 33; + } + + public override int GetDropletGore() + { + return 713; + } + + public override Color BiomeHairColor() + { + return Color.Teal; + } + } +} diff --git a/Waters/SulphuricDepthsWater.png b/Waters/SulphuricDepthsWater.png new file mode 100644 index 0000000000..a7a870a527 Binary files /dev/null and b/Waters/SulphuricDepthsWater.png differ diff --git a/Waters/SulphuricDepthsWater_Block.png b/Waters/SulphuricDepthsWater_Block.png new file mode 100644 index 0000000000..93beaf1669 Binary files /dev/null and b/Waters/SulphuricDepthsWater_Block.png differ diff --git a/Waters/SulphuricDepthsWaterflow.cs b/Waters/SulphuricDepthsWaterflow.cs new file mode 100644 index 0000000000..0b0e76017e --- /dev/null +++ b/Waters/SulphuricDepthsWaterflow.cs @@ -0,0 +1,8 @@ +using Terraria.ModLoader; +namespace CalamityMod.Waters +{ + public class SulphuricDepthsWaterflow : ModWaterfallStyle + { + + } +} diff --git a/Waters/SulphuricDepthsWaterflow.png b/Waters/SulphuricDepthsWaterflow.png new file mode 100644 index 0000000000..2bffb3c294 Binary files /dev/null and b/Waters/SulphuricDepthsWaterflow.png differ diff --git a/Waters/UpperAbyssWater.cs b/Waters/UpperAbyssWater.cs new file mode 100644 index 0000000000..965861fdf7 --- /dev/null +++ b/Waters/UpperAbyssWater.cs @@ -0,0 +1,28 @@ +using Microsoft.Xna.Framework; +using Terraria.ModLoader; + +namespace CalamityMod.Waters +{ + public class UpperAbyssWater : ModWaterStyle + { + public override int ChooseWaterfallStyle() + { + return ModContent.Find("CalamityMod/UpperAbyssWaterflow").Slot; + } + + public override int GetSplashDust() + { + return 33; + } + + public override int GetDropletGore() + { + return 713; + } + + public override Color BiomeHairColor() + { + return Color.Blue; + } + } +} diff --git a/Waters/UpperAbyssWater.png b/Waters/UpperAbyssWater.png new file mode 100644 index 0000000000..bb2acdbdf3 Binary files /dev/null and b/Waters/UpperAbyssWater.png differ diff --git a/Waters/UpperAbyssWater_Block.png b/Waters/UpperAbyssWater_Block.png new file mode 100644 index 0000000000..af1637a72d Binary files /dev/null and b/Waters/UpperAbyssWater_Block.png differ diff --git a/Waters/UpperAbyssWaterflow.cs b/Waters/UpperAbyssWaterflow.cs new file mode 100644 index 0000000000..855d4f319d --- /dev/null +++ b/Waters/UpperAbyssWaterflow.cs @@ -0,0 +1,8 @@ +using Terraria.ModLoader; +namespace CalamityMod.Waters +{ + public class UpperAbyssWaterflow : ModWaterfallStyle + { + + } +} diff --git a/Waters/UpperAbyssWaterflow.png b/Waters/UpperAbyssWaterflow.png new file mode 100644 index 0000000000..8c9ae27357 Binary files /dev/null and b/Waters/UpperAbyssWaterflow.png differ diff --git a/Waters/AbyssWater.cs b/Waters/VoidWater.cs similarity index 88% rename from Waters/AbyssWater.cs rename to Waters/VoidWater.cs index a6d848a409..bff3e0bf78 100644 --- a/Waters/AbyssWater.cs +++ b/Waters/VoidWater.cs @@ -3,11 +3,11 @@ using Terraria.ModLoader; namespace CalamityMod.Waters { - public class AbyssWater : ModWaterStyle + public class VoidWater : ModWaterStyle { public override int ChooseWaterfallStyle() { - return ModContent.Find("CalamityMod/AbyssWaterflow").Slot; + return ModContent.Find("CalamityMod/VoidWaterflow").Slot; } public override int GetSplashDust() diff --git a/Waters/AbyssWater.png b/Waters/VoidWater.png similarity index 100% rename from Waters/AbyssWater.png rename to Waters/VoidWater.png diff --git a/Waters/AbyssWater_Block.png b/Waters/VoidWater_Block.png similarity index 100% rename from Waters/AbyssWater_Block.png rename to Waters/VoidWater_Block.png diff --git a/Waters/AbyssWaterflow.cs b/Waters/VoidWaterflow.cs similarity index 58% rename from Waters/AbyssWaterflow.cs rename to Waters/VoidWaterflow.cs index 9284d28dd3..3224a16282 100644 --- a/Waters/AbyssWaterflow.cs +++ b/Waters/VoidWaterflow.cs @@ -1,7 +1,7 @@ using Terraria.ModLoader; namespace CalamityMod.Waters { - public class AbyssWaterflow : ModWaterfallStyle + public class VoidWaterflow : ModWaterfallStyle { } diff --git a/Waters/AbyssWaterflow.png b/Waters/VoidWaterflow.png similarity index 100% rename from Waters/AbyssWaterflow.png rename to Waters/VoidWaterflow.png diff --git a/World/Abyss.cs b/World/Abyss.cs index 2cb9fb8120..f092d9b303 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -40,7 +40,7 @@ namespace CalamityMod.World int abyssChasmY = y - 250; //Underworld = y - 200 AbyssChasmBottom = abyssChasmY - 100; //850 small 1450 medium 2050 large - int abyssChasmX = AtLeftSideOfWorld ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135); //2100 - 1965 = 135 : 2100 + 1965 = 4065 + int abyssChasmX = AtLeftSideOfWorld ? genLimit - (genLimit - 135) + 35 : genLimit + (genLimit - 135) - 35; //2100 - 1965 = 135 : 2100 + 1965 = 4065 bool plantyMushSide = true; @@ -49,240 +49,177 @@ namespace CalamityMod.World plantyMushSide = false; } - if (AtLeftSideOfWorld) + int abyssMinX = AtLeftSideOfWorld ? 0 : abyssChasmX - 130; + int abyssMaxX = AtLeftSideOfWorld ? abyssChasmX + 130 : x; + + for (int abyssIndex = abyssMinX; abyssIndex < abyssMaxX; abyssIndex++) { - for (int abyssIndex = 0; abyssIndex < abyssChasmX + 80; abyssIndex++) //235 + for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY + 50; abyssIndex2++) { - for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) + Tile tile = Framing.GetTileSafely(abyssIndex, abyssIndex2); + + if (tile.LiquidType == LiquidID.Lava && tile.LiquidAmount > 0) { - Tile tile = Framing.GetTileSafely(abyssIndex, abyssIndex2); - - if (tile.LiquidType == LiquidID.Lava && tile.LiquidAmount > 0) - { - tile.LiquidType = LiquidID.Water; - tile.LiquidAmount = 255; - } - - bool canConvert = tile.HasTile && tile.TileType < TileID.Count && tile.TileType != TileID.DyePlants && tile.TileType != TileID.Trees && - tile.TileType != TileID.PalmTree && tile.TileType != TileID.Sand && tile.TileType != TileID.Containers && tile.TileType != TileID.Coral && - tile.TileType != TileID.BeachPiles && tile.TileType != ModContent.TileType() && tile.TileType != ModContent.TileType(); - - if (abyssIndex2 > rockLayer - WorldGen.genRand.Next(30)) - { - //dithering on the edge of the abyss - if (abyssIndex > abyssChasmX + 75) - { - if (WorldGen.genRand.NextBool(2)) - { - WorldGen.KillTile(abyssIndex, abyssIndex2); - - if (abyssIndex2 > (rockLayer + y * 0.262)) - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3)) - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - else if (abyssIndex2 > (rockLayer + y * 0.145)) - { - if (WorldGen.genRand.NextBool(3)) - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - else - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - } - else - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - } - } - else - { - if (canConvert) - { - if (abyssIndex2 > (rockLayer + y * 0.262)) - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.142) && WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.145)) - { - if (WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - } - else - { - tile.TileType = (ushort)ModContent.TileType(); - } - tile.WallType = (ushort)ModContent.WallType(); - } - else - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - } - else if (!tile.HasTile) - { - tile.Get().HasTile = true; - if (abyssIndex2 > (rockLayer + y * 0.262)) - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.142) && WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.145)) - { - if (WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - } - else - { - tile.TileType = (ushort)ModContent.TileType(); - } - tile.WallType = (ushort)ModContent.WallType(); - } - else - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - } - } - } + tile.LiquidType = LiquidID.Water; + tile.LiquidAmount = 255; } - } - } - else - { - for (int abyssIndex = abyssChasmX - 80; abyssIndex < x; abyssIndex++) //3965 - { - for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) + + bool canConvert = tile.HasTile && tile.TileType < TileID.Count && tile.TileType != TileID.DyePlants && tile.TileType != TileID.Trees && + tile.TileType != TileID.PalmTree && tile.TileType != TileID.Sand && tile.TileType != TileID.Containers && tile.TileType != TileID.Coral && + tile.TileType != TileID.BeachPiles && tile.TileType != ModContent.TileType(); + + if (abyssIndex2 > (rockLayer - Main.maxTilesY / 15) - WorldGen.genRand.Next(30)) { - Tile tile = Framing.GetTileSafely(abyssIndex, abyssIndex2); - - if (tile.LiquidType == LiquidID.Lava && tile.LiquidAmount > 0) + //dithering on the edge of the abyss + if ((AtLeftSideOfWorld && abyssIndex > abyssChasmX + 125) || (!AtLeftSideOfWorld && abyssIndex < abyssChasmX - 125)) { - tile.LiquidType = LiquidID.Water; - tile.LiquidAmount = 255; - } - - bool canConvert = tile.HasTile && tile.TileType < TileID.Count && tile.TileType != TileID.DyePlants && tile.TileType != TileID.Trees && - tile.TileType != TileID.PalmTree && tile.TileType != TileID.Sand && tile.TileType != TileID.Containers && tile.TileType != TileID.Coral && - tile.TileType != TileID.BeachPiles && tile.TileType != ModContent.TileType() && tile.TileType != ModContent.TileType(); - - if (abyssIndex2 > rockLayer - WorldGen.genRand.Next(30)) - { - //dithering on the edge of the abyss - if (abyssIndex < abyssChasmX - 75) + if (WorldGen.genRand.NextBool(2)) { - if (WorldGen.genRand.NextBool(2)) - { - WorldGen.KillTile(abyssIndex, abyssIndex2); + WorldGen.KillTile(abyssIndex, abyssIndex2); - if (abyssIndex2 > (rockLayer + y * 0.262)) + if (abyssIndex2 > (rockLayer + y * 0.262)) + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + } + else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3)) + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + } + else if (abyssIndex2 > (rockLayer + y * 0.145)) + { + if (WorldGen.genRand.NextBool(3)) { WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); } - else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3)) - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - else if (abyssIndex2 > (rockLayer + y * 0.145)) - { - if (WorldGen.genRand.NextBool(3)) - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - else - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - } else { WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); } } - } - else - { - if (canConvert) + else if (abyssIndex2 >= rockLayer - 20 && abyssIndex2 <= rockLayer - 10) { - if (abyssIndex2 > (rockLayer + y * 0.262)) + if (WorldGen.genRand.NextBool(2)) { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.145)) - { - if (WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - } - else - { - tile.TileType = (ushort)ModContent.TileType(); - } - tile.WallType = (ushort)ModContent.WallType(); + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); } else { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); } } - else if (!tile.HasTile) + else if (abyssIndex2 <= rockLayer - 20) { - tile.Get().HasTile = true; - if (abyssIndex2 > (rockLayer + y * 0.262)) + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + } + else + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + } + } + } + else + { + if (canConvert) + { + if (abyssIndex2 > (rockLayer + y * 0.262)) + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 > (rockLayer + y * 0.142) && WorldGen.genRand.NextBool(3)) + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 > (rockLayer + y * 0.145)) + { + if (WorldGen.genRand.NextBool(3)) { tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.145)) - { - if (WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - } - else - { - tile.TileType = (ushort)ModContent.TileType(); - } - tile.WallType = (ushort)ModContent.WallType(); } else { tile.TileType = (ushort)ModContent.TileType(); + } + + tile.WallType = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 >= rockLayer - 20 && abyssIndex2 <= rockLayer) + { + if (WorldGen.genRand.NextBool(2)) + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); + tile.TileType = (ushort)ModContent.TileType(); tile.WallType = (ushort)ModContent.WallType(); } + else + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + } + else if (abyssIndex2 <= rockLayer - 20) + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + else + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + } + else if (!tile.HasTile) + { + tile.Get().HasTile = true; + if (abyssIndex2 > (rockLayer + y * 0.262)) + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 > (rockLayer + y * 0.142) && WorldGen.genRand.NextBool(3)) + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 > (rockLayer + y * 0.145)) + { + if (WorldGen.genRand.NextBool(3)) + { + tile.TileType = (ushort)ModContent.TileType(); + } + else + { + tile.TileType = (ushort)ModContent.TileType(); + } + + tile.WallType = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 >= rockLayer - 20 && abyssIndex2 <= rockLayer) + { + if (WorldGen.genRand.NextBool(2)) + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + else + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + } + else if (abyssIndex2 <= rockLayer - 20) + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + else + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); } } } @@ -290,7 +227,10 @@ namespace CalamityMod.World } } - MiscWorldgenRoutines.ChasmGenerator(abyssChasmX, (int)WorldGen.worldSurfaceLow, AbyssChasmBottom, true); + //just place three craters next to each other to make it wider + MiscWorldgenRoutines.ChasmGenerator(abyssChasmX + 25, (int)WorldGen.worldSurfaceLow, AbyssChasmBottom, true); + MiscWorldgenRoutines.ChasmGenerator(abyssChasmX, (int)WorldGen.worldSurfaceLow + 65, AbyssChasmBottom, true); + MiscWorldgenRoutines.ChasmGenerator(abyssChasmX - 25, (int)WorldGen.worldSurfaceLow, AbyssChasmBottom, true); int maxAbyssIslands = 11; //Small World @@ -308,8 +248,8 @@ namespace CalamityMod.World bool placedFossil = false; //place islands to hide the fossil (funny) - AbyssIsland(abyssChasmX + 32, AbyssChasmBottom + 25, 55, 75, 35, 45, false, true, true); - AbyssIsland(abyssChasmX - 32, AbyssChasmBottom + 25, 55, 75, 35, 45, false, true, true); + AbyssIsland(abyssChasmX + 55, AbyssChasmBottom + 25, 55, 75, 55, 75, false, true, true, false); + AbyssIsland(abyssChasmX - 55, AbyssChasmBottom + 25, 55, 75, 55, 75, false, true, true, false); while (!placedFossil) { @@ -350,12 +290,42 @@ namespace CalamityMod.World } //place a single abyss island under the terminus shrine - AbyssIsland(abyssChasmX, AbyssChasmBottom + 5, 65, 75, 40, 45, false, false, true); + AbyssIsland(abyssChasmX, AbyssChasmBottom + 5, 65, 75, 40, 45, false, false, true, false); //place terminus shrine UndergroundShrines.SpecialHut((ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.WallType(), UndergroundShrines.UndergroundShrineType.Abyss, abyssChasmX, AbyssChasmBottom); + //place islands in the sulphuric depths layer + for (int sulphurIslandY = (rockLayer - Main.maxTilesY / 15) - 5; sulphurIslandY <= rockLayer - 15; sulphurIslandY++) + { + if (WorldGen.genRand.NextBool(2)) + { + int randomIsland = WorldGen.genRand.Next(4); + switch (randomIsland) + { + case 0: + AbyssIsland(abyssChasmX - WorldGen.genRand.Next(55, 78), sulphurIslandY, 55, 75, 35, 45, false, false, false, true); + break; + case 1: + AbyssIsland(abyssChasmX + WorldGen.genRand.Next(55, 78), sulphurIslandY, 55, 75, 35, 45, false, false, false, true); + break; + case 2: + AbyssIsland(abyssChasmX + WorldGen.genRand.Next(55, 78), sulphurIslandY, 55, 75, 35, 45, false, false, false, true); + AbyssIsland(abyssChasmX - WorldGen.genRand.Next(10, 20), sulphurIslandY, 55, 75, 35, 45, false, false, false, true); + break; + case 3: + AbyssIsland(abyssChasmX - WorldGen.genRand.Next(55, 78), sulphurIslandY, 55, 75, 35, 45, false, false, false, true); + AbyssIsland(abyssChasmX + WorldGen.genRand.Next(10, 20), sulphurIslandY, 55, 75, 35, 45, false, false, false, true); + break; + } + + //increase y value so islands cant be spammed on top of each other + sulphurIslandY += 12; + } + } + + //normal abyss islands int islandLocationOffset = 30; int islandLocationY = rockLayer; @@ -365,35 +335,36 @@ namespace CalamityMod.World int randomIsland = WorldGen.genRand.Next(5); //0 1 2 3 4 bool hasVoidstone = islandLocationY > (rockLayer + y * 0.143); AbyssIslandPositions[TotalPlacedIslandsSoFar].Y = islandLocationY; + int randomPositon = WorldGen.genRand.Next(38, 65); switch (randomIsland) { case 0: - AbyssIsland(islandLocationX, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX + 40, islandLocationY + 15, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone); - AbyssIsland(islandLocationX - 40, islandLocationY + 15, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone); + AbyssIsland(islandLocationX, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone, false); + AbyssIsland(islandLocationX + randomPositon, islandLocationY + 15, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone, false); + AbyssIsland(islandLocationX - randomPositon, islandLocationY + 15, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone, false); break; case 1: - AbyssIsland(islandLocationX + 30, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX, islandLocationY + 15, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone); - AbyssIsland(islandLocationX - 40, islandLocationY + 10, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone); + AbyssIsland(islandLocationX + randomPositon, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone, false); + AbyssIsland(islandLocationX, islandLocationY + 15, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone, false); + AbyssIsland(islandLocationX - randomPositon, islandLocationY + 10, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone, false); islandLocationX += 30; break; case 2: - AbyssIsland(islandLocationX - 30, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX + 30, islandLocationY + 10, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone); - AbyssIsland(islandLocationX, islandLocationY + 15, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone); + AbyssIsland(islandLocationX - randomPositon, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone, false); + AbyssIsland(islandLocationX + randomPositon, islandLocationY + 10, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone, false); + AbyssIsland(islandLocationX, islandLocationY + 15, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone, false); islandLocationX -= 30; break; case 3: - AbyssIsland(islandLocationX + 25, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX - 5, islandLocationY + 5, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone); - AbyssIsland(islandLocationX - 35, islandLocationY + 15, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone); + AbyssIsland(islandLocationX + randomPositon, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone, false); + AbyssIsland(islandLocationX - 5, islandLocationY + 5, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone, false); + AbyssIsland(islandLocationX - randomPositon, islandLocationY + 15, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone, false); islandLocationX += 25; break; case 4: - AbyssIsland(islandLocationX - 25, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX + 5, islandLocationY + 15, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone); - AbyssIsland(islandLocationX + 35, islandLocationY + 5, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone); + AbyssIsland(islandLocationX - randomPositon, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone, false); + AbyssIsland(islandLocationX + 5, islandLocationY + 15, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone, false); + AbyssIsland(islandLocationX + randomPositon, islandLocationY + 5, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone, false); islandLocationX -= 25; break; } @@ -415,14 +386,14 @@ namespace CalamityMod.World switch (randomIsland) { case 0: - AbyssIsland(abyssChasmX + WorldGen.genRand.Next(42, 48), voidIslandY, 55, 75, 35, 45, false, true, true); + AbyssIsland(abyssChasmX + WorldGen.genRand.Next(60, 78), voidIslandY, 65, 85, 35, 45, false, true, true, false); break; case 1: - AbyssIsland(abyssChasmX - WorldGen.genRand.Next(42, 48), voidIslandY, 55, 75, 35, 45, false, true, true); + AbyssIsland(abyssChasmX - WorldGen.genRand.Next(60, 78), voidIslandY, 65, 85, 35, 45, false, true, true, false); break; case 2: - AbyssIsland(abyssChasmX + WorldGen.genRand.Next(42, 48), voidIslandY, 55, 75, 35, 45, false, true, true); - AbyssIsland(abyssChasmX - WorldGen.genRand.Next(42, 48), voidIslandY, 55, 75, 35, 45, false, true, true); + AbyssIsland(abyssChasmX + WorldGen.genRand.Next(60, 78), voidIslandY, 65, 85, 35, 45, false, true, true, false); + AbyssIsland(abyssChasmX - WorldGen.genRand.Next(60, 78), voidIslandY, 65, 85, 35, 45, false, true, true, false); break; } @@ -434,93 +405,58 @@ namespace CalamityMod.World AbyssItemArray = CalamityUtils.ShuffleArray(AbyssItemArray); for (int abyssHouse = 0; abyssHouse < TotalPlacedIslandsSoFar; abyssHouse++) //11 15 19 { + bool hasVoidstone = AbyssIslandPositions[abyssHouse].Y + 5 > (rockLayer + y * 0.143); + if (abyssHouse != 20) { + //place an island below the houses + //place the island first so it doesnt destroy the house or chest + AbyssIsland(AbyssIslandPositions[abyssHouse].X, AbyssIslandPositions[abyssHouse].Y + 15, 55, 75, 35, 45, false, true, hasVoidstone, false); + AbyssIslandHouse(AbyssIslandPositions[abyssHouse].X, AbyssIslandPositions[abyssHouse].Y, AbyssItemArray[abyssHouse > 9 ? (abyssHouse - 10) : abyssHouse], //10 choices 0 to 9 - AbyssIslandPositions[abyssHouse].Y > (rockLayer + y * 0.143)); + hasVoidstone); } } //clean up - if (AtLeftSideOfWorld) + for (int abyssIndex = abyssMinX + 5; abyssIndex < abyssMaxX - 5; abyssIndex++) { - for (int abyssIndex = 5; abyssIndex < abyssChasmX + 80; abyssIndex++) //235 + for (int abyssIndex2 = 5; abyssIndex2 < abyssChasmY; abyssIndex2++) { - for (int abyssIndex2 = 5; abyssIndex2 < abyssChasmY; abyssIndex2++) + Tile tile = Main.tile[abyssIndex, abyssIndex2]; + Tile tileUp = Main.tile[abyssIndex, abyssIndex2 - 1]; + Tile tileDown = Main.tile[abyssIndex, abyssIndex2 + 1]; + Tile tileLeft = Main.tile[abyssIndex - 1, abyssIndex2]; + Tile tileRight = Main.tile[abyssIndex + 1, abyssIndex2]; + + if (tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || + tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || + tile.TileType == ModContent.TileType()) { - Tile tile = Main.tile[abyssIndex, abyssIndex2]; - Tile tileUp = Main.tile[abyssIndex, abyssIndex2 - 1]; - Tile tileDown = Main.tile[abyssIndex, abyssIndex2 + 1]; - Tile tileLeft = Main.tile[abyssIndex - 1, abyssIndex2]; - Tile tileRight = Main.tile[abyssIndex + 1, abyssIndex2]; + //slope tiles + Tile.SmoothSlope(abyssIndex, abyssIndex2, true); - if (tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || - tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType()) - { - //slope tiles - Tile.SmoothSlope(abyssIndex, abyssIndex2, true); - - //kill any individual floating tiles - if (!tileUp.HasTile && !tileDown.HasTile && !tileLeft.HasTile && !tileRight.HasTile) - { - WorldGen.KillTile(abyssIndex, abyssIndex2); - } - } - - if (!tile.HasTile && (tile.WallType == ModContent.WallType() || tile.WallType == ModContent.WallType())) - { - //fill up any air pockets with water - tile.LiquidType = LiquidID.Water; - tile.LiquidAmount = 255; - } - - //kill obsidian - if (tile.TileType == TileID.Obsidian) + //kill any individual floating tiles + if (!tileUp.HasTile && !tileDown.HasTile && !tileLeft.HasTile && !tileRight.HasTile) { WorldGen.KillTile(abyssIndex, abyssIndex2); } } - } - } - else - { - for (int abyssIndex = abyssChasmX - 80; abyssIndex < x - 5; abyssIndex++) //3965 - { - for (int abyssIndex2 = 5; abyssIndex2 < abyssChasmY; abyssIndex2++) + + if (!tile.HasTile && (tile.WallType == ModContent.WallType() || tile.WallType == ModContent.WallType() || + tile.WallType == ModContent.WallType())) { - Tile tile = Main.tile[abyssIndex, abyssIndex2]; - Tile tileUp = Main.tile[abyssIndex, abyssIndex2 - 1]; - Tile tileDown = Main.tile[abyssIndex, abyssIndex2 + 1]; - Tile tileLeft = Main.tile[abyssIndex - 1, abyssIndex2]; - Tile tileRight = Main.tile[abyssIndex + 1, abyssIndex2]; + //fill up any air pockets with water + tile.LiquidType = LiquidID.Water; + tile.LiquidAmount = 255; + } - if (tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || - tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType()) - { - //slope tiles - Tile.SmoothSlope(abyssIndex, abyssIndex2, true); - - //kill any individual floating tiles - if (!tileUp.HasTile && !tileDown.HasTile && !tileLeft.HasTile && !tileRight.HasTile) - { - WorldGen.KillTile(abyssIndex, abyssIndex2); - } - } - - if (!tile.HasTile && (tile.WallType == ModContent.WallType() || tile.WallType == ModContent.WallType())) - { - //fill up any air pockets with water - tile.LiquidType = LiquidID.Water; - tile.LiquidAmount = 255; - } - - //kill obsidian - if (tile.TileType == TileID.Obsidian) - { - WorldGen.KillTile(abyssIndex, abyssIndex2); - } + //kill obsidian + if (tile.TileType == TileID.Obsidian) + { + WorldGen.KillTile(abyssIndex, abyssIndex2); } } } @@ -543,7 +479,7 @@ namespace CalamityMod.World if (Mosses.Contains(tile.TileType)) { - tile.TileType = TileID.Stone; + WorldGen.KillTile(abyssIndex, abyssIndex2); } } } @@ -565,140 +501,92 @@ namespace CalamityMod.World if (Mosses.Contains(tile.TileType)) { - tile.TileType = TileID.Stone; + WorldGen.KillTile(abyssIndex, abyssIndex2); } } } } //ambient tiles and pots - if (AtLeftSideOfWorld) + for (int abyssIndex = abyssMinX + 5; abyssIndex < abyssMaxX - 5; abyssIndex++) { - for (int abyssIndex = 0; abyssIndex < abyssChasmX + 80; abyssIndex++) //235 + for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) { - for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) + if (!Main.tile[abyssIndex, abyssIndex2].HasTile) { - if (!Main.tile[abyssIndex, abyssIndex2].HasTile) + //above the 4th layer + if (abyssIndex2 < (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) { - //above the 4th layer - if (abyssIndex2 < (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) + //giant kelp, more often in upper layers + if ((WorldGen.genRand.NextBool(18) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) || + (WorldGen.genRand.NextBool(35) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType())) { - //giant kelp, more often in upper layers - if ((WorldGen.genRand.NextBool(18) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) || - (WorldGen.genRand.NextBool(35) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType())) - { - ushort[] Kelps = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + ushort[] Kelps = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Kelps)); - } - - //bulb trees on voidstone - if (WorldGen.genRand.NextBool(25) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) - { - ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); - } + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Kelps)); } - //below 4th layer - if (abyssIndex2 >= (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) + //bulb trees on voidstone + if (WorldGen.genRand.NextBool(25) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) { - //bulb trees on voidstone - if (WorldGen.genRand.NextBool(6) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) - { - ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); - } + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); } - //pots - if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 > rockLayer) + //sulphur shale stuff + if (Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) { - if (WorldGen.genRand.NextBool(5)) + if (WorldGen.genRand.NextBool(8)) { - WorldGen.PlacePot(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + ushort[] SulphuricFossils = new ushort[] { (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(SulphuricFossils)); } - } - //sulphur pots - else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 < (int)Main.worldSurface) - { - if (WorldGen.genRand.NextBool(3)) + + if (WorldGen.genRand.NextBool(6)) { - WorldGen.PlacePot(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + ushort[] Ribs = new ushort[] { (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Ribs)); } } } - } - } - } - else - { - for (int abyssIndex = abyssChasmX - 80; abyssIndex < x; abyssIndex++) //3965 - { - for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) - { - if (!Main.tile[abyssIndex, abyssIndex2].HasTile) + + //below 4th layer + if (abyssIndex2 >= (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) { - //above the 4th layer - if (abyssIndex2 < (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) + //bulb trees on voidstone + if (WorldGen.genRand.NextBool(6) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) { - //giant kelp, more often in upper layers - if ((WorldGen.genRand.NextBool(18) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) || - (WorldGen.genRand.NextBool(35) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType())) - { - ushort[] Kelps = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Kelps)); - } - - //bulb trees on voidstone - if (WorldGen.genRand.NextBool(25) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) - { - ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); - } + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); } + } - //below 4th layer - if (abyssIndex2 >= (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) + //pots + if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 > rockLayer) + { + if (WorldGen.genRand.NextBool(5)) { - //bulb trees on voidstone - if (WorldGen.genRand.NextBool(6) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) - { - ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); - } + WorldGen.PlacePot(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } - - //pots - if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 > rockLayer) + } + //sulphur pots + else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 < (int)Main.worldSurface) + { + if (WorldGen.genRand.NextBool(3)) { - if (WorldGen.genRand.NextBool(5)) - { - WorldGen.PlacePot(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); - } - } - //sulphur pots - else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 < (int)Main.worldSurface) - { - if (WorldGen.genRand.NextBool(3)) - { - WorldGen.PlacePot(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); - } + WorldGen.PlacePot(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } } @@ -707,7 +595,7 @@ namespace CalamityMod.World } #region Houses - public static void AbyssIsland(int i, int j, int sizeMin, int sizeMax, int sizeMin2, int sizeMax2, bool hasChest, bool hasPlantyMush, bool isVoid) + public static void AbyssIsland(int i, int j, int sizeMin, int sizeMax, int sizeMin2, int sizeMax2, bool hasChest, bool hasPlantyMush, bool isVoid, bool isShale) { float islandWidth = WorldGen.genRand.Next(sizeMin, sizeMax); //100 150 float smallIslandWidth = (float)WorldGen.genRand.Next(sizeMin, sizeMax) / (float)5; //20 30 @@ -777,7 +665,16 @@ namespace CalamityMod.World islandPositionY = l; } Main.tile[k, l].Get().HasTile = true; - Main.tile[k, l].TileType = (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType()); + + if (!isShale) + { + Main.tile[k, l].TileType = (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType()); + } + else + { + Main.tile[k, l].TileType = (ushort)ModContent.TileType(); + } + CalamityUtils.SafeSquareTileFrame(k, l, true); } } @@ -814,6 +711,7 @@ namespace CalamityMod.World num14 += WorldGen.genRand.Next(-3, 4); num15 = WorldGen.genRand.Next(4, 8); int num16 = isVoid ? ModContent.TileType() : ModContent.TileType(); + if (WorldGen.genRand.NextBool(4)) { num16 = hasChest ? ModContent.TileType() : ModContent.TileType(); @@ -829,7 +727,16 @@ namespace CalamityMod.World if (Math.Sqrt((double)(arg_409_0 * arg_409_0 + num18 * num18)) < (double)(num15 + WorldGen.genRand.Next(2))) { Main.tile[n, num17].Get().HasTile = true; - Main.tile[n, num17].TileType = (ushort)num16; + + if (!isShale) + { + Main.tile[n, num17].TileType = (ushort)num16; + } + else + { + Main.tile[n, num17].TileType = (ushort)ModContent.TileType(); + } + CalamityUtils.SafeSquareTileFrame(n, num17, true); } } diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index 5cd5ecc56d..299432d374 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -127,7 +127,7 @@ 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 - 350) : rand.Next(xLimit + 350, Main.dungeonX - 200); + int x = Abyss.AtLeftSideOfWorld ? rand.Next(Main.dungeonX + 200, xLimit - 400) : rand.Next(xLimit + 400, Main.dungeonX - 200); //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 ec9a8883e6..86f1ca7b38 100644 --- a/World/BrimstoneCrag.cs +++ b/World/BrimstoneCrag.cs @@ -366,8 +366,8 @@ namespace CalamityMod.World //place lillies on scorched remains grass if (tile.TileType == ModContent.TileType()) { - //place them decently often since they are pretty big tiles, also dont place them in lava - if (WorldGen.genRand.Next(4) == 0) + //place them often since they are pretty big tiles, also dont place them in lava + if (WorldGen.genRand.Next(3) == 0) { ushort[] Lillies = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; diff --git a/World/MiscWorldgenRoutines.cs b/World/MiscWorldgenRoutines.cs index ab1a5d1412..0d90b261cf 100644 --- a/World/MiscWorldgenRoutines.cs +++ b/World/MiscWorldgenRoutines.cs @@ -214,128 +214,6 @@ namespace CalamityMod.World } #endregion - /* - #region UnderworldIslandHouse - public static void UnderworldIslandHouse(int i, int j, int item) - { - ushort type = (ushort)ModContent.TileType(); //tile - int wall = ModContent.WallType(); //wall - Vector2 vector = new Vector2((float)i, (float)j); - int num = 1; - if (WorldGen.genRand.Next(2) == 0) - { - num = -1; - } - int num2 = WorldGen.genRand.Next(7, 12); - int num3 = WorldGen.genRand.Next(5, 7); - vector.X = (float)(i + (num2 + 2) * num); - for (int k = j - 15; k < j + 30; k++) - { - if (Main.tile[(int)vector.X, k].HasTile) - { - vector.Y = (float)(k - 1); - break; - } - } - vector.X = (float)i; - int num4 = (int)(vector.X - (float)num2 - 1f); - int num5 = (int)(vector.X + (float)num2 + 1f); - int num6 = (int)(vector.Y - (float)num3 - 1f); - int num7 = (int)(vector.Y + 2f); - if (num4 < 0) - { - num4 = 0; - } - if (num5 > Main.maxTilesX) - { - num5 = Main.maxTilesX; - } - if (num6 < 0) - { - num6 = 0; - } - if (num7 > Main.maxTilesY) - { - num7 = Main.maxTilesY; - } - for (int l = num4; l <= num5; l++) - { - for (int m = num6 - 1; m < num7 + 1; m++) - { - if (m != num6 - 1 || (l != num4 && l != num5)) - { - Main.tile[l, m].Get().HasTile = true; - Main.tile[l, m].LiquidAmount = 0; - Main.tile[l, m].TileType = type; - Main.tile[l, m].WallType = 0; - Main.tile[l, m].Get().IsHalfBlock = false; - Main.tile[l, m].Get().Slope = SlopeType.Solid; - } - } - } - num4 = (int)(vector.X - (float)num2); - num5 = (int)(vector.X + (float)num2); - num6 = (int)(vector.Y - (float)num3); - num7 = (int)(vector.Y + 1f); - if (num4 < 0) - { - num4 = 0; - } - if (num5 > Main.maxTilesX) - { - num5 = Main.maxTilesX; - } - if (num6 < 0) - { - num6 = 0; - } - if (num7 > Main.maxTilesY) - { - num7 = Main.maxTilesY; - } - for (int n = num4; n <= num5; n++) - { - for (int num8 = num6; num8 < num7; num8++) - { - if ((num8 != num6 || (n != num4 && n != num5)) && Main.tile[n, num8].WallType == 0) - { - Main.tile[n, num8].Get().HasTile = false; - Main.tile[n, num8].WallType = (ushort)wall; - } - } - } - int num9 = i + (num2 + 1) * num; - int num10 = (int)vector.Y; - for (int num11 = num9 - 2; num11 <= num9 + 2; num11++) - { - Main.tile[num11, num10].Get().HasTile = false; - Main.tile[num11, num10 - 1].Get().HasTile = false; - Main.tile[num11, num10 - 2].Get().HasTile = false; - } - WorldGen.PlaceTile(num9, num10, ModContent.TileType(), true, false, -1); //door - num9 = i + (num2 + 1) * -num - num; - for (int num12 = num6; num12 <= num7 + 1; num12++) - { - Main.tile[num9, num12].Get().HasTile = true; - Main.tile[num9, num12].LiquidAmount = 0; - Main.tile[num9, num12].TileType = type; - Main.tile[num9, num12].WallType = 0; - Main.tile[num9, num12].Get().IsHalfBlock = false; - Main.tile[num9, num12].Get().Slope = SlopeType.Solid; - } - WorldGen.AddBuriedChest(i, num10 - 3, item, false, 4); //chest - int num22 = i + (num2 / 2 + 1) * -num; - WorldGen.PlaceTile(num22, num7 - 1, ModContent.TileType(), true, false, -1); //table - WorldGen.PlaceTile(num22 - 2, num7 - 1, ModContent.TileType(), true, false, 0); //chair - Tile tile = Main.tile[num22 - 2, num7 - 1]; - tile.TileFrameX += 18; - Tile tile2 = Main.tile[num22 - 2, num7 - 2]; - tile2.TileFrameX += 18; - WorldGen.PlaceTile(num22 + 2, num7 - 1, ModContent.TileType(), true, false, 0); //chair - } - #endregion - */ - #region ChasmGenerator public static void ChasmGenerator(int i, int j, int steps, bool ocean = false) { diff --git a/World/SulphurousSea.cs b/World/SulphurousSea.cs index b06f86f7fe..75cf866050 100644 --- a/World/SulphurousSea.cs +++ b/World/SulphurousSea.cs @@ -313,7 +313,7 @@ namespace CalamityMod.World for (int y = top; y < bottom; y++) { if (y >= top + DepthForWater) - Main.tile[x, y + WorldGen.genRand.Next(15, 17)].WallType = (ushort)ModContent.WallType(); + Main.tile[x, y + WorldGen.genRand.Next(22, 25)].WallType = (ushort)ModContent.WallType(); Main.tile[x, y].LiquidAmount = byte.MaxValue; Main.tile[x, y].Get().HasTile = false; } @@ -867,7 +867,7 @@ namespace CalamityMod.World // Try again if there is no tile above or the ceiling is not level. if (!WorldUtils.Find(new(x, y), searchCondition, out Point top) || - !WorldUtils.Find(new(x + 1, y), searchCondition, out Point topRight) || top.Y != topRight.Y) + !WorldUtils.Find(new(x + 1, y), searchCondition, out Point topRight) || top.Y != topRight.Y) { tryAgain = true; } @@ -882,7 +882,10 @@ namespace CalamityMod.World continue; } - GenerateColumn(x, top.Y, y); + if (WorldGen.genRand.NextBool(2)) + { + GenerateColumn(x, top.Y, y); + } } } @@ -983,7 +986,7 @@ namespace CalamityMod.World if (WorldGen.InWorld(x + dx, y + dy)) { if (CalamityUtils.ParanoidTileRetrieval(x + dx, y + dy).TileType != sandstoneID && - SulphSeaTiles.Contains(CalamityUtils.ParanoidTileRetrieval(x + dx, y + dy).TileType)) + SulphSeaTiles.Contains(CalamityUtils.ParanoidTileRetrieval(x + dx, y + dy).TileType)) { Main.tile[x + dx, y + dy].WallType = sandstoneWallID; Main.tile[x + dx, y + dy].TileType = sandstoneID; @@ -1029,9 +1032,12 @@ namespace CalamityMod.World type++; int height = heightFromType(type); - PlaceStalactite(x, y, height, CalamityMod.Instance.Find($"SulphurousStalactite{type}").Type); - if (WorldGen.SolidTile(x, y + dy + 1)) + if ((Main.tile[x, y + dy + 1].TileType == ModContent.TileType() || + Main.tile[x, y + dy + 1].TileType == ModContent.TileType()) && + !Main.tile[x, y + dy + 1].LeftSlope && !Main.tile[x, y + dy + 1].RightSlope && !Main.tile[x, y + dy + 1].IsHalfBlock) + { PlaceStalacmite(x, y + dy, height, CalamityMod.Instance.Find($"SulphurousStalacmite{type}").Type); + } } } }