Skip to content

Commit

Permalink
Add checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dyceron committed Sep 11, 2024
1 parent 41605ff commit e32f127
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
17 changes: 12 additions & 5 deletions src/open_samus_returns_rando/files/levels/s070_area7.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/open_samus_returns_rando/misc_patches/final_boss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
]
Expand Down
2 changes: 1 addition & 1 deletion src/open_samus_returns_rando/misc_patches/spawn_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit e32f127

Please sign in to comment.