-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #321 from randovania/elevator-shuffle
Support Elevator Shuffle
- Loading branch information
Showing
6 changed files
with
80 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ElevatorDestinations = TEMPLATE("elevator_dict") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from construct import Container | ||
from mercury_engine_data_structures.formats.lua import Lua | ||
from open_samus_returns_rando.misc_patches import lua_util | ||
from open_samus_returns_rando.patcher_editor import PatcherEditor | ||
|
||
|
||
def create_elevator_table(editor: PatcherEditor, configuration: dict): | ||
py_dict: dict = configuration["elevators"] | ||
|
||
file = lua_util.replace_lua_template("elevators.lua", {"elevator_dict": py_dict}, True) | ||
editor.add_new_asset( | ||
"system/scripts/elevators.lc", | ||
Lua(Container(lua_text=file), editor.target_game), | ||
[] | ||
) | ||
|
||
|
||
def update_elevators(editor: PatcherEditor, configuration: dict): | ||
for scenario_name, elevators in configuration["elevators"].items(): | ||
scenario = editor.get_scenario(scenario_name) | ||
for elevator in elevators: | ||
platform = scenario.raw.actors[10][elevator]["components"][0] | ||
platform["arguments"][1]["value"] = "Scenario.RandoOnElevatorUse" | ||
|
||
|
||
def patch_elevators(editor: PatcherEditor, configuration: dict): | ||
create_elevator_table(editor, configuration) | ||
update_elevators(editor, configuration) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters