mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
DS3: Apply Rules to Non-Randomized Locations (#5106)
This commit is contained in:
@@ -75,6 +75,13 @@ class DarkSouls3World(World):
|
|||||||
"""The pool of all items within this particular world. This is a subset of
|
"""The pool of all items within this particular world. This is a subset of
|
||||||
`self.multiworld.itempool`."""
|
`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):
|
def __init__(self, multiworld: MultiWorld, player: int):
|
||||||
super().__init__(multiworld, player)
|
super().__init__(multiworld, player)
|
||||||
self.all_excluded_locations = set()
|
self.all_excluded_locations = set()
|
||||||
@@ -258,10 +265,7 @@ class DarkSouls3World(World):
|
|||||||
new_location.progress_type = LocationProgressType.EXCLUDED
|
new_location.progress_type = LocationProgressType.EXCLUDED
|
||||||
else:
|
else:
|
||||||
# Don't allow missable duplicates of progression items to be expected progression.
|
# Don't allow missable duplicates of progression items to be expected progression.
|
||||||
if location.name in {"PC: Storm Ruler - Siegward",
|
if location.name in self.missable_dupe_prog_locs: continue
|
||||||
"US: Pyromancy Flame - Cornyx",
|
|
||||||
"US: Tower Key - kill Irina"}:
|
|
||||||
continue
|
|
||||||
|
|
||||||
# Replace non-randomized items with events that give the default item
|
# Replace non-randomized items with events that give the default item
|
||||||
event_item = (
|
event_item = (
|
||||||
@@ -1286,8 +1290,9 @@ class DarkSouls3World(World):
|
|||||||
data = location_dictionary[location]
|
data = location_dictionary[location]
|
||||||
if data.dlc and not self.options.enable_dlc: continue
|
if data.dlc and not self.options.enable_dlc: continue
|
||||||
if data.ngp and not self.options.enable_ngp: 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):
|
if isinstance(rule, str):
|
||||||
assert item_dictionary[rule].classification == ItemClassification.progression
|
assert item_dictionary[rule].classification == ItemClassification.progression
|
||||||
rule = lambda state, item=rule: state.has(item, self.player)
|
rule = lambda state, item=rule: state.has(item, self.player)
|
||||||
|
Reference in New Issue
Block a user