diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index b52c15e978..4511d4cfa3 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -616,6 +616,7 @@ DraedonFacility: Other minor research projects Abyss: Disposing of Silva's remains SulphurSea2: Irradiating one of the oceans Roxcalibur: I wanna rock +AuricLandMines: Setting god killing traps // Hold Shift tooltip default HoldShiftTooltipExtensionIndicator: Hold "Left Shift" for more HoldShiftTooltipReplacementIndicator: Hold "Left Shift" for details diff --git a/Systems/WorldgenManagementSystem.cs b/Systems/WorldgenManagementSystem.cs index d7c58193c9..72124efd39 100644 --- a/Systems/WorldgenManagementSystem.cs +++ b/Systems/WorldgenManagementSystem.cs @@ -306,6 +306,16 @@ namespace CalamityMod.Systems progress.Message = Language.GetOrRegister("Mods.CalamityMod.UI.Roxcalibur").Value; MiscWorldgenRoutines.PlaceRoxShrine(); })); + + // No Traps/GFB Auric Land Mines + if (Main.noTrapsWorld) + { + tasks.Insert(++currentFinalIndex, new PassLegacy("Auric Land Mines", (progress, config) => + { + progress.Message = Language.GetOrRegister("Mods.CalamityMod.UI.AuricLandMines").Value; + MiscWorldgenRoutines.GenerateAuricLandMines(); + })); + } } } diff --git a/World/MiscWorldgenRoutines.cs b/World/MiscWorldgenRoutines.cs index f413f99e1e..ddf4982220 100644 --- a/World/MiscWorldgenRoutines.cs +++ b/World/MiscWorldgenRoutines.cs @@ -10,6 +10,7 @@ using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.Crags; using CalamityMod.Tiles.FurnitureAncient; +using CalamityMod.Tiles.FurnitureAuric; using CalamityMod.Tiles.Ores; using CalamityMod.Walls; using Microsoft.Xna.Framework; @@ -489,5 +490,37 @@ namespace CalamityMod.World } } #endregion + + #region Auric Land Mines + public static void GenerateAuricLandMines() + { + int landMineID = ModContent.TileType(); + int landMineChance = Main.zenithWorld ? 150 : 300; + float maxDepth = Main.maxTilesY * (Main.zenithWorld ? 0.75f : 0.5f); // depth increased in gfb due to the evil columns that extend further downward + for (int x = 0; x < Main.maxTilesX; x++) + { + for (int y = 0; y < maxDepth; y++) + { + Tile t = CalamityUtils.ParanoidTileRetrieval(x, y); + Tile above = CalamityUtils.ParanoidTileRetrieval(x, y - 1); + if (t != null) + { + if (above != null) + { + // Yharim killed the gods with auric land mines obviously + if ((t.TileType == TileID.Ebonstone || t.TileType == TileID.Crimstone) && !above.HasTile) + { + if (WorldGen.genRand.NextBool(landMineChance)) + { + WorldGen.SlopeTile(x, y); + WorldGen.PlaceTile(x, y - 1, landMineID); + } + } + } + } + } + } + } + #endregion } }