Fixed a couple of generation errors

This commit is contained in:
aerinon
2019-12-31 21:12:53 -07:00
parent dcec274b63
commit 59f819aebd
3 changed files with 15 additions and 2 deletions

View File

@@ -1482,7 +1482,7 @@ def valid_polarized_assignment(builder, sector_list):
sector_mag = sector.magnitude()
for i in range(len(sector_mag)):
if sector_mag[i] > 0 and other_mag[i] == 0:
return True
return False
# dead_ends = 0
# branches = 0
# for sector in sector_list:

View File

@@ -306,6 +306,7 @@ def start():
for _ in range(args.count):
main(seed=seed, args=args)
seed = random.randint(0, 999999999)
logging.getLogger('').info('Finished run %s', _)
else:
main(seed=args.seed, args=args)

View File

@@ -118,8 +118,9 @@ def analyze_dungeon(key_layout, world, player):
raw_avail = chest_keys + len(key_counter.key_only_locations)
available = raw_avail - key_counter.used_keys
possible_smalls = count_unique_small_doors(key_counter, key_layout.flat_prop)
avail_bigs = count_unique_big_doors(key_counter)
if not key_counter.big_key_opened:
if chest_keys == count_locations_big_optional(key_counter.free_locations) and available <= possible_smalls:
if chest_keys == count_locations_big_optional(key_counter.free_locations) and available <= possible_smalls and avail_bigs == 0:
key_logic.bk_restricted.update(filter_big_chest(key_counter.free_locations))
if not key_counter.big_key_opened and big_chest_in_locations(key_counter.free_locations):
key_logic.sm_restricted.update(find_big_chest_locations(key_counter.free_locations))
@@ -479,6 +480,17 @@ def count_unique_small_doors(key_counter, proposal):
return cnt
def count_unique_big_doors(key_counter):
cnt = 0
counted = set()
for door in key_counter.child_doors:
if door.bigKey and door not in counted:
cnt += 1
counted.add(door)
counted.add(door.dest)
return cnt
def count_locations_big_optional(locations, bk=False):
cnt = 0
for loc in locations: