Make standard x retro work
Fix no logic generation Remove a duplicate function in Main.py
This commit is contained in:
26
Main.py
26
Main.py
@@ -296,32 +296,6 @@ def copy_world(world):
|
|||||||
return ret
|
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):
|
def create_playthrough(world):
|
||||||
# create a copy as we will modify it
|
# create a copy as we will modify it
|
||||||
old_world = world
|
old_world = world
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ def no_logic_rules(world, player):
|
|||||||
Add OWG transitions to no logic player's world
|
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_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.
|
# Glitched speed drops.
|
||||||
create_no_logic_connections(player, world, get_glitched_speed_drops_dw(world.mode == 'inverted'))
|
create_no_logic_connections(player, world, get_glitched_speed_drops_dw(world.mode == 'inverted'))
|
||||||
|
|||||||
3
Rules.py
3
Rules.py
@@ -1027,6 +1027,9 @@ 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))
|
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):
|
def standard_rules(world, 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))
|
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 (East)', player), lambda state: state.can_reach('Sanctuary', 'Region', player))
|
||||||
|
|||||||
Reference in New Issue
Block a user