Skip to content

Commit

Permalink
Merge pull request #277 from randovania/fix-missile-reserve
Browse files Browse the repository at this point in the history
Fix Missile Reserve Tanks not refilling Missiles
  • Loading branch information
ThanatosGit authored Feb 20, 2024
2 parents be3fcc3 + 7b4fc79 commit b58ffd3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ function RandomizerMissileLauncher.OnPickedUp(progression)
end
RandomizerPowerup.OnPickedUp(progression)
RandomizerPowerup.SetItemAmount("ITEM_MISSILE_TANKS", 0)
RandomizerPowerup.IncreaseMissileCheckValue()
end
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ function RandomizerMissileTank.OnPickedUp(progression)
end
end
RandomizerPowerup.OnPickedUp(progression)
RandomizerPowerup.IncreaseMissileCheckValue()
end
2 changes: 1 addition & 1 deletion src/open_samus_returns_rando/files/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 @@ -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)

Expand Down
5 changes: 2 additions & 3 deletions src/open_samus_returns_rando/specific_patches/static_fixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit b58ffd3

Please sign in to comment.