Merged in DR v1.4.5

This commit is contained in:
codemann8
2024-08-21 03:57:12 -05:00
parent fe303876b4
commit 89e91a85fd
33 changed files with 665 additions and 337 deletions

View File

@@ -11,7 +11,7 @@ from Tables import bonk_prize_lookup
from Items import ItemFactory
from source.dungeon.EnemyList import add_drop_contents
from source.overworld.EntranceShuffle2 import connect_entrance
from source.overworld.EntranceShuffle2 import exit_ids, door_addresses
from source.item.FillUtil import trash_items, pot_items
import source.classes.constants as CONST
@@ -546,6 +546,27 @@ def set_up_take_anys(world, player, skip_adjustments=False):
world.initialize_regions()
def connect_entrance(world, entrancename, exitname, player):
entrance = world.get_entrance(entrancename, player)
# check if we got an entrance or a region to connect to
try:
region = world.get_region(exitname, player)
exit = None
except RuntimeError:
exit = world.get_entrance(exitname, player)
region = exit.parent_region
# if this was already connected somewhere, remove the backreference
if entrance.connected_region is not None:
entrance.connected_region.entrances.remove(entrance)
target = exit_ids[exit.name][0] if exit is not None else exit_ids.get(region.name, None)
addresses = door_addresses[entrance.name][0]
entrance.connect(region, addresses, target)
world.spoiler.set_entrance(entrance.name, exit.name if exit is not None else region.name, 'entrance', player)
def create_dynamic_shop_locations(world, player):
for shop in world.shops[player]:
if shop.region.player == player:
@@ -1462,6 +1483,7 @@ def make_customizer_pool(world, player):
bow_found = next((i for i in pool if i in {'Bow', 'Progressive Bow'}), None)
if not bow_found:
missing_items.append('Progressive Bow')
missing_items = [i for i in missing_items if all(i != start.name or player != start.player for start in world.precollected_items)]
if missing_items:
logging.getLogger('').warning(f'The following items are not in the custom item pool {", ".join(missing_items)}')