Skip to content

Commit

Permalink
Fix Surface not working
Browse files Browse the repository at this point in the history
  • Loading branch information
dyceron committed Apr 30, 2024
1 parent 57066d0 commit 52c9176
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/open_samus_returns_rando/specific_patches/static_fixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"},
],
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 52c9176

Please sign in to comment.