From 43867ebcee6b8ef999b09277b03b8e6640df9bbb Mon Sep 17 00:00:00 2001 From: dyceron Date: Fri, 1 Mar 2024 20:29:38 -0500 Subject: [PATCH 1/4] Fix custom Chozo Seal assets dependencies breaking Diggernaut --- .../specific_patches/chozo_seal_patches.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py b/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py index a999590d..b296a9dd 100644 --- a/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py +++ b/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py @@ -2,6 +2,7 @@ from construct import Container, ListContainer from mercury_engine_data_structures.formats import Bmsad, Bmsmsd +from open_samus_returns_rando.constants import get_package_name from open_samus_returns_rando.patcher_editor import PatcherEditor SCRIPT_COMPONENT = Container({ @@ -165,8 +166,9 @@ def update_item_seals(editor:PatcherEditor): scenario.raw.actors[16][seal]["type"] = "chozoseal" # Dependencies - for asset in editor.get_asset_names_in_folder("actors/props/chozoseal"): - editor.ensure_present_in_scenario(scenario_name, asset) + for level_pkg in editor.get_all_level_pkgs(): + for asset in editor.get_asset_names_in_folder("actors/props/chozoseal"): + editor.ensure_present(get_package_name(level_pkg, asset), asset) def patch_chozo_seals(editor: PatcherEditor): From bdad3c4848aadb11c0408f7f37febd68854ba0c2 Mon Sep 17 00:00:00 2001 From: dyceron Date: Fri, 1 Mar 2024 23:12:06 -0500 Subject: [PATCH 2/4] Only ensure in the scenarios with changed seals --- .../specific_patches/chozo_seal_patches.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py b/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py index b296a9dd..7fbfb2d3 100644 --- a/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py +++ b/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py @@ -166,7 +166,7 @@ def update_item_seals(editor:PatcherEditor): scenario.raw.actors[16][seal]["type"] = "chozoseal" # Dependencies - for level_pkg in editor.get_all_level_pkgs(): + for level_pkg in editor.get_level_pkgs(scenario_name): for asset in editor.get_asset_names_in_folder("actors/props/chozoseal"): editor.ensure_present(get_package_name(level_pkg, asset), asset) From 802311b5ba0f18ce94c32a9bda9c871485e179d3 Mon Sep 17 00:00:00 2001 From: dyceron Date: Sat, 2 Mar 2024 07:11:45 -0500 Subject: [PATCH 3/4] Revert asset ensure and update the common way :p --- src/open_samus_returns_rando/patcher_editor.py | 4 ++-- .../specific_patches/chozo_seal_patches.py | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/open_samus_returns_rando/patcher_editor.py b/src/open_samus_returns_rando/patcher_editor.py index 7e08e3bc..6e20a0b9 100644 --- a/src/open_samus_returns_rando/patcher_editor.py +++ b/src/open_samus_returns_rando/patcher_editor.py @@ -7,7 +7,7 @@ from mercury_engine_data_structures.formats import BaseResource, Bmsld from mercury_engine_data_structures.game_check import Game -from open_samus_returns_rando.constants import ALL_SCENARIOS +from open_samus_returns_rando.constants import ALL_SCENARIOS, get_package_name T = typing.TypeVar("T") @@ -39,7 +39,7 @@ def get_nested_list(): def ensure_present_in_scenario(self, scenario: str, asset): for pkg in self.get_level_pkgs(scenario): - self.ensure_present(pkg, asset) + self.ensure_present(get_package_name(pkg, asset), asset) def get_scenario(self, name: str) -> Bmsld: return self.get_file(path_for_level(name) + ".bmsld", Bmsld) diff --git a/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py b/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py index 7fbfb2d3..a999590d 100644 --- a/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py +++ b/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py @@ -2,7 +2,6 @@ from construct import Container, ListContainer from mercury_engine_data_structures.formats import Bmsad, Bmsmsd -from open_samus_returns_rando.constants import get_package_name from open_samus_returns_rando.patcher_editor import PatcherEditor SCRIPT_COMPONENT = Container({ @@ -166,9 +165,8 @@ def update_item_seals(editor:PatcherEditor): scenario.raw.actors[16][seal]["type"] = "chozoseal" # Dependencies - for level_pkg in editor.get_level_pkgs(scenario_name): - for asset in editor.get_asset_names_in_folder("actors/props/chozoseal"): - editor.ensure_present(get_package_name(level_pkg, asset), asset) + for asset in editor.get_asset_names_in_folder("actors/props/chozoseal"): + editor.ensure_present_in_scenario(scenario_name, asset) def patch_chozo_seals(editor: PatcherEditor): From 3f4b489ecf615e3d2f4bd733f1a7c11dd7341aaa Mon Sep 17 00:00:00 2001 From: dyceron Date: Sat, 2 Mar 2024 07:23:05 -0500 Subject: [PATCH 4/4] Re-enable surfaceb seal --- .../specific_patches/chozo_seal_patches.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py b/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py index a999590d..1475f4e1 100644 --- a/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py +++ b/src/open_samus_returns_rando/specific_patches/chozo_seal_patches.py @@ -105,10 +105,9 @@ class NewChozoSeal(typing.NamedTuple): "s100_area10", [-4100.0, 11200.0, 0.0], [-4100.0, 11200.0, 0.0], 253, ["collision_camera_022", "collision_camera_024"] ), - # Currently breaks Ridley if added :( - # NewChozoSeal( - # "s110_surfaceb", [-28150.0, 300.0, 0.0], [-28150.0, 300.0, 0.0], 145, ["collision_camera_017"] - # ), + NewChozoSeal( + "s110_surfaceb", [-28150.0, 300.0, 0.0], [-28150.0, 300.0, 0.0], 145, ["collision_camera_017"] + ), ] def add_chozo_seals(editor: PatcherEditor, new_seal: NewChozoSeal):