From bfb4197be1c4134fef1b6b16351e652d86a84fff Mon Sep 17 00:00:00 2001 From: dyceron <38679103+dyceron@users.noreply.github.com> Date: Sun, 27 Aug 2023 09:20:01 -0400 Subject: [PATCH] Fix collecting Gravity Suit in liquids not removing affect fixes #62 --- .../files/randomizer_powerup.lua | 21 ++++++++++++++++++- open_samus_returns_rando/pickup.py | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/open_samus_returns_rando/files/randomizer_powerup.lua b/open_samus_returns_rando/files/randomizer_powerup.lua index d0323a7..230733c 100644 --- a/open_samus_returns_rando/files/randomizer_powerup.lua +++ b/open_samus_returns_rando/files/randomizer_powerup.lua @@ -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 {} @@ -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 @@ -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 diff --git a/open_samus_returns_rando/pickup.py b/open_samus_returns_rando/pickup.py index 100c534..4b78a7d 100644 --- a/open_samus_returns_rando/pickup.py +++ b/open_samus_returns_rando/pickup.py @@ -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"]