Skip to content

Commit 724999f

Browse files
authored
Ocarina of Time: long-awaited bugfixes (ArchipelagoMW#2344)
- Added location name groups, so you can make your entire Water Temple priority to annoy everyone else - Significant improvement to ER generation success rate (~80% to >99%) - Changed `adult_trade_start` option to a choice option instead of a list (this shouldn't actually break any YAMLs though, due to the lesser-known property of lists parsing as a uniformly-weighted choice) - Major improvements to the option tooltips where needed. (Possibly too much text now) - Changed default hint distribution to `async` to help people's generation times. The tooltip explains that it removes WOTH hints so people hopefully don't get tripped up. - Makes stick and nut capacity upgrades useful items - Added shop prices and required trials to spoiler log - Added Cojiro to adult trade item group, because it had been forgotten previously - Fixed size-modified chests not being moved properly due to trap appearance changing the size - Fixed Thieves Hideout keyring not being allowed in start inventory - Fixed hint generation not accurately flagging barren locations on certain dungeon item shuffle settings - Fixed bug where you could plando arbitrarily-named items into the world, breaking everything
1 parent 5024434 commit 724999f

File tree

7 files changed

+424
-252
lines changed

7 files changed

+424
-252
lines changed

worlds/oot/ItemPool.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def generate_itempool(ootworld):
350350
ootworld.itempool = [ootworld.create_item(item) for item in pool]
351351
for (location_name, item) in placed_items.items():
352352
location = world.get_location(location_name, player)
353-
location.place_locked_item(ootworld.create_item(item))
353+
location.place_locked_item(ootworld.create_item(item, allow_arbitrary_name=True))
354354

355355

356356
def get_pool_core(world):
@@ -675,7 +675,7 @@ def get_pool_core(world):
675675
world.remove_from_start_inventory.append('Scarecrow Song')
676676

677677
if world.no_epona_race:
678-
world.multiworld.push_precollected(world.create_item('Epona'))
678+
world.multiworld.push_precollected(world.create_item('Epona', allow_arbitrary_name=True))
679679
world.remove_from_start_inventory.append('Epona')
680680

681681
if world.shuffle_smallkeys == 'vanilla':

worlds/oot/Location.py

+57-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from .LocationList import location_table
33
from BaseClasses import Location
44

5+
non_indexed_location_types = {'Boss', 'Event', 'Drop', 'HintStone', 'Hint'}
6+
57
location_id_offset = 67000
68
locnames_pre_70 = {
79
"Gift from Sages",
@@ -18,7 +20,7 @@
1820
else 0)
1921

2022
location_name_to_id = {name: (location_id_offset + index) for (index, name) in enumerate(new_name_order)
21-
if location_table[name][0] not in {'Boss', 'Event', 'Drop', 'HintStone', 'Hint'}}
23+
if location_table[name][0] not in non_indexed_location_types}
2224

2325
class DisableType(Enum):
2426
ENABLED = 0
@@ -83,3 +85,57 @@ def LocationFactory(locations, player: int):
8385
return ret
8486

8587

88+
def build_location_name_groups() -> dict:
89+
90+
def fix_sing(t) -> tuple:
91+
if isinstance(t, str):
92+
return (t,)
93+
return t
94+
95+
def rename(d, k1, k2) -> None:
96+
d[k2] = d[k1]
97+
del d[k1]
98+
99+
# whoever wrote the location table didn't realize they need to add a comma to mark a singleton as a tuple
100+
# so we have to check types unfortunately
101+
tags = set()
102+
for v in location_table.values():
103+
if v[5] is not None:
104+
tags.update(fix_sing(v[5]))
105+
106+
sorted_tags = sorted(list(tags))
107+
108+
ret = {
109+
tag: {k for k, v in location_table.items()
110+
if v[5] is not None
111+
and tag in fix_sing(v[5])
112+
and v[0] not in non_indexed_location_types}
113+
for tag in sorted_tags
114+
}
115+
116+
# Delete tags which are a combination of other tags
117+
del ret['Death Mountain']
118+
del ret['Forest']
119+
del ret['Gerudo']
120+
del ret['Kakariko']
121+
del ret['Market']
122+
123+
# Delete Vanilla and MQ tags because they are just way too broad
124+
del ret['Vanilla']
125+
del ret['Master Quest']
126+
127+
rename(ret, 'Beehive', 'Beehives')
128+
rename(ret, 'Cow', 'Cows')
129+
rename(ret, 'Crate', 'Crates')
130+
rename(ret, 'Deku Scrub', 'Deku Scrubs')
131+
rename(ret, 'FlyingPot', 'Flying Pots')
132+
rename(ret, 'Freestanding', 'Freestanding Items')
133+
rename(ret, 'Pot', 'Pots')
134+
rename(ret, 'RupeeTower', 'Rupee Groups')
135+
rename(ret, 'SmallCrate', 'Small Crates')
136+
rename(ret, 'the Market', 'Market')
137+
rename(ret, 'the Graveyard', 'Graveyard')
138+
rename(ret, 'the Lost Woods', 'Lost Woods')
139+
140+
return ret
141+

worlds/oot/LocationList.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def shop_address(shop_id, shelf_id):
238238
("Market Night Green Rupee Crate 1", ("Crate", 0x21, (0,0,24), None, 'Rupee (1)', ("the Market", "Market", "Crate"))),
239239
("Market Night Green Rupee Crate 2", ("Crate", 0x21, (0,0,25), None, 'Rupee (1)', ("the Market", "Market", "Crate"))),
240240
("Market Night Green Rupee Crate 3", ("Crate", 0x21, (0,0,26), None, 'Rupee (1)', ("the Market", "Market", "Crate"))),
241-
("Market Dog Lady House Crate", ("Crate", 0x35, (0,0,3), None, 'Rupees (5)', ("Market", "Market", "Crate"))),
241+
("Market Dog Lady House Crate", ("Crate", 0x35, (0,0,3), None, 'Rupees (5)', ("the Market", "Market", "Crate"))),
242242
("Market Guard House Child Crate", ("Crate", 0x4D, (0,0,6), None, 'Rupee (1)', ("the Market", "Market", "Crate"))),
243243
("Market Guard House Child Pot 1", ("Pot", 0x4D, (0,0,9), None, 'Rupee (1)', ("the Market", "Market", "Pot"))),
244244
("Market Guard House Child Pot 2", ("Pot", 0x4D, (0,0,10), None, 'Rupee (1)', ("the Market", "Market", "Pot"))),

0 commit comments

Comments
 (0)