diff --git a/BiomeManagers/AbyssLayer1Biome.cs b/BiomeManagers/AbyssLayer1Biome.cs index 34af82e2df..4b6ae7b4a0 100644 --- a/BiomeManagers/AbyssLayer1Biome.cs +++ b/BiomeManagers/AbyssLayer1Biome.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.World; +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -9,17 +10,16 @@ namespace CalamityMod.BiomeManagers { public class AbyssLayer1Biome : ModBiome { + //keep this here even though layer one now uses a tile check, cannot be bothered to move it for now public static bool MeetsBaseAbyssRequirement(Player player, out int playerYTileCoords) { Point point = player.Center.ToTileCoordinates(); int x = Main.maxTilesX; int y = Main.maxTilesY; int genLimit = x / 2; - int abyssChasmY = y - 250; int abyssChasmX = Abyss.AtLeftSideOfWorld ? genLimit - (genLimit - 135) + 35 : genLimit + (genLimit - 135) - 35; bool abyssPosX = false; - bool abyssPosY = point.Y >= (Main.rockLayer - Main.maxTilesY / 13) && point.Y <= Main.maxTilesY - 200; if (Abyss.AtLeftSideOfWorld) { if (point.X < abyssChasmX + 140) @@ -36,7 +36,7 @@ namespace CalamityMod.BiomeManagers if (WeakReferenceSupport.InAnySubworld()) return false; - return !player.lavaWet && !player.honeyWet && abyssPosY && abyssPosX; + return !player.lavaWet && !player.honeyWet && abyssPosX && playerYTileCoords <= Main.maxTilesY - 200; } //temporarily use sulphur for now @@ -65,9 +65,12 @@ namespace CalamityMod.BiomeManagers public override bool IsBiomeActive(Player player) { - return MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && - playerYTileCoords >= Main.rockLayer - Main.maxTilesY / 15 && - playerYTileCoords <= Main.rockLayer - 22; + Point point = player.Center.ToTileCoordinates(); + + 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; } } } diff --git a/BiomeManagers/AbyssLayer2Biome.cs b/BiomeManagers/AbyssLayer2Biome.cs index 1388f43a10..2121a7cc06 100644 --- a/BiomeManagers/AbyssLayer2Biome.cs +++ b/BiomeManagers/AbyssLayer2Biome.cs @@ -25,14 +25,14 @@ namespace CalamityMod.BiomeManagers public override void SetStaticDefaults() { - DisplayName.SetDefault("Upper Abyss"); + DisplayName.SetDefault("Murky Waters"); } public override bool IsBiomeActive(Player player) { return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && - playerYTileCoords > Main.rockLayer - 22 && - playerYTileCoords <= Main.rockLayer + Main.maxTilesY * 0.145; + playerYTileCoords > Main.rockLayer - 10 && + playerYTileCoords <= Main.rockLayer + Main.maxTilesY * 0.140; } } } diff --git a/BiomeManagers/AbyssLayer3Biome.cs b/BiomeManagers/AbyssLayer3Biome.cs index 57acbda920..aed13ed5ac 100644 --- a/BiomeManagers/AbyssLayer3Biome.cs +++ b/BiomeManagers/AbyssLayer3Biome.cs @@ -25,14 +25,14 @@ namespace CalamityMod.BiomeManagers public override void SetStaticDefaults() { - DisplayName.SetDefault("Lower Abyss"); + DisplayName.SetDefault("Thermal Vents"); } public override bool IsBiomeActive(Player player) { return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && - playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.145 && - playerYTileCoords <= Main.rockLayer + Main.maxTilesY * 0.262; + playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.140 && + playerYTileCoords <= Main.rockLayer + Main.maxTilesY * 0.270; } } } diff --git a/BiomeManagers/AbyssLayer3Icon.png b/BiomeManagers/AbyssLayer3Icon.png index 9469ac6600..8986721ad5 100644 Binary files a/BiomeManagers/AbyssLayer3Icon.png and b/BiomeManagers/AbyssLayer3Icon.png differ diff --git a/BiomeManagers/AbyssLayer4Biome.cs b/BiomeManagers/AbyssLayer4Biome.cs index 8f6b830864..4d7a60ff96 100644 --- a/BiomeManagers/AbyssLayer4Biome.cs +++ b/BiomeManagers/AbyssLayer4Biome.cs @@ -31,7 +31,7 @@ namespace CalamityMod.BiomeManagers public override bool IsBiomeActive(Player player) { return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && - playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.262; + playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.270; } } } diff --git a/BiomeManagers/AbyssLayer4Icon(alt).png b/BiomeManagers/AbyssLayer4Icon(alt).png new file mode 100644 index 0000000000..9469ac6600 Binary files /dev/null and b/BiomeManagers/AbyssLayer4Icon(alt).png differ diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 1fe99f6614..b3cea15892 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -179,7 +179,7 @@ namespace CalamityMod.CalPlayer } bool ASPoisoning = ASPoisonLevel > 0f; - if (ASPoisoning || (ZoneSulphur && !Player.creativeGodMode && Player.IsUnderwater() && !decayEffigy && !abyssalDivingSuit && !Player.lavaWet && !Player.honeyWet && !nearSafeZone)) + if (ASPoisoning || ((ZoneSulphur || Player.Calamity().ZoneAbyssLayer1) && !Player.creativeGodMode && Player.IsUnderwater() && !decayEffigy && !abyssalDivingSuit && !Player.lavaWet && !Player.honeyWet && !nearSafeZone)) { float increment = 1f / SulphSeaWaterSafetyTime; //No way to mitigate AS Poisoning diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 0afda36f12..70f80a9b78 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -969,7 +969,8 @@ 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) + if (tile.LiquidAmount <= 0 || tile.HasTile || (Main.waterStyle != ModContent.Find("CalamityMod/SulphuricWater").Slot && + Main.waterStyle != ModContent.Find("CalamityMod/SulphuricDepthsWater").Slot)) return; Tile above = CalamityUtils.ParanoidTileRetrieval(x, y - 1); @@ -981,7 +982,16 @@ namespace CalamityMod.ILEditing } if (tile.TileType != (ushort)ModContent.TileType()) - outputColor = Vector3.Lerp(outputColor, Color.LightSeaGreen.ToVector3(), 0.41f); + { + if (Main.waterStyle == ModContent.Find("CalamityMod/SulphuricWater").Slot) + { + outputColor = Vector3.Lerp(outputColor, Color.LightSeaGreen.ToVector3(), 0.41f); + } + if (Main.waterStyle == ModContent.Find("CalamityMod/SulphuricDepthsWater").Slot) + { + outputColor = Vector3.Lerp(outputColor, Color.MediumSeaGreen.ToVector3(), 0.18f); + } + } } #endregion Sulph Sea Water Visuals diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index 6d853aee16..c378537ac9 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -49,7 +49,7 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -230,10 +230,6 @@ namespace CalamityMod.NPCs.Abyss public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.Player.Calamity().ZoneAbyssLayer2 && spawnInfo.Water) - { - return SpawnCondition.CaveJellyfish.Chance * 0.4f; - } if (spawnInfo.Player.Calamity().ZoneAbyssLayer3 && spawnInfo.Water) { return SpawnCondition.CaveJellyfish.Chance * 0.6f; diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index b3ad2b873d..fb92790826 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -300,7 +300,7 @@ namespace CalamityMod.NPCs.Abyss public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.Player.Calamity().ZoneAbyssLayer2 && spawnInfo.Water) + if (spawnInfo.Player.Calamity().ZoneAbyssLayer3 && spawnInfo.Water) { return SpawnCondition.CaveJellyfish.Chance * 0.3f; } diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index d1afae2ced..a3edb69bd7 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -296,7 +296,7 @@ namespace CalamityMod.NPCs.Abyss public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.Player.Calamity().ZoneAbyssLayer2 && spawnInfo.Water) + if (spawnInfo.Player.Calamity().ZoneAbyssLayer3 && spawnInfo.Water) { return SpawnCondition.CaveJellyfish.Chance * 0.3f; } diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 36514b12ff..e40cdcdb87 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -439,7 +439,7 @@ namespace CalamityMod.NPCs.Abyss if (spawnInfo.Player.Calamity().ZoneAbyssLayer3 && spawnInfo.Water && !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType())) { - return SpawnCondition.CaveJellyfish.Chance * 0.3f; + return SpawnCondition.CaveJellyfish.Chance * 0.1f; } if (spawnInfo.Player.Calamity().ZoneAbyssLayer4 && spawnInfo.Water && !NPC.AnyNPCs(ModContent.NPCType())) { diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index 542e3cf6e2..419aa6224a 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -224,10 +224,6 @@ namespace CalamityMod.NPCs.Abyss public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.Player.Calamity().ZoneAbyssLayer2 && spawnInfo.Water) - { - return SpawnCondition.CaveJellyfish.Chance * 0.6f; - } if (spawnInfo.Player.Calamity().ZoneAbyssLayer3 && spawnInfo.Water) { return SpawnCondition.CaveJellyfish.Chance * 1.2f; diff --git a/NPCs/Abyss/ReaperShark.cs b/NPCs/Abyss/ReaperShark.cs index 0d31d184d6..2e8a1c8296 100644 --- a/NPCs/Abyss/ReaperShark.cs +++ b/NPCs/Abyss/ReaperShark.cs @@ -656,9 +656,9 @@ namespace CalamityMod.NPCs.Abyss public override float SpawnChance(NPCSpawnInfo spawnInfo) { if (spawnInfo.Player.Calamity().ZoneAbyssLayer3 && spawnInfo.Water && !NPC.AnyNPCs(ModContent.NPCType()) && - !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType())) + !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType())) { - return SpawnCondition.CaveJellyfish.Chance * 0.6f; + return SpawnCondition.CaveJellyfish.Chance * 0.1f; } if (spawnInfo.Player.Calamity().ZoneAbyssLayer4 && spawnInfo.Water && !NPC.AnyNPCs(ModContent.NPCType())) { diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index b8877a962f..40874b01a9 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -50,7 +50,7 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - SpawnModBiomes = new int[3] { ModContent.GetInstance().Type, ModContent.GetInstance().Type, ModContent.GetInstance().Type }; + SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -173,10 +173,6 @@ namespace CalamityMod.NPCs.Abyss { return SpawnCondition.CaveJellyfish.Chance * 0.9f; } - if (spawnInfo.Player.Calamity().ZoneAbyssLayer3 && spawnInfo.Water) - { - return SpawnCondition.CaveJellyfish.Chance * 0.6f; - } return 0f; } diff --git a/NPCs/SulphurousSea/Sulflounder.cs b/NPCs/SulphurousSea/Sulflounder.cs index 93e1ba87dc..4ebf538cb3 100644 --- a/NPCs/SulphurousSea/Sulflounder.cs +++ b/NPCs/SulphurousSea/Sulflounder.cs @@ -132,17 +132,13 @@ namespace CalamityMod.NPCs.SulphurousSea public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.PlayerSafe) - { - return 0f; - } if (spawnInfo.Player.Calamity().ZoneSulphur && spawnInfo.Water) { return 0.2f; } if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water) { - return 0.35f; + return 0.45f; } return 0f; } diff --git a/NPCs/SulphurousSea/Toxicatfish.cs b/NPCs/SulphurousSea/Toxicatfish.cs index 83f0188e6a..f2a9bfd686 100644 --- a/NPCs/SulphurousSea/Toxicatfish.cs +++ b/NPCs/SulphurousSea/Toxicatfish.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -98,14 +98,14 @@ namespace CalamityMod.NPCs.SulphurousSea public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.PlayerSafe) - { - return 0f; - } if (spawnInfo.Player.Calamity().ZoneSulphur && spawnInfo.Water) { return 0.2f; } + if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water) + { + return 0.35f; + } return 0f; } diff --git a/Tiles/Abyss/AbyssAmbient/SulphurPireCoralThin.png b/Tiles/Abyss/AbyssAmbient/SulphurPireCoralThin.png deleted file mode 100644 index f6e5754248..0000000000 Binary files a/Tiles/Abyss/AbyssAmbient/SulphurPireCoralThin.png and /dev/null differ diff --git a/Tiles/Abyss/AbyssAmbient/SulphurPireCoralThinGlow.png b/Tiles/Abyss/AbyssAmbient/SulphurPireCoralThinGlow.png deleted file mode 100644 index 7a9e3c583e..0000000000 Binary files a/Tiles/Abyss/AbyssAmbient/SulphurPireCoralThinGlow.png and /dev/null differ diff --git a/Tiles/Abyss/AbyssAmbient/SulphurTentacleCorals.cs b/Tiles/Abyss/AbyssAmbient/SulphurTentacleCorals.cs index 0fcaf3ab39..e88296836f 100644 --- a/Tiles/Abyss/AbyssAmbient/SulphurTentacleCorals.cs +++ b/Tiles/Abyss/AbyssAmbient/SulphurTentacleCorals.cs @@ -30,8 +30,7 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); TileObjectData.addTile(Type); AddMapEntry(new Color(111, 89, 127)); - DustType = DustID.Grass; - HitSound = SoundID.Grass; + DustType = 32; base.SetStaticDefaults(); } @@ -45,7 +44,7 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { Tile tile = Framing.GetTileSafely(i, j); - if (tile.TileFrameX >= 72) + if (tile.TileFrameX <= 324) { float brightness = 0.7f; float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.0025f; @@ -59,6 +58,21 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient g *= brightness; b *= brightness; } + + if (tile.TileFrameX > 324) + { + float brightness = 0.7f; + float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.0025f; + brightness *= (float)MathF.Sin(-j / 2f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + i); + brightness *= (float)MathF.Sin(-i / 2f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + j); + brightness += 0.7f; + r = 230f / 500f; + g = 255f / 500f; + b = 0f; + r *= brightness; + g *= brightness; + b *= brightness; + } } } } diff --git a/Tiles/Abyss/AbyssAmbient/SulphurTentacleCorals.png b/Tiles/Abyss/AbyssAmbient/SulphurTentacleCorals.png index fdbdb38773..aa5d0743b8 100644 Binary files a/Tiles/Abyss/AbyssAmbient/SulphurTentacleCorals.png and b/Tiles/Abyss/AbyssAmbient/SulphurTentacleCorals.png differ diff --git a/Tiles/Abyss/AbyssAmbient/SulphurTentacleCoralsGlow.png b/Tiles/Abyss/AbyssAmbient/SulphurTentacleCoralsGlow.png index c2f8290b23..2b64708f68 100644 Binary files a/Tiles/Abyss/AbyssAmbient/SulphurTentacleCoralsGlow.png and b/Tiles/Abyss/AbyssAmbient/SulphurTentacleCoralsGlow.png differ diff --git a/Tiles/Abyss/PyreMantle.cs b/Tiles/Abyss/PyreMantle.cs index b6c1e1ce4f..0881be913b 100644 --- a/Tiles/Abyss/PyreMantle.cs +++ b/Tiles/Abyss/PyreMantle.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Tiles.Abyss public class PyreMantle : ModTile { public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/VoidstoneMine", 3) { Volume = 0.4f }; + public override void SetStaticDefaults() { - Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; Main.tileBrick[Type] = true; @@ -35,7 +35,7 @@ namespace CalamityMod.Tiles.Abyss public override bool CreateDust(int i, int j, ref int type) { - Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 180, 0f, 0f, 1, new Color(128, 128, 128), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 162, 0f, 0f, 1, new Color(128, 128, 128), 1f); return false; } diff --git a/Tiles/Abyss/PyreMantleMolten.cs b/Tiles/Abyss/PyreMantleMolten.cs index 1fdf0b8b22..7684acc143 100644 --- a/Tiles/Abyss/PyreMantleMolten.cs +++ b/Tiles/Abyss/PyreMantleMolten.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Tiles.Abyss HitSound = MineSound; MineResist = 10f; MinPick = 180; - ItemDrop = ModContent.ItemType(); + ItemDrop = ModContent.ItemType(); AddMapEntry(new Color(113, 49, 16)); } @@ -39,7 +39,7 @@ namespace CalamityMod.Tiles.Abyss public override bool CreateDust(int i, int j, ref int type) { - Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 180, 0f, 0f, 1, new Color(128, 128, 128), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 162, 0f, 0f, 1, new Color(128, 128, 128), 1f); return false; } diff --git a/Tiles/Abyss/SulphurousShale.cs b/Tiles/Abyss/SulphurousShale.cs index 6deb4dbfa3..5c5d16946b 100644 --- a/Tiles/Abyss/SulphurousShale.cs +++ b/Tiles/Abyss/SulphurousShale.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Tiles.Abyss if (WorldGen.InWorld(x, y)) { if (CalamityUtils.ParanoidTileRetrieval(x, y).HasTile && - CalamityUtils.ParanoidTileRetrieval(x, y).TileType == (ushort)ModContent.TileType()) + CalamityUtils.ParanoidTileRetrieval(x, y).TileType == (ushort)ModContent.TileType()) { nearbyVineCount++; } @@ -105,15 +105,15 @@ namespace CalamityMod.Tiles.Abyss Tile up = Main.tile[i, j - 1]; Tile up2 = Main.tile[i, j - 2]; - //place kelp - if (WorldGen.genRand.Next(8) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + //place sulphur tentacle corals + if (WorldGen.genRand.Next(10) == 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; up.TileFrameY = 0; - //7 different frames, choose a random one - up.TileFrameX = (short)(WorldGen.genRand.Next(11) * 18); + //18 different frames, choose a random one + up.TileFrameX = (short)(WorldGen.genRand.Next(22) * 18); WorldGen.SquareTileFrame(i, j - 1, true); if (Main.netMode == NetmodeID.Server) diff --git a/Tiles/Abyss/SulphurousVines.cs b/Tiles/Abyss/SulphurousVines.cs index 8b0a01ff04..70c79e3dc8 100644 --- a/Tiles/Abyss/SulphurousVines.cs +++ b/Tiles/Abyss/SulphurousVines.cs @@ -35,6 +35,19 @@ namespace CalamityMod.Tiles.Abyss num = fail ? 1 : 3; } + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + Tile tileAbove = Framing.GetTileSafely(i, j - 1); + + if (!tileAbove.HasTile) + { + WorldGen.KillTile(i, j); + return true; + } + + return true; + } + public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem) { //GIVE VINE ROPE IF SPECIAL VINE BOOK diff --git a/Tiles/Abyss/ViperVines.cs b/Tiles/Abyss/ViperVines.cs index 31d0831016..ee623ff792 100644 --- a/Tiles/Abyss/ViperVines.cs +++ b/Tiles/Abyss/ViperVines.cs @@ -26,6 +26,19 @@ namespace CalamityMod.Tiles.Abyss num = fail ? 1 : 3; } + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + Tile tileAbove = Framing.GetTileSafely(i, j - 1); + + if (!tileAbove.HasTile) + { + WorldGen.KillTile(i, j); + return true; + } + + return true; + } + public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem) { //GIVE VINE ROPE IF SPECIAL VINE BOOK diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index c3b229d13c..61d9b5f01c 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -50,8 +50,8 @@ namespace CalamityMod.Tiles (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), }; public static List GrowthTiles = new List() diff --git a/Tiles/Crags/Lily/LavaLily4.cs b/Tiles/Crags/Lily/LavaLily4.cs new file mode 100644 index 0000000000..656b9ee373 --- /dev/null +++ b/Tiles/Crags/Lily/LavaLily4.cs @@ -0,0 +1,63 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; +using Terraria.DataStructures; +using Terraria.Enums; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Tiles.Crags.Lily +{ + public class LavaLily4 : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileSolid[Type] = false; + TileObjectData.newTile.Width = 5; + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(3, 2); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.StyleWrapLimit = 36; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.DrawYOffset = 3; + TileObjectData.addTile(Type); + AddMapEntry(new Color(153, 100, 176)); + DustType = -1; //idk what dust to put here + } + + internal static void DrawLilyTop(int i, int j, Texture2D tex, Rectangle? source, Vector2? offset = null, Vector2? origin = null, bool Glow = false) + { + Tile tile = Main.tile[i, j]; + Vector2 drawPos = new Vector2(i, j).ToWorldCoordinates() - Main.screenPosition + (offset ?? new Vector2(0, -2)); + Color color = Lighting.GetColor(i, j); + + Main.spriteBatch.Draw(tex, drawPos, source, Glow ? Color.White : color, 0, origin ?? source.Value.Size() / 3f, 1f, SpriteEffects.None, 0f); + } + + public static Vector2 TileOffset => Lighting.LegacyEngine.Mode > 1 ? Vector2.Zero : Vector2.One * 12; + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + //draw the glowmask on the lily base + Tile tile = Framing.GetTileSafely(i, j); + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily4Glow").Value; + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); + + spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White); + + Texture2D lilyTex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily4Top").Value; + Texture2D glowTex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily4TopGlow").Value; + + //draw in the middle of the tile so it doesnt draw more than once + if (Framing.GetTileSafely(i, j).TileFrameX == 36 && Framing.GetTileSafely(i, j).TileFrameY == 18) + { + DrawLilyTop(i, j, lilyTex, new Rectangle(0, 0, 178, 184), TileOffset.ToWorldCoordinates(), new Vector2(96, 191), false); + DrawLilyTop(i, j, glowTex, new Rectangle(0, 0, 178, 184), TileOffset.ToWorldCoordinates(), new Vector2(96, 191), true); + } + } + } +} \ No newline at end of file diff --git a/Tiles/Crags/Lily/LavaLily4.png b/Tiles/Crags/Lily/LavaLily4.png new file mode 100644 index 0000000000..4b2ca5ac81 Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily4.png differ diff --git a/Tiles/Crags/Lily/LavaLily4Glow.png b/Tiles/Crags/Lily/LavaLily4Glow.png new file mode 100644 index 0000000000..0d76ccdea0 Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily4Glow.png differ diff --git a/Tiles/Crags/Lily/LavaLily4Top.png b/Tiles/Crags/Lily/LavaLily4Top.png new file mode 100644 index 0000000000..328eba3368 Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily4Top.png differ diff --git a/Tiles/Crags/Lily/LavaLily4TopGlow.png b/Tiles/Crags/Lily/LavaLily4TopGlow.png new file mode 100644 index 0000000000..38b92d2064 Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily4TopGlow.png differ diff --git a/Tiles/Crags/Lily/LavaLily5.cs b/Tiles/Crags/Lily/LavaLily5.cs new file mode 100644 index 0000000000..2a0457980a --- /dev/null +++ b/Tiles/Crags/Lily/LavaLily5.cs @@ -0,0 +1,63 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; +using Terraria.DataStructures; +using Terraria.Enums; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Tiles.Crags.Lily +{ + public class LavaLily5 : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileSolid[Type] = false; + TileObjectData.newTile.Width = 5; + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(3, 2); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.StyleWrapLimit = 36; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.DrawYOffset = 3; + TileObjectData.addTile(Type); + AddMapEntry(new Color(153, 100, 176)); + DustType = -1; //idk what dust to put here + } + + internal static void DrawLilyTop(int i, int j, Texture2D tex, Rectangle? source, Vector2? offset = null, Vector2? origin = null, bool Glow = false) + { + Tile tile = Main.tile[i, j]; + Vector2 drawPos = new Vector2(i, j).ToWorldCoordinates() - Main.screenPosition + (offset ?? new Vector2(0, -2)); + Color color = Lighting.GetColor(i, j); + + Main.spriteBatch.Draw(tex, drawPos, source, Glow ? Color.White : color, 0, origin ?? source.Value.Size() / 3f, 1f, SpriteEffects.None, 0f); + } + + public static Vector2 TileOffset => Lighting.LegacyEngine.Mode > 1 ? Vector2.Zero : Vector2.One * 12; + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + //draw the glowmask on the lily base + Tile tile = Framing.GetTileSafely(i, j); + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily5Glow").Value; + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); + + spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White); + + Texture2D lilyTex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily5Top").Value; + Texture2D glowTex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily5TopGlow").Value; + + //draw in the middle of the tile so it doesnt draw more than once + if (Framing.GetTileSafely(i, j).TileFrameX == 36 && Framing.GetTileSafely(i, j).TileFrameY == 18) + { + DrawLilyTop(i, j, lilyTex, new Rectangle(0, 0, 192, 206), TileOffset.ToWorldCoordinates(), new Vector2(114, 209), false); + DrawLilyTop(i, j, glowTex, new Rectangle(0, 0, 192, 206), TileOffset.ToWorldCoordinates(), new Vector2(114, 209), true); + } + } + } +} \ No newline at end of file diff --git a/Tiles/Crags/Lily/LavaLily5.png b/Tiles/Crags/Lily/LavaLily5.png new file mode 100644 index 0000000000..ece379c262 Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily5.png differ diff --git a/Tiles/Crags/Lily/LavaLily5Glow.png b/Tiles/Crags/Lily/LavaLily5Glow.png new file mode 100644 index 0000000000..b51e6b0b1b Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily5Glow.png differ diff --git a/Tiles/Crags/Lily/LavaLily5Top.png b/Tiles/Crags/Lily/LavaLily5Top.png new file mode 100644 index 0000000000..d78dfda67b Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily5Top.png differ diff --git a/Tiles/Crags/Lily/LavaLily5TopGlow.png b/Tiles/Crags/Lily/LavaLily5TopGlow.png new file mode 100644 index 0000000000..8d857ef0d9 Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily5TopGlow.png differ diff --git a/Tiles/Crags/Lily/LavaLily6.cs b/Tiles/Crags/Lily/LavaLily6.cs new file mode 100644 index 0000000000..916f4bdd13 --- /dev/null +++ b/Tiles/Crags/Lily/LavaLily6.cs @@ -0,0 +1,63 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; +using Terraria.DataStructures; +using Terraria.Enums; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Tiles.Crags.Lily +{ + public class LavaLily6 : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileSolid[Type] = false; + TileObjectData.newTile.Width = 5; + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(3, 2); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.StyleWrapLimit = 36; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.DrawYOffset = 3; + TileObjectData.addTile(Type); + AddMapEntry(new Color(153, 100, 176)); + DustType = -1; //idk what dust to put here + } + + internal static void DrawLilyTop(int i, int j, Texture2D tex, Rectangle? source, Vector2? offset = null, Vector2? origin = null, bool Glow = false) + { + Tile tile = Main.tile[i, j]; + Vector2 drawPos = new Vector2(i, j).ToWorldCoordinates() - Main.screenPosition + (offset ?? new Vector2(0, -2)); + Color color = Lighting.GetColor(i, j); + + Main.spriteBatch.Draw(tex, drawPos, source, Glow ? Color.White : color, 0, origin ?? source.Value.Size() / 3f, 1f, SpriteEffects.None, 0f); + } + + public static Vector2 TileOffset => Lighting.LegacyEngine.Mode > 1 ? Vector2.Zero : Vector2.One * 12; + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + //draw the glowmask on the lily base + Tile tile = Framing.GetTileSafely(i, j); + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily6Glow").Value; + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); + + spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White); + + Texture2D lilyTex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily6Top").Value; + Texture2D glowTex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily6TopGlow").Value; + + //draw in the middle of the tile so it doesnt draw more than once + if (Framing.GetTileSafely(i, j).TileFrameX == 36 && Framing.GetTileSafely(i, j).TileFrameY == 18) + { + DrawLilyTop(i, j, lilyTex, new Rectangle(0, 0, 178, 198), TileOffset.ToWorldCoordinates(), new Vector2(96, 199), false); + DrawLilyTop(i, j, glowTex, new Rectangle(0, 0, 178, 198), TileOffset.ToWorldCoordinates(), new Vector2(96, 199), true); + } + } + } +} \ No newline at end of file diff --git a/Tiles/Crags/Lily/LavaLily6.png b/Tiles/Crags/Lily/LavaLily6.png new file mode 100644 index 0000000000..8c3eda7fea Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily6.png differ diff --git a/Tiles/Crags/Lily/LavaLily6Glow.png b/Tiles/Crags/Lily/LavaLily6Glow.png new file mode 100644 index 0000000000..03545208df Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily6Glow.png differ diff --git a/Tiles/Crags/Lily/LavaLily6Top.png b/Tiles/Crags/Lily/LavaLily6Top.png new file mode 100644 index 0000000000..10de73d614 Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily6Top.png differ diff --git a/Tiles/Crags/Lily/LavaLily6TopGlow.png b/Tiles/Crags/Lily/LavaLily6TopGlow.png new file mode 100644 index 0000000000..e7cacb0baf Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily6TopGlow.png differ diff --git a/Tiles/Crags/ScorchedRemains.cs b/Tiles/Crags/ScorchedRemains.cs index 139143f484..d12acfb850 100644 --- a/Tiles/Crags/ScorchedRemains.cs +++ b/Tiles/Crags/ScorchedRemains.cs @@ -43,7 +43,6 @@ namespace CalamityMod.Tiles.Crags public override bool CreateDust(int i, int j, ref int type) { - Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 60, 0f, 0f, 1, new Color(255, 255, 255), 1f); Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 1, 0f, 0f, 1, new Color(100, 100, 100), 1f); return false; } diff --git a/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs b/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs index d86ea1833f..36c7756de2 100644 --- a/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs +++ b/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs @@ -53,7 +53,7 @@ namespace CalamityMod.UI.SulphurousWaterMeter CalamityPlayer modPlayer = player.Calamity(); // If not drawing the water meter, save its latest position to config and leave. - if (modPlayer.SulphWaterUIOpacity > 0f && modPlayer.ZoneSulphur) + if (modPlayer.SulphWaterUIOpacity > 0f && (modPlayer.ZoneSulphur || player.Calamity().ZoneAbyssLayer1)) DrawWaterBar(spriteBatch, modPlayer, screenPos); else { diff --git a/Utilities/TileFraming.cs b/Utilities/TileFraming.cs index a7499120c9..6cec98ca77 100644 --- a/Utilities/TileFraming.cs +++ b/Utilities/TileFraming.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Abyss.AbyssAmbient; using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.AstralSnow; @@ -62,6 +63,8 @@ namespace CalamityMod PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; + PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; + PlantCheckAgainst[ModContent.TileType()] = new int[2] { ModContent.TileType(), ModContent.TileType() }; VineToGrass = new Dictionary { diff --git a/Utilities/WorldgenUtils.cs b/Utilities/WorldgenUtils.cs index 5c1fbcdbf8..215a38a0c4 100644 --- a/Utilities/WorldgenUtils.cs +++ b/Utilities/WorldgenUtils.cs @@ -41,6 +41,28 @@ namespace CalamityMod } } + public static void GrowVines(int VineX, int VineY, int numVines, ushort vineType, bool finished = false) + { + for (int Y = VineY; Y <= VineY + numVines && !finished; Y++) + { + Tile tileBelow = Framing.GetTileSafely(VineX, Y + 1); + + if ((!tileBelow.HasTile || tileBelow.TileType == TileID.Cobweb) && WorldGen.InWorld(VineX, Y)) + { + WorldGen.PlaceTile(VineX, Y, vineType); + } + else + { + finished = true; + } + + if (numVines <= 1) + { + finished = true; + } + } + } + /// /// Settles all liquids in the world. /// diff --git a/Walls/BrimstoneSlabWall.cs b/Walls/BrimstoneSlabWall.cs index 086a7b8d03..844705176b 100644 --- a/Walls/BrimstoneSlabWall.cs +++ b/Walls/BrimstoneSlabWall.cs @@ -21,6 +21,11 @@ namespace CalamityMod.Walls return false; } + public override bool CanExplode(int i, int j) + { + return false; + } + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) diff --git a/Walls/PyreMantleWall.cs b/Walls/PyreMantleWall.cs new file mode 100644 index 0000000000..151de556ec --- /dev/null +++ b/Walls/PyreMantleWall.cs @@ -0,0 +1,31 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Walls +{ + public class PyreMantleWall : ModWall + { + public override void SetStaticDefaults() + { + DustType = 33; + AddMapEntry(new Color(6, 10, 54)); + } + + public override void RandomUpdate(int i, int j) + { + if (Main.tile[i, j].LiquidAmount <= 0 && j < Main.maxTilesY - 205) + { + Main.tile[i, j].LiquidAmount = 255; + Main.tile[i, j].Get().LiquidType = LiquidID.Water; + } + } + + public override void KillWall(int i, int j, ref bool fail) => fail = true; + + public override bool CanExplode(int i, int j) => false; + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + } +} diff --git a/Walls/PyreMantleWall.png b/Walls/PyreMantleWall.png new file mode 100644 index 0000000000..7224452252 Binary files /dev/null and b/Walls/PyreMantleWall.png differ diff --git a/World/Abyss.cs b/World/Abyss.cs index ddb1382e58..bdb9d47b33 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -11,6 +11,7 @@ using CalamityMod.Tiles.Abyss.AbyssAmbient; using CalamityMod.Tiles.FurnitureVoid; using CalamityMod.Tiles.Ores; using CalamityMod.Walls; +using CalamityMod.DataStructures; using Microsoft.Xna.Framework; using System; using System.Linq; @@ -19,6 +20,9 @@ using Terraria; using Terraria.ID; using Terraria.IO; using Terraria.ModLoader; +using Terraria.GameContent.Generation; +using Terraria.DataStructures; +using Terraria.WorldBuilding; namespace CalamityMod.World { @@ -64,56 +68,61 @@ namespace CalamityMod.World 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(); + bool canConvert = tile.HasTile && tile.TileType < TileID.Count && tile.TileType != ModContent.TileType(); + //normally i would organize each layer of blocks by the order of how they are placed in the abyss + //but i cannot be bothered, and when i do it, it keeps messing up or making certain parts like transitions not gen right + //i have at least left comments so people reading will know what does what if (abyssIndex2 > (rockLayer - Main.maxTilesY / 15) - WorldGen.genRand.Next(30)) { - //dithering on the edge of the abyss + //dithering on the edge of the abyss, checks for the exposed edge depending on worldside if ((AtLeftSideOfWorld && abyssIndex > abyssChasmX + 145) || (!AtLeftSideOfWorld && abyssIndex < abyssChasmX - 145)) { if (WorldGen.genRand.NextBool(2)) { WorldGen.KillTile(abyssIndex, abyssIndex2); - if (abyssIndex2 > (rockLayer + y * 0.262)) + //layer 4 + if (abyssIndex2 > (rockLayer + y * 0.275)) { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); } - else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3)) + //layer 3-4 dithering transition + else if (abyssIndex2 > (rockLayer + y * 0.270) && WorldGen.genRand.NextBool(2)) { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); } + //layer 3 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()); - } + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); } - else if (abyssIndex2 >= rockLayer - 20 && abyssIndex2 <= rockLayer - 10) + //layer 2-3 dithering transition + else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(2)) + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); + } + //layer 1-2 dithering transition + else if (abyssIndex2 >= rockLayer - 10 && abyssIndex2 <= rockLayer) { if (WorldGen.genRand.NextBool(2)) { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); } else { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); } } - else if (abyssIndex2 <= rockLayer - 20) + //layer 1 + else if (abyssIndex2 <= rockLayer - 10) { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); } + //layer 2 (default block for the abyss) else { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); } } } @@ -121,49 +130,51 @@ namespace CalamityMod.World { if (canConvert) { - if (abyssIndex2 > (rockLayer + y * 0.262)) + //layer 4 + if (abyssIndex2 > (rockLayer + y * 0.275)) { tile.TileType = (ushort)ModContent.TileType(); tile.WallType = (ushort)ModContent.WallType(); } - else if (abyssIndex2 > (rockLayer + y * 0.142) && WorldGen.genRand.NextBool(3)) + //layer 3-4 dithering transition + else if (abyssIndex2 > (rockLayer + y * 0.270) && WorldGen.genRand.NextBool(2)) { tile.TileType = (ushort)ModContent.TileType(); tile.WallType = (ushort)ModContent.WallType(); } + //layer 3 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(); + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); } - else if (abyssIndex2 >= rockLayer - 20 && abyssIndex2 <= rockLayer) + //layer 2-3 dithering transition + else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(2)) + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + //layer 1-2 dithering transition + else if (abyssIndex2 >= rockLayer - 10 && 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) + //layer 1 + else if (abyssIndex2 <= rockLayer - 10) { tile.TileType = (ushort)ModContent.TileType(); tile.WallType = (ushort)ModContent.WallType(); } + //layer 2 (default block for the abyss) else { tile.TileType = (ushort)ModContent.TileType(); @@ -173,49 +184,52 @@ namespace CalamityMod.World else if (!tile.HasTile) { tile.Get().HasTile = true; - if (abyssIndex2 > (rockLayer + y * 0.262)) + + //layer 4 + if (abyssIndex2 > (rockLayer + y * 0.275)) { tile.TileType = (ushort)ModContent.TileType(); tile.WallType = (ushort)ModContent.WallType(); } - else if (abyssIndex2 > (rockLayer + y * 0.142) && WorldGen.genRand.NextBool(3)) + //layer 3-4 dithering transition + else if (abyssIndex2 > (rockLayer + y * 0.270) && WorldGen.genRand.NextBool(2)) { tile.TileType = (ushort)ModContent.TileType(); tile.WallType = (ushort)ModContent.WallType(); } + //layer 3 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(); + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); } - else if (abyssIndex2 >= rockLayer - 20 && abyssIndex2 <= rockLayer) + //layer 2-3 dithering transition + else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(2)) + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + //layer 1-2 dithering transition + else if (abyssIndex2 >= rockLayer - 10 && 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) + //layer 1 + else if (abyssIndex2 <= rockLayer - 10) { tile.TileType = (ushort)ModContent.TileType(); tile.WallType = (ushort)ModContent.WallType(); } + //layer 2 (default block for the abyss) else { tile.TileType = (ushort)ModContent.TileType(); @@ -227,7 +241,7 @@ namespace CalamityMod.World } } - //just place three craters next to each other to make it wider + //just place three craters next to each other to make it wider, genuinely could not understand the ChasmGenerator generation code 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); @@ -246,10 +260,9 @@ namespace CalamityMod.World //place eidolon snail fossil int realFossilY = 0; bool placedFossil = false; - - //place islands to hide the fossil (funny) - 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); + + AbyssIsland(abyssChasmX + 50, AbyssChasmBottom + 25, 65, 75, 65, 75, ModContent.TileType(), false, true, false); + AbyssIsland(abyssChasmX - 50, AbyssChasmBottom + 25, 65, 75, 65, 75, ModContent.TileType(), false, true, false); while (!placedFossil) { @@ -290,78 +303,103 @@ namespace CalamityMod.World } //place a single abyss island under the terminus shrine - AbyssIsland(abyssChasmX, AbyssChasmBottom + 5, 65, 75, 40, 45, false, false, true, false); + AbyssIsland(abyssChasmX, AbyssChasmBottom + 5, 65, 75, 40, 45, ModContent.TileType(), 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++) + //start placing islands at the world surface so the abyss hole isnt completely empty + int abyssStartHeight = (SulphurousSea.YStart + (int)Main.worldSurface) / 2 + 90; + for (int sulphurIslandY = abyssStartHeight; sulphurIslandY <= rockLayer - 15; sulphurIslandY++) { - if (WorldGen.genRand.NextBool(2)) + int islandLocationX = abyssChasmX; + int islandLocationOffset = WorldGen.genRand.Next(15, 22); + int randomPositon = WorldGen.genRand.Next(35, 80); + int randomIsland = WorldGen.genRand.Next(4); + switch (randomIsland) { - int randomIsland = WorldGen.genRand.Next(3); - switch (randomIsland) - { - case 0: - AbyssIsland(abyssChasmX - WorldGen.genRand.Next(-40, 40), 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); - AbyssIsland(abyssChasmX - WorldGen.genRand.Next(10, 20), 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; - } - - //increase y value so islands cant be spammed on top of each other - sulphurIslandY += 15; + case 0: + //3 islands, middle one with chest + AbyssIsland(islandLocationX - randomPositon - 10, sulphurIslandY + 15, 60, 65, 45, 55, ModContent.TileType(), false, false, false); + AbyssIsland(islandLocationX, sulphurIslandY, 60, 65, 45, 55, ModContent.TileType(), false, false, false); + AbyssIsland(islandLocationX + randomPositon + 10, sulphurIslandY + 15, 60, 65, 45, 55, ModContent.TileType(), false, false, false); + break; + case 1: + //3 islands, left, middle one with chest, and right + AbyssIsland(islandLocationX - randomPositon, sulphurIslandY + 10, 60, 85, 30, 35, ModContent.TileType(), false, false, false); + AbyssIsland(islandLocationX, sulphurIslandY + 15, 60, 85, 30, 35, ModContent.TileType(), false, false, false); + AbyssIsland(islandLocationX + randomPositon, sulphurIslandY, 60, 85, 30, 35, ModContent.TileType(), false, false, false); + islandLocationX += 30; + break; + case 2: + //1 island, right only + AbyssIsland(islandLocationX - randomPositon, sulphurIslandY + 10, 55, 65, 30, 35, ModContent.TileType(), false, false, false); + islandLocationX -= 30; + break; + case 3: + //1 island, right only + AbyssIsland(islandLocationX + randomPositon, sulphurIslandY + 15, 60, 85, 30, 55, ModContent.TileType(), false, false, false); + islandLocationX += 25; + break; + case 4: + //2 islands, left and right + AbyssIsland(islandLocationX - randomPositon, sulphurIslandY, 60, 75, 30, 40, ModContent.TileType(), false, false, false); + AbyssIsland(islandLocationX + randomPositon, sulphurIslandY + 5, 60, 75, 30, 40, ModContent.TileType(), false, false, false); + islandLocationX -= 25; + break; } + + //increase y value so islands cant be spammed on top of each other + sulphurIslandY += islandLocationOffset; } - //normal abyss islands - int islandLocationOffset = 30; + //islands for layer 2 int islandLocationY = rockLayer; for (int islands = 0; islands < maxAbyssIslands; islands++) { int islandLocationX = abyssChasmX; - int randomIsland = WorldGen.genRand.Next(5); //0 1 2 3 4 - bool hasVoidstone = islandLocationY > (rockLayer + y * 0.143); + int islandLocationOffset = WorldGen.genRand.Next(18, 25); + int randomPositon = WorldGen.genRand.Next(45, 80); AbyssIslandPositions[TotalPlacedIslandsSoFar].Y = islandLocationY; - int randomPositon = WorldGen.genRand.Next(38, 65); + + int randomIsland = WorldGen.genRand.Next(5); switch (randomIsland) { case 0: - 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); + //3 islands, middle one with chest + AbyssIsland(islandLocationX - randomPositon - 10, islandLocationY + 15, 60, 65, 30, 35, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX, islandLocationY, 60, 65, 30, 35, ModContent.TileType(), true, true, true); + AbyssIsland(islandLocationX + randomPositon + 10, islandLocationY + 15, 60, 65, 30, 35, ModContent.TileType(), false, true, false); break; case 1: - 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); + //3 islands, left, middle one with chest, and right + AbyssIsland(islandLocationX - randomPositon, islandLocationY + 10, 60, 65, 30, 35, ModContent.TileType(), false, true, true); + AbyssIsland(islandLocationX, islandLocationY + 15, 60, 65, 30, 35, ModContent.TileType(), true, true, false); + AbyssIsland(islandLocationX + randomPositon, islandLocationY, 60, 65, 30, 35, ModContent.TileType(), false, true, false); islandLocationX += 30; break; case 2: - 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); + //3 islands, none with chest + AbyssIsland(islandLocationX - randomPositon - 20, islandLocationY, 55, 65, 30, 35, ModContent.TileType(), false, true, true); + AbyssIsland(islandLocationX + 15, islandLocationY + 15, 55, 65, 30, 35, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX + randomPositon + 20, islandLocationY + 10, 55, 65, 30, 35, ModContent.TileType(), false, true, false); islandLocationX -= 30; break; case 3: - 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); + //3 islands, left, middle, and right one with chest + AbyssIsland(islandLocationX - randomPositon, islandLocationY + 15, 60, 65, 30, 45, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX - 15, islandLocationY + 5, 60, 65, 30, 45, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX + randomPositon, islandLocationY, 60, 65, 30, 45, ModContent.TileType(), true, true, true); islandLocationX += 25; break; case 4: - 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); + //3 islands, left one with chest, middle, and right + AbyssIsland(islandLocationX - randomPositon, islandLocationY, 60, 75, 30, 40, ModContent.TileType(), true, true, false); + AbyssIsland(islandLocationX, islandLocationY + 15, 60, 75, 30, 40, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX + randomPositon, islandLocationY + 5, 60, 75, 30, 40, ModContent.TileType(), false, true, false); islandLocationX -= 25; break; } @@ -370,12 +408,66 @@ namespace CalamityMod.World TotalPlacedIslandsSoFar++; islandLocationY += islandLocationOffset; - if (islandLocationY >= AbyssChasmBottom - 50) + + //do not place anymore islands when the third layer is reached + if (islandLocationY >= (rockLayer + y * 0.145) - 10) + { break; + } + } + + //islands for layer 3 + for (int thermalIslandY = (int)(rockLayer + y * 0.145); thermalIslandY <= (int)(rockLayer + y * 0.270); thermalIslandY++) + { + int islandLocationX = abyssChasmX; + int islandLocationOffset = WorldGen.genRand.Next(18, 30); + int randomPositon = WorldGen.genRand.Next(45, 80); + bool hasScoria = WorldGen.genRand.NextBool(2); //50% chance to place scoria in each island instead of planty mush + + int randomIsland = WorldGen.genRand.Next(4); + switch (randomIsland) + { + case 0: + //3 islands, left, middle, and right + AbyssIsland(islandLocationX - randomPositon - 10, thermalIslandY + 15, 60, 65, 45, 55, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX, thermalIslandY, 60, 65, 45, 55, ModContent.TileType(), false, true, true); + AbyssIsland(islandLocationX + randomPositon + 10, thermalIslandY + 15, 60, 65, 45, 55, ModContent.TileType(), false, true, false); + islandLocationX -= 30; + break; + case 1: + //3 islands, left, middle (slightly lower), and right + AbyssIsland(islandLocationX - randomPositon, thermalIslandY + 10, 60, 85, 30, 35, ModContent.TileType(), false, true, true); + AbyssIsland(islandLocationX, thermalIslandY + 15, 60, 85, 30, 35, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX + randomPositon, thermalIslandY, 60, 85, 30, 35, ModContent.TileType(), false, true, false); + islandLocationX += 30; + break; + case 2: + //3 islands, left, middle (slightly left), and right + AbyssIsland(islandLocationX - randomPositon - 20, thermalIslandY, 55, 65, 30, 35, ModContent.TileType(), false, true, true); + AbyssIsland(islandLocationX - 20, thermalIslandY + 15, 55, 65, 30, 35, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX + randomPositon + 20, thermalIslandY + 10, 55, 65, 30, 35, ModContent.TileType(), false, true, false); + islandLocationX -= 25; + break; + case 3: + //3 islands, left, middle (slightly right), and right + AbyssIsland(islandLocationX - randomPositon, thermalIslandY + 15, 60, 85, 30, 55, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX + 20, thermalIslandY + 5, 60, 85, 30, 55, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX + randomPositon, thermalIslandY, 60, 85, 30, 55, ModContent.TileType(), false, true, true); + islandLocationX += 25; + break; + } + + thermalIslandY += islandLocationOffset; + + //do not place anymore islands when the fourth layer is reached + if (thermalIslandY >= (rockLayer + y * 0.270) - 10) + { + break; + } } //place some islands lining the walls in layer 4 - for (int voidIslandY = (int)(rockLayer + y * 0.262); voidIslandY <= AbyssChasmBottom - 20; voidIslandY++) + for (int voidIslandY = (int)(rockLayer + y * 0.275); voidIslandY <= AbyssChasmBottom - 20; voidIslandY++) { if (WorldGen.genRand.NextBool(8)) { @@ -383,14 +475,17 @@ namespace CalamityMod.World switch (randomIsland) { case 0: - AbyssIsland(abyssChasmX + WorldGen.genRand.Next(60, 78), voidIslandY, 65, 85, 35, 45, false, true, true, false); + //1 island, to the left + AbyssIsland(abyssChasmX - WorldGen.genRand.Next(65, 78), voidIslandY, 65, 85, 35, 45, ModContent.TileType(), false, true, false); break; case 1: - AbyssIsland(abyssChasmX - WorldGen.genRand.Next(60, 78), voidIslandY, 65, 85, 35, 45, false, true, true, false); + //1 island, to the right + AbyssIsland(abyssChasmX + WorldGen.genRand.Next(65, 78), voidIslandY, 65, 85, 35, 45, ModContent.TileType(), false, true, false); break; case 2: - 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); + //2 islands, left and right + AbyssIsland(abyssChasmX - WorldGen.genRand.Next(65, 78), voidIslandY, 65, 85, 35, 45, ModContent.TileType(), false, true, false); + AbyssIsland(abyssChasmX + WorldGen.genRand.Next(65, 78), voidIslandY, 65, 85, 35, 45, ModContent.TileType(), false, true, false); break; } @@ -399,21 +494,15 @@ namespace CalamityMod.World } } + //place chests in each location saved from before AbyssItemArray = CalamityUtils.ShuffleArray(AbyssItemArray); for (int abyssHouse = 0; abyssHouse < TotalPlacedIslandsSoFar; abyssHouse++) //11 15 19 { - bool hasVoidstone = AbyssIslandPositions[abyssHouse].Y + 5 > (rockLayer + y * 0.143); + bool isInLayer2 = AbyssIslandPositions[abyssHouse].Y < (rockLayer + y * 0.145); 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 - hasVoidstone); + AbyssChest(AbyssIslandPositions[abyssHouse].X, AbyssIslandPositions[abyssHouse].Y, AbyssItemArray[abyssHouse > 9 ? (abyssHouse - 10) : abyssHouse]); } } @@ -428,9 +517,9 @@ namespace CalamityMod.World 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()) + if (tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || + tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || + tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType()) { //slope tiles Tile.SmoothSlope(abyssIndex, abyssIndex2, true); @@ -442,8 +531,7 @@ namespace CalamityMod.World } } - if (!tile.HasTile && (tile.WallType == ModContent.WallType() || tile.WallType == ModContent.WallType() || - tile.WallType == ModContent.WallType())) + if (!tile.HasTile && tile.WallType > 0) { //fill up any air pockets with water tile.LiquidType = LiquidID.Water; @@ -463,6 +551,8 @@ namespace CalamityMod.World { for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) { + Tile tileToGrowVineOn = Main.tile[abyssIndex, abyssIndex2]; + if (!Main.tile[abyssIndex, abyssIndex2].HasTile) { Tile tile = Main.tile[abyssIndex, abyssIndex2 + 1]; @@ -472,7 +562,7 @@ namespace CalamityMod.World { //giant kelp, more often in upper layers if ((WorldGen.genRand.NextBool(18) && tile.TileType == ModContent.TileType()) || - (WorldGen.genRand.NextBool(35) && tile.TileType == ModContent.TileType())) + (WorldGen.genRand.NextBool(15) && tile.TileType == ModContent.TileType())) { ushort[] Kelps = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; @@ -492,11 +582,13 @@ namespace CalamityMod.World //sulphur shale stuff if (tile.TileType == ModContent.TileType()) { + //tube coral if (WorldGen.genRand.NextBool(25)) { WorldGen.PlaceObject(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); } + //shale rock piles if (WorldGen.genRand.NextBool(18)) { ushort[] ShalePiles = new ushort[] { (ushort)ModContent.TileType(), @@ -505,6 +597,7 @@ namespace CalamityMod.World WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(ShalePiles)); } + //pire corals if (WorldGen.genRand.NextBool(15)) { ushort[] PireCorals = new ushort[] { (ushort)ModContent.TileType(), @@ -513,6 +606,7 @@ namespace CalamityMod.World WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(PireCorals)); } + //sulphur fossils if (WorldGen.genRand.NextBool(10)) { ushort[] SulphuricFossils = new ushort[] { (ushort)ModContent.TileType(), @@ -521,6 +615,7 @@ namespace CalamityMod.World WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(SulphuricFossils)); } + //ribs if (WorldGen.genRand.NextBool(10)) { ushort[] Ribs = new ushort[] { (ushort)ModContent.TileType(), @@ -536,7 +631,7 @@ namespace CalamityMod.World if (abyssIndex2 >= (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) { //bulb trees on voidstone - if (WorldGen.genRand.NextBool(6) && tile.TileType == ModContent.TileType()) + if (WorldGen.genRand.NextBool(8) && tile.TileType == ModContent.TileType()) { ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; @@ -546,7 +641,8 @@ namespace CalamityMod.World } //pots - if ((tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType()) && abyssIndex2 > rockLayer) + if ((tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || + tile.TileType == ModContent.TileType()) && abyssIndex2 > rockLayer) { if (WorldGen.genRand.NextBool(5)) { @@ -554,6 +650,7 @@ namespace CalamityMod.World CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } + //sulphur pots else if (tile.TileType == ModContent.TileType() && abyssIndex2 < (int)Main.worldSurface) { @@ -564,12 +661,37 @@ namespace CalamityMod.World } } } + + //esentially what this does is grow one vine on the bottom of a tile, then use the util to keep placing the vine until it decides to stop + if (tileToGrowVineOn.TileType == ModContent.TileType() && !Main.tile[abyssIndex, abyssIndex2 + 1].HasTile) + { + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2 + 1, (ushort)ModContent.TileType()); + } + } + if (tileToGrowVineOn.TileType == ModContent.TileType()) + { + CalamityUtils.GrowVines(abyssIndex, abyssIndex2, WorldGen.genRand.Next(1, 4), (ushort)ModContent.TileType()); + } + + //same as above but for sulphur vines + if (tileToGrowVineOn.TileType == ModContent.TileType() && !Main.tile[abyssIndex, abyssIndex2 + 1].HasTile) + { + if (WorldGen.genRand.Next(5) == 0) + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2 + 1, (ushort)ModContent.TileType()); + } + } + if (tileToGrowVineOn.TileType == ModContent.TileType()) + { + CalamityUtils.GrowVines(abyssIndex, abyssIndex2, WorldGen.genRand.Next(1, 4), (ushort)ModContent.TileType()); + } } } } - #region Houses - public static void AbyssIsland(int i, int j, int sizeMin, int sizeMax, int sizeMin2, int sizeMax2, bool hasChest, bool hasPlantyMush, bool isVoid, bool isShale) + public static void AbyssIsland(int i, int j, int sizeMin, int sizeMax, int sizeMin2, int sizeMax2, int tileType, bool hasChest, bool hasClumps, bool hasScoria) { float islandWidth = WorldGen.genRand.Next(sizeMin, sizeMax); //100 150 float smallIslandWidth = (float)WorldGen.genRand.Next(sizeMin, sizeMax) / (float)5; //20 30 @@ -640,14 +762,7 @@ namespace CalamityMod.World } Main.tile[k, l].Get().HasTile = true; - if (!isShale) - { - Main.tile[k, l].TileType = (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType()); - } - else - { - Main.tile[k, l].TileType = (ushort)ModContent.TileType(); - } + Main.tile[k, l].TileType = (ushort)tileType; CalamityUtils.SafeSquareTileFrame(k, l, true); } @@ -684,12 +799,28 @@ namespace CalamityMod.World } num14 += WorldGen.genRand.Next(-3, 4); num15 = WorldGen.genRand.Next(4, 8); - int num16 = isVoid ? ModContent.TileType() : ModContent.TileType(); + int num16 = tileType; - if (WorldGen.genRand.NextBool(4)) + //chance to place clumps of whatever defined block + if (hasClumps && WorldGen.genRand.NextBool(3)) { - num16 = hasChest ? ModContent.TileType() : ModContent.TileType(); + //if the tile isnt pyre mantle place scoria or planty mush + if (tileType != ModContent.TileType()) + { + //if scoria is enabled, then place it, otherwise place planty mush clumps + num16 = hasScoria ? ModContent.TileType() : ModContent.TileType(); + } + //if the tile is pyre mantle then always place scoria + else + { + //goofy ahh checking + //essentially places molten blocks if scoria is enabled + //if scoria is not enabled, then it places planty mush with a 1 in 5 chance, and otherwise place actual scoria + //very backwards logic of having scoria not place when enabled but it makes it place more often so whatever + num16 = hasScoria ? ModContent.TileType() : WorldGen.genRand.Next(5) == 0 ? ModContent.TileType() : ModContent.TileType(); + } } + for (int n = m - num15; n <= m + num15; n++) { for (int num17 = num14 - num15; num17 <= num14 + num15; num17++) @@ -702,14 +833,7 @@ namespace CalamityMod.World { Main.tile[n, num17].Get().HasTile = true; - if (!isShale) - { - Main.tile[n, num17].TileType = (ushort)num16; - } - else - { - Main.tile[n, num17].TileType = (ushort)ModContent.TileType(); - } + Main.tile[n, num17].TileType = (ushort)num16; CalamityUtils.SafeSquareTileFrame(n, num17, true); } @@ -717,39 +841,7 @@ namespace CalamityMod.World } } } - if (hasPlantyMush) - { - int p = islandPositionX; - int num150; - for (p += WorldGen.genRand.Next(5); p < islandPositionXAgain; p += WorldGen.genRand.Next(num150, (int)(num150 * 1.5))) - { - int num14 = islandPositionY; - while (!Main.tile[p, num14].HasTile) - { - num14--; - } - num14 += WorldGen.genRand.Next(-3, 4); //-3 4 - num150 = 1; //4 8 - int num16 = ModContent.TileType(); - for (int n = p - num150; n <= p + num150; n++) - { - for (int num17 = num14 - num150; num17 <= num14 + num150; num17++) - { - if (num17 > islandPositionYAgain) - { - float arg_409_0 = Math.Abs(n - p); - float num18 = (Math.Abs(num17 - num14) * 2); - if (Math.Sqrt((double)(arg_409_0 * arg_409_0 + num18 * num18)) < (num150 + WorldGen.genRand.Next(2))) - { - Main.tile[n, num17].Get().HasTile = true; - Main.tile[n, num17].TileType = (ushort)num16; - CalamityUtils.SafeSquareTileFrame(n, num17, true); - } - } - } - } - } - } + int sizeMinSmall2 = sizeMin2 / 8; int sizeMaxSmall2 = sizeMax2 / 8; islandWidth = WorldGen.genRand.Next(sizeMin2, sizeMax2); @@ -803,7 +895,7 @@ namespace CalamityMod.World { num24 += WorldGen.genRand.Next(0, 4); int num25 = WorldGen.genRand.Next(2, 5); - int num26 = isVoid ? ModContent.TileType() : ModContent.TileType(); + int num26 = tileType; for (int num27 = num23 - num25; num27 <= num23 + num25; num27++) { for (int num28 = num24 - num25; num28 <= num24 + num25; num28++) @@ -823,172 +915,49 @@ namespace CalamityMod.World num23 += WorldGen.genRand.Next(num25, (int)(num25 * 1.5)); } } - - //Place backwall - for (int backwallX = islandPositionX - 20; backwallX <= islandPositionXAgain + 20; backwallX++) - { - for (int backwallJ = islandPositionYAgain - 20; backwallJ <= islandPositionY + 20; backwallJ++) - { - //Check to see if the tile is surrounded by other tiles to place a wall - bool AmISurroundedByTiles = true; - for (int i2 = backwallX - 1; i2 <= backwallX + 1; i2++) - { - for (int j2 = backwallJ - 1; j2 <= backwallJ + 1; j2++) - { - if (!Main.tile[i2, j2].HasTile) - { - AmISurroundedByTiles = false; - } - } - } - if (AmISurroundedByTiles) - { - Main.tile[backwallX, backwallJ].WallType = (ushort)(isVoid ? ModContent.WallType() : ModContent.WallType()); - WorldGen.SquareWallFrame(backwallX, backwallJ, true); - } - } - } - for (int num34 = islandPositionX; num34 <= islandPositionXAgain; num34++) - { - int num35 = islandPositionYAgain - 10; - while (!Main.tile[num34, num35 + 1].HasTile) - { - num35++; - } - if (num35 < islandPositionY && Main.tile[num34, num35 + 1].TileType == (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType())) - { - if (WorldGen.genRand.NextBool(10)) - { - int num36 = WorldGen.genRand.Next(1, 3); - for (int num37 = num34 - num36; num37 <= num34 + num36; num37++) - { - if (Main.tile[num37, num35].TileType == (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType())) - { - Main.tile[num37, num35].Get().HasTile = false; - Main.tile[num37, num35].LiquidAmount = 255; - Main.tile[num37, num35].Get().LiquidType = LiquidID.Water; - CalamityUtils.SafeSquareTileFrame(num34, num35, true); - } - if (Main.tile[num37, num35 + 1].TileType == (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType())) - { - Main.tile[num37, num35 + 1].Get().HasTile = false; - Main.tile[num37, num35 + 1].LiquidAmount = 255; - Main.tile[num37, num35 + 1].Get().LiquidType = LiquidID.Water; - CalamityUtils.SafeSquareTileFrame(num34, num35 + 1, true); - } - if (num37 > num34 - num36 && num37 < num34 + 2 && Main.tile[num37, num35 + 2].TileType == (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType())) - { - Main.tile[num37, num35 + 2].Get().HasTile = false; - Main.tile[num37, num35 + 2].LiquidAmount = 255; - Main.tile[num37, num35 + 2].Get().LiquidType = LiquidID.Water; - CalamityUtils.SafeSquareTileFrame(num34, num35 + 2, true); - } - } - } - if (WorldGen.genRand.NextBool(5)) - { - Main.tile[num34, num35].LiquidAmount = 255; - } - Main.tile[num34, num35].Get().LiquidType = LiquidID.Water; - CalamityUtils.SafeSquareTileFrame(num34, num35, true); - } - } } - public static void AbyssIslandHouse(int i, int j, int itemChoice, bool isVoid) + public static void AbyssChest(int i, int j, int itemChoice) { - ushort type = (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType()); //tile - ushort wall = (ushort)(isVoid ? ModContent.WallType() : ModContent.WallType()); //wall - Vector2 vector = new Vector2((float)i, (float)j); - int num = 1; - if (WorldGen.genRand.NextBool(2)) + //place an island + //always place abyss gravel because chests will never place outside of layer 2 for now + AbyssIsland(i, j + 2, 55, 75, 35, 45, ModContent.TileType(), false, true, false); + + //clear decently big circular area where the chest will be + for (int clearX = i - 2; clearX <= i + 2; clearX++) { - num = -1; - } - int num2 = WorldGen.genRand.Next(5, 9); - int num3 = 3; - vector.X = (float)(i + (num2 + 2) * num); - for (int k = j - 15; k < j + 30; k++) - { - if (Main.tile[(int)vector.X, k].HasTile) + for (int clearY = j - 8; clearY <= j - 1; clearY++) { - 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)) + //clear area for the chest to place + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + + int radius = (int)(WorldGen.genRand.Next(3, 5) * WorldGen.genRand.NextFloat(0.74f, 0.82f)); + + WorldUtils.Gen(new Point(clearX, clearY), new Shapes.Circle(radius), Actions.Chain(new GenAction[] { - Main.tile[l, m].Get().HasTile = true; - Main.tile[l, m].TileType = type; - Main.tile[l, m].WallType = wall; - 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 == wall) + blotchMod.Output(circle) + })); + + WorldUtils.Gen(new Point(clearX, clearY), new ModShapes.All(circle), Actions.Chain(new GenAction[] { - Main.tile[n, num8].Get().HasTile = false; - } + new Actions.ClearTile() + })); } } - int num9 = i + (num2 + 1) * num; - int num10 = (int)vector.Y; - for (int num11 = num9 - 2; num11 <= num9 + 2; num11++) + + //place cluster where chest will spawn + WorldGen.TileRunner(i, j + 4, 8, 5, ModContent.TileType(), true, 0, 0, false, true); + + //clear another small square exactly around where the chest will be so it has a flat area to place on + for (int clearX = i - 7; clearX <= i + 7; clearX++) { - Main.tile[num11, num10].Get().HasTile = false; - Main.tile[num11, num10 - 1].Get().HasTile = false; - Main.tile[num11, num10 - 2].Get().HasTile = false; + for (int clearY = j - 1; clearY <= j + 5; clearY++) + { + WorldGen.PlaceTile(clearX, clearY, ModContent.TileType()); + } } + switch (itemChoice) { case 0: @@ -1025,8 +994,9 @@ namespace CalamityMod.World itemChoice = ItemID.NeptunesShell; break; //fallback case. Should never happen naturally } - WorldGen.AddBuriedChest(i, num10 - 3, itemChoice, false, 4); //chest + + //place the chest itself + WorldGen.AddBuriedChest(i, j - 1, itemChoice, false, 4); } - #endregion } } diff --git a/World/AerialiteOreGen.cs b/World/AerialiteOreGen.cs index 8d5b5ce2bc..00530dd0a5 100644 --- a/World/AerialiteOreGen.cs +++ b/World/AerialiteOreGen.cs @@ -33,10 +33,10 @@ namespace CalamityMod.World ShapeData biggerCircle = new ShapeData(); GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - int outerRadius = (int)(WorldGen.genRand.Next(3, 5) * WorldGen.genRand.NextFloat(0.74f, 0.82f)); + int radius = (int)(WorldGen.genRand.Next(3, 5) * WorldGen.genRand.NextFloat(0.74f, 0.82f)); //big cloud circle - WorldUtils.Gen(new Point(x, y), new Shapes.Circle(outerRadius + 3), Actions.Chain(new GenAction[] + WorldUtils.Gen(new Point(x, y), new Shapes.Circle(radius + 1), Actions.Chain(new GenAction[] { blotchMod.Output(biggerCircle) })); @@ -48,7 +48,7 @@ namespace CalamityMod.World })); //circle of ore - WorldUtils.Gen(new Point(x, y), new Shapes.Circle(outerRadius), Actions.Chain(new GenAction[] + WorldUtils.Gen(new Point(x, y), new Shapes.Circle(radius), Actions.Chain(new GenAction[] { blotchMod.Output(circle) })); diff --git a/World/BrimstoneCrag.cs b/World/BrimstoneCrag.cs index 86f1ca7b38..c45210bef2 100644 --- a/World/BrimstoneCrag.cs +++ b/World/BrimstoneCrag.cs @@ -94,15 +94,6 @@ namespace CalamityMod.World } } - //scorched remains patches - for (int x = biomeStart + 30; x <= biomeEdge - 30; x++) - { - if (WorldGen.genRand.Next(145) == 0) - { - ScorchedGrassPatches(new Point(x, Main.maxTilesY - 135)); - } - } - //place ceiling of slag across the top of the biome for (int x = biomeStart; x <= biomeEdge; x++) { @@ -220,6 +211,15 @@ namespace CalamityMod.World } } + //scorched remains patches + for (int x = biomeStart + 30; x <= biomeEdge - 30; x++) + { + if (WorldGen.genRand.Next(145) == 0) + { + ScorchedGrassPatches(new Point(x, Main.maxTilesY - 135)); + } + } + //place clumps of charred ore for (int x = biomeStart; x <= biomeEdge; x++) { @@ -370,7 +370,9 @@ namespace CalamityMod.World if (WorldGen.genRand.Next(3) == 0) { ushort[] Lillies = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + (ushort)ModContent.TileType() }; WorldGen.PlaceObject(x, y - 1, WorldGen.genRand.Next(Lillies)); } @@ -388,7 +390,7 @@ namespace CalamityMod.World if (tile.TileType == ModContent.TileType()) { //grow spine tree - if (WorldGen.genRand.Next(12) == 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + if (WorldGen.genRand.Next(8) == 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) { PlaceTree(x, y - 1, ModContent.TileType()); } @@ -471,7 +473,7 @@ namespace CalamityMod.World float angle = MathHelper.Pi * 0.15f; float otherAngle = MathHelper.PiOver2 - angle; - int distanceInTiles = WorldGen.genRand.Next(20, 50); + int distanceInTiles = WorldGen.genRand.Next(30, 45); float distance = distanceInTiles * 16f; float constant = distance * 2f / (float)Math.Sin(angle); diff --git a/World/MiscWorldgenRoutines.cs b/World/MiscWorldgenRoutines.cs index 0d90b261cf..2afeea88ab 100644 --- a/World/MiscWorldgenRoutines.cs +++ b/World/MiscWorldgenRoutines.cs @@ -252,8 +252,17 @@ namespace CalamityMod.World num3 += WorldGen.genRand.Next(2); num3 -= WorldGen.genRand.Next(2); float smallHoleLimit = 790f; //small + if (Main.maxTilesY > 1500) - { smallHoleLimit = 1360f; if (Main.maxTilesY > 2100) { smallHoleLimit = 1950f; } } + { + smallHoleLimit = 1360f; + + if (Main.maxTilesY > 2100) + { + smallHoleLimit = 1950f; + } + } + if (ocean && num > smallHoleLimit) { if (num3 < 7.0) //min width @@ -291,7 +300,7 @@ namespace CalamityMod.World if (Main.maxTilesY > 2100) { if (((double)vector.Y > Abyss.AbyssChasmBottom && num > 0f && ocean) || - (vector.Y >= Main.maxTilesY && num > 0f && !ocean)) + (vector.Y >= Main.maxTilesY && num > 0f && !ocean)) { num = 0f; } @@ -299,7 +308,7 @@ namespace CalamityMod.World else if (Main.maxTilesY > 1500) { if (((double)vector.Y > Abyss.AbyssChasmBottom && num > 0f && ocean) || - (vector.Y > Main.maxTilesY && num > 0f && !ocean)) + (vector.Y > Main.maxTilesY && num > 0f && !ocean)) { num = 0f; } @@ -307,11 +316,12 @@ namespace CalamityMod.World else { if (((double)vector.Y > Abyss.AbyssChasmBottom && num > 0f && ocean) || - (vector.Y > Main.maxTilesY && num > 0f && !ocean)) + (vector.Y > Main.maxTilesY && num > 0f && !ocean)) { num = 0f; } } + num -= 1f; int num4; int num5;