Skip to content

Commit

Permalink
Merge pull request #221 from randovania/fix-a4-gamma-loop
Browse files Browse the repository at this point in the history
Fix a4 gamma teleport occuring more than once
  • Loading branch information
ThanatosGit authored Dec 17, 2023
2 parents 65ce12e + 92d717c commit ab953d2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/open_samus_returns_rando/files/levels/s040_area4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,16 @@ function s040_area4.OnEnter_Gamma_001_Dead()
if Game.GetEntity("SpawnGroup021") ~= nil then
Game.GetEntity("SpawnGroup021").SPAWNGROUP:EnableSpawnGroup()
end
Game.GetPlayer().vPos = Game.GetEntity("ST_SG_Gamma_001").vPos
Game.AddSF(0.5, "s040_area4.DelayedWarp", "")
end
end
function s040_area4.DelayedWarp()
Game.GetPlayer().vPos = V3D(1766.0, 4742.0, 0.0)
Game.SetPlayerInputEnabled(false, true)
Game.FadeIn(2.5)
Game.GetPlayer().vPos = InitialPosition
Game.AddSF(1.5, "s040_area4.DelayedInput", "")
end
function s040_area4.DelayedInput()
Game.SetPlayerInputEnabled(true, true)
end
s040_area4.tDNAScanLandmarks = {
SG_Alpha_001 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ end
function Metroid.DelayedDelete(spawnGroupName)
Game.DeleteEntity(spawnGroupName)
if spawnGroupName == "SG_Gamma_001_A" then
InitialPosition = Game.GetPlayer().vPos
Game.GetPlayer().vPos = Game.GetEntity("ST_SG_Gamma_001").vPos
Game.SetPlayerInputEnabled(false, true)
Game.AddSF(0.5, "s040_area4.DelayedWarp", "")
CurrentScenario.OnEnter_Gamma_001_Dead()
elseif spawnGroupName == "SG_Gamma_002_A" then
CurrentScenario.OnEnter_Gamma_002_Dead()
Expand All @@ -42,6 +46,9 @@ function Metroid.RemoveMetroid(_ARG_0_)
end
local allDead = "Arena_" .. string.sub(spawnGroupName, 4, -3) .. "_AllDead"
Scenario.WriteToBlackboard(allDead, "b", true)
if spawnGroupName == "SG_Gamma_001_A" then
Game.SetPlayerInputEnabled(false, true)
end
Game.AddSF(4.0, "Metroid.DelayedDelete", "s", spawnGroupName)
-- disable single arena metroid
else
Expand Down

0 comments on commit ab953d2

Please sign in to comment.