From 6e33181f05f280a7bd2c88a22df44ba82d6aca01 Mon Sep 17 00:00:00 2001 From: espeon65536 Date: Tue, 8 Jun 2021 08:58:16 -0500 Subject: [PATCH] Changed advancement_goal to a Range option --- Options.py | 9 ++++----- playerSettings.yaml | 7 ++----- test/minecraft/TestMinecraft.py | 2 +- worlds/minecraft/Rules.py | 11 ++++------- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/Options.py b/Options.py index 5200bed0..4717b3a7 100644 --- a/Options.py +++ b/Options.py @@ -386,11 +386,10 @@ factorio_options: typing.Dict[str, type(Option)] = {"max_science_pack": MaxScien "recipe_time": RecipeTime} -class AdvancementGoal(Choice): - option_few = 0 - option_normal = 1 - option_many = 2 - default = 1 +class AdvancementGoal(Range): + range_start = 0 + range_end = 87 + default = 30 class CombatDifficulty(Choice): diff --git a/playerSettings.yaml b/playerSettings.yaml index 2bc168c4..ef1aaac8 100644 --- a/playerSettings.yaml +++ b/playerSettings.yaml @@ -92,10 +92,7 @@ starting_items: burner-mining-drill: 19 stone-furnace: 19 # Minecraft options: -advancement_goal: # Number of advancements required (out of 92 total) to spawn the Ender Dragon and complete the game. - few: 0 # 30 advancements - normal: 1 # 50 - many: 0 # 70 +advancement_goal: 50 # Number of advancements required to spawn the Ender Dragon and complete the game (currently 87 max) combat_difficulty: # Modifies the level of items logically required for exploring dangerous areas and fighting bosses. easy: 0 normal: 1 @@ -109,7 +106,7 @@ include_insane_advancements: # Junk-fills extremely difficult advancements; this include_postgame_advancements: # Some advancements require defeating the Ender Dragon; this will junk-fill them so you won't have to finish to send some items. on: 0 off: 1 -shuffle_structures: # CURRENTLY DISABLED; enables shuffling of villages, outposts, fortresses, bastions, and end cities. +shuffle_structures: # Enables shuffling of villages, outposts, fortresses, bastions, and end cities. on: 0 off: 1 # A Link to the Past options: diff --git a/test/minecraft/TestMinecraft.py b/test/minecraft/TestMinecraft.py index 375de5f5..f2fdcd22 100644 --- a/test/minecraft/TestMinecraft.py +++ b/test/minecraft/TestMinecraft.py @@ -31,7 +31,7 @@ class TestMinecraft(TestBase): exclusion_pools = ['hard', 'insane', 'postgame'] for pool in exclusion_pools: setattr(self.world, f"include_{pool}_advancements", [False, False]) - setattr(self.world, "advancement_goal", [0, Options.AdvancementGoal(value=0)]) + setattr(self.world, "advancement_goal", [0, Options.AdvancementGoal(value=30)]) setattr(self.world, "shuffle_structures", [False, False]) setattr(self.world, "combat_difficulty", [0, Options.CombatDifficulty(value=1)]) minecraft_create_regions(self.world, 1) diff --git a/worlds/minecraft/Rules.py b/worlds/minecraft/Rules.py index b4a58476..4a1316b6 100644 --- a/worlds/minecraft/Rules.py +++ b/worlds/minecraft/Rules.py @@ -15,13 +15,10 @@ def set_rules(world: MultiWorld, player: int): (location.name not in postgame_advancements) and location.can_reach(state)] - # 92 total advancements, 16 are typically excluded, 1 is Free the End. Goal is to complete X advancements and then Free the End. - goal_map = { - 'few': 30, - 'normal': 50, - 'many': 70 - } - goal = goal_map[getattr(world, 'advancement_goal')[player].get_option_name()] + # 92 total advancements. Goal is to complete X advancements and then Free the End. + # There are 5 advancements which cannot be included for dragon spawning (4 postgame, Free the End) + # Hence the true maximum is (92 - 5) = 87 + goal = int(world.advancement_goal[player].value) can_complete = lambda state: len(reachable_locations(state)) >= goal and state.can_reach('The End', 'Region', player) and state.can_kill_ender_dragon(player) if world.logic[player] != 'nologic':