From 52c91765a101ae486afe1b9a352e2b44481c5876 Mon Sep 17 00:00:00 2001 From: dyceron Date: Sun, 28 Apr 2024 19:38:48 -0400 Subject: [PATCH] Fix Surface not working --- .../specific_patches/static_fixes.py | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 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 75d9d8a..5b269e5 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,18 @@ 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([]))]) + ) + BMSBK_GROUP = Container( + name="bg_SubArea_collision_camera_023", entries=ListContainer([]) + ) scenario_powerup_eg = { + "s000_surface": [ + {"powerup_name": "HiddenPowerup001", "cc": "collision_camera_023"}, + ], "s010_area1": [ {"powerup_name": "HiddenPowerup001", "cc": "collision_camera_018"}, ], @@ -249,14 +259,20 @@ 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 - new_group = copy.deepcopy(BOMB_GROUP) - new_block = copy.deepcopy(BOMB_BLOCK) + # Edge case for the beam block in Surface + 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 new_group.types[0].blocks.append(new_block) @@ -265,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)