Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map ITEM_RANDO_DNA to ITEM_ADN #123

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions open_samus_returns_rando/files/randomizer_powerup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 40 additions & 1 deletion open_samus_returns_rando/files/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
dyceron marked this conversation as resolved.
Show resolved Hide resolved
]
},
"item": {
Expand Down
4 changes: 4 additions & 0 deletions open_samus_returns_rando/files/templates/custom_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down