fix: moon pearl paths respect blocked doors
This commit is contained in:
2
Main.py
2
Main.py
@@ -38,7 +38,7 @@ from source.enemizer.DamageTables import DamageTable
|
|||||||
from source.enemizer.Enemizer import randomize_enemies
|
from source.enemizer.Enemizer import randomize_enemies
|
||||||
from source.rom.DataTables import init_data_tables
|
from source.rom.DataTables import init_data_tables
|
||||||
|
|
||||||
version_number = '1.4.1.0'
|
version_number = '1.4.1.1'
|
||||||
version_branch = '-v'
|
version_branch = '-v'
|
||||||
__version__ = f'{version_number}{version_branch}'
|
__version__ = f'{version_number}{version_branch}'
|
||||||
|
|
||||||
|
|||||||
@@ -141,6 +141,8 @@ These are now independent of retro mode and have three options: None, Random, an
|
|||||||
|
|
||||||
# Bug Fixes and Notes
|
# Bug Fixes and Notes
|
||||||
|
|
||||||
|
* 1.4.1.1v
|
||||||
|
* Logic: Moon pearl logic respects blocked doors
|
||||||
* 1.4.1.0v
|
* 1.4.1.0v
|
||||||
* World Model Refactor: The overworld has been split up by screen, brings OR and DR a bit closer together in the model sense. A few OWG clips have been rewritten to fit into this new logic better.
|
* World Model Refactor: The overworld has been split up by screen, brings OR and DR a bit closer together in the model sense. A few OWG clips have been rewritten to fit into this new logic better.
|
||||||
* Logic: New logic for some bosses on ice
|
* Logic: New logic for some bosses on ice
|
||||||
|
|||||||
9
Rules.py
9
Rules.py
@@ -2076,16 +2076,19 @@ def set_bunny_rules(world, player, inverted):
|
|||||||
# for each such entrance a new option is added that consist of:
|
# for each such entrance a new option is added that consist of:
|
||||||
# a) being able to reach it, and
|
# a) being able to reach it, and
|
||||||
# b) being able to access all entrances from there to `region`
|
# b) being able to access all entrances from there to `region`
|
||||||
queue = deque([(region, [], {region})])
|
queue = deque([(region, [], {region}, [region])])
|
||||||
seen_sets = set([frozenset({region})])
|
seen_sets = set([frozenset({region})])
|
||||||
while queue:
|
while queue:
|
||||||
(current, path, seen) = queue.popleft()
|
(current, path, seen, region_path) = queue.popleft()
|
||||||
for entrance in current.entrances:
|
for entrance in current.entrances:
|
||||||
|
if entrance.door and entrance.door.blocked:
|
||||||
|
continue
|
||||||
new_region = entrance.parent_region
|
new_region = entrance.parent_region
|
||||||
new_seen = seen.union({new_region})
|
new_seen = seen.union({new_region})
|
||||||
if new_region.type in (RegionType.Cave, RegionType.Dungeon) and new_seen in seen_sets:
|
if new_region.type in (RegionType.Cave, RegionType.Dungeon) and new_seen in seen_sets:
|
||||||
continue
|
continue
|
||||||
new_path = path + [entrance.access_rule]
|
new_path = path + [entrance.access_rule]
|
||||||
|
new_region_path = region_path + [new_region]
|
||||||
seen_sets.add(frozenset(new_seen))
|
seen_sets.add(frozenset(new_seen))
|
||||||
if not is_link(new_region):
|
if not is_link(new_region):
|
||||||
if world.logic[player] in ['owglitches', 'hybridglitches']:
|
if world.logic[player] in ['owglitches', 'hybridglitches']:
|
||||||
@@ -2129,7 +2132,7 @@ def set_bunny_rules(world, player, inverted):
|
|||||||
continue
|
continue
|
||||||
if is_bunny(new_region):
|
if is_bunny(new_region):
|
||||||
# todo: if not owg or hmg and entrance is in bunny_impassible_doors, then skip this nonsense?
|
# todo: if not owg or hmg and entrance is in bunny_impassible_doors, then skip this nonsense?
|
||||||
queue.append((new_region, new_path, new_seen))
|
queue.append((new_region, new_path, new_seen, new_region_path))
|
||||||
else:
|
else:
|
||||||
# we have reached pure light world, so we have a new possible option
|
# we have reached pure light world, so we have a new possible option
|
||||||
possible_options.append(path_to_access_rule(new_path, entrance))
|
possible_options.append(path_to_access_rule(new_path, entrance))
|
||||||
|
|||||||
Reference in New Issue
Block a user