Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DS3: Make your own region cache #4040

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion worlds/dark_souls_3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def __init__(self, multiworld: MultiWorld, player: int):
self.all_excluded_locations = set()

def generate_early(self) -> None:
self.created_regions = set()
self.all_excluded_locations.update(self.options.exclude_locations.value)

# Inform Universal Tracker where Yhorm is being randomized to.
Expand Down Expand Up @@ -294,6 +295,7 @@ def create_region(self, region_name, location_table) -> Region:
new_region.locations.append(new_location)

self.multiworld.regions.append(new_region)
self.created_regions.add(new_region)
return new_region

def create_items(self) -> None:
Expand Down Expand Up @@ -1305,7 +1307,7 @@ def _add_location_rule(self, location: Union[str, List[str]], rule: Union[Collec
def _add_entrance_rule(self, region: str, rule: Union[CollectionRule, str]) -> None:
"""Sets a rule for the entrance to the given region."""
assert region in location_tables
if not any(region == reg for reg in self.multiworld.regions.region_cache[self.player]): return
if region not in self.created_regions: return
if isinstance(rule, str):
if " -> " not in rule:
assert item_dictionary[rule].classification == ItemClassification.progression
Expand Down
Loading