Skip to content

Commit

Permalink
Muse Dash: Remove regions for a decent speed gain in generating worlds (
Browse files Browse the repository at this point in the history
ArchipelagoMW#3435)

* Remove Muse Dash Regions.

* Update comments.
  • Loading branch information
DeamonHunter authored and qwint committed Jun 24, 2024
1 parent 530ab44 commit a298b0e
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions worlds/musedash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,7 @@ def create_items(self) -> None:

def create_regions(self) -> None:
menu_region = Region("Menu", self.player, self.multiworld)
song_select_region = Region("Song Select", self.player, self.multiworld)
self.multiworld.regions += [menu_region, song_select_region]
menu_region.connect(song_select_region)
self.multiworld.regions += [menu_region]

# Make a collection of all songs available for this rando.
# 1. All starting songs
Expand All @@ -265,18 +263,16 @@ def create_regions(self) -> None:
self.random.shuffle(included_song_copy)
all_selected_locations.extend(included_song_copy)

# Make a region per song/album, then adds 1-2 item locations to them
# Adds 2 item locations per song/album to the menu region.
for i in range(0, len(all_selected_locations)):
name = all_selected_locations[i]
region = Region(name, self.player, self.multiworld)
self.multiworld.regions.append(region)
song_select_region.connect(region, name, lambda state, place=name: state.has(place, self.player))

# Muse Dash requires 2 locations per song to be *interesting*. Balanced out by filler.
region.add_locations({
name + "-0": self.md_collection.song_locations[name + "-0"],
name + "-1": self.md_collection.song_locations[name + "-1"]
}, MuseDashLocation)
loc1 = MuseDashLocation(self.player, name + "-0", self.md_collection.song_locations[name + "-0"], menu_region)
loc1.access_rule = lambda state, place=name: state.has(place, self.player)
menu_region.locations.append(loc1)

loc2 = MuseDashLocation(self.player, name + "-1", self.md_collection.song_locations[name + "-1"], menu_region)
loc2.access_rule = lambda state, place=name: state.has(place, self.player)
menu_region.locations.append(loc2)

def set_rules(self) -> None:
self.multiworld.completion_condition[self.player] = lambda state: \
Expand Down

0 comments on commit a298b0e

Please sign in to comment.