Merged DR v1.0.1.2

This commit is contained in:
codemann8
2022-09-01 03:40:03 -05:00
5 changed files with 18 additions and 10 deletions

View File

@@ -215,7 +215,7 @@ def vanilla_key_logic(world, player):
key_layout = build_key_layout(builder, start_regions, doors, world, player)
valid = validate_key_layout(key_layout, world, player)
if not valid:
logging.getLogger('').warning('Vanilla key layout not valid %s', builder.name)
logging.getLogger('').info('Vanilla key layout not valid %s', builder.name)
builder.key_door_proposal = doors
if player not in world.key_logic.keys():
world.key_logic[player] = {}
@@ -989,11 +989,16 @@ def cross_dungeon(world, player):
paths = determine_required_paths(world, player)
check_required_paths(paths, world, player)
hc_compass = ItemFactory('Compass (Escape)', player)
at_compass = ItemFactory('Compass (Agahnims Tower)', player)
at_map = ItemFactory('Map (Agahnims Tower)', player)
if world.restrict_boss_items[player] != 'none':
hc_compass.advancement = at_compass.advancement = at_map.advancement = True
hc = world.get_dungeon('Hyrule Castle', player)
hc.dungeon_items.append(ItemFactory('Compass (Escape)', player))
hc.dungeon_items.append(hc_compass)
at = world.get_dungeon('Agahnims Tower', player)
at.dungeon_items.append(ItemFactory('Compass (Agahnims Tower)', player))
at.dungeon_items.append(ItemFactory('Map (Agahnims Tower)', player))
at.dungeon_items.append(at_compass)
at.dungeon_items.append(at_map)
assign_cross_keys(dungeon_builders, world, player)
all_dungeon_items_cnt = len(list(y for x in world.dungeons if x.player == player for y in x.all_items))
@@ -1904,8 +1909,10 @@ def find_inaccessible_regions(world, player):
def find_accessible_entrances(world, player, builder):
entrances = [region.name for region in (portal.door.entrance.parent_region for portal in world.dungeon_portals[player]) if region.dungeon.name == builder.name]
entrances.extend(drop_entrances[builder.name])
hc_std = False
if world.mode[player] == 'standard' and builder.name == 'Hyrule Castle':
hc_std = True
start_regions = ['Hyrule Castle Courtyard']
else:
start_regions = ['Links House' if not world.is_bombshop_start(player) else 'Big Bomb Shop', 'Sanctuary' if world.mode[player] != 'inverted' else 'Dark Sanctuary Hint']
@@ -1930,6 +1937,8 @@ def find_accessible_entrances(world, player, builder):
if connect not in queue and connect not in visited_regions:
queue.append(connect)
for ext in next_region.exits:
if hc_std and ext.name == 'Hyrule Castle Main Gate (North)': # just skip it
continue
connect = ext.connected_region
if connect is None or ext.door and ext.door.blocked:
continue

View File

@@ -48,9 +48,10 @@ def fill_dungeons_restrictive(world, shuffled_locations):
bigs, smalls, others = [], [], []
for i in dungeon_items:
(bigs if i.bigkey else smalls if i.smallkey else others).append(i)
unplaced_smalls = list(smalls)
for i in world.itempool:
if i.smallkey and world.keyshuffle[i.player]:
smalls.append(i)
unplaced_smalls.append(i)
def fill(base_state, items, key_pool):
fill_restrictive(world, base_state, shuffled_locations, items, key_pool, True)
@@ -59,12 +60,12 @@ def fill_dungeons_restrictive(world, shuffled_locations):
big_state_base = all_state_base.copy()
for x in smalls + others:
big_state_base.collect(x, True)
fill(big_state_base, bigs, smalls)
fill(big_state_base, bigs, unplaced_smalls)
random.shuffle(shuffled_locations)
small_state_base = all_state_base.copy()
for x in others:
small_state_base.collect(x, True)
fill(small_state_base, smalls, list(smalls))
fill(small_state_base, smalls, unplaced_smalls)
random.shuffle(shuffled_locations)
fill(all_state_base, others, None)

View File

@@ -45,7 +45,7 @@ def main(args=None):
test("Vanilla ", "--shuffle vanilla")
test("Retro ", "--retro --shuffle vanilla")
test("Keysanity ", "--shuffle vanilla --keydropshuffle drops_only --keysanity")
test("Keysanity ", "--shuffle vanilla --dropshuffle --keysanity")
test("Shopsanity", "--shuffle vanilla --shopsanity")
test("Simple ", "--shuffle simple")
test("Full ", "--shuffle full")

View File

@@ -22,7 +22,6 @@ if os.path.isdir("build") and not sys.platform.find("mac") and not sys.platform.
subprocess.run(" ".join([f"pyinstaller {SPEC_FILE} ",
upx_string,
"-y ",
"--onefile ",
f"--distpath {DEST_DIRECTORY} ",
]),
shell=True)

View File

@@ -22,7 +22,6 @@ if os.path.isdir("build") and not sys.platform.find("mac") and not sys.platform.
subprocess.run(" ".join([f"pyinstaller {SPEC_FILE} ",
upx_string,
"-y ",
"--onefile ",
f"--distpath {DEST_DIRECTORY} ",
]),
shell=True)