Minor fixes for customized vanilla doors

This commit is contained in:
aerinon
2023-03-22 14:58:07 -06:00
parent 636819ffc0
commit c9c510ae21
4 changed files with 30 additions and 8 deletions

View File

@@ -322,6 +322,11 @@ def connect_simple_door(world, exit_name, region_name, player):
d.dest = region d.dest = region
def connect_simple_door_to_region(exit_door, region):
exit_door.entrance.connect(region)
exit_door.dest = region
def connect_door_only(world, exit_name, region, player): def connect_door_only(world, exit_name, region, player):
d = world.check_for_door(exit_name, player) d = world.check_for_door(exit_name, player)
if d is not None: if d is not None:
@@ -354,6 +359,12 @@ def connect_two_way(world, entrancename, exitname, player):
x.dest = y x.dest = y
if y is not None: if y is not None:
y.dest = x y.dest = x
if x.dependents:
for dep in x.dependents:
connect_simple_door_to_region(dep, ext.parent_region)
if y.dependents:
for dep in y.dependents:
connect_simple_door_to_region(dep, entrance.parent_region)
def connect_one_way(world, entrancename, exitname, player): def connect_one_way(world, entrancename, exitname, player):
@@ -373,6 +384,9 @@ def connect_one_way(world, entrancename, exitname, player):
y = world.check_for_door(exitname, player) y = world.check_for_door(exitname, player)
if x is not None: if x is not None:
x.dest = y x.dest = y
if x.dependents:
for dep in x.dependents:
connect_simple_door_to_region(dep, ext.parent_region)
def unmark_ugly_smalls(world, player): def unmark_ugly_smalls(world, player):
for d in ['Eastern Hint Tile Blocked Path SE', 'Eastern Darkness S', 'Thieves Hallway SE', 'Mire Left Bridge S', for d in ['Eastern Hint Tile Blocked Path SE', 'Eastern Darkness S', 'Thieves Hallway SE', 'Mire Left Bridge S',

View File

@@ -1561,13 +1561,18 @@ def validate_key_layout_sub_loop(key_layout, state, checked_states, flat_proposa
def invalid_self_locking_key(key_layout, state, prev_state, prev_avail, world, player): def invalid_self_locking_key(key_layout, state, prev_state, prev_avail, world, player):
if prev_state is None or state.used_smalls == prev_state.used_smalls: if prev_state is None or state.used_smalls == prev_state.used_smalls:
return False return False
new_bk_doors = set(state.big_doors).difference(set(prev_state.big_doors)) if state.found_forced_bk() and not prev_state.found_forced_bk():
state_copy = state.copy() return False
while len(new_bk_doors) > 0: if state.big_key_opened:
for door in new_bk_doors: new_bk_doors = set(state.big_doors).difference(set(prev_state.big_doors))
open_a_door(door.door, state_copy, key_layout.flat_prop, world, player) state_copy = state.copy()
new_bk_doors = set(state_copy.big_doors).difference(set(prev_state.big_doors)) while len(new_bk_doors) > 0:
expand_key_state(state_copy, key_layout.flat_prop, world, player) for door in new_bk_doors:
open_a_door(door.door, state_copy, key_layout.flat_prop, world, player)
new_bk_doors = set(state_copy.big_doors).difference(set(prev_state.big_doors))
expand_key_state(state_copy, key_layout.flat_prop, world, player)
else:
state_copy = state
new_locations = set(state_copy.found_locations).difference(set(prev_state.found_locations)) new_locations = set(state_copy.found_locations).difference(set(prev_state.found_locations))
important_found = False important_found = False
for loc in new_locations: for loc in new_locations:

View File

@@ -34,7 +34,7 @@ from source.overworld.EntranceShuffle2 import link_entrances_new
from source.tools.BPS import create_bps_from_data from source.tools.BPS import create_bps_from_data
from source.classes.CustomSettings import CustomSettings from source.classes.CustomSettings import CustomSettings
version_number = '1.2.0.13' version_number = '1.2.0.14'
version_branch = '-u' version_branch = '-u'
__version__ = f'{version_number}{version_branch}' __version__ = f'{version_number}{version_branch}'

View File

@@ -109,6 +109,9 @@ These are now independent of retro mode and have three options: None, Random, an
# Bug Fixes and Notes # Bug Fixes and Notes
* 1.2.0.14u
* Small fix for key logic validation (got rid of a false negative)
* Customized doors in ice cross work properly now
* 1.2.0.13u * 1.2.0.13u
* Allow green/blue potion refills to be customized * Allow green/blue potion refills to be customized
* OW Map showing dungeon entrance at Snitch Lady (West) fixed (instead of @ HC Courtyard) * OW Map showing dungeon entrance at Snitch Lady (West) fixed (instead of @ HC Courtyard)