From b4212d1c3eaef5980fae7329796636274d80df1a Mon Sep 17 00:00:00 2001 From: Scipio Wright Date: Sun, 28 Jan 2024 15:13:03 -0500 Subject: [PATCH 1/3] TUNIC: Fix for nmg logic bug (#2772) --- worlds/tunic/er_data.py | 51 ++++++++++++++++++++++---------------- worlds/tunic/er_rules.py | 19 +++++++++++--- worlds/tunic/er_scripts.py | 6 ++--- 3 files changed, 48 insertions(+), 28 deletions(-) diff --git a/worlds/tunic/er_data.py b/worlds/tunic/er_data.py index 2d3bcc025f4b..95d33d4aff67 100644 --- a/worlds/tunic/er_data.py +++ b/worlds/tunic/er_data.py @@ -37,7 +37,7 @@ def scene_destination(self) -> str: # full, nonchanging name to interpret by th destination="Furnace_gyro_lower"), Portal(name="Caustic Light Cave Entrance", region="Overworld", destination="Overworld Cave_"), - Portal(name="Swamp Upper Entrance", region="Overworld Laurels", + Portal(name="Swamp Upper Entrance", region="Overworld Swamp Upper Entry", destination="Swamp Redux 2_wall"), Portal(name="Swamp Lower Entrance", region="Overworld", destination="Swamp Redux 2_conduit"), @@ -49,7 +49,7 @@ def scene_destination(self) -> str: # full, nonchanging name to interpret by th destination="Atoll Redux_upper"), Portal(name="Atoll Lower Entrance", region="Overworld", destination="Atoll Redux_lower"), - Portal(name="Special Shop Entrance", region="Overworld Laurels", + Portal(name="Special Shop Entrance", region="Overworld Special Shop Entry", destination="ShopSpecial_"), Portal(name="Maze Cave Entrance", region="Overworld", destination="Maze Room_"), @@ -57,7 +57,7 @@ def scene_destination(self) -> str: # full, nonchanging name to interpret by th destination="Archipelagos Redux_upper"), Portal(name="West Garden Entrance from Furnace", region="Overworld to West Garden from Furnace", destination="Archipelagos Redux_lower"), - Portal(name="West Garden Laurels Entrance", region="Overworld Laurels", + Portal(name="West Garden Laurels Entrance", region="Overworld West Garden Laurels Entry", destination="Archipelagos Redux_lowest"), Portal(name="Temple Door Entrance", region="Overworld Temple Door", destination="Temple_main"), @@ -533,7 +533,9 @@ class Hint(IntEnum): "Overworld": RegionInfo("Overworld Redux"), "Overworld Holy Cross": RegionInfo("Fake", dead_end=DeadEnd.all_cats), "Overworld Belltower": RegionInfo("Overworld Redux"), # the area with the belltower and chest - "Overworld Laurels": RegionInfo("Overworld Redux"), # all spots in Overworld that you need laurels to reach + "Overworld Swamp Upper Entry": RegionInfo("Overworld Redux"), # upper swamp entry spot + "Overworld Special Shop Entry": RegionInfo("Overworld Redux"), # special shop entry spot + "Overworld West Garden Laurels Entry": RegionInfo("Overworld Redux"), # west garden laurels entry "Overworld to West Garden from Furnace": RegionInfo("Overworld Redux", hint=Hint.region), "Overworld Well to Furnace Rail": RegionInfo("Overworld Redux"), # the tiny rail passageway "Overworld Ruined Passage Door": RegionInfo("Overworld Redux"), # the small space betweeen the door and the portal @@ -710,7 +712,7 @@ class Hint(IntEnum): hallway_helper[p2] = p1 # so we can just loop over this instead of doing some complicated thing to deal with hallways in the hints -hallways_nmg: Dict[str, str] = { +hallways_ur: Dict[str, str] = { "Ruins Passage, Overworld Redux_east": "Ruins Passage, Overworld Redux_west", "East Forest Redux Interior, East Forest Redux_upper": "East Forest Redux Interior, East Forest Redux_lower", "Forest Boss Room, East Forest Redux Laddercave_": "Forest Boss Room, Forest Belltower_", @@ -720,20 +722,22 @@ class Hint(IntEnum): "ziggurat2020_0, Quarry Redux_": "ziggurat2020_0, ziggurat2020_1_", "Purgatory, Purgatory_bottom": "Purgatory, Purgatory_top", } -hallway_helper_nmg: Dict[str, str] = {} -for p1, p2 in hallways.items(): - hallway_helper[p1] = p2 - hallway_helper[p2] = p1 +hallway_helper_ur: Dict[str, str] = {} +for p1, p2 in hallways_ur.items(): + hallway_helper_ur[p1] = p2 + hallway_helper_ur[p2] = p1 # the key is the region you have, the value is the regions you get for having that region # this is mostly so we don't have to do something overly complex to get this information dependent_regions: Dict[Tuple[str, ...], List[str]] = { - ("Overworld", "Overworld Belltower", "Overworld Laurels", "Overworld Southeast Cross Door", "Overworld Temple Door", + ("Overworld", "Overworld Belltower", "Overworld Swamp Upper Entry", "Overworld Special Shop Entry", + "Overworld West Garden Laurels Entry", "Overworld Southeast Cross Door", "Overworld Temple Door", "Overworld Fountain Cross Door", "Overworld Town Portal", "Overworld Spawn Portal"): - ["Overworld", "Overworld Belltower", "Overworld Laurels", "Overworld Ruined Passage Door", - "Overworld Southeast Cross Door", "Overworld Old House Door", "Overworld Temple Door", - "Overworld Fountain Cross Door", "Overworld Town Portal", "Overworld Spawn Portal"], + ["Overworld", "Overworld Belltower", "Overworld Swamp Upper Entry", "Overworld Special Shop Entry", + "Overworld West Garden Laurels Entry", "Overworld Ruined Passage Door", "Overworld Southeast Cross Door", + "Overworld Old House Door", "Overworld Temple Door", "Overworld Fountain Cross Door", "Overworld Town Portal", + "Overworld Spawn Portal"], ("Old House Front",): ["Old House Front", "Old House Back"], ("Furnace Fuse", "Furnace Ladder Area", "Furnace Walking Path"): @@ -818,12 +822,14 @@ class Hint(IntEnum): dependent_regions_nmg: Dict[Tuple[str, ...], List[str]] = { - ("Overworld", "Overworld Belltower", "Overworld Laurels", "Overworld Southeast Cross Door", "Overworld Temple Door", + ("Overworld", "Overworld Belltower", "Overworld Swamp Upper Entry", "Overworld Special Shop Entry", + "Overworld West Garden Laurels Entry", "Overworld Southeast Cross Door", "Overworld Temple Door", "Overworld Fountain Cross Door", "Overworld Town Portal", "Overworld Spawn Portal", "Overworld Ruined Passage Door"): - ["Overworld", "Overworld Belltower", "Overworld Laurels", "Overworld Ruined Passage Door", - "Overworld Southeast Cross Door", "Overworld Old House Door", "Overworld Temple Door", - "Overworld Fountain Cross Door", "Overworld Town Portal", "Overworld Spawn Portal"], + ["Overworld", "Overworld Belltower", "Overworld Swamp Upper Entry", "Overworld Special Shop Entry", + "Overworld West Garden Laurels Entry", "Overworld Ruined Passage Door", "Overworld Southeast Cross Door", + "Overworld Old House Door", "Overworld Temple Door", "Overworld Fountain Cross Door", "Overworld Town Portal", + "Overworld Spawn Portal"], # can laurels through the gate ("Old House Front", "Old House Back"): ["Old House Front", "Old House Back"], @@ -908,13 +914,14 @@ class Hint(IntEnum): dependent_regions_ur: Dict[Tuple[str, ...], List[str]] = { # can use ladder storage to get to the well rail - ("Overworld", "Overworld Belltower", "Overworld Laurels", "Overworld Southeast Cross Door", "Overworld Temple Door", + ("Overworld", "Overworld Belltower", "Overworld Swamp Upper Entry", "Overworld Special Shop Entry", + "Overworld West Garden Laurels Entry", "Overworld Southeast Cross Door", "Overworld Temple Door", "Overworld Fountain Cross Door", "Overworld Town Portal", "Overworld Spawn Portal", "Overworld Ruined Passage Door"): - ["Overworld", "Overworld Belltower", "Overworld Laurels", "Overworld Ruined Passage Door", - "Overworld Southeast Cross Door", "Overworld Old House Door", "Overworld Temple Door", - "Overworld Fountain Cross Door", "Overworld Town Portal", "Overworld Spawn Portal", - "Overworld Well to Furnace Rail"], + ["Overworld", "Overworld Belltower", "Overworld Swamp Upper Entry", "Overworld Special Shop Entry", + "Overworld West Garden Laurels Entry", "Overworld Ruined Passage Door", "Overworld Southeast Cross Door", + "Overworld Old House Door", "Overworld Temple Door", "Overworld Fountain Cross Door", "Overworld Town Portal", + "Overworld Spawn Portal", "Overworld Well to Furnace Rail"], # can laurels through the gate ("Old House Front", "Old House Back"): ["Old House Front", "Old House Back"], diff --git a/worlds/tunic/er_rules.py b/worlds/tunic/er_rules.py index 5d88022dc159..ab0cf02bd97c 100644 --- a/worlds/tunic/er_rules.py +++ b/worlds/tunic/er_rules.py @@ -53,9 +53,23 @@ def set_er_region_rules(world: "TunicWorld", ability_unlocks: Dict[str, int], re or (state.has(laurels, player) and options.logic_rules)) regions["Overworld"].connect( - connecting_region=regions["Overworld Laurels"], + connecting_region=regions["Overworld Swamp Upper Entry"], rule=lambda state: state.has(laurels, player)) - regions["Overworld Laurels"].connect( + regions["Overworld Swamp Upper Entry"].connect( + connecting_region=regions["Overworld"], + rule=lambda state: state.has(laurels, player)) + + regions["Overworld"].connect( + connecting_region=regions["Overworld Special Shop Entry"], + rule=lambda state: state.has(laurels, player)) + regions["Overworld Special Shop Entry"].connect( + connecting_region=regions["Overworld"], + rule=lambda state: state.has(laurels, player)) + + regions["Overworld"].connect( + connecting_region=regions["Overworld West Garden Laurels Entry"], + rule=lambda state: state.has(laurels, player)) + regions["Overworld West Garden Laurels Entry"].connect( connecting_region=regions["Overworld"], rule=lambda state: state.has(laurels, player)) @@ -230,7 +244,6 @@ def set_er_region_rules(world: "TunicWorld", ability_unlocks: Dict[str, int], re connecting_region=regions["West Garden Laurels Exit"], rule=lambda state: state.has(laurels, player)) - # todo: can you wake the boss, then grapple to it, then kill it? regions["West Garden after Boss"].connect( connecting_region=regions["West Garden"], rule=lambda state: state.has(laurels, player)) diff --git a/worlds/tunic/er_scripts.py b/worlds/tunic/er_scripts.py index 4d640b2fda78..4e28344b20ad 100644 --- a/worlds/tunic/er_scripts.py +++ b/worlds/tunic/er_scripts.py @@ -1,7 +1,7 @@ from typing import Dict, List, Set, Tuple, TYPE_CHECKING from BaseClasses import Region, ItemClassification, Item, Location from .locations import location_table -from .er_data import Portal, tunic_er_regions, portal_mapping, hallway_helper, hallway_helper_nmg, \ +from .er_data import Portal, tunic_er_regions, portal_mapping, hallway_helper, hallway_helper_ur, \ dependent_regions, dependent_regions_nmg, dependent_regions_ur from .er_rules import set_er_region_rules @@ -28,8 +28,8 @@ def hint_helper(portal: Portal, hint_string: str = "") -> str: if hint_string == "": hint_string = portal.name - if logic_rules: - hallways = hallway_helper_nmg + if logic_rules == "unrestricted": + hallways = hallway_helper_ur else: hallways = hallway_helper From 0bc9966d6f4d216948c7db345b54a04ce94f2d73 Mon Sep 17 00:00:00 2001 From: JusticePS <5125765+JusticePS@users.noreply.github.com> Date: Mon, 29 Jan 2024 09:37:55 -0800 Subject: [PATCH 2/3] Adventure: Fix iterable copy error when freeincarnate_max is tuned low (#2774) --- worlds/adventure/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/adventure/__init__.py b/worlds/adventure/__init__.py index 105725bd053c..9b9b0d77d800 100644 --- a/worlds/adventure/__init__.py +++ b/worlds/adventure/__init__.py @@ -271,7 +271,7 @@ def pre_fill(self): overworld_locations_copy = overworld.locations.copy() all_locations = self.multiworld.get_locations(self.player) - locations_copy = all_locations.copy() + locations_copy = list(all_locations) for loc in all_locations: if loc.item is not None or loc.progress_type != LocationProgressType.DEFAULT: locations_copy.remove(loc) From 69c80501c494be4edf8210949fa5fed7e9f73f7c Mon Sep 17 00:00:00 2001 From: JaredWeakStrike <96694163+JaredWeakStrike@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:39:45 -0500 Subject: [PATCH 3/3] KH2: Fix empty location groups (#2757) Co-authored-by: Aaron Wagener --- worlds/kh2/Locations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/kh2/Locations.py b/worlds/kh2/Locations.py index 61fafe909412..100e971e7dff 100644 --- a/worlds/kh2/Locations.py +++ b/worlds/kh2/Locations.py @@ -1356,5 +1356,5 @@ location_groups: typing.Dict[str, list] location_groups = { Region_Name: [loc for loc in Region_Locs if "Event" not in loc] - for Region_Name, Region_Locs in KH2REGIONS.items() if Region_Locs + for Region_Name, Region_Locs in KH2REGIONS.items() if Region_Locs and "Event" not in Region_Locs[0] }