[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
This commit is contained in:
Alchav
2022-10-27 19:43:02 -04:00
committed by GitHub
parent c09e089f9d
commit 813ea6ef8b
2 changed files with 12 additions and 10 deletions

View File

@@ -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))