fix(key logic): typo
fix(bunny logic): multiple paths considered
This commit is contained in:
@@ -1729,7 +1729,7 @@ def imp_locations_factory(world, player):
|
||||
imp_locations = ['Agahnim 1', 'Agahnim 2', 'Attic Cracked Floor', 'Suspicious Maiden']
|
||||
if world.mode[player] == 'standard':
|
||||
imp_locations.append('Zelda Pickup')
|
||||
imp_locations.append('Zelda Dropoff')
|
||||
imp_locations.append('Zelda Drop Off')
|
||||
return imp_locations
|
||||
|
||||
|
||||
|
||||
2
Main.py
2
Main.py
@@ -31,7 +31,7 @@ from Utils import output_path, parse_player_names
|
||||
from source.item.FillUtil import create_item_pool_config, massage_item_pool, district_item_pool_config
|
||||
from source.tools.BPS import create_bps_from_data
|
||||
|
||||
__version__ = '1.1.6-dev'
|
||||
__version__ = '1.1.7-dev'
|
||||
|
||||
from source.classes.BabelFish import BabelFish
|
||||
|
||||
|
||||
@@ -181,6 +181,10 @@ Same as above but both small keys and bigs keys of the dungeon are not allowed o
|
||||
|
||||
# Bug Fixes and Notes
|
||||
|
||||
* 1.1.7
|
||||
* Fixed logic issues:
|
||||
* Self-locking key not allowed in Sanctuary in standard (typo fixed)
|
||||
* More advanced bunny-walking logic in dungeons (multiple paths considred)
|
||||
* 1.1.6
|
||||
* Minor issue with dungeon counter hud interfering with timer
|
||||
* 1.1.5
|
||||
|
||||
29
Rules.py
29
Rules.py
@@ -98,16 +98,20 @@ def mirrorless_path_to_castle_courtyard(world, player):
|
||||
else:
|
||||
queue.append((entrance.connected_region, new_path))
|
||||
|
||||
|
||||
def set_rule(spot, rule):
|
||||
spot.access_rule = rule
|
||||
|
||||
|
||||
def set_defeat_dungeon_boss_rule(location):
|
||||
# Lambda required to defer evaluation of dungeon.boss since it will change later if boos shuffle is used
|
||||
set_rule(location, lambda state: location.parent_region.dungeon.boss.can_defeat(state))
|
||||
|
||||
|
||||
def set_always_allow(spot, rule):
|
||||
spot.always_allow = rule
|
||||
|
||||
|
||||
def add_rule(spot, rule, combine='and'):
|
||||
old_rule = spot.access_rule
|
||||
if combine == 'or':
|
||||
@@ -128,22 +132,26 @@ def forbid_item(location, item, player):
|
||||
old_rule = location.item_rule
|
||||
location.item_rule = lambda i: (i.name != item or i.player != player) and old_rule(i)
|
||||
|
||||
|
||||
def add_item_rule(location, rule):
|
||||
old_rule = location.item_rule
|
||||
location.item_rule = lambda item: rule(item) and old_rule(item)
|
||||
|
||||
|
||||
def item_in_locations(state, item, player, locations):
|
||||
for location in locations:
|
||||
if item_name(state, location[0], location[1]) == (item, player):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def item_name(state, location, player):
|
||||
location = state.world.get_location(location, player)
|
||||
if location.item is None:
|
||||
return None
|
||||
return (location.item.name, location.item.player)
|
||||
|
||||
|
||||
def global_rules(world, player):
|
||||
# ganon can only carry triforce
|
||||
add_item_rule(world.get_location('Ganon', player), lambda item: item.name == 'Triforce' and item.player == player)
|
||||
@@ -220,7 +228,6 @@ def global_rules(world, player):
|
||||
set_rule(world.get_entrance('Tower Altar NW', player), lambda state: state.has_sword(player))
|
||||
set_defeat_dungeon_boss_rule(world.get_location('Agahnim 1', player))
|
||||
|
||||
|
||||
set_rule(world.get_entrance('PoD Arena Landing Bonk Path', player), lambda state: state.has_Boots(player))
|
||||
set_rule(world.get_entrance('PoD Mimics 1 NW', player), lambda state: state.can_shoot_arrows(player))
|
||||
set_rule(world.get_entrance('PoD Mimics 2 NW', player), lambda state: state.can_shoot_arrows(player))
|
||||
@@ -768,7 +775,6 @@ def pot_rules(world, player):
|
||||
add_rule(l, lambda state: state.can_hit_crystal(player))
|
||||
|
||||
|
||||
|
||||
def default_rules(world, player):
|
||||
# overworld requirements
|
||||
set_rule(world.get_entrance('Kings Grave', player), lambda state: state.has_Boots(player))
|
||||
@@ -1098,17 +1104,20 @@ def forbid_bomb_jump_requirements(world, player):
|
||||
add_rule(world.get_location(location, player), lambda state: state.has('Hookshot', player))
|
||||
set_rule(world.get_entrance('Paradox Cave Bomb Jump', player), lambda state: False)
|
||||
|
||||
|
||||
# Light cones in standard depend on which world we actually are in, not which one the location would normally be
|
||||
# We add Lamp requirements only to those locations which lie in the dark world (or everything if open
|
||||
DW_Entrances = ['Bumper Cave (Bottom)', 'Superbunny Cave (Top)', 'Superbunny Cave (Bottom)', 'Hookshot Cave', 'Bumper Cave (Top)', 'Hookshot Cave Back Entrance', 'Dark Death Mountain Ledge (East)',
|
||||
'Turtle Rock Isolated Ledge Entrance', 'Thieves Town', 'Skull Woods Final Section', 'Ice Palace', 'Misery Mire', 'Palace of Darkness', 'Swamp Palace', 'Turtle Rock', 'Dark Death Mountain Ledge (West)']
|
||||
|
||||
|
||||
def check_is_dark_world(region):
|
||||
for entrance in region.entrances:
|
||||
if entrance.name in DW_Entrances:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def add_conditional_lamps(world, player):
|
||||
def add_conditional_lamp(spot, region, spottype='Location'):
|
||||
if spottype == 'Location':
|
||||
@@ -1180,6 +1189,7 @@ def add_conditional_lamps(world, player):
|
||||
|
||||
add_conditional_lamp('Old Man House Front to Back', 'Old Man House', 'Entrance')
|
||||
|
||||
|
||||
def open_rules(world, player):
|
||||
# softlock protection as you can reach the sewers small key door with a guard drop key
|
||||
set_rule(world.get_location('Hyrule Castle - Boomerang Chest', player), lambda state: state.has_sm_key('Small Key (Escape)', player))
|
||||
@@ -1187,7 +1197,6 @@ def open_rules(world, player):
|
||||
|
||||
|
||||
def swordless_rules(world, player):
|
||||
|
||||
set_rule(world.get_entrance('Tower Altar NW', player), lambda state: True)
|
||||
set_rule(world.get_entrance('Skull Vines NW', player), lambda state: True)
|
||||
set_rule(world.get_entrance('Ice Lobby WS', player), lambda state: state.has('Fire Rod', player) or state.has('Bombos', player))
|
||||
@@ -1239,6 +1248,7 @@ std_kill_rooms = {
|
||||
'GT Wizzrobes 2': ['GT Wizzrobes 2 SE', 'GT Wizzrobes 2 NE'] # Wizzrobes. Bombs don't work
|
||||
} # all trap rooms?
|
||||
|
||||
|
||||
def add_connection(parent_name, target_name, entrance_name, world, player):
|
||||
parent = world.get_region(parent_name, player)
|
||||
target = world.get_region(target_name, player)
|
||||
@@ -1300,6 +1310,7 @@ def standard_rules(world, player):
|
||||
|
||||
def check_rule_list(state, r_list):
|
||||
return True if len(r_list) <= 0 else r_list[0](state) and check_rule_list(state, r_list[1:])
|
||||
|
||||
rule_list, debug_path = find_rules_for_zelda_delivery(world, player)
|
||||
set_rule(world.get_location('Zelda Drop Off', player), lambda state: state.has('Zelda Herself', player) and check_rule_list(state, rule_list))
|
||||
|
||||
@@ -1780,7 +1791,6 @@ def set_inverted_big_bomb_rules(world, player):
|
||||
|
||||
|
||||
def set_bunny_rules(world, player, inverted):
|
||||
|
||||
# regions for the exits of multi-entrace caves/drops that bunny cannot pass
|
||||
# Note spiral cave may be technically passible, but it would be too absurd to require since OHKO mode is a thing.
|
||||
bunny_impassable_caves = ['Bumper Cave (top)', 'Bumper Cave (bottom)', 'Two Brothers House',
|
||||
@@ -1819,6 +1829,7 @@ def set_bunny_rules(world, player, inverted):
|
||||
return region.is_light_world
|
||||
else:
|
||||
return region.is_dark_world
|
||||
|
||||
def is_link(region):
|
||||
if inverted:
|
||||
return region.is_dark_world
|
||||
@@ -1848,16 +1859,15 @@ def set_bunny_rules(world, player, inverted):
|
||||
# for each such entrance a new option is added that consist of:
|
||||
# a) being able to reach it, and
|
||||
# b) being able to access all entrances from there to `region`
|
||||
seen = {region}
|
||||
queue = deque([(region, [])])
|
||||
queue = deque([(region, [], {region})])
|
||||
while queue:
|
||||
(current, path) = queue.popleft()
|
||||
(current, path, seen) = queue.popleft()
|
||||
for entrance in current.entrances:
|
||||
new_region = entrance.parent_region
|
||||
if new_region.type in (RegionType.Cave, RegionType.Dungeon) and new_region in seen:
|
||||
continue
|
||||
new_path = path + [entrance.access_rule]
|
||||
seen.add(new_region)
|
||||
new_seen = seen.union({new_region})
|
||||
if not is_link(new_region):
|
||||
if world.logic[player] == 'owglitches':
|
||||
if region.type == RegionType.Dungeon and new_region.type != RegionType.Dungeon:
|
||||
@@ -1894,7 +1904,7 @@ def set_bunny_rules(world, player, inverted):
|
||||
else:
|
||||
continue
|
||||
if is_bunny(new_region):
|
||||
queue.append((new_region, new_path))
|
||||
queue.append((new_region, new_path, new_seen))
|
||||
else:
|
||||
# we have reached pure light world, so we have a new possible option
|
||||
possible_options.append(path_to_access_rule(new_path, entrance))
|
||||
@@ -1941,7 +1951,6 @@ drop_dungeon_entrances = {
|
||||
"Skull Back Drop"
|
||||
}
|
||||
|
||||
|
||||
bunny_revivable_entrances = {
|
||||
"Sewers Pull Switch", "TR Dash Room", "Swamp Boss", "Hera Boss",
|
||||
"Tower Agahnim 1", "Ice Lobby", "Sewers Rat Path", "PoD Falling Bridge",
|
||||
|
||||
Reference in New Issue
Block a user