From 813ea6ef8b6d08ec7e89007997198b6bb9e3980c Mon Sep 17 00:00:00 2001 From: Alchav <59858495+Alchav@users.noreply.github.com> Date: Thu, 27 Oct 2022 19:43:02 -0400 Subject: [PATCH] [SM64] Separate Entrance Shuffle pools option and MIPS cost option improvement (#1137) * Add separate pool option for entrance shuffle and swap MIPS costs if MIPS1Cost is greater * Changes based on N00by's suggestions * split into secret_entrance_ids and course_entrance_ids --- worlds/sm64ex/Options.py | 5 +++-- worlds/sm64ex/Rules.py | 17 +++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/worlds/sm64ex/Options.py b/worlds/sm64ex/Options.py index f29a65c5..88d27bb3 100644 --- a/worlds/sm64ex/Options.py +++ b/worlds/sm64ex/Options.py @@ -46,7 +46,7 @@ class MIPS1Cost(Range): class MIPS2Cost(Range): - """How many stars are required to spawn MIPS the secound time. Must be bigger or equal MIPS1Cost""" + """How many stars are required to spawn MIPS the second time.""" range_start = 0 range_end = 80 default = 50 @@ -72,7 +72,8 @@ class AreaRandomizer(Choice): display_name = "Entrance Randomizer" option_Off = 0 option_Courses_Only = 1 - option_Courses_and_Secrets = 2 + option_Courses_and_Secrets_Separate = 2 + option_Courses_and_Secrets = 3 class BuddyChecks(Toggle): diff --git a/worlds/sm64ex/Rules.py b/worlds/sm64ex/Rules.py index 24622062..2397f2c8 100644 --- a/worlds/sm64ex/Rules.py +++ b/worlds/sm64ex/Rules.py @@ -11,13 +11,14 @@ def fix_reg(entrance_ids, reg, invalidspot, swaplist, world): def set_rules(world, player: int, area_connections): destination_regions = list(range(13)) + [12,13,14] + list(range(15,15+len(sm64secrets))) # Two instances of Destination Course THI. Past normal course idx are secret regions - if world.AreaRandomizer[player].value == 0: - entrance_ids = list(range(len(sm64paintings + sm64secrets))) - if world.AreaRandomizer[player].value >= 1: # Some randomization is happening, randomize Courses - entrance_ids = list(range(len(sm64paintings))) - world.random.shuffle(entrance_ids) - entrance_ids = entrance_ids + list(range(len(sm64paintings), len(sm64paintings) + len(sm64secrets))) - if world.AreaRandomizer[player].value == 2: # Secret Regions as well + secret_entrance_ids = list(range(len(sm64paintings), len(sm64paintings) + len(sm64secrets))) + course_entrance_ids = list(range(len(sm64paintings))) + if world.AreaRandomizer[player].value >= 1: # Some randomization is happening, randomize Courses + world.random.shuffle(course_entrance_ids) + if world.AreaRandomizer[player].value == 2: # Randomize Secrets as well + world.random.shuffle(secret_entrance_ids) + entrance_ids = course_entrance_ids + secret_entrance_ids + if world.AreaRandomizer[player].value == 3: # Randomize Courses and Secrets in one pool world.random.shuffle(entrance_ids) # Guarantee first entrance is a course swaplist = list(range(len(entrance_ids))) @@ -117,7 +118,7 @@ def set_rules(world, player: int, area_connections): add_rule(world.get_location("Toad (Third Floor)", player), lambda state: state.can_reach("Third Floor", 'Region', player) and state.has("Power Star", player, 35)) if world.MIPS1Cost[player].value > world.MIPS2Cost[player].value: - world.MIPS2Cost[player].value = world.MIPS1Cost[player].value + (world.MIPS2Cost[player].value, world.MIPS1Cost[player].value) = (world.MIPS1Cost[player].value, world.MIPS2Cost[player].value) add_rule(world.get_location("MIPS 1", player), lambda state: state.can_reach("Basement", 'Region', player) and state.has("Power Star", player, world.MIPS1Cost[player].value)) add_rule(world.get_location("MIPS 2", player), lambda state: state.can_reach("Basement", 'Region', player) and state.has("Power Star", player, world.MIPS2Cost[player].value))