diff --git a/EntranceShuffle.py b/EntranceShuffle.py index dea90b2a5..fb92d6b5f 100644 --- a/EntranceShuffle.py +++ b/EntranceShuffle.py @@ -778,7 +778,7 @@ def shuffle_random_entrances(worlds: list[World]) -> None: for pool_type, entrance_pool in entrance_pools.items(): for entrance in entrance_pool: target = (entrance.replaces or entrance).reverse - if not target or target.type not in ('ChildBoss', 'AdultBoss'): + if not entrance.primary or not target or target.type not in ('ChildBoss', 'AdultBoss'): continue savewarp = target.parent_region.savewarp if not savewarp: diff --git a/README.md b/README.md index ddc133b1d..941d701d5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This is a randomizer for _The Legend of Zelda: Ocarina of Time_ for the Nintendo When asking questions or reporting issues in the main Randomizer Discord, please make sure to include the full version number in the `A.B.C Fenhl-D` format — that last part is important! You can also [open an issue](https://github.com/fenhl/OoT-Randomizer/issues/new) on this fork or contact me directly on Discord (`@fenhl`) for any help, report or request. -This branch is available to use online at (may be outdated). +This branch is available to use online at . This branch (`dev-fenhl`) is based on [Roman971](https://github.com/Roman971)'s branch ([`Dev-R`](https://github.com/Roman971/OoT-Randomizer)) which is in turn based on the main [`Dev`](https://github.com/OoTRandomizer/OoT-Randomizer) branch. diff --git a/Unittest.py b/Unittest.py index 5df0b70f9..344e1720d 100644 --- a/Unittest.py +++ b/Unittest.py @@ -662,6 +662,54 @@ def test_spawn_point_invalid_areas(self): with self.assertRaises(EntranceShuffleError): build_world_graphs(world_settings) + @unittest.skip("test usually fails during entrance shuffling, but keep this for documentation") + def test_decoupled_boss_shuffle(self): + # Note that this test will frequently fail to shuffle all entrances. + # This is a side effect of the settings combo and not related to the + # goal of this test. Failure does not mean anything broke, which + # makes this test less useful but still has a place for documentation. + # + # Savewarps in boss rooms are set during entrance shuffle, while + # all other savewarps are set immediately after region file parsing + # and kept static. Boss room savewarps are identified by filtering + # shuffled entrance pools for ChildBoss and AdultBoss types. In + # decoupled, the entrance pools need to filter for only forward/primary + # entrances to avoid catching the savewarp on the dungeon side of the + # boss door and modifying it. This test ensures that all dungeon-side + # savewarps remain pointing to their vanilla regions. While possible + # for modified savewarps to be set to all of their vanilla regions, it + # is unlikely enough that this check should provide confidence nothing + # is being touched that shouldn't be. + filenames = [ + "decoupled_boss_shuffle.sav", + ] + boss_door_savewarps = [ + "Deku Tree Before Boss -> Deku Tree Lobby", + "Dodongos Cavern Before Boss -> Dodongos Cavern Beginning", + "Jabu Jabus Belly Before Boss -> Jabu Jabus Belly Beginning", + "Forest Temple Before Boss -> Forest Temple Lobby", + "Fire Temple Before Boss -> Fire Temple Lower", + "Water Temple Before Boss -> Water Temple Lobby", + "Shadow Temple Before Boss -> Shadow Temple Entryway", + "Spirit Temple Before Boss -> Spirit Temple Lobby", + ] + for filename in filenames: + with self.subTest(filename): + # Work around normal test loading system to avoid disturbing the seed + sfile = os.path.join(test_dir, 'plando', filename) + basename = os.path.splitext(filename)[0] + with open(sfile) as f: + j = json.load(f) + base_settings = make_settings_for_test(j, seed='UWR8ZEKTU7', outfilename=basename) + _, world_settings = resolve_settings(base_settings) + # Known working seed values hardcoded to avoid issues with version/setting changes + world_settings[0].seed = 'UWR8ZEKTU7' + world_settings[0].numeric_seed = 24225027679129157771418409769358900835786779545219061240209643832751186884349 + worlds = build_world_graphs(world_settings) + for savewarp_name in boss_door_savewarps: + savewarp = worlds[0].get_entrance(savewarp_name) + self.assertEqual(savewarp.connected_region.name, savewarp.name.split(' -> ')[1]) + class TestValidSpoilers(unittest.TestCase): # Normalizes spoiler dict for single world or multiple worlds diff --git a/version.py b/version.py index ea5ab8b7e..3a9568c75 100644 --- a/version.py +++ b/version.py @@ -1,7 +1,7 @@ __version__ = '8.1.45' # This is a supplemental version number for branches based off of main dev. -supplementary_version = 2 +supplementary_version = 3 # Pick a unique identifier byte for your fork if you are intending to have a long-lasting branch. # This will be 0x00 for main releases and 0x01 for main dev.