From 56b7640a6fad7b8afb10acc959f70c2808a9467a Mon Sep 17 00:00:00 2001 From: Thanatos Date: Wed, 10 Jul 2024 16:42:10 +0200 Subject: [PATCH 1/2] Bad Arachnus fix --- .../characters/arachnus/scripts/arachnus.lc | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/open_samus_returns_rando/files/romfs/actors/characters/arachnus/scripts/arachnus.lc diff --git a/src/open_samus_returns_rando/files/romfs/actors/characters/arachnus/scripts/arachnus.lc b/src/open_samus_returns_rando/files/romfs/actors/characters/arachnus/scripts/arachnus.lc new file mode 100644 index 0000000..b72a265 --- /dev/null +++ b/src/open_samus_returns_rando/files/romfs/actors/characters/arachnus/scripts/arachnus.lc @@ -0,0 +1,29 @@ +function Arachnus.main() + Game.AddSF(0.0, "Arachnus.RotatePickup", "") +end +function Arachnus.RotatePickup() + local springball = Game.GetEntity("LE_PowerUp_Springball") + if springball ~= nil then + if springball.vAng ~= V3D(0, 0 ,0) then + springball.vAng = V3D(0, 0, 0) + else + Game.AddSF(0.0, "Arachnus.RotatePickup", "") + end + end +end +function Arachnus.LaunchDamageSound(_ARG_0_) + if _ARG_0_ ~= nil then + Game.PlayEntitySound("actors/arachnus/arachnus_firevoice_0" .. math.random(2) .. ".wav", _ARG_0_.sName, 0.4, 500, 3000, 1.4) + end +end +function Arachnus.OnProjectileEntityCollision(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_) + Game.PlayPosSound("actors/arachnus/arachnus_fireboom_01.wav", _ARG_1_, _ARG_2_, _ARG_3_, 1.2, 500, 1750, 1) +end +function Arachnus.OnProjectileScenarioCollision(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_) + Game.PlayPosSound("actors/arachnus/arachnus_fireboom_01.wav", _ARG_1_, _ARG_2_, _ARG_3_, 1.1, 500, 1750, 1) +end +function Arachnus.OnDeath(_ARG_0_) + if Game.GetPlayer() ~= nil then + Game.GetPlayer().LIFE:SetInvulnerableWithReaction(false) + end +end From e8da6152982be41f4181a312a3dd3fa2e39f7cf9 Mon Sep 17 00:00:00 2001 From: dyceron Date: Wed, 10 Jul 2024 17:23:38 -0400 Subject: [PATCH 2/2] Replace the script like the others --- .../files/custom/arachnus.lua | 14 +++++++++ .../characters/arachnus/scripts/arachnus.lc | 29 ------------------- src/open_samus_returns_rando/lua_editor.py | 1 + 3 files changed, 15 insertions(+), 29 deletions(-) create mode 100644 src/open_samus_returns_rando/files/custom/arachnus.lua delete mode 100644 src/open_samus_returns_rando/files/romfs/actors/characters/arachnus/scripts/arachnus.lc diff --git a/src/open_samus_returns_rando/files/custom/arachnus.lua b/src/open_samus_returns_rando/files/custom/arachnus.lua new file mode 100644 index 0000000..710174b --- /dev/null +++ b/src/open_samus_returns_rando/files/custom/arachnus.lua @@ -0,0 +1,14 @@ +Game.ImportLibrary("actors/characters/arachnus/scripts/arachnus_original.lc") +function Arachnus.main() + Game.AddSF(0.0, "Arachnus.RotatePickup", "") +end +function Arachnus.RotatePickup() + local springball = Game.GetEntity("LE_PowerUp_Springball") + if springball ~= nil then + if springball.vAng ~= V3D(0, 0 ,0) then + springball.vAng = V3D(0, 0, 0) + else + Game.AddSF(0.0, "Arachnus.RotatePickup", "") + end + end +end diff --git a/src/open_samus_returns_rando/files/romfs/actors/characters/arachnus/scripts/arachnus.lc b/src/open_samus_returns_rando/files/romfs/actors/characters/arachnus/scripts/arachnus.lc deleted file mode 100644 index b72a265..0000000 --- a/src/open_samus_returns_rando/files/romfs/actors/characters/arachnus/scripts/arachnus.lc +++ /dev/null @@ -1,29 +0,0 @@ -function Arachnus.main() - Game.AddSF(0.0, "Arachnus.RotatePickup", "") -end -function Arachnus.RotatePickup() - local springball = Game.GetEntity("LE_PowerUp_Springball") - if springball ~= nil then - if springball.vAng ~= V3D(0, 0 ,0) then - springball.vAng = V3D(0, 0, 0) - else - Game.AddSF(0.0, "Arachnus.RotatePickup", "") - end - end -end -function Arachnus.LaunchDamageSound(_ARG_0_) - if _ARG_0_ ~= nil then - Game.PlayEntitySound("actors/arachnus/arachnus_firevoice_0" .. math.random(2) .. ".wav", _ARG_0_.sName, 0.4, 500, 3000, 1.4) - end -end -function Arachnus.OnProjectileEntityCollision(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_) - Game.PlayPosSound("actors/arachnus/arachnus_fireboom_01.wav", _ARG_1_, _ARG_2_, _ARG_3_, 1.2, 500, 1750, 1) -end -function Arachnus.OnProjectileScenarioCollision(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_) - Game.PlayPosSound("actors/arachnus/arachnus_fireboom_01.wav", _ARG_1_, _ARG_2_, _ARG_3_, 1.1, 500, 1750, 1) -end -function Arachnus.OnDeath(_ARG_0_) - if Game.GetPlayer() ~= nil then - Game.GetPlayer().LIFE:SetInvulnerableWithReaction(false) - end -end diff --git a/src/open_samus_returns_rando/lua_editor.py b/src/open_samus_returns_rando/lua_editor.py index 9964bc4..d423729 100644 --- a/src/open_samus_returns_rando/lua_editor.py +++ b/src/open_samus_returns_rando/lua_editor.py @@ -293,6 +293,7 @@ def _add_replacement_files(self, editor: PatcherEditor, configuration: dict) -> scenario_lua_content += "\n" + self._progressive_models lua_util.replace_script_with_content(editor, "system/scripts/scenario", scenario_lua_content) + lua_util.replace_script(editor, "actors/characters/arachnus/scripts/arachnus", "custom/arachnus.lua") lua_util.replace_script(editor, "actors/props/samusship/scripts/samusship", "custom/ship.lua") lua_util.replace_script(editor, "actors/props/savestation/scripts/savestation", "custom/savestation.lua") lua_util.replace_script(editor, "actors/props/heatzone/scripts/heatzone", "custom/heatzone.lua")