From aa9e6175108afb16caec2411486e2f1a054ae4a6 Mon Sep 17 00:00:00 2001 From: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> Date: Sat, 14 Jun 2025 09:27:22 -0400 Subject: [PATCH] DS3: Apply Rules to Non-Randomized Locations (#5106) --- worlds/dark_souls_3/__init__.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/worlds/dark_souls_3/__init__.py b/worlds/dark_souls_3/__init__.py index 94150faf..6584ccec 100644 --- a/worlds/dark_souls_3/__init__.py +++ b/worlds/dark_souls_3/__init__.py @@ -75,6 +75,13 @@ class DarkSouls3World(World): """The pool of all items within this particular world. This is a subset of `self.multiworld.itempool`.""" + missable_dupe_prog_locs: Set[str] = {"PC: Storm Ruler - Siegward", + "US: Pyromancy Flame - Cornyx", + "US: Tower Key - kill Irina"} + """Locations whose vanilla item is a missable duplicate of a non-missable progression item. + If vanilla, these locations shouldn't be expected progression, so they aren't created and don't get rules. + """ + def __init__(self, multiworld: MultiWorld, player: int): super().__init__(multiworld, player) self.all_excluded_locations = set() @@ -258,10 +265,7 @@ class DarkSouls3World(World): new_location.progress_type = LocationProgressType.EXCLUDED else: # Don't allow missable duplicates of progression items to be expected progression. - if location.name in {"PC: Storm Ruler - Siegward", - "US: Pyromancy Flame - Cornyx", - "US: Tower Key - kill Irina"}: - continue + if location.name in self.missable_dupe_prog_locs: continue # Replace non-randomized items with events that give the default item event_item = ( @@ -1286,8 +1290,9 @@ class DarkSouls3World(World): data = location_dictionary[location] if data.dlc and not self.options.enable_dlc: continue if data.ngp and not self.options.enable_ngp: continue + # Don't add rules to missable duplicates of progression items + if location in self.missable_dupe_prog_locs and not self._is_location_available(location): continue - if not self._is_location_available(location): continue if isinstance(rule, str): assert item_dictionary[rule].classification == ItemClassification.progression rule = lambda state, item=rule: state.has(item, self.player)