Skip to content

Commit

Permalink
Allow for placing more than 39 dna via config
Browse files Browse the repository at this point in the history
  • Loading branch information
dyceron committed Jul 28, 2024
1 parent 0525d0d commit 74af694
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/open_samus_returns_rando/files/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@
"minimum": 0,
"default": 39
},
"extra_dna": {
"description": "Extra Metroid DNA to place in the game.",
"type": "integer",
"default": 0
},
"reveal_map_on_start": {
"type": "boolean",
"default": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Init.bEnableRoomIds = TEMPLATE("enable_room_ids")
Init.sBabyMetroidHint = TEMPLATE("baby_metroid_hint")
Init.bTanksRefillAmmo = TEMPLATE("tanks_refill_ammo")
Init.iRequiredDNA = TEMPLATE("required_dna")
Init.iExtraDNA = TEMPLATE("extra_dna")

local orig_log = Game.LogWarn
if TEMPLATE("enable_remote_lua") then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function RandomizerPowerup.IncreaseAmmo(resource)
end

function RandomizerPowerup.ObjectiveComplete()
if RandomizerPowerup.GetItemAmount("ITEM_ADN") == 39 then
if RandomizerPowerup.GetItemAmount("ITEM_ADN") == (39 + Init.iExtraDNA) then
Blackboard.SetProp("GAME", "OBJECTIVE_COMPLETE", "b", true)
Game.HUDIdleScreenLeave()
local baby = RandomizerPowerup.GetItemAmount("ITEM_BABY_HATCHLING")
Expand Down
3 changes: 2 additions & 1 deletion src/open_samus_returns_rando/lua_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ def chunks(array: list[str], n: int) -> Iterable[list[str]]:
"enable_remote_lua": enable_remote_lua,
"baby_metroid_hint": baby_metroid_hint,
"tanks_refill_ammo": game_patches["tanks_refill_ammo"],
"required_dna": configuration["required_dna"]
"required_dna": configuration["required_dna"],
"extra_dna": configuration["extra_dna"]
}

return lua_util.replace_lua_template("custom_init.lua", replacement)
Expand Down

0 comments on commit 74af694

Please sign in to comment.