Skip to content

Commit

Permalink
Map ITEM_RANDO_DNA to ITEM_ADN (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThanatosGit authored Oct 2, 2023
1 parent 16d5176 commit 596b549
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
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"
]
},
"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

0 comments on commit 596b549

Please sign in to comment.