Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix collecting Gravity Suit in liquids not removing effects #67

Merged
merged 1 commit into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion open_samus_returns_rando/files/randomizer_powerup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,23 @@ function RandomizerPowerup.OnPickedUp(actor, resources)
return granted
end

function RandomizerPowerup.DisableLiquids()
if Game.GetPlayer().MODELUPDATER.sModelAlias == "Varia" then
if Scenario.CurrentScenarioID == "s010_area1" then
Game.GetEntity("Lava_Trigger_001").TRIGGER:DisableTrigger()
elseif Scenario.CurrentScenarioID == "s067_area6c" then
Game.GetEntity("TG_SP_Water_002").TRIGGER:DisableTrigger()
end
end
end

function RandomizerPowerup.EnableLiquids()
if Scenario.CurrentScenarioID == "s010_area1" then
Game.GetEntity("Lava_Trigger_001").TRIGGER:EnableTrigger()
elseif Scenario.CurrentScenarioID == "s067_area6c" then
Game.GetEntity("TG_SP_Water_002").TRIGGER:EnableTrigger()
end
end

function RandomizerPowerup.HandlePickupResources(progression)
progression = progression or {}
Expand Down Expand Up @@ -71,7 +87,9 @@ function RandomizerPowerup.HandlePickupResources(progression)

if shouldGrant then
for _, resource in ipairs(resource_list) do
RandomizerPowerup.DisableLiquids()
RandomizerPowerup.IncreaseItemAmount(resource.item_id, resource.quantity)
RandomizerPowerup.EnableLiquids()
end

return resource_list
Expand Down Expand Up @@ -137,7 +155,8 @@ end
RandomizerGravitySuit = {}
setmetatable(RandomizerGravitySuit, {__index = RandomizerPowerup})
function RandomizerGravitySuit.OnPickedUp(actor, progression)
RandomizerPowerup.DisableLiquids()
RandomizerPowerup.OnPickedUp(actor, progression)
Game.GetEntity("Samus").MODELUPDATER.sModelAlias = "Gravity"
Game.GetPlayer():StopEntityLoopWithFade("actors/samus/damage_alarm.wav", 0.6)
RandomizerPowerup.EnableLiquids()
end
2 changes: 1 addition & 1 deletion open_samus_returns_rando/pickup.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def patch_model(self, editor: PatcherEditor, model_names: list[str], new_templat

def patch(self, editor: PatcherEditor):
template_bmsad = editor.get_parsed_asset(
"actors/items/powerup_chargebeam/charclasses/powerup_chargebeam.bmsad"
"actors/items/powerup_spiderball/charclasses/powerup_spiderball.bmsad"
).raw

actor_reference = self.pickup["pickup_actor"]
Expand Down