Skip to content

Commit

Permalink
Heat rooms (#81)
Browse files Browse the repository at this point in the history
* Ruff fixes + missing import

* Add required items as required in schema, update inventory proper

* Heat for missing Area 2B room
  • Loading branch information
ThanatosGit authored Sep 4, 2023
1 parent dbcd56f commit a6154b5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions open_samus_returns_rando/patcher_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]]

Expand Down
12 changes: 12 additions & 0 deletions open_samus_returns_rando/samus_returns_patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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", {}))

Expand Down

0 comments on commit a6154b5

Please sign in to comment.