Skip to content

Commit

Permalink
Changes for vector in meds + some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ThanatosGit committed Sep 25, 2023
1 parent ef8849a commit 73d406c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
6 changes: 3 additions & 3 deletions open_samus_returns_rando/patcher_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def copy_actor(self, scenario: str, coords, template_actor: Container, new_name:
new_actor = copy.deepcopy(template_actor)
current_scenario = self.get_scenario(scenario)
current_scenario.raw.actors[layer_index][new_name] = new_actor
new_actor.x = coords[0] + offset[0]
new_actor.y = coords[1] + offset[1]
new_actor.z = coords[2] + offset[2]
new_actor["position"][0] = coords[0] + offset[0]
new_actor["position"][1] = coords[1] + offset[1]
new_actor["position"][2] = coords[2] + offset[2]

return new_actor

Expand Down
27 changes: 15 additions & 12 deletions open_samus_returns_rando/specific_patches/door_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _patch_missile_covers(editor: PatcherEditor):
scenario = editor.get_scenario(area)
for layer, actor_name, actor in scenario.all_actors():
if actor.type in missile_types:
actor["unk06"] = 90
actor["y_rotation"] = 90

def _patch_beam_covers(editor: PatcherEditor):
creature_bmsad_files = [
Expand All @@ -61,34 +61,37 @@ def _patch_beam_covers(editor: PatcherEditor):
]
for creature_bmsad_file in creature_bmsad_files:
cr_bmsad = editor.get_parsed_asset(creature_bmsad_file, type_hint=Bmsad)
# add the script component, which defines the lua file where it finds functions
cr_bmsad.raw["components"]["SCRIPT"] = SCRIPT_COMPONENT
# add the callback to the first animation (which is "death" for the bmsad's)
action_set_anim = cr_bmsad.action_sets[0].raw["animations"][0]
action_set_anim.event_counts[0] = action_set_anim.event_counts[0] + 1
action_set_anim["events0"].append(ON_DEAD_CB)
# wave cb didn't work and it has animation id 21.it's maybe a bitmask? because it works
# with 29 and also with 30 (which the other two are using) and both are setting 2^3 bit
action_set_anim["animation_id"] = 30
editor.replace_asset(creature_bmsad_file, cr_bmsad)

beam_types = {"doorwave", "doorspazerbeam", "doorcreature"}
for area in ALL_AREAS:
editor.ensure_present_in_scenario(area, "actors/props/doors/scripts/doors.lc")
editor.ensure_present_in_scenario(area, "actors/props/doorspazerbeam/collisions/doorspazerbeam.bmscd")
editor.ensure_present_in_scenario(area, "actors/props/doorspazerbeam/models/doorspazerbeam.bcmdl")
scenario = editor.get_scenario(area)
actor_list_copy = {actor_name: actor for layer, actor_name, actor in scenario.all_actors()}
for actor_name, actor in actor_list_copy.items():
if actor.type in beam_types:
new_actor_name = f"{actor_name}_o"
new_actor = editor.copy_actor(
area, (actor["x"], actor["y"], actor["z"]), actor, new_actor_name, 9
area, (actor["position"][0], actor["position"][1], actor["position"][2]),
actor, new_actor_name, 9
)
if new_actor["unk06"] == 0.0:
new_actor["unk05"] = 0
new_actor["unk06"] = 180
new_actor["unk07"] = 0
elif new_actor["unk06"] == 180.0:
new_actor["unk05"] = 0
new_actor["unk06"] = 0
new_actor["unk07"] = 0
if new_actor["rotation"][1] == 0.0:
new_actor["rotation"][0] = 0
new_actor["rotation"][1] = 180
new_actor["rotation"][2] = 0
elif new_actor["rotation"][1] == 180.0:
new_actor["rotation"][0] = 0
new_actor["rotation"][1] = 0
new_actor["rotation"][2] = 0
else:
# that one is weird (because of fake surface west ?)
if area == "s000_surface" and actor_name == "LE_SpazerShield_Door_012":
Expand Down

0 comments on commit 73d406c

Please sign in to comment.