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 8ed809a..042f034 100644 --- a/src/open_samus_returns_rando/files/levels/s110_surfaceb.lua +++ b/src/open_samus_returns_rando/files/levels/s110_surfaceb.lua @@ -61,7 +61,7 @@ function s110_surfaceb.ElevatorSetTarget(_ARG_0_) end function s110_surfaceb.InitFromBlackboard() s110_surfaceb.SetLowModelsVisibility(false) - if Game.GetItemAmount(Game.GetPlayerName(), "ITEM_ADN") < 39 and Game.GetItemAmount(Game.GetPlayerName(), "ITEM_BABY_HATCHLING") < 1 then + if Game.GetItemAmount(Game.GetPlayerName(), "ITEM_ADN") > 0 and Game.GetItemAmount(Game.GetPlayerName(), "ITEM_BABY_HATCHLING") < 1 then Game.PlayMusicStream(0, "streams/music/t_m2_surface_arr1.wav", -1, -1, -1, 2, 2, 1) end if Blackboard.GetProp("DEFEATED_ENEMIES", "Ridley") and Game.GetEntity("TG_Ridley_Access") ~= nil then diff --git a/src/open_samus_returns_rando/files/templates/custom_init.lua b/src/open_samus_returns_rando/files/templates/custom_init.lua index e671ab9..2c8ee79 100644 --- a/src/open_samus_returns_rando/files/templates/custom_init.lua +++ b/src/open_samus_returns_rando/files/templates/custom_init.lua @@ -62,14 +62,10 @@ function Init.InitGameBlackboard() end end Blackboard.SetProp("GAME", "OBJECTIVE_COMPLETE", "b", false) + Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_ADN", "f", Init.iRequiredDNA) if Init.iRequiredDNA == 0 then -- If no DNA is required, then the path to Ridley should always be open Blackboard.SetProp("GAME", "OBJECTIVE_COMPLETE", "b", true) - Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_ADN", "f", 39) - elseif Init.iRequiredDNA <= 39 then - Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_ADN", "f", 39 - Init.iRequiredDNA) - else - Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_ADN", "f", 0) end Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_METROID_COUNT", "f", 0) Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_CURRENT_LIFE", "f", Init.tNewGameInventory.ITEM_MAX_LIFE) diff --git a/src/open_samus_returns_rando/files/templates/randomizerpowerup.lua b/src/open_samus_returns_rando/files/templates/randomizerpowerup.lua index cd6ee1f..7ff5b79 100644 --- a/src/open_samus_returns_rando/files/templates/randomizerpowerup.lua +++ b/src/open_samus_returns_rando/files/templates/randomizerpowerup.lua @@ -160,7 +160,7 @@ function RandomizerPowerup.HandlePickupResources(progression, actorOrName) Blackboard.SetProp("GAME", scenario .. "_acquired_dna", "i", currentDNA + 1) end Scenario.UpdateDNACounter() - RandomizerPowerup.IncreaseItemAmount("ITEM_ADN", resource.quantity) + RandomizerPowerup.IncreaseItemAmount("ITEM_ADN", -1 * resource.quantity) RandomizerPowerup.ObjectiveComplete() end end @@ -197,13 +197,7 @@ function RandomizerPowerup.IncreaseAmmo(resource) end function RandomizerPowerup.ObjectiveComplete() - local required_dna = 39 - -- Default required_dna is 39, so change the requirement if set higher in the config - if Init.iRequiredDNA > 39 then - required_dna = Init.iRequiredDNA - end - - if RandomizerPowerup.GetItemAmount("ITEM_ADN") == required_dna then + if RandomizerPowerup.GetItemAmount("ITEM_ADN") == 0 and not Blackboard.GetProp("GAME", "OBJECTIVE_COMPLETE") then Blackboard.SetProp("GAME", "OBJECTIVE_COMPLETE", "b", true) Game.HUDIdleScreenLeave() GUILib.BlinkTotalDNACounter()