Skip to content

Commit

Permalink
"Connect" both Surfaces together
Browse files Browse the repository at this point in the history
  • Loading branch information
dyceron committed Sep 30, 2023
1 parent dd9186a commit 4e1210d
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 32 deletions.
3 changes: 3 additions & 0 deletions open_samus_returns_rando/files/levels/s000_surface.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
44 changes: 22 additions & 22 deletions open_samus_returns_rando/files/levels/s110_surfaceb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
45 changes: 35 additions & 10 deletions open_samus_returns_rando/files/templates/custom_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,50 @@ Game.ImportLibrary("system/scripts/init_original.lua")
Init.tNewGameInventory = TEMPLATE("new_game_inventory")

Init.bRevealMap = TEMPLATE("reveal_map_on_start")
Init.sStartingScenario = TEMPLATE("starting_scenario")
Init.sStartingActor = TEMPLATE("starting_actor")
Init.fEnergyPerTank = TEMPLATE("energy_per_tank")
Init.fAeionPerTank = TEMPLATE("aeion_per_tank")

Game.LogWarn(0, "Inventory:")
for k, v in pairs(Init.tNewGameInventory) do
Game.LogWarn(0, tostring(k) .. " = " .. tostring(v))
end

local buff = {}

Init.sStartingScenario = TEMPLATE("starting_scenario")
Init.sStartingActor = TEMPLATE("starting_actor")

function Init.InitNewGame(arg1, arg2, arg3, arg4, arg5)
Game.LogWarn(0, string.format("Will start Game - %s / %s / %s / %s", tostring(arg1), tostring(arg2), tostring(arg3), tostring(arg4)))
Game.LoadScenario("c10_samus", Init.sStartingScenario, Init.sStartingActor, "samus", 1)
if Init.bRevealMap then
Game.AddGUISF(0.0, Game.ScanVisitDiscoverEverything, "", "")
function Init.InitGameBlackboard()
Blackboard.ResetWithExceptionList({
"GAME_PROGRESS"
})
for _FORV_3_, _FORV_4_ in pairs(Init.tNewGameInventory) do
Blackboard.SetProp("PLAYER_INVENTORY", _FORV_3_, "f", _FORV_4_)
end
Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_METROID_COUNT", "f", 0)
Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_CURRENT_LIFE", "f", Init.tNewGameInventory.ITEM_MAX_LIFE)
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)
Blackboard.SetProp("GAME", "ITEM_RESERVE_TANK_SUPER_MISSILE_SIZE", "f", Init.tReserveTanksInitialConfiguration.ITEM_RESERVE_TANK_SUPER_MISSILE_SIZE)
Blackboard.SetProp("GAME", "Version", "i", SaveGame.Version)
Blackboard.SetProp("GAME", "HUD", "b", true)
Blackboard.SetProp("GAME", "Player", "s", "samus")
Blackboard.SetProp(Game.GetPlayerBlackboardSectionName(), "LevelID", "s", "c10_samus")
Blackboard.SetProp(Game.GetPlayerBlackboardSectionName(), "ScenarioID", "s", TEMPLATE("starting_scenario"))
Blackboard.SetProp(Game.GetPlayerBlackboardSectionName(), "StartPoint", "s", TEMPLATE("starting_actor"))
Game.UnlockAmiiboMenu()
end

function Init.InitNewGame(arg1, arg2, arg3, arg4, arg4)
Game.LogWarn(0, string.format("Will start Game - %s / %s / %s / %s", tostring(arg1), tostring(arg2), tostring(arg3), tostring(arg4)))
Game.LoadScenario("c10_samus", Init.sStartingScenario, Init.sStartingActor, "samus", 1)
if Init.bRevealMap then
Game.AddGUISF(0.0, Game.ScanVisitDiscoverEverything, "", "")
end
end

Game.SetForceSkipCutscenes(true)

Game.LogWarn(0, "Finished modded system/init.lc")

0 comments on commit 4e1210d

Please sign in to comment.