Skip to content

Commit

Permalink
Fix reserve tanks as starting items (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThanatosGit authored Mar 31, 2024
1 parent 3472fb6 commit ab08f32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/open_samus_returns_rando/files/templates/custom_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ function Init.InitGameBlackboard()
local current_amount = Blackboard.GetProp("PLAYER_INVENTORY", "ITEM_ADN") or 0
Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_ADN", "f", current_amount + 1)
end
if string.sub(_FORV_3_, 1, 17) == "ITEM_RESERVE_TANK" then
if _FORV_3_ ~= "ITEM_RESERVE_TANK_MISSILE" or Blackboard.GetProp("PLAYER_INVENTORY", "ITEM_WEAPON_MISSILE_LAUNCHER") then
if string.sub(_FORV_3_, 1, 17) == "ITEM_RESERVE_TANK" and _FORV_4_ > 0 then
local missile_launcher = Init.tNewGameInventory["ITEM_WEAPON_MISSILE_LAUNCHER"]
if _FORV_3_ ~= "ITEM_RESERVE_TANK_MISSILE" or (missile_launcher ~= nil and missile_launcher > 0) then
Blackboard.SetProp("GAME", _FORV_3_ .. "_ACTIVE", "b", true)
Blackboard.SetProp("GAME", _FORV_3_ .. "_FULL", "b", true)
end
Expand Down Expand Up @@ -71,6 +72,7 @@ function Init.InitNewGame(arg1, arg2, arg3, arg4, arg4)
if Init.bRevealMap then
Game.AddGUISF(0.0, Game.ScanVisitDiscoverEverything, "", "")
end
Game.SaveGame("savedata", "", Init.sStartingActor, true)
end

Game.SetForceSkipCutscenes(true)
Expand Down
1 change: 1 addition & 0 deletions src/open_samus_returns_rando/lua_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ def _create_custom_init(self, editor: PatcherEditor, configuration: dict) -> str
max_life += etanks * energy_per_tank

# use _MAX if main is unlocked to unlock the ammo too
# FIXME: These checks are kinda wrong if you use something like `"ITEM_WEAPON_MISSILE_LAUNCHER": 0`
if "ITEM_WEAPON_MISSILE_LAUNCHER" in inventory and "ITEM_MISSILE_TANKS" in inventory:
inventory["ITEM_WEAPON_MISSILE_MAX"] = inventory.pop("ITEM_MISSILE_TANKS")
if "ITEM_WEAPON_SUPER_MISSILE" in inventory and "ITEM_SUPER_MISSILE_TANKS" in inventory:
Expand Down

0 comments on commit ab08f32

Please sign in to comment.