From 596b549426fd5e2f41cf90eb5b9ed5975fe865c0 Mon Sep 17 00:00:00 2001 From: Thanatos <117127188+ThanatosGit@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:34:43 +0200 Subject: [PATCH] Map ITEM_RANDO_DNA to ITEM_ADN (#123) --- .../files/randomizer_powerup.lua | 3 ++ open_samus_returns_rando/files/schema.json | 41 ++++++++++++++++++- .../files/templates/custom_init.lua | 4 ++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/open_samus_returns_rando/files/randomizer_powerup.lua b/open_samus_returns_rando/files/randomizer_powerup.lua index 0a0b984..a9e75f9 100644 --- a/open_samus_returns_rando/files/randomizer_powerup.lua +++ b/open_samus_returns_rando/files/randomizer_powerup.lua @@ -98,6 +98,9 @@ function RandomizerPowerup.HandlePickupResources(progression) RandomizerPowerup.DisableLiquids() RandomizerPowerup.IncreaseItemAmount(resource.item_id, resource.quantity) RandomizerPowerup.EnableLiquids() + if string.sub(resource.item_id, 0, 14) == "ITEM_RANDO_DNA" then + RandomizerPowerup.IncreaseItemAmount("ITEM_ADN", resource.quantity) + end end return resource_list diff --git a/open_samus_returns_rando/files/schema.json b/open_samus_returns_rando/files/schema.json index ca2769c..ab4a693 100644 --- a/open_samus_returns_rando/files/schema.json +++ b/open_samus_returns_rando/files/schema.json @@ -335,7 +335,46 @@ "ITEM_METROID_TOTAL_COUNT", "ITEM_ADN", "ITEM_RANDO_LOCKED_SUPERS", - "ITEM_RANDO_LOCKED_PBS" + "ITEM_RANDO_LOCKED_PBS", + "ITEM_RANDO_DNA_1", + "ITEM_RANDO_DNA_2", + "ITEM_RANDO_DNA_3", + "ITEM_RANDO_DNA_4", + "ITEM_RANDO_DNA_5", + "ITEM_RANDO_DNA_6", + "ITEM_RANDO_DNA_7", + "ITEM_RANDO_DNA_8", + "ITEM_RANDO_DNA_9", + "ITEM_RANDO_DNA_10", + "ITEM_RANDO_DNA_11", + "ITEM_RANDO_DNA_12", + "ITEM_RANDO_DNA_13", + "ITEM_RANDO_DNA_14", + "ITEM_RANDO_DNA_15", + "ITEM_RANDO_DNA_16", + "ITEM_RANDO_DNA_17", + "ITEM_RANDO_DNA_18", + "ITEM_RANDO_DNA_19", + "ITEM_RANDO_DNA_20", + "ITEM_RANDO_DNA_21", + "ITEM_RANDO_DNA_22", + "ITEM_RANDO_DNA_23", + "ITEM_RANDO_DNA_24", + "ITEM_RANDO_DNA_25", + "ITEM_RANDO_DNA_26", + "ITEM_RANDO_DNA_27", + "ITEM_RANDO_DNA_28", + "ITEM_RANDO_DNA_29", + "ITEM_RANDO_DNA_30", + "ITEM_RANDO_DNA_31", + "ITEM_RANDO_DNA_32", + "ITEM_RANDO_DNA_33", + "ITEM_RANDO_DNA_34", + "ITEM_RANDO_DNA_35", + "ITEM_RANDO_DNA_36", + "ITEM_RANDO_DNA_37", + "ITEM_RANDO_DNA_38", + "ITEM_RANDO_DNA_39" ] }, "item": { diff --git a/open_samus_returns_rando/files/templates/custom_init.lua b/open_samus_returns_rando/files/templates/custom_init.lua index 8ad68ec..ea1c682 100644 --- a/open_samus_returns_rando/files/templates/custom_init.lua +++ b/open_samus_returns_rando/files/templates/custom_init.lua @@ -19,6 +19,10 @@ function Init.InitGameBlackboard() }) for _FORV_3_, _FORV_4_ in pairs(Init.tNewGameInventory) do Blackboard.SetProp("PLAYER_INVENTORY", _FORV_3_, "f", _FORV_4_) + if string.sub(_FORV_3_, 0, 14) == "ITEM_RANDO_DNA" then + local current_amount = Blackboard.GetProp("PLAYER_INVENTORY", "ITEM_ADN") or 0 + Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_ADN", "f", current_amount + 1) + end end Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_METROID_COUNT", "f", 0) Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_CURRENT_LIFE", "f", Init.tNewGameInventory.ITEM_MAX_LIFE)