From 5cf0586cdf9590a7b0afa1beb1875730399955df Mon Sep 17 00:00:00 2001 From: dyceron Date: Sun, 28 Apr 2024 17:55:32 -0400 Subject: [PATCH 1/2] Hotfix for Beam Block in Surface --- .../specific_patches/static_fixes.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/open_samus_returns_rando/specific_patches/static_fixes.py b/src/open_samus_returns_rando/specific_patches/static_fixes.py index 75d9d8a3..6484c1bf 100644 --- a/src/open_samus_returns_rando/specific_patches/static_fixes.py +++ b/src/open_samus_returns_rando/specific_patches/static_fixes.py @@ -204,7 +204,7 @@ def increase_pb_drop_chance(editor: PatcherEditor): def fix_wrong_cc_actor_deletions(editor: PatcherEditor): # Prevents hidden item actors from being deleted when its block is broken from an adjacent cc - BOMB_BLOCK = Container({ + CUSTOM_BLOCK = Container({ "pos": ListContainer([ -10350.0, -1850.0, @@ -220,8 +220,15 @@ def fix_wrong_cc_actor_deletions(editor: PatcherEditor): unk_bool=True, types=ListContainer([Container(block_type='bomb', blocks=ListContainer([]))]) ) + BEAM_GROUP = Container( + unk_bool=True, + types=ListContainer([Container(block_type='powerbeam', blocks=ListContainer([]))]) + ) scenario_powerup_eg = { + "s000_surface": [ + {"powerup_name": "HiddenPowerup001", "cc": "collision_camera_023"}, + ], "s010_area1": [ {"powerup_name": "HiddenPowerup001", "cc": "collision_camera_018"}, ], @@ -255,8 +262,9 @@ def fix_wrong_cc_actor_deletions(editor: PatcherEditor): ) sg_casca = powerup_actor.components[0].arguments[2].value pos = powerup_actor.position - new_group = copy.deepcopy(BOMB_GROUP) - new_block = copy.deepcopy(BOMB_BLOCK) + # Edge case for the beam block in Surface + new_group = copy.deepcopy(BOMB_GROUP) if scenario != "s000_surface" else copy.deepcopy(BEAM_GROUP) + new_block = copy.deepcopy(CUSTOM_BLOCK) new_block.pos = pos new_block.name1 = sg_casca new_group.types[0].blocks.append(new_block) From 84e650e6193537884b2ccc8ca9f19c6edf9ad2d5 Mon Sep 17 00:00:00 2001 From: dyceron Date: Sun, 28 Apr 2024 19:38:48 -0400 Subject: [PATCH 2/2] Fix Surface not working --- .../specific_patches/static_fixes.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/open_samus_returns_rando/specific_patches/static_fixes.py b/src/open_samus_returns_rando/specific_patches/static_fixes.py index 6484c1bf..5b269e5f 100644 --- a/src/open_samus_returns_rando/specific_patches/static_fixes.py +++ b/src/open_samus_returns_rando/specific_patches/static_fixes.py @@ -224,6 +224,9 @@ def fix_wrong_cc_actor_deletions(editor: PatcherEditor): unk_bool=True, types=ListContainer([Container(block_type='powerbeam', blocks=ListContainer([]))]) ) + BMSBK_GROUP = Container( + name="bg_SubArea_collision_camera_023", entries=ListContainer([]) + ) scenario_powerup_eg = { "s000_surface": [ @@ -256,14 +259,19 @@ def fix_wrong_cc_actor_deletions(editor: PatcherEditor): # Make actor freestanding powerup_actor["components"][0]["arguments"][0]["value"] = "" - # add block on top of item + # Add block on top of item bmsbk = editor.get_file( f"maps/levels/c10_samus/{scenario_name}/{scenario_name}.bmsbk", Bmsbk ) sg_casca = powerup_actor.components[0].arguments[2].value pos = powerup_actor.position # Edge case for the beam block in Surface - new_group = copy.deepcopy(BOMB_GROUP) if scenario != "s000_surface" else copy.deepcopy(BEAM_GROUP) + if scenario_name == "s000_surface": + new_group = copy.deepcopy(BEAM_GROUP) + # Add the missing collision_camera entry + bmsbk.raw.collision_cameras.append(BMSBK_GROUP) + else: + new_group = copy.deepcopy(BOMB_GROUP) new_block = copy.deepcopy(CUSTOM_BLOCK) new_block.pos = pos new_block.name1 = sg_casca @@ -273,7 +281,6 @@ def fix_wrong_cc_actor_deletions(editor: PatcherEditor): bmsbk_cc_obj.entries.append(len(bmsbk.raw.block_groups) - 1) - def apply_static_fixes(editor: PatcherEditor): patch_multi_room_gammas(editor) patch_pickup_rotation(editor)