Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix for Beam Block in Surface being deleted #329

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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