Skip to content

Commit

Permalink
Reuse original lua, add the same for samusship
Browse files Browse the repository at this point in the history
  • Loading branch information
ThanatosGit committed Sep 22, 2023
1 parent d8a1914 commit 4ccd261
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 39 deletions.
14 changes: 14 additions & 0 deletions open_samus_returns_rando/files/custom_savestation.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Game.ImportLibrary("actors/props/savestation/scripts/savestation_original.lc")
function SaveStation.ShowDialogChoice(_ARG_0_, _ARG_1_)
Usable._oUsableObject = _ARG_0_
GUI.LaunchMessage(_ARG_1_, "Usable.OnDialogAccepted", "SaveStation.OnDialogDeclined")
end
function SaveStation.Dummy()
end
function SaveStation.WarpToStart()
Game.LoadScenario("c10_samus", Init.sStartingScenario, Init.sStartingActor, "samus", 1)
end
function SaveStation.OnDialogDeclined()
Usable._oUsableObject.USABLE:OnDialogDeclined()
GUI.LaunchMessage("Warp to Start?", "SaveStation.WarpToStart", " SaveStation.Dummy()")
end
14 changes: 14 additions & 0 deletions open_samus_returns_rando/files/custom_ship.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Game.ImportLibrary("actors/props/samusship/scripts/samusship_original.lc")
function SamusShip.ShowDialogChoice(_ARG_0_, _ARG_1_)
Usable._oUsableObject = _ARG_0_
GUI.LaunchMessage(_ARG_1_, "Usable.OnDialogAccepted", "SamusShip.OnDialogDeclined")
end
function SamusShip.Dummy()
end
function SamusShip.WarpToStart()
Game.LoadScenario("c10_samus", Init.sStartingScenario, Init.sStartingActor, "samus", 1)
end
function SamusShip.OnDialogDeclined()
Usable._oUsableObject.USABLE:OnDialogDeclined()
GUI.LaunchMessage("Warp to Start?", "SamusShip.WarpToStart", " SamusShip.Dummy()")
end
37 changes: 0 additions & 37 deletions open_samus_returns_rando/files/savestation.lua

This file was deleted.

2 changes: 0 additions & 2 deletions open_samus_returns_rando/lua_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,5 @@ def save_modifications(self, editor: PatcherEditor):
editor.replace_asset("actors/items/randomizer_powerup/scripts/randomizer_powerup.lc", self._powerup_script)
editor.replace_asset("actors/props/heatzone/scripts/heatzone.lc",
files_path().joinpath("heatzone.lua").read_bytes())
editor.replace_asset("actors/props/savestation/scripts/savestation.lc",
files_path().joinpath("savestation.lua").read_bytes())
for scenario, script in self._custom_level_scripts.items():
editor.replace_asset(path_for_level(scenario) + ".lc", script["script"].encode("utf-8"))
2 changes: 2 additions & 0 deletions open_samus_returns_rando/samus_returns_patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def patch_extracted(input_path: Path, output_path: Path, configuration: dict):
# Add custom lua files
lua_util.replace_script(editor, "system/scripts/scenario", "custom_scenario.lua")
lua_util.replace_script(editor, "actors/characters/player/scripts/player", "custom_player.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")

# Custom pickups
patch_custom_pickups(editor, configuration["custom_pickups"])
Expand Down

0 comments on commit 4ccd261

Please sign in to comment.