Make standard x retro work

Fix no logic generation
Remove a duplicate function in Main.py
This commit is contained in:
compiling
2020-10-31 15:10:11 +11:00
parent b4160358bc
commit 3e1b5a03a0
3 changed files with 5 additions and 28 deletions

26
Main.py
View File

@@ -296,32 +296,6 @@ def copy_world(world):
return ret
def copy_dynamic_regions_and_locations(world, ret):
for region in world.dynamic_regions:
new_reg = Region(region.name, region.type, region.hint_text, region.player)
ret.regions.append(new_reg)
ret.initialize_regions([new_reg])
ret.dynamic_regions.append(new_reg)
# Note: ideally exits should be copied here, but the current use case (Take anys) do not require this
if region.shop:
new_reg.shop = Shop(new_reg, region.shop.room_id, region.shop.type, region.shop.shopkeeper_config, region.shop.custom, region.shop.locked)
ret.shops.append(new_reg.shop)
for location in world.dynamic_locations:
new_reg = ret.get_region(location.parent_region.name, location.parent_region.player)
new_loc = Location(location.player, location.name, location.address, location.crystal, location.hint_text, new_reg)
# todo: this is potentially dangerous. later refactor so we
# can apply dynamic region rules on top of copied world like other rules
new_loc.access_rule = location.access_rule
new_loc.always_allow = location.always_allow
new_loc.item_rule = location.item_rule
new_reg.locations.append(new_loc)
ret.clear_location_cache()
def create_playthrough(world):
# create a copy as we will modify it
old_world = world

View File

@@ -221,7 +221,7 @@ def no_logic_rules(world, player):
Add OWG transitions to no logic player's world
"""
create_no_logic_connections(player, world, get_boots_clip_exits_lw(world.mode == 'inverted'))
create_no_logic_connections(player, world, get_boots_clip_exits_dw(world.mode == 'inverted', player))
create_no_logic_connections(player, world, get_boots_clip_exits_dw(world.mode == 'inverted'))
# Glitched speed drops.
create_no_logic_connections(player, world, get_glitched_speed_drops_dw(world.mode == 'inverted'))

View File

@@ -1027,7 +1027,10 @@ def swordless_rules(world, player):
set_rule(world.get_location('Bombos Tablet', player), lambda state: state.has('Book of Mudora', player) and state.has('Hammer', player))
def standard_rules(world, player):
add_rule(world.get_entrance('Sewers Door', player), lambda state: state.can_kill_most_things(player))
if world.retro:
set_rule(world.get_entrance('Sewers Door', player), lambda state: state.can_kill_most_things(player)) # key is manually placed
else:
add_rule(world.get_entrance('Sewers Door', player), lambda state: state.can_kill_most_things(player))
set_rule(world.get_entrance('Hyrule Castle Exit (East)', player), lambda state: state.can_reach('Sanctuary', 'Region', player))
set_rule(world.get_entrance('Hyrule Castle Exit (West)', player), lambda state: state.can_reach('Sanctuary', 'Region', player))