From feb4edecec919147459d2d2a87e079202a8f91cf Mon Sep 17 00:00:00 2001 From: Jared Blackburn Date: Tue, 8 Jun 2021 18:56:19 -0400 Subject: [PATCH] Hub rooms can now be set to all be tall --- .../java/jaredbgreat/dldungeons/ConfigHandler.java | 14 ++++++++++++-- main/java/jaredbgreat/dldungeons/Info.java | 2 +- main/java/jaredbgreat/dldungeons/planner/Node.java | 7 +++++++ main/resources/mcmod.info | 2 +- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/main/java/jaredbgreat/dldungeons/ConfigHandler.java b/main/java/jaredbgreat/dldungeons/ConfigHandler.java index 2448f45..7a90b92 100644 --- a/main/java/jaredbgreat/dldungeons/ConfigHandler.java +++ b/main/java/jaredbgreat/dldungeons/ConfigHandler.java @@ -71,6 +71,7 @@ public final class ConfigHandler { private static final boolean DEFAULT_VANILLA_LOOT = false; private static final boolean EASY_FIND = true; private static final boolean SINGLE_ENTRANCE = true; + private static final boolean BIG_HUBS = false; private static final boolean DISABLE_API = false; private static final boolean NO_MOB_CHANGES = false; @@ -89,6 +90,8 @@ public final class ConfigHandler { public static boolean easyFind = EASY_FIND; public static boolean singleEntrance = SINGLE_ENTRANCE; + public static boolean bigHubs = EASY_FIND; + public static boolean announceCommands = DEFAULT_ANNOUNCE_COMMANDS; public static boolean vanillaLoot = DEFAULT_VANILLA_LOOT; @@ -188,6 +191,11 @@ public static void init() { + System.lineSeparator() + "is one that never has entrances.").getBoolean(EASY_FIND); Logging.logInfo("Will dungeons be easy to find? " + easyFind); + bigHubs = config.get("General", "BigHubs", BIG_HUBS, + "If true entrances and \"boss\" rooms will have extra high ceilings, good with tall mobs") + .getBoolean(BIG_HUBS); + Logging.logInfo("Hub room (entrances and boss rooms) will have high ceiling? " + bigHubs); + singleEntrance = config.get("General", "SingleEntrances", SINGLE_ENTRANCE, "If true all dungeons will exactly one entrance (if the theme allows entrances), " + System.lineSeparator() @@ -299,8 +307,10 @@ public static void init() { + System.lineSeparator() + " random.nextInt(A2 + (RoomDifficulty / B2)) + C2"); nerf = config.getBoolean("NerfEpicLoot", "Loot", false, - "If true it will limit the amount of level 8 loot place with most spawers " - + "(anything less than a full boss); enable if want to have truly epic items " + "If true it will limit the amount of level 8 loot place with most spawners " + + System.lineSeparator() + + "(anything less than a full boss); enable if want to have truly epic items " + + System.lineSeparator() + "like indestructable god picks) but don't want too many of them around."); TreasureChest.setBasicLootNumbers(a, b, c, nerf); Room.setLootBonus(config.getInt("Loot Bonus", "Loot", 1, -9, 9, diff --git a/main/java/jaredbgreat/dldungeons/Info.java b/main/java/jaredbgreat/dldungeons/Info.java index 0f15a23..dab6b5f 100644 --- a/main/java/jaredbgreat/dldungeons/Info.java +++ b/main/java/jaredbgreat/dldungeons/Info.java @@ -12,7 +12,7 @@ public final class Info { public static final String OLD_ID = "DLDungeonsJBG"; public static final String ID = "dldungeonsjbg"; public static final String NAME = "Doomlike Dungeons"; - public static final String VERSION = "1.14.3"; + public static final String VERSION = "1.14.4"; public static final String MINECRAFT = "1.12.2"; public static final String CHANNEL = "JBGDungeons"; public static final String LOG_NAME = "DLDUNGEONS"; diff --git a/main/java/jaredbgreat/dldungeons/planner/Node.java b/main/java/jaredbgreat/dldungeons/planner/Node.java index 607334f..0f4106e 100644 --- a/main/java/jaredbgreat/dldungeons/planner/Node.java +++ b/main/java/jaredbgreat/dldungeons/planner/Node.java @@ -1,6 +1,8 @@ package jaredbgreat.dldungeons.planner; +import jaredbgreat.dldungeons.ConfigHandler; + /* * Doomlike Dungeons by is licensed the MIT License * Copyright (c) 2014-2018 Jared Blackburn @@ -29,7 +31,12 @@ public Node(int x, int y, int z, Random random, Dungeon dungeon) { int zdim = random.nextInt((dungeon.size.maxRoomSize / 2) - 3) + (dungeon.size.maxRoomSize / 2) + 4; int ymod = (xdim <= zdim) ? (int) Math.sqrt(xdim) : (int) Math.sqrt(zdim); + int height = random.nextInt((dungeon.verticle.value / 2) + ymod + 1) + 2; + if(ConfigHandler.bigHubs ) { + height = Math.min(12, Math.max(7, Math.max(height * 2, height + dungeon.random.nextInt(3) + 2))); + } + // Then plant a seed and try to grow the room hubRoom = new RoomSeed(x, y, z).growRoom(xdim, zdim, height, dungeon, null, null); diff --git a/main/resources/mcmod.info b/main/resources/mcmod.info index dfca992..f5034a8 100644 --- a/main/resources/mcmod.info +++ b/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "dldungeonsjbg", "name": "Doomlike Dungeons", "description": "Procedurally generates multiroom dungeons resembling Doom levels into the world.", - "version": "1.14.3", + "version": "1.14.4", "mcversion": "1.12.2", "url": "http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1293843-doomlike-dungeons", "updateUrl": "",