From e32f127841a70a0aa3ea9a7c43fe336c9cc4cbf9 Mon Sep 17 00:00:00 2001 From: dyceron Date: Tue, 10 Sep 2024 20:28:24 -0400 Subject: [PATCH] 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"]