Merge pull request #18 from Catobat/UndefinedChanceFix
Fix edge cases with undefined_chance
This commit is contained in:
@@ -3405,7 +3405,7 @@ def find_accessible_entrances(world, player, builder):
|
|||||||
visited_entrances = []
|
visited_entrances = []
|
||||||
|
|
||||||
# Add Sanctuary as an additional entrance in open mode, since you can save and quit to there
|
# Add Sanctuary as an additional entrance in open mode, since you can save and quit to there
|
||||||
if world.mode[player] == 'open' and world.get_region('Sanctuary', player).dungeon.name == builder.name and 'Sanctuary' not in entrances:
|
if not world.is_dark_chapel_start(player) and world.get_region('Sanctuary', player).dungeon.name == builder.name and 'Sanctuary' not in entrances:
|
||||||
entrances.append('Sanctuary')
|
entrances.append('Sanctuary')
|
||||||
visited_entrances.append('Sanctuary')
|
visited_entrances.append('Sanctuary')
|
||||||
regs.remove(world.get_region('Sanctuary', player))
|
regs.remove(world.get_region('Sanctuary', player))
|
||||||
|
|||||||
2
Doors.py
2
Doors.py
@@ -1516,7 +1516,7 @@ def create_doors(world, player):
|
|||||||
|
|
||||||
# static portal flags
|
# static portal flags
|
||||||
world.get_door('Sanctuary S', player).dead_end(allowPassage=True)
|
world.get_door('Sanctuary S', player).dead_end(allowPassage=True)
|
||||||
if world.mode[player] == 'open' and world.shuffle[player] not in ['lean', 'swapped', 'crossed', 'insanity']:
|
if not world.is_dark_chapel_start(player) and world.shuffle[player] not in ['lean', 'swapped', 'crossed', 'insanity']:
|
||||||
world.get_door('Sanctuary S', player).lw_restricted = True
|
world.get_door('Sanctuary S', player).lw_restricted = True
|
||||||
world.get_door('Eastern Hint Tile Blocked Path SE', player).passage = False
|
world.get_door('Eastern Hint Tile Blocked Path SE', player).passage = False
|
||||||
world.get_door('TR Big Chest Entrance SE', player).passage = False
|
world.get_door('TR Big Chest Entrance SE', player).passage = False
|
||||||
|
|||||||
@@ -1360,7 +1360,7 @@ def create_dungeon_builders(all_sectors, connections_tuple, world, player, dunge
|
|||||||
for name, builder in dungeon_map.items():
|
for name, builder in dungeon_map.items():
|
||||||
calc_allowance_and_dead_ends(builder, connections_tuple, world, player)
|
calc_allowance_and_dead_ends(builder, connections_tuple, world, player)
|
||||||
|
|
||||||
if world.mode[player] == 'open' and world.shuffle[player] not in ['lean', 'swapped', 'crossed', 'insanity']:
|
if not world.is_dark_chapel_start(player) and world.shuffle[player] not in ['lean', 'swapped', 'crossed', 'insanity']:
|
||||||
sanc = find_sector('Sanctuary', candidate_sectors)
|
sanc = find_sector('Sanctuary', candidate_sectors)
|
||||||
if sanc: # only run if sanc if a candidate
|
if sanc: # only run if sanc if a candidate
|
||||||
lw_builders = []
|
lw_builders = []
|
||||||
|
|||||||
@@ -1049,9 +1049,13 @@ def shuffle_tiles(world, groups, result_list, do_grouped, forced_flips, player):
|
|||||||
|
|
||||||
# tile shuffle happens here
|
# tile shuffle happens here
|
||||||
removed = []
|
removed = []
|
||||||
if 0 < undefined_chance < 100:
|
for group in groups:
|
||||||
for group in groups:
|
if group[0] in nonflipped_groups:
|
||||||
if group[0] in nonflipped_groups or (group[0] not in flipped_groups and random.randint(1, 100) > undefined_chance):
|
removed.append(group)
|
||||||
|
else:
|
||||||
|
if group[0] in flipped_groups or undefined_chance >= 100:
|
||||||
|
continue
|
||||||
|
if undefined_chance == 0 or random.randint(1, 100) > undefined_chance:
|
||||||
removed.append(group)
|
removed.append(group)
|
||||||
|
|
||||||
# save shuffled tiles to list
|
# save shuffled tiles to list
|
||||||
|
|||||||
Reference in New Issue
Block a user