Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
dyceron committed Aug 7, 2024
1 parent 35474dd commit 5e894e8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 35 deletions.
25 changes: 10 additions & 15 deletions src/open_samus_returns_rando/files/custom/scenario.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 5 additions & 9 deletions src/open_samus_returns_rando/files/levels/s020_area2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 0 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 @@ -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
Expand Down Expand Up @@ -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()
Expand Down
5 changes: 0 additions & 5 deletions src/open_samus_returns_rando/files/levels/s100_area10.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e894e8

Please sign in to comment.