@@ -1278,20 +1278,10 @@ def build_bingo_hint_list(board_url: str) -> list[str]:
12781278 return hints
12791279
12801280
1281- def always_named_item (world : World , locations : Iterable [Location ]):
1282- for location in locations :
1283- if location .item .name in bingoBottlesForHints and world .settings .hint_dist == 'bingo' :
1284- always_item = 'Bottle'
1285- else :
1286- always_item = location .item .name
1287- if always_item in world .named_item_pool and world .settings .world_count == 1 :
1288- world .named_item_pool .remove (always_item )
1289-
1290-
12911281def build_gossip_hints (spoiler : Spoiler , worlds : list [World ]) -> None :
12921282 from Dungeon import Dungeon
12931283
1294- checked_locations = dict ()
1284+ checked_locations = {}
12951285 # Add misc. item hint locations to "checked" locations if the respective hint is reachable without the hinted item.
12961286 for world in worlds :
12971287 for location in world .hinted_dungeon_reward_locations .values ():
@@ -1349,16 +1339,16 @@ def build_gossip_hints(spoiler: Spoiler, worlds: list[World]) -> None:
13491339 item_world = location .world
13501340 if item_world .id not in checked_locations :
13511341 checked_locations [item_world .id ] = {}
1352- mark_checked (checked_locations [item_world .id ], location .name )
1342+ mark_checked (checked_locations [item_world .id ], location .name , CheckedKind . ALWAYS )
13531343
13541344 # Build all the hints.
13551345 for world in worlds :
13561346 world .update_useless_areas (spoiler )
1357- build_world_gossip_hints (spoiler , world , checked_locations .pop (world .id , None ))
1347+ build_world_gossip_hints (spoiler , world , checked_locations .pop (world .id , {} ))
13581348
13591349
13601350# builds out general hints based on location and whether an item is required or not
1361- def build_world_gossip_hints (spoiler : Spoiler , world : World , checked_locations : Optional [ dict [HintArea | str , set [CheckedKind ]]] = None ) -> None :
1351+ def build_world_gossip_hints (spoiler : Spoiler , world : World , checked_locations : dict [HintArea | str , set [CheckedKind ]]) -> None :
13621352 world .barren_dungeon = 0
13631353 world .woth_dungeon = 0
13641354
@@ -1368,9 +1358,6 @@ def build_world_gossip_hints(spoiler: Spoiler, world: World, checked_locations:
13681358 search .spot_access (world .get_location (stone .location ))
13691359 and search .state_list [world .id ].guarantee_hint ())
13701360
1371- if checked_locations is None :
1372- checked_locations = {}
1373-
13741361 stone_ids = list (gossipLocations .keys ())
13751362
13761363 world .distribution .configure_gossip (spoiler , stone_ids )
@@ -1491,8 +1478,6 @@ def build_world_gossip_hints(spoiler: Spoiler, world: World, checked_locations:
14911478 mark_checked (checked_locations , first_location .name , CheckedKind .ALWAYS )
14921479 mark_checked (checked_locations , second_location .name , CheckedKind .ALWAYS )
14931480
1494- always_named_item (world , [first_location , second_location ])
1495-
14961481 if hint .name in world .hint_text_overrides :
14971482 location_text = world .hint_text_overrides [hint .name ]
14981483 else :
@@ -1514,8 +1499,6 @@ def build_world_gossip_hints(spoiler: Spoiler, world: World, checked_locations:
15141499 location = world .get_location (hint .name )
15151500 mark_checked (checked_locations , hint .name , CheckedKind .ALWAYS )
15161501
1517- always_named_item (world , [location ])
1518-
15191502 if location .name in world .hint_text_overrides :
15201503 location_text = world .hint_text_overrides [location .name ]
15211504 else :
@@ -1572,6 +1555,18 @@ def build_world_gossip_hints(spoiler: Spoiler, world: World, checked_locations:
15721555
15731556 # Add user-specified hinted item locations if using a built-in hint distribution
15741557 # Raise error if hint copies is zero
1558+ for location_name , kinds in checked_locations .items ():
1559+ if CheckedKind .ALWAYS in kinds :
1560+ try :
1561+ location = world .get_location (location_name )
1562+ except KeyError :
1563+ continue
1564+ if location .item .name in bingoBottlesForHints and world .settings .hint_dist == 'bingo' :
1565+ always_item = 'Bottle'
1566+ else :
1567+ always_item = location .item .name
1568+ if always_item in world .named_item_pool and world .settings .world_count == 1 :
1569+ world .named_item_pool .remove (always_item )
15751570 if len (world .named_item_pool ) > 0 and world .hint_dist_user ['named_items_required' ]:
15761571 if hint_dist ['named-item' ][1 ] == 0 :
15771572 raise Exception ('User-provided item hints were requested, but copies per named-item hint is zero' )
0 commit comments