From bb5f02c8e9c53891216561a6778bc26894a869d5 Mon Sep 17 00:00:00 2001 From: dyceron <38679103+dyceron@users.noreply.github.com> Date: Fri, 29 Sep 2023 22:32:39 -0400 Subject: [PATCH] "Connect" both Surfaces together --- .../files/levels/s000_surface.lua | 3 ++ .../files/levels/s110_surfaceb.lua | 44 +++++++++---------- .../files/templates/custom_init.lua | 1 + 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/open_samus_returns_rando/files/levels/s000_surface.lua b/open_samus_returns_rando/files/levels/s000_surface.lua index 9a1e946..211ae07 100644 --- a/open_samus_returns_rando/files/levels/s000_surface.lua +++ b/open_samus_returns_rando/files/levels/s000_surface.lua @@ -457,6 +457,9 @@ function s000_surface.OnSubAreaChange(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4 elseif (_ARG_0_ == "collision_camera_024" and not Scenario.ReadFromBlackboard("alpha_killed", false)) then s000_surface.LaunchFirstTimeAlphaPresentation() end + if _ARG_0_ == "collision_camera_000" and _ARG_2_ == "collision_camera_017" then + Game.LoadScenario("c10_samus", "s110_surfaceb", "", "Samus", 1) + end --if _ARG_0_ == "collision_camera_002" and _ARG_2_ == "collision_camera_003" and not Scenario.ReadFromBlackboard("FirstTimeChozoStatuePlayed", false) then -- s000_surface.LaunchFirstTimeChozoStatuePresentation() diff --git a/open_samus_returns_rando/files/levels/s110_surfaceb.lua b/open_samus_returns_rando/files/levels/s110_surfaceb.lua index daf762b..e15216d 100644 --- a/open_samus_returns_rando/files/levels/s110_surfaceb.lua +++ b/open_samus_returns_rando/files/levels/s110_surfaceb.lua @@ -138,21 +138,19 @@ function s110_surfaceb.OnEnter_SetCheckpoint_001_Ridley() Game.SetBossCheckPointNames("ST_SG_Ridley", "ST_SG_Ridley", "SG_Ridley", "", "") end function s110_surfaceb.LaunchRidleyIntro() - if Game.GetPlayer().INVENTORY:GetItemAmount("ITEM_METROID_COUNT") == 0 then - Game.FadeOut(0.3) - if Game.GetPlayer() ~= nil then - Game.GetPlayer().INPUT:IgnoreInput(true, false) - Game.GetPlayer().MOVEMENT:StartForcedAnalogInput(1, 0) - end - Game.AddSF(0.31, "s110_surfaceb.ScheduledTeleportRidleyIntro", "") - if Game.GetEntity("Samus") ~= nil then - Game.GetEntity("Samus").MODELUPDATER:SetVertexLightsEnabled(true) - end - if Game.GetEntity("morphball") ~= nil then - Game.GetEntity("morphball").MODELUPDATER:SetVertexLightsEnabled(true) - end - s110_surfaceb.SetRidleyStormSoundEnabled(false) + Game.FadeOut(0.3) + if Game.GetPlayer() ~= nil then + Game.GetPlayer().INPUT:IgnoreInput(true, false) + Game.GetPlayer().MOVEMENT:StartForcedAnalogInput(1, 0) + end + Game.AddSF(0.31, "s110_surfaceb.ScheduledTeleportRidleyIntro", "") + if Game.GetEntity("Samus") ~= nil then + Game.GetEntity("Samus").MODELUPDATER:SetVertexLightsEnabled(true) end + if Game.GetEntity("morphball") ~= nil then + Game.GetEntity("morphball").MODELUPDATER:SetVertexLightsEnabled(true) + end + s110_surfaceb.SetRidleyStormSoundEnabled(false) end function s110_surfaceb.PlayMusicOnSkip(_ARG_0_) Game.PlayMusicFromLoopStart(_ARG_0_) @@ -169,14 +167,12 @@ function s110_surfaceb.OnRidley3Skip() Game.AddSF(0.5, "s110_surfaceb.PlayMusicOnSkip", "s", "m_boss_ridley_third99") end function s110_surfaceb.ScheduledTeleportRidleyIntro() - if Game.GetPlayer().INVENTORY:GetItemAmount("ITEM_METROID_COUNT") == 0 then - Game.LockSamusOnMinimap() - if Game.GetEntity("SP_Ridley") ~= nil and Game.GetPlayer() ~= nil then - Game.GetPlayer().vPos = Game.GetEntity("SP_Ridley").vPos - Game.GetPlayer().MOVEMENT:StopForcedAnalogInput() - end - Game.AddSF(0, "s110_surfaceb.ScheduledLaunchRidleyIntro", "") + Game.LockSamusOnMinimap() + if Game.GetEntity("SP_Ridley") ~= nil and Game.GetPlayer() ~= nil then + Game.GetPlayer().vPos = Game.GetEntity("SP_Ridley").vPos + Game.GetPlayer().MOVEMENT:StopForcedAnalogInput() end + Game.AddSF(0, "s110_surfaceb.ScheduledLaunchRidleyIntro", "") end function s110_surfaceb.ScheduledLaunchRidleyIntro() if Game.GetPlayer() ~= nil then @@ -555,7 +551,11 @@ function s110_surfaceb.OnSubAreaChange(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_ Game.SetScenarioItemEnabledByName("ray01", false) Game.SetSceneGroupEnabledByName("sg_debris02", false) Game.SetSceneGroupEnabledByName("sg_debris03", false) - if _ARG_2_ == "collision_camera_021" and _ARG_0_ == "collision_camera_021" and _ARG_3_ == "RidleyCombat" and Game.GetPlayer().INVENTORY:GetItemAmount("ITEM_METROID_COUNT") == 0 then + if _ARG_0_ == "collision_camera_017" and _ARG_2_ == "collision_camera_000" and Blackboard.GetProp("PLAYER_INVENTORY", "ITEM_ADN") < 39 then + Game.LoadScenario("c10_samus", "s000_surface", "", "Samus", 1) + Game.GetPlayer().vPos = V3D(-22800, 4450, 0) + end + if _ARG_2_ == "collision_camera_021" and _ARG_0_ == "collision_camera_021" and _ARG_3_ == "RidleyCombat" then if Game.GetEntity("SG_Ridley") ~= nil then Game.GetEntity("SG_Ridley").SPAWNGROUP:EnableSpawnGroup() if Game.GetEntityFromSpawnPoint("SP_Ridley") ~= nil then diff --git a/open_samus_returns_rando/files/templates/custom_init.lua b/open_samus_returns_rando/files/templates/custom_init.lua index 8ad68ec..80bc356 100644 --- a/open_samus_returns_rando/files/templates/custom_init.lua +++ b/open_samus_returns_rando/files/templates/custom_init.lua @@ -25,6 +25,7 @@ function Init.InitGameBlackboard() Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_WEAPON_MISSILE_CURRENT", "f", Init.tNewGameInventory.ITEM_WEAPON_MISSILE_MAX) Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_WEAPON_SUPER_MISSILE_CURRENT", "f", Init.tNewGameInventory.ITEM_WEAPON_SUPER_MISSILE_MAX) Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_WEAPON_POWER_BOMB_CURRENT", "f", Init.tNewGameInventory.ITEM_WEAPON_POWER_BOMB_MAX) + Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_ADN", "f", Init.tNewGameInventory.ITEM_ADN) Blackboard.SetProp("GAME", "ITEM_RESERVE_TANK_LIFE_SIZE", "f", Init.tReserveTanksInitialConfiguration.ITEM_RESERVE_TANK_LIFE_SIZE) Blackboard.SetProp("GAME", "ITEM_RESERVE_TANK_SPECIAL_ENERGY_SIZE", "f", Init.tReserveTanksInitialConfiguration.ITEM_RESERVE_TANK_SPECIAL_ENERGY_SIZE) Blackboard.SetProp("GAME", "ITEM_RESERVE_TANK_MISSILE_SIZE", "f", Init.tReserveTanksInitialConfiguration.ITEM_RESERVE_TANK_MISSILE_SIZE)