diff --git a/src/open_samus_returns_rando/files/pickups/randomizermissilelauncher.lua b/src/open_samus_returns_rando/files/pickups/randomizermissilelauncher.lua index 081c33f..6bc1f31 100644 --- a/src/open_samus_returns_rando/files/pickups/randomizermissilelauncher.lua +++ b/src/open_samus_returns_rando/files/pickups/randomizermissilelauncher.lua @@ -15,4 +15,5 @@ function RandomizerMissileLauncher.OnPickedUp(progression) end RandomizerPowerup.OnPickedUp(progression) RandomizerPowerup.SetItemAmount("ITEM_MISSILE_TANKS", 0) + RandomizerPowerup.IncreaseMissileCheckValue() end diff --git a/src/open_samus_returns_rando/files/pickups/randomizermissiletank.lua b/src/open_samus_returns_rando/files/pickups/randomizermissiletank.lua index 2153a6a..b875fa1 100644 --- a/src/open_samus_returns_rando/files/pickups/randomizermissiletank.lua +++ b/src/open_samus_returns_rando/files/pickups/randomizermissiletank.lua @@ -17,4 +17,5 @@ function RandomizerMissileTank.OnPickedUp(progression) end end RandomizerPowerup.OnPickedUp(progression) + RandomizerPowerup.IncreaseMissileCheckValue() end \ No newline at end of file diff --git a/src/open_samus_returns_rando/files/schema.json b/src/open_samus_returns_rando/files/schema.json index 0c8f2f8..cd2fd48 100644 --- a/src/open_samus_returns_rando/files/schema.json +++ b/src/open_samus_returns_rando/files/schema.json @@ -152,7 +152,7 @@ "missile_tank_size": { "description": "How many Missiles are restored when using a Missile Reserve Tank", "type": "number", - "default": 50.0 + "default": 30.0 }, "super_missile_tank_size": { "description": "How many Super Missiles are restored when using a Missile Reserve Tank", diff --git a/src/open_samus_returns_rando/files/templates/randomizerpowerup.lua b/src/open_samus_returns_rando/files/templates/randomizerpowerup.lua index 85a3c92..4e3fcc0 100644 --- a/src/open_samus_returns_rando/files/templates/randomizerpowerup.lua +++ b/src/open_samus_returns_rando/files/templates/randomizerpowerup.lua @@ -142,3 +142,10 @@ function RandomizerPowerup.IncreaseAmmo(resource) RandomizerPowerup.IncreaseItemAmount(current_id, resource.quantity, resource.item_id) end + +function RandomizerPowerup.IncreaseMissileCheckValue() + -- Update the min missile reserve tank refill value (capped by config) + if RandomizerPowerup.GetItemAmount("ITEM_MISSILE_CHECK") ~= nil then + RandomizerPowerup.SetItemAmount("ITEM_MISSILE_CHECK", RandomizerPowerup.GetItemAmount("ITEM_WEAPON_MISSILE_MAX")) + end +end diff --git a/src/open_samus_returns_rando/lua_editor.py b/src/open_samus_returns_rando/lua_editor.py index 0bb4fb3..59d5046 100644 --- a/src/open_samus_returns_rando/lua_editor.py +++ b/src/open_samus_returns_rando/lua_editor.py @@ -227,6 +227,7 @@ def _create_custom_init(self, editor: PatcherEditor, configuration: dict) -> str "ITEM_WEAPON_POWER_BOMB_MAX": 0, "ITEM_METROID_COUNT": 0, "ITEM_METROID_TOTAL_COUNT": 40, + "ITEM_MISSILE_CHECK": max(1, inventory.get("ITEM_WEAPON_MISSILE_MAX", 0)), } final_inventory.update(inventory) diff --git a/src/open_samus_returns_rando/specific_patches/static_fixes.py b/src/open_samus_returns_rando/specific_patches/static_fixes.py index 6469e81..44aa96c 100644 --- a/src/open_samus_returns_rando/specific_patches/static_fixes.py +++ b/src/open_samus_returns_rando/specific_patches/static_fixes.py @@ -73,11 +73,10 @@ def patch_a7_save_screw_blocks(editor: PatcherEditor): def shoot_supers_without_missiles(editor: PatcherEditor): - samus = editor.get_file( + samus_bmsad = editor.get_file( "actors/characters/samus/charclasses/samus.bmsad", Bmsad ) - gun = samus.raw["components"]["GUN"]["functions"] - gun[20]["params"]["Param5"]["value"] = "" + samus_bmsad.raw["components"]["GUN"]["functions"][20]["params"]["Param5"]["value"] = "ITEM_MISSILE_CHECK" def nerf_ridley_fight(editor: PatcherEditor):