Skip to content

Commit

Permalink
Wargroove 2: Fixed an issue where the level seed option would produce…
Browse files Browse the repository at this point in the history
… different level configurations using the same seed for two WG2 worlds in the same multiworld.
  • Loading branch information
FlySniper committed Sep 4, 2024
1 parent 0f58bc1 commit 7d21172
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions worlds/wargroove2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,18 @@ class Wargroove2World(World):
location_name_to_id = {name: code for name, code in location_table.items() if code is not None}

def generate_early(self) -> None:
if self.options.level_shuffle_seed == 0:
if self.options.level_shuffle_seed.value == 0:
random = self.random
else:
random = Random(str(self.options.level_shuffle_seed))

random.shuffle(low_victory_checks_levels)
random.shuffle(high_victory_checks_levels)
non_starting_levels = high_victory_checks_levels + low_victory_checks_levels[4:]
low_victory_checks_levels_copy = low_victory_checks_levels.copy()
high_victory_checks_levels_copy = high_victory_checks_levels.copy()
random.shuffle(low_victory_checks_levels_copy)
random.shuffle(high_victory_checks_levels_copy)
non_starting_levels = high_victory_checks_levels_copy + low_victory_checks_levels_copy[4:]
random.shuffle(non_starting_levels)
self.level_list = low_victory_checks_levels[0:4] + non_starting_levels
self.level_list = low_victory_checks_levels_copy[0:4] + non_starting_levels

final_levels_no_ocean = list(level for level in final_levels if not level.has_ocean)
final_levels_ocean = list(level for level in final_levels if level.has_ocean)
Expand Down

0 comments on commit 7d21172

Please sign in to comment.