Fixed a couple of generation errors
This commit is contained in:
@@ -1482,7 +1482,7 @@ def valid_polarized_assignment(builder, sector_list):
|
|||||||
sector_mag = sector.magnitude()
|
sector_mag = sector.magnitude()
|
||||||
for i in range(len(sector_mag)):
|
for i in range(len(sector_mag)):
|
||||||
if sector_mag[i] > 0 and other_mag[i] == 0:
|
if sector_mag[i] > 0 and other_mag[i] == 0:
|
||||||
return True
|
return False
|
||||||
# dead_ends = 0
|
# dead_ends = 0
|
||||||
# branches = 0
|
# branches = 0
|
||||||
# for sector in sector_list:
|
# for sector in sector_list:
|
||||||
|
|||||||
@@ -306,6 +306,7 @@ def start():
|
|||||||
for _ in range(args.count):
|
for _ in range(args.count):
|
||||||
main(seed=seed, args=args)
|
main(seed=seed, args=args)
|
||||||
seed = random.randint(0, 999999999)
|
seed = random.randint(0, 999999999)
|
||||||
|
logging.getLogger('').info('Finished run %s', _)
|
||||||
else:
|
else:
|
||||||
main(seed=args.seed, args=args)
|
main(seed=args.seed, args=args)
|
||||||
|
|
||||||
|
|||||||
@@ -118,8 +118,9 @@ def analyze_dungeon(key_layout, world, player):
|
|||||||
raw_avail = chest_keys + len(key_counter.key_only_locations)
|
raw_avail = chest_keys + len(key_counter.key_only_locations)
|
||||||
available = raw_avail - key_counter.used_keys
|
available = raw_avail - key_counter.used_keys
|
||||||
possible_smalls = count_unique_small_doors(key_counter, key_layout.flat_prop)
|
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 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))
|
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):
|
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))
|
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
|
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):
|
def count_locations_big_optional(locations, bk=False):
|
||||||
cnt = 0
|
cnt = 0
|
||||||
for loc in locations:
|
for loc in locations:
|
||||||
|
|||||||
Reference in New Issue
Block a user