From a6154b507382c17d87cc1bd9208ba8af10134239 Mon Sep 17 00:00:00 2001 From: Thanatos <117127188+ThanatosGit@users.noreply.github.com> Date: Mon, 4 Sep 2023 19:24:43 +0200 Subject: [PATCH] Heat rooms (#81) * Ruff fixes + missing import * Add required items as required in schema, update inventory proper * Heat for missing Area 2B room --- open_samus_returns_rando/patcher_editor.py | 1 + open_samus_returns_rando/samus_returns_patcher.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/open_samus_returns_rando/patcher_editor.py b/open_samus_returns_rando/patcher_editor.py index 7d399db..0a6b235 100644 --- a/open_samus_returns_rando/patcher_editor.py +++ b/open_samus_returns_rando/patcher_editor.py @@ -40,6 +40,7 @@ def get_scenario(self, name: str) -> Bmsld: def resolve_actor_reference(self, ref: dict) -> Container: scenario = self.get_scenario(ref["scenario"]) + # FIXME: There is no "default" as layer in SR layer = int(ref.get("layer", "default")) return scenario.raw.actors[layer][ref["actor"]] diff --git a/open_samus_returns_rando/samus_returns_patcher.py b/open_samus_returns_rando/samus_returns_patcher.py index 5b4c782..4497fba 100644 --- a/open_samus_returns_rando/samus_returns_patcher.py +++ b/open_samus_returns_rando/samus_returns_patcher.py @@ -97,6 +97,15 @@ def patch_custom_pickups(editor: PatcherEditor, pickup_config: list[dict]): editor.copy_actor(scenario_name, new_pos, base_actor, new_actor_name, 9) add_actor_to_entity_groups(scenario, collision_camera_name, new_actor_name) +def fix_heat_rooms(editor: PatcherEditor): + # area2b => just uses one heat trigger for multiple rooms => just append it to + # the group of the missing room + heat_trigger_2b = {"scenario": "s025_area2b", "layer": "2", "actor": "TG_SP_Heat_001"} + scenario_2b = editor.get_scenario(heat_trigger_2b["scenario"]) + add_actor_to_entity_groups(scenario_2b, "collision_camera013", heat_trigger_2b["actor"]) + + # TODO: Implement the other areas + def patch_extracted(input_path: Path, output_path: Path, configuration: dict): LOG.info("Will patch files from %s", input_path) @@ -131,6 +140,9 @@ def patch_extracted(input_path: Path, output_path: Path, configuration: dict): # custom spawn points patch_spawn_points(editor, configuration["new_spawn_points"]) + # make some heat rooms really heated + fix_heat_rooms(editor) + # Specific game patches game_patches.apply_game_patches(editor, configuration.get("game_patches", {}))