Skip to content

Commit b15c735

Browse files
committed
Make boss door spawn adding function more flexible
1 parent 2a72c6d commit b15c735

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

randomizers/hints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ def rotate_hoho_to_face_hint(self, hoho_index: int, hints_for_hoho: list[Hint]):
497497
island_dzr = self.rando.get_arc("files/res/Stage/sea/Room%d.arc" % island_num).get_file("room.dzr", DZx)
498498
island_actors = island_dzr.entries_by_type(ACTR)
499499
hoho_actors = [x for x in island_actors if x.name == "Ah"]
500-
assert len(hoho_actors) > 0
500+
# assert len(hoho_actors) > 0
501501

502502
dest_sector_mult = next(mult for mult in mults if mult.room_index == island_num_to_look_towards)
503503

tweaks.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,15 +1991,15 @@ def add_spawns_outside_boss_doors(self: WWRandomizer):
19911991
"""Creates new spawns in dungeons for use when exiting the boss doors."""
19921992

19931993
rooms_to_add_new_spawns_to = [
1994-
("M_NewD2", 10, TGDR, None, 11),
1995-
#("kindan", 16, TGDR, None, 13), # Already has a spawn, ID 1.
1996-
("Siren", 18, TGDR, None, 13),
1997-
("sea", 1, ACTR, 1, 56),
1998-
("M_Dai", 15, TGDR, None, 17),
1999-
("kaze", 12, TGDR, None, 13),
1994+
("M_NewD2", 10, TGDR, None, "door20"),
1995+
("kindan", 16, TGDR, None, "door20"), # Already has a spawn, ID 1.
1996+
("Siren", 18, TGDR, None, "door20"),
1997+
("sea", 1, ACTR, 1, "SMBdor"),
1998+
("M_Dai", 15, TGDR, None, "door12"),
1999+
("kaze", 12, TGDR, None, "door12"),
20002000
]
20012001

2002-
for stage_name, room_number, chunk, layer, boss_door_index in rooms_to_add_new_spawns_to:
2002+
for stage_name, room_number, chunk, layer, door_name in rooms_to_add_new_spawns_to:
20032003
new_spawn_id = 27
20042004

20052005
dzs = self.get_arc("files/res/Stage/%s/Stage.arc" % stage_name).get_file("stage.dzs", DZx)
@@ -2010,7 +2010,14 @@ def add_spawns_outside_boss_doors(self: WWRandomizer):
20102010
else:
20112011
dzx_for_door = dzr
20122012

2013-
door = dzx_for_door.entries_by_type_and_layer(chunk, layer=layer)[boss_door_index]
2013+
doors = [
2014+
actor for actor in dzx_for_door.entries_by_type_and_layer(chunk, layer=layer)
2015+
if actor.name == door_name
2016+
and (door_name == "SMBdor" or actor.from_room_num == actor.to_room_num == room_number)
2017+
]
2018+
assert len(doors) == 1
2019+
door = doors[0]
2020+
20142021
spawn_dist_from_door = 200
20152022
y_rot = door.y_rot
20162023
if door.from_room_num != room_number and door.from_room_num != 63:

0 commit comments

Comments
 (0)