From 4db6640b052c742f7d6f8f9ec6b692732371155d Mon Sep 17 00:00:00 2001 From: dyceron Date: Mon, 9 Sep 2024 20:31:04 -0400 Subject: [PATCH 1/3] Remove breakable Grapple Block if Diggernaut is FB --- src/open_samus_returns_rando/misc_patches/final_boss.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/open_samus_returns_rando/misc_patches/final_boss.py b/src/open_samus_returns_rando/misc_patches/final_boss.py index 2f4fa06..27ce81f 100644 --- a/src/open_samus_returns_rando/misc_patches/final_boss.py +++ b/src/open_samus_returns_rando/misc_patches/final_boss.py @@ -79,6 +79,8 @@ def patch_final_boss(editor: PatcherEditor, configuration: dict) -> None: if not game_patches["remove_elevator_grapple_blocks"]: scenario = editor.get_scenario("s070_area7") scenario.raw.actors[9]["LE_GrappleMov_001"]["position"][0] = -15250.0 + # Remove the breakable Grapple block to allow access to Diggernaut backwards + editor.remove_entity({"scenario": "s070_area7", "layer": 9, "actor": "LE_GrappleDest_012"}) elif final_boss == "Queen": # Remove the Queen wall regardless if the config is set if not game_patches["reverse_area8"]: From 41605ffbd57700af958d058f1c20e24f7124e232 Mon Sep 17 00:00:00 2001 From: dyceron Date: Mon, 9 Sep 2024 22:10:27 -0400 Subject: [PATCH 2/3] Add DNA check for backwards access --- src/open_samus_returns_rando/files/levels/s070_area7.lua | 7 +++++++ src/open_samus_returns_rando/misc_patches/final_boss.py | 3 +++ src/open_samus_returns_rando/misc_patches/spawn_points.py | 3 +++ 3 files changed, 13 insertions(+) diff --git a/src/open_samus_returns_rando/files/levels/s070_area7.lua b/src/open_samus_returns_rando/files/levels/s070_area7.lua index 41cc826..f307839 100644 --- a/src/open_samus_returns_rando/files/levels/s070_area7.lua +++ b/src/open_samus_returns_rando/files/levels/s070_area7.lua @@ -163,6 +163,13 @@ function s070_area7.OnExitHazardous_001() PoisonZone.OnExit() Game.SetSubAreaCurrentSetup("collision_camera_Hazard_End_A", "Default", false) end +function s070_area7.OnEnter_Diggernaut_Access() + if Init.sFinalBoss == "Diggernaut" and not Blackboard.GetProp("GAME", "OBJECTIVE_COMPLETE") then + local startpoint = "Diggernaut" + GUI.LaunchMessage("Not enough Metroid DNA!\nCollect more DNA to fight Diggernaut!", "RandomizerPowerup.Dummy", "") + Game.AddSF(0, "Scenario.FinalBossReload", "s", startpoint) + end +end function s070_area7.OnZeta_001_Intro_Generated(_ARG_0_, _ARG_1_) s070_area7.OnZeta_001_Generated(_ARG_0_, _ARG_1_) end diff --git a/src/open_samus_returns_rando/misc_patches/final_boss.py b/src/open_samus_returns_rando/misc_patches/final_boss.py index 27ce81f..4d65ec2 100644 --- a/src/open_samus_returns_rando/misc_patches/final_boss.py +++ b/src/open_samus_returns_rando/misc_patches/final_boss.py @@ -15,6 +15,9 @@ class NewTrigger(typing.NamedTuple): new_triggers = [ + NewTrigger( + "s070_area7", "TG_Diggernaut_Access", [-20900.0, -7700.0, 0.0], [50, 700, 300], ["collision_camera_045"] + ), NewTrigger("s100_area10", "TG_Queen_Access", [1000.0, 12050.0, 0.0], [500, 300, 300], ["collision_camera_019"]), NewTrigger("s110_surfaceb", "TG_Ridley_Access", [-22800.0, 4400.0, 0.0], [150, 800, 800], ["collision_camera_017"]), ] diff --git a/src/open_samus_returns_rando/misc_patches/spawn_points.py b/src/open_samus_returns_rando/misc_patches/spawn_points.py index fc102dd..5807f11 100644 --- a/src/open_samus_returns_rando/misc_patches/spawn_points.py +++ b/src/open_samus_returns_rando/misc_patches/spawn_points.py @@ -18,6 +18,9 @@ class NewSpawnPoint(typing.NamedTuple): NewSpawnPoint( "s050_area5", "ST_Diggernaut_Chase_Respawn", [-2100.0, -4800.0, 0.0], 90, ["collision_camera_AfterChase_001"] ), + NewSpawnPoint( + "s070_area7", "ST_SG_Diggernaut", [-21450.0, -7600.0, 0.0], 90, ["collision_camera_045"] + ), NewSpawnPoint( "s110_surfaceb", "ST_SurfaceB_Connector", [-23179.0, 4500.0, 0.0], -90, ["collision_camera_017"] ), From e32f127841a70a0aa3ea9a7c43fe336c9cc4cbf9 Mon Sep 17 00:00:00 2001 From: dyceron Date: Tue, 10 Sep 2024 20:28:24 -0400 Subject: [PATCH 3/3] Add checkpoint --- .../files/levels/s070_area7.lua | 17 ++++++++++++----- .../misc_patches/final_boss.py | 7 +++++++ .../misc_patches/spawn_points.py | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/open_samus_returns_rando/files/levels/s070_area7.lua b/src/open_samus_returns_rando/files/levels/s070_area7.lua index f307839..d657627 100644 --- a/src/open_samus_returns_rando/files/levels/s070_area7.lua +++ b/src/open_samus_returns_rando/files/levels/s070_area7.lua @@ -164,10 +164,14 @@ function s070_area7.OnExitHazardous_001() Game.SetSubAreaCurrentSetup("collision_camera_Hazard_End_A", "Default", false) end function s070_area7.OnEnter_Diggernaut_Access() - if Init.sFinalBoss == "Diggernaut" and not Blackboard.GetProp("GAME", "OBJECTIVE_COMPLETE") then - local startpoint = "Diggernaut" - GUI.LaunchMessage("Not enough Metroid DNA!\nCollect more DNA to fight Diggernaut!", "RandomizerPowerup.Dummy", "") - Game.AddSF(0, "Scenario.FinalBossReload", "s", startpoint) + if Init.sFinalBoss == "Diggernaut" then + if not Blackboard.GetProp("GAME", "OBJECTIVE_COMPLETE") then + local startpoint = "Diggernaut" + GUI.LaunchMessage("Not enough Metroid DNA!\nCollect more DNA to fight Diggernaut!", "RandomizerPowerup.Dummy", "") + Game.AddSF(0, "Scenario.FinalBossReload", "s", startpoint) + else + Game.GetPlayer().vPos = V3D(-18500, -7600, 0) + end end end function s070_area7.OnZeta_001_Intro_Generated(_ARG_0_, _ARG_1_) @@ -823,7 +827,7 @@ function s070_area7.OnSubAreaChange(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_) if not Scenario.ReadFromBlackboard("ManicMinerBotStealOrbPlayed", false) then s070_area7.LaunchManicMinerBotStealOrb() end - elseif _ARG_0_ == "collision_camera_034" and _ARG_2_ == "collision_camera_043" then + elseif _ARG_2_ == "collision_camera_043" then if Init.sFinalBoss == "Diggernaut" and not Blackboard.GetProp("GAME", "OBJECTIVE_COMPLETE") then Game.AddSF(0, "Scenario.ShowFinalBossMessage", "") elseif not Scenario.ReadFromBlackboard("ManicMinerBotIntroCutscenePlayed", false) then @@ -936,6 +940,9 @@ end function s070_area7.OnEnter_SetCheckpoint_001_ManicMiner() Game.SetBossCheckPointNames("ST_SG_ManicMiner_Checkpoint", "ST_SG_ManicMiner_Checkpoint", "SG_ManicMinerBot", "", "") end +function s070_area7.OnEnter_SetCheckpoint_002_ManicMiner() + Game.SetBossCheckPointNames("ST_SG_Diggernaut_Checkpoint", "ST_SG_Diggernaut_Checkpoint", "SG_ManicMinerBot", "", "") +end function s070_area7.OnManicMinerBotGenerated(_ARG_0_, _ARG_1_) if _ARG_1_ ~= nil then _ARG_1_.AI.bPlaceholder = false diff --git a/src/open_samus_returns_rando/misc_patches/final_boss.py b/src/open_samus_returns_rando/misc_patches/final_boss.py index 4d65ec2..3ad3f49 100644 --- a/src/open_samus_returns_rando/misc_patches/final_boss.py +++ b/src/open_samus_returns_rando/misc_patches/final_boss.py @@ -18,6 +18,13 @@ class NewTrigger(typing.NamedTuple): NewTrigger( "s070_area7", "TG_Diggernaut_Access", [-20900.0, -7700.0, 0.0], [50, 700, 300], ["collision_camera_045"] ), + NewTrigger( + "s070_area7", + "TG_SetCheckpoint_002_ManicMiner", + [-21450.0, -7600.0, 0.0], + [50, 700, 300], + ["collision_camera_045"], + ), NewTrigger("s100_area10", "TG_Queen_Access", [1000.0, 12050.0, 0.0], [500, 300, 300], ["collision_camera_019"]), NewTrigger("s110_surfaceb", "TG_Ridley_Access", [-22800.0, 4400.0, 0.0], [150, 800, 800], ["collision_camera_017"]), ] diff --git a/src/open_samus_returns_rando/misc_patches/spawn_points.py b/src/open_samus_returns_rando/misc_patches/spawn_points.py index 5807f11..aa22a84 100644 --- a/src/open_samus_returns_rando/misc_patches/spawn_points.py +++ b/src/open_samus_returns_rando/misc_patches/spawn_points.py @@ -19,7 +19,7 @@ class NewSpawnPoint(typing.NamedTuple): "s050_area5", "ST_Diggernaut_Chase_Respawn", [-2100.0, -4800.0, 0.0], 90, ["collision_camera_AfterChase_001"] ), NewSpawnPoint( - "s070_area7", "ST_SG_Diggernaut", [-21450.0, -7600.0, 0.0], 90, ["collision_camera_045"] + "s070_area7", "ST_SG_Diggernaut_Checkpoint", [-21450.0, -7600.0, 0.0], 90, ["collision_camera_045"] ), NewSpawnPoint( "s110_surfaceb", "ST_SurfaceB_Connector", [-23179.0, 4500.0, 0.0], -90, ["collision_camera_017"]