From 5e894e8af64124bde9053ce9fefc4f02de7867c7 Mon Sep 17 00:00:00 2001 From: dyceron Date: Tue, 6 Aug 2024 20:21:57 -0400 Subject: [PATCH] Address review --- .../files/custom/scenario.lua | 25 ++++++++----------- .../files/levels/s020_area2.lua | 14 ++++------- .../files/levels/s070_area7.lua | 5 ---- .../files/levels/s100_area10.lua | 5 ---- .../files/levels/s110_surfaceb.lua | 2 +- 5 files changed, 16 insertions(+), 35 deletions(-) diff --git a/src/open_samus_returns_rando/files/custom/scenario.lua b/src/open_samus_returns_rando/files/custom/scenario.lua index db868b7..49e41b1 100644 --- a/src/open_samus_returns_rando/files/custom/scenario.lua +++ b/src/open_samus_returns_rando/files/custom/scenario.lua @@ -203,21 +203,16 @@ end function Scenario.ShowFinalBossMessage() if Init.sFinalBoss == "Ridley" then return end - local bosses = {"Arachnus", "Diggernaut", "Queen"} - for _, boss in ipairs(bosses) do - if Init.sFinalBoss == boss then - local boss_name = boss - local startpoint = boss - if boss == "Diggernaut" then - startpoint = "ManicMiner" - elseif boss == "Queen" then - boss_name = "the Queen" - end - GUI.LaunchMessage("Not enough Metroid DNA!\nCollect more DNA to fight " .. boss_name .. "!", "RandomizerPowerup.Dummy", "") - if Init.sFinalBoss ~= "Queen" then - Game.AddSF(0, "Scenario.FinalBossReload", "s", startpoint) - end - end + local boss = Init.sFinalBoss + local startpoint = boss + if boss == "Diggernaut" then + startpoint = "ManicMiner" + elseif boss == "Queen" then + boss = "the Queen" + end + GUI.LaunchMessage("Not enough Metroid DNA!\nCollect more DNA to fight " .. boss .. "!", "RandomizerPowerup.Dummy", "") + if Init.sFinalBoss ~= "Queen" then + Game.AddSF(0, "Scenario.FinalBossReload", "s", startpoint) end end diff --git a/src/open_samus_returns_rando/files/levels/s020_area2.lua b/src/open_samus_returns_rando/files/levels/s020_area2.lua index 2d97c6a..4c3e76c 100644 --- a/src/open_samus_returns_rando/files/levels/s020_area2.lua +++ b/src/open_samus_returns_rando/files/levels/s020_area2.lua @@ -2,10 +2,6 @@ Game.ImportLibrary("actors/props/damageplants/scripts/damageplants.lua", false) Game.ImportLibrary("actors/props/heatzone/scripts/heatzone.lua", false) Game.ImportLibrary("actors/props/poisonzone/scripts/poisonzone.lua", false) Game.ImportLibrary("actors/props/waterzone/scripts/waterzone.lua", false) -s020_area2 = { - bAfterCredits = false, - bFirstTimeCompleted = false -} function s020_area2.main() Scenario.InitGUI() end @@ -68,12 +64,12 @@ end function s020_area2.OnExit() end function s020_area2.OnSubAreaChange(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_) - if _ARG_0_ == "" and _ARG_2_ == "collision_camera_005" and Init.sFinalBoss == "Arachnus" and 0 < Scenario.ReadFromBlackboard("entity_SG_Arachnus_001_deaths", 0) then - s020_area2.bAfterCredits = false - Scenario.OnPostCreditsEnd() - end if _ARG_2_ == "collision_camera_005" and Init.sFinalBoss == "Arachnus" and 0 < Scenario.ReadFromBlackboard("entity_SG_Arachnus_001_deaths", 0) then - Game.AddSF(0, "Scenario.LaunchCredits", "") + if _ARG_0_ == "" then + Scenario.OnPostCreditsEnd() + else + Game.AddSF(0, "Scenario.LaunchCredits", "") + end end if _ARG_2_ == "collision_camera_006" then if Init.sFinalBoss == "Arachnus" and not Blackboard.GetProp("GAME", "OBJECTIVE_COMPLETE") then 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 965f81f..bc8493d 100644 --- a/src/open_samus_returns_rando/files/levels/s070_area7.lua +++ b/src/open_samus_returns_rando/files/levels/s070_area7.lua @@ -2,10 +2,6 @@ Game.ImportLibrary("actors/props/damageplants/scripts/damageplants.lua", false) Game.ImportLibrary("actors/props/heatzone/scripts/heatzone.lua", false) Game.ImportLibrary("actors/props/poisonzone/scripts/poisonzone.lua", false) Game.ImportLibrary("actors/props/waterzone/scripts/waterzone.lua", false) -s070_area7 = { - bAfterCredits = false, - bFirstTimeCompleted = false -} function s070_area7.main() Scenario.InitGUI() end @@ -806,7 +802,6 @@ end function s070_area7.OnSubAreaChange(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_) if _ARG_0_ == "" and _ARG_2_ == "collision_camera_043" and _ARG_3_ == "ManicMiner_Dead" then if Init.sFinalBoss == "Diggernaut" then - s070_area7.bAfterCredits = false Scenario.OnPostCreditsEnd() elseif Game.GetEntity("SG_ManicMinerBot") ~= nil then Game.GetEntity("SG_ManicMinerBot").SPAWNGROUP:EnableSpawnGroup() diff --git a/src/open_samus_returns_rando/files/levels/s100_area10.lua b/src/open_samus_returns_rando/files/levels/s100_area10.lua index e276f2b..4bfdc1e 100644 --- a/src/open_samus_returns_rando/files/levels/s100_area10.lua +++ b/src/open_samus_returns_rando/files/levels/s100_area10.lua @@ -2,10 +2,6 @@ Game.ImportLibrary("actors/props/damageplants/scripts/damageplants.lua", false) Game.ImportLibrary("actors/props/heatzone/scripts/heatzone.lua", false) Game.ImportLibrary("actors/props/poisonzone/scripts/poisonzone.lua", false) Game.ImportLibrary("actors/props/waterzone/scripts/waterzone.lua", false) -s100_area10 = { - bAfterCredits = false, - bFirstTimeCompleted = false -} function s100_area10.main() Scenario.InitGUI() end @@ -303,7 +299,6 @@ function s100_area10.OnSubAreaChange(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_ Game.SetSafeFarPlaneFactor(s100_area10.fSafeFarPlaneFactor) end if _ARG_0_ == "" and _ARG_2_ == "collision_camera_020" and _ARG_3_ == "PostMetroids_001" then - s100_area10.bAfterCredits = false Scenario.OnPostCreditsEnd() end if _ARG_0_ == "collision_camera_020" and _ARG_2_ == "collision_camera_022" then diff --git a/src/open_samus_returns_rando/files/levels/s110_surfaceb.lua b/src/open_samus_returns_rando/files/levels/s110_surfaceb.lua index 056ed1e..8ed809a 100644 --- a/src/open_samus_returns_rando/files/levels/s110_surfaceb.lua +++ b/src/open_samus_returns_rando/files/levels/s110_surfaceb.lua @@ -575,7 +575,7 @@ function s110_surfaceb.OnSubAreaChange(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_ Game.SetSceneGroupEnabledByName("sg_debris02", false) Game.SetSceneGroupEnabledByName("sg_debris03", false) if _ARG_2_ == "collision_camera_000" then - if (Init.sFinalBoss == Ridley and not Blackboard.GetProp("GAME", "OBJECTIVE_COMPLETE")) or Blackboard.GetProp("DEFEATED_ENEMIES", "Ridley") then + if (Init.sFinalBoss == "Ridley" and not Blackboard.GetProp("GAME", "OBJECTIVE_COMPLETE")) or Blackboard.GetProp("DEFEATED_ENEMIES", "Ridley") then s110_surfaceb.LoadSurface() end end