Skip to content

Commit

Permalink
Merge pull request #27 from randovania/fix/doors
Browse files Browse the repository at this point in the history
various door fixes
  • Loading branch information
duncathan authored Jun 23, 2023
2 parents c8c0e83 + e08200d commit f6b58d5
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/open_prime_rando/echoes/dock_lock_rando/dock_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ def patch_door(self, editor: PatcherEditor, world_name: str, area_name: str, doc
with door.edit_properties(Door) as door_props:
door_props.shell_model = shell_model
door_props.shell_color = self.shell_color
if self.scan_text is not None:
door_props.alt_scannable.scannable_info0 = self.get_patched_scan(editor, world_name, area_name)
else:
door_props.alt_scannable.scannable_info0 = 0xFFFFFFFF

for pak in self.get_paks(editor, world_name, area_name):
editor.ensure_present(pak, shell_model)
Expand All @@ -147,8 +151,6 @@ def patch_door(self, editor: PatcherEditor, world_name: str, area_name: str, doc

with door.edit_properties(Door) as door_props:
door_props.vulnerability = self.vulnerability
if self.scan_text is not None:
door_props.alt_scannable.scannable_info0 = self.get_patched_scan(editor, world_name, area_name)


class BlastShieldActors(NamedTuple):
Expand Down Expand Up @@ -396,23 +398,17 @@ def remove_blast_shield(self, editor: PatcherEditor, world_name: str, area_name:
area = self.get_area(editor, world_name, area_name)
door = self.get_door_from_dock_index(area, self.get_dock_index(world_name, area_name, dock_name))

default = area.get_layer("Default")

memory_relay = self.find_attached_instance(area, door, State.Open, Message.Activate, MemoryRelay)
trigger = self.find_attached_instance(area, memory_relay, State.Active, Message.Deactivate, DamageableTrigger)
shaker = self.find_attached_instance(area, trigger, State.Dead, Message.Action, CameraShaker)
counter = self.find_attached_instance(area, trigger, State.Dead, Message.Increment, Counter)
complete_relay = self.find_attached_instance(area, counter, State.MaxReached, Message.SetToZero, Relay)

default.remove_instance(shaker)
area.remove_instance(shaker)
for connection in complete_relay.connections:
try:
default.remove_instance(connection.target)
except KeyError:
# I guess claris already removed it probably?
complete_relay.remove_connection(connection)
default.remove_instance(complete_relay)
default.remove_instance(counter)
area.remove_instance(connection.target)
area.remove_instance(complete_relay)
area.remove_instance(counter)


@dataclasses.dataclass(kw_only=True)
Expand Down

0 comments on commit f6b58d5

Please sign in to comment.