LttP: extract Dungeon and Boss from core (#1787)

This commit is contained in:
Fabian Dill
2023-05-20 19:57:48 +02:00
committed by GitHub
parent a2ddd5c9e8
commit c8453035da
13 changed files with 342 additions and 305 deletions

View File

@@ -474,7 +474,8 @@ def get_woth_hint(world, checked):
locations = world.required_locations
locations = list(filter(lambda location:
location.name not in checked[location.player]
and not (world.woth_dungeon >= world.hint_dist_user['dungeons_woth_limit'] and location.parent_region.dungeon)
and not (world.woth_dungeon >= world.hint_dist_user['dungeons_woth_limit']
and getattr(location.parent_region, "dungeon", None))
and location.name not in world.hint_exclusions
and location.name not in world.hint_type_overrides['woth']
and location.item.name not in world.item_hint_type_overrides['woth'],
@@ -486,7 +487,7 @@ def get_woth_hint(world, checked):
location = world.hint_rng.choice(locations)
checked[location.player].add(location.name)
if location.parent_region.dungeon:
if getattr(location.parent_region, "dungeon", None):
world.woth_dungeon += 1
location_text = getHint(location.parent_region.dungeon.name, world.clearer_hints).text
else:
@@ -570,7 +571,7 @@ def get_good_item_hint(world, checked):
checked[location.player].add(location.name)
item_text = getHint(getItemGenericName(location.item), world.clearer_hints).text
if location.parent_region.dungeon:
if getattr(location.parent_region, "dungeon", None):
location_text = getHint(location.parent_region.dungeon.name, world.clearer_hints).text
return (GossipText('#%s# hoards #%s#.' % (attach_name(location_text, location, world), attach_name(item_text, location.item, world)),
['Green', 'Red']), location)
@@ -613,8 +614,8 @@ def get_specific_item_hint(world, checked):
location = world.hint_rng.choice(locations)
checked[location.player].add(location.name)
item_text = getHint(getItemGenericName(location.item), world.clearer_hints).text
if location.parent_region.dungeon:
if getattr(location.parent_region, "dungeon", None):
location_text = getHint(location.parent_region.dungeon.name, world.clearer_hints).text
if world.hint_dist_user.get('vague_named_items', False):
return (GossipText('#%s# may be on the hero\'s path.' % (location_text), ['Green']), location)