From ae6f2a7734e49c33b239a9e43d6bc98178030b3c Mon Sep 17 00:00:00 2001 From: Crain-32 Date: Tue, 29 Mar 2022 16:08:19 -0600 Subject: [PATCH] Stopped Dungeon items from remaking locations progressive. --- logic/world.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/logic/world.py b/logic/world.py index 3c5f6bb..b1555c1 100644 --- a/logic/world.py +++ b/logic/world.py @@ -123,9 +123,9 @@ def determine_chart_mappings(self, random_state): self._replace_macro_item(f"Chart for Island {sector + 1}", Requirement(REQUIREMENT_HAS_ITEM, [chart])) def determine_progression_locations(self): - self.location_entries = self.determine_progression_locations_from_list(self.location_entries) + self.location_entries = self.make_progression_locations_from_list(self.location_entries) - def determine_progression_locations_from_list(self, location_list: list[Location])-> list[Location]: + def make_progression_locations_from_list(self, location_list: list[Location])-> list[Location]: return list( map( (lambda logical: logical.make_logical()), @@ -139,6 +139,18 @@ def determine_progression_locations_from_list(self, location_list: list[Location ) ) + def determine_progression_locations_from_list(self, location_list: list[Location])-> list[Location]: + return list( + filter( + (lambda progressive: + World.location_category_cache(self._location_category_list(), + progressive.category_set) + ), + location_list + ) + ) + + def determine_race_mode_dungeons(self, random_state: Random): if self.world_settings.race_mode: shuffled_dungeons = dungeon_names.copy() @@ -272,8 +284,7 @@ def load_parse_world(world_location: str, world_id: int) -> dict[str, Area]: def _set_dungeon_non_progressive(self, dungeon_name: str) -> None: location_entries = list() for location in self.location_entries: - if dungeon_name in location.name: - location.logical = False + location.logical = not dungeon_name in location.name location_entries.append(location) self.location_entries = location_entries