diff --git a/worlds/tunic/er_data.py b/worlds/tunic/er_data.py index ac73ad2dd8..5e0e83d5b6 100644 --- a/worlds/tunic/er_data.py +++ b/worlds/tunic/er_data.py @@ -1,4 +1,4 @@ -from typing import Dict, NamedTuple, List +from typing import Dict, NamedTuple, List, Optional from enum import IntEnum @@ -532,6 +532,7 @@ portal_mapping: List[Portal] = [ class RegionInfo(NamedTuple): game_scene: str # the name of the scene in the actual game dead_end: int = 0 # if a region has only one exit + outlet_region: Optional[str] = None class DeadEnd(IntEnum): @@ -575,10 +576,10 @@ tunic_er_regions: Dict[str, RegionInfo] = { "Overworld Ruined Passage Door": RegionInfo("Overworld Redux"), # the small space betweeen the door and the portal "Overworld Old House Door": RegionInfo("Overworld Redux"), # the too-small space between the door and the portal "Overworld Southeast Cross Door": RegionInfo("Overworld Redux"), # the small space betweeen the door and the portal - "Overworld Fountain Cross Door": RegionInfo("Overworld Redux"), # the small space between the door and the portal + "Overworld Fountain Cross Door": RegionInfo("Overworld Redux", outlet_region="Overworld"), "Overworld Temple Door": RegionInfo("Overworld Redux"), # the small space betweeen the door and the portal - "Overworld Town Portal": RegionInfo("Overworld Redux"), # being able to go to or come from the portal - "Overworld Spawn Portal": RegionInfo("Overworld Redux"), # being able to go to or come from the portal + "Overworld Town Portal": RegionInfo("Overworld Redux", outlet_region="Overworld"), + "Overworld Spawn Portal": RegionInfo("Overworld Redux", outlet_region="Overworld"), "Stick House": RegionInfo("Sword Cave", dead_end=DeadEnd.all_cats), "Windmill": RegionInfo("Windmill"), "Old House Back": RegionInfo("Overworld Interiors"), # part with the hc door @@ -607,7 +608,7 @@ tunic_er_regions: Dict[str, RegionInfo] = { "Forest Belltower Lower": RegionInfo("Forest Belltower"), "East Forest": RegionInfo("East Forest Redux"), "East Forest Dance Fox Spot": RegionInfo("East Forest Redux"), - "East Forest Portal": RegionInfo("East Forest Redux"), + "East Forest Portal": RegionInfo("East Forest Redux", outlet_region="East Forest"), "Lower Forest": RegionInfo("East Forest Redux"), # bottom of the forest "Guard House 1 East": RegionInfo("East Forest Redux Laddercave"), "Guard House 1 West": RegionInfo("East Forest Redux Laddercave"), @@ -617,7 +618,7 @@ tunic_er_regions: Dict[str, RegionInfo] = { "Forest Grave Path Main": RegionInfo("Sword Access"), "Forest Grave Path Upper": RegionInfo("Sword Access"), "Forest Grave Path by Grave": RegionInfo("Sword Access"), - "Forest Hero's Grave": RegionInfo("Sword Access"), + "Forest Hero's Grave": RegionInfo("Sword Access", outlet_region="Forest Grave Path by Grave"), "Dark Tomb Entry Point": RegionInfo("Crypt Redux"), # both upper exits "Dark Tomb Upper": RegionInfo("Crypt Redux"), # the part with the casket and the top of the ladder "Dark Tomb Main": RegionInfo("Crypt Redux"), @@ -633,19 +634,20 @@ tunic_er_regions: Dict[str, RegionInfo] = { "West Garden at Dagger House": RegionInfo("Archipelagos Redux"), # just outside magic dagger house "West Garden South Checkpoint": RegionInfo("Archipelagos Redux"), "Magic Dagger House": RegionInfo("archipelagos_house", dead_end=DeadEnd.all_cats), - "West Garden Portal": RegionInfo("Archipelagos Redux", dead_end=DeadEnd.restricted), + "West Garden Portal": RegionInfo("Archipelagos Redux", dead_end=DeadEnd.restricted, outlet_region="West Garden by Portal"), + "West Garden by Portal": RegionInfo("Archipelagos Redux", dead_end=DeadEnd.restricted), "West Garden Portal Item": RegionInfo("Archipelagos Redux", dead_end=DeadEnd.restricted), "West Garden Laurels Exit Region": RegionInfo("Archipelagos Redux"), "West Garden before Boss": RegionInfo("Archipelagos Redux"), # main west garden "West Garden after Boss": RegionInfo("Archipelagos Redux"), - "West Garden Hero's Grave Region": RegionInfo("Archipelagos Redux"), + "West Garden Hero's Grave Region": RegionInfo("Archipelagos Redux", outlet_region="West Garden"), "Ruined Atoll": RegionInfo("Atoll Redux"), "Ruined Atoll Lower Entry Area": RegionInfo("Atoll Redux"), "Ruined Atoll Ladder Tops": RegionInfo("Atoll Redux"), # at the top of the 5 ladders in south Atoll "Ruined Atoll Frog Mouth": RegionInfo("Atoll Redux"), "Ruined Atoll Frog Eye": RegionInfo("Atoll Redux"), - "Ruined Atoll Portal": RegionInfo("Atoll Redux"), - "Ruined Atoll Statue": RegionInfo("Atoll Redux"), + "Ruined Atoll Portal": RegionInfo("Atoll Redux", outlet_region="Ruined Atoll"), + "Ruined Atoll Statue": RegionInfo("Atoll Redux", outlet_region="Ruined Atoll"), "Frog Stairs Eye Exit": RegionInfo("Frog Stairs"), "Frog Stairs Upper": RegionInfo("Frog Stairs"), "Frog Stairs Lower": RegionInfo("Frog Stairs"), @@ -654,18 +656,20 @@ tunic_er_regions: Dict[str, RegionInfo] = { "Frog's Domain Front": RegionInfo("frog cave main"), # before combat "Frog's Domain Main": RegionInfo("frog cave main"), "Frog's Domain Back": RegionInfo("frog cave main"), - "Library Exterior Tree Region": RegionInfo("Library Exterior"), + "Library Exterior Tree Region": RegionInfo("Library Exterior", outlet_region="Library Exterior by Tree"), + "Library Exterior by Tree": RegionInfo("Library Exterior"), "Library Exterior Ladder Region": RegionInfo("Library Exterior"), "Library Hall Bookshelf": RegionInfo("Library Hall"), "Library Hall": RegionInfo("Library Hall"), - "Library Hero's Grave Region": RegionInfo("Library Hall"), + "Library Hero's Grave Region": RegionInfo("Library Hall", outlet_region="Library Hall"), "Library Hall to Rotunda": RegionInfo("Library Hall"), "Library Rotunda to Hall": RegionInfo("Library Rotunda"), "Library Rotunda": RegionInfo("Library Rotunda"), "Library Rotunda to Lab": RegionInfo("Library Rotunda"), "Library Lab": RegionInfo("Library Lab"), "Library Lab Lower": RegionInfo("Library Lab"), - "Library Portal": RegionInfo("Library Lab"), + "Library Lab on Portal Pad": RegionInfo("Library Lab"), + "Library Portal": RegionInfo("Library Lab", outlet_region="Library Lab on Portal Pad"), "Library Lab to Librarian": RegionInfo("Library Lab"), "Library Arena": RegionInfo("Library Arena", dead_end=DeadEnd.all_cats), "Fortress Exterior from East Forest": RegionInfo("Fortress Courtyard"), @@ -686,22 +690,22 @@ tunic_er_regions: Dict[str, RegionInfo] = { "Fortress Grave Path by Grave": RegionInfo("Fortress Reliquary"), "Fortress Grave Path Upper": RegionInfo("Fortress Reliquary", dead_end=DeadEnd.restricted), "Fortress Grave Path Dusty Entrance Region": RegionInfo("Fortress Reliquary"), - "Fortress Hero's Grave Region": RegionInfo("Fortress Reliquary"), + "Fortress Hero's Grave Region": RegionInfo("Fortress Reliquary", outlet_region="Fortress Grave Path by Grave"), "Fortress Leaf Piles": RegionInfo("Dusty", dead_end=DeadEnd.all_cats), "Fortress Arena": RegionInfo("Fortress Arena"), - "Fortress Arena Portal": RegionInfo("Fortress Arena"), + "Fortress Arena Portal": RegionInfo("Fortress Arena", outlet_region="Fortress Arena"), "Lower Mountain": RegionInfo("Mountain"), "Lower Mountain Stairs": RegionInfo("Mountain"), "Top of the Mountain": RegionInfo("Mountaintop", dead_end=DeadEnd.all_cats), "Quarry Connector": RegionInfo("Darkwoods Tunnel"), "Quarry Entry": RegionInfo("Quarry Redux"), "Quarry": RegionInfo("Quarry Redux"), - "Quarry Portal": RegionInfo("Quarry Redux"), + "Quarry Portal": RegionInfo("Quarry Redux", outlet_region="Quarry Entry"), "Quarry Back": RegionInfo("Quarry Redux"), "Quarry Monastery Entry": RegionInfo("Quarry Redux"), "Monastery Front": RegionInfo("Monastery"), "Monastery Back": RegionInfo("Monastery"), - "Monastery Hero's Grave Region": RegionInfo("Monastery"), + "Monastery Hero's Grave Region": RegionInfo("Monastery", outlet_region="Monastery Back"), "Monastery Rope": RegionInfo("Quarry Redux"), "Lower Quarry": RegionInfo("Quarry Redux"), "Even Lower Quarry": RegionInfo("Quarry Redux"), @@ -717,17 +721,18 @@ tunic_er_regions: Dict[str, RegionInfo] = { "Rooted Ziggurat Lower Front": RegionInfo("ziggurat2020_3"), # the front for combat logic "Rooted Ziggurat Lower Mid Checkpoint": RegionInfo("ziggurat2020_3"), # the mid-checkpoint before double admin "Rooted Ziggurat Lower Back": RegionInfo("ziggurat2020_3"), # the boss side - "Zig Skip Exit": RegionInfo("ziggurat2020_3", dead_end=DeadEnd.special), # for use with fixed shop on + "Zig Skip Exit": RegionInfo("ziggurat2020_3", dead_end=DeadEnd.special, outlet_region="Rooted Ziggurat Lower Front"), # for use with fixed shop on "Rooted Ziggurat Portal Room Entrance": RegionInfo("ziggurat2020_3"), # the door itself on the zig 3 side - "Rooted Ziggurat Portal": RegionInfo("ziggurat2020_FTRoom"), - "Rooted Ziggurat Portal Room Exit": RegionInfo("ziggurat2020_FTRoom"), + "Rooted Ziggurat Portal": RegionInfo("ziggurat2020_FTRoom", outlet_region="Rooted Ziggurat Portal Room"), + "Rooted Ziggurat Portal Room": RegionInfo("ziggurat2020_FTRoom"), + "Rooted Ziggurat Portal Room Exit": RegionInfo("ziggurat2020_FTRoom", outlet_region="Rooted Ziggurat Portal Room"), "Swamp Front": RegionInfo("Swamp Redux 2"), # from the main entry to the top of the ladder after south "Swamp Mid": RegionInfo("Swamp Redux 2"), # from the bottom of the ladder to the cathedral door "Swamp Ledge under Cathedral Door": RegionInfo("Swamp Redux 2"), # the ledge with the chest and secret door - "Swamp to Cathedral Treasure Room": RegionInfo("Swamp Redux 2"), # just the door + "Swamp to Cathedral Treasure Room": RegionInfo("Swamp Redux 2", outlet_region="Swamp Ledge under Cathedral Door"), # just the door "Swamp to Cathedral Main Entrance Region": RegionInfo("Swamp Redux 2"), # just the door "Back of Swamp": RegionInfo("Swamp Redux 2"), # the area with hero grave and gauntlet entrance - "Swamp Hero's Grave Region": RegionInfo("Swamp Redux 2"), + "Swamp Hero's Grave Region": RegionInfo("Swamp Redux 2", outlet_region="Back of Swamp"), "Back of Swamp Laurels Area": RegionInfo("Swamp Redux 2"), # the spots you need laurels to traverse "Cathedral Entry": RegionInfo("Cathedral Redux"), # the checkpoint and easily-accessible chests "Cathedral Main": RegionInfo("Cathedral Redux"), # the majority of Cathedral @@ -739,10 +744,10 @@ tunic_er_regions: Dict[str, RegionInfo] = { "Far Shore": RegionInfo("Transit"), "Far Shore to Spawn Region": RegionInfo("Transit"), "Far Shore to East Forest Region": RegionInfo("Transit"), - "Far Shore to Quarry Region": RegionInfo("Transit"), - "Far Shore to Fortress Region": RegionInfo("Transit"), - "Far Shore to Library Region": RegionInfo("Transit"), - "Far Shore to West Garden Region": RegionInfo("Transit"), + "Far Shore to Quarry Region": RegionInfo("Transit", outlet_region="Far Shore"), + "Far Shore to Fortress Region": RegionInfo("Transit", outlet_region="Far Shore"), + "Far Shore to Library Region": RegionInfo("Transit", outlet_region="Far Shore"), + "Far Shore to West Garden Region": RegionInfo("Transit", outlet_region="Far Shore"), "Hero Relic - Fortress": RegionInfo("RelicVoid", dead_end=DeadEnd.all_cats), "Hero Relic - Quarry": RegionInfo("RelicVoid", dead_end=DeadEnd.all_cats), "Hero Relic - West Garden": RegionInfo("RelicVoid", dead_end=DeadEnd.all_cats), @@ -970,6 +975,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { # "Overworld": # [], # }, + "Old House Front": { "Old House Back": [], @@ -978,6 +984,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Old House Front": [["Hyperdash", "Zip"]], }, + "Furnace Fuse": { "Furnace Ladder Area": [["Hyperdash"]], @@ -992,6 +999,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Furnace Ladder Area": [["Hyperdash"]], }, + "Sealed Temple": { "Sealed Temple Rafters": [], @@ -1000,10 +1008,12 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Sealed Temple": [["Hyperdash"]], }, + "Hourglass Cave": { "Hourglass Cave Tower": [], }, + "Forest Belltower Upper": { "Forest Belltower Main": [], @@ -1012,6 +1022,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Forest Belltower Lower": [], }, + "East Forest": { "East Forest Dance Fox Spot": [["Hyperdash"], ["IG1"], ["LS1"]], @@ -1032,6 +1043,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "East Forest": [], }, + "Guard House 1 East": { "Guard House 1 West": [], @@ -1040,6 +1052,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Guard House 1 East": [["Hyperdash"], ["LS1"]], }, + "Guard House 2 Upper": { "Guard House 2 Lower": [], @@ -1048,6 +1061,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Guard House 2 Upper": [], }, + "Forest Grave Path Main": { "Forest Grave Path Upper": [["Hyperdash"], ["LS2"]], @@ -1068,6 +1082,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Forest Grave Path by Grave": [], }, + "Beneath the Well Ladder Exit": { "Beneath the Well Front": [], @@ -1088,6 +1103,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Beneath the Well Main": [], }, + "Well Boss": { "Dark Tomb Checkpoint": [], @@ -1096,6 +1112,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Well Boss": [["Hyperdash", "Zip"]], }, + "Dark Tomb Entry Point": { "Dark Tomb Upper": [], @@ -1116,6 +1133,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Dark Tomb Main": [], }, + "West Garden before Terry": { "West Garden after Terry": [], @@ -1167,13 +1185,20 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "West Garden Portal Item": { "West Garden at Dagger House": [["IG1"]], - "West Garden Portal": - [["Hyperdash", "West Garden South Checkpoint"]], + "West Garden by Portal": + [["Hyperdash"]], }, - "West Garden Portal": { + "West Garden by Portal": { + "West Garden Portal": + [["West Garden South Checkpoint"]], "West Garden Portal Item": [["Hyperdash"]], }, + "West Garden Portal": { + "West Garden by Portal": + [], + }, + "Ruined Atoll": { "Ruined Atoll Lower Entry Area": [["Hyperdash"], ["LS1"]], @@ -1212,6 +1237,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Ruined Atoll": [], }, + "Frog Stairs Eye Exit": { "Frog Stairs Upper": [], @@ -1232,6 +1258,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Frog Stairs Lower": [], }, + "Frog's Domain Entry": { "Frog's Domain Front": [], @@ -1248,15 +1275,23 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Frog's Domain Back": [], }, + # cannot get from frogs back to front "Library Exterior Ladder Region": { - "Library Exterior Tree Region": + "Library Exterior by Tree": [], }, - "Library Exterior Tree Region": { + "Library Exterior by Tree": { + "Library Exterior Tree Region": + [], "Library Exterior Ladder Region": [], }, + "Library Exterior Tree Region": { + "Library Exterior by Tree": + [], + }, + "Library Hall Bookshelf": { "Library Hall": [], @@ -1275,6 +1310,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Library Hall": [], }, + "Library Rotunda to Hall": { "Library Rotunda": [], @@ -1302,14 +1338,21 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Library Lab to Librarian": [], }, - "Library Portal": { + "Library Lab on Portal Pad": { + "Library Portal": + [], "Library Lab": [], }, + "Library Portal": { + "Library Lab on Portal Pad": + [], + }, "Library Lab to Librarian": { "Library Lab": [], }, + "Fortress Exterior from East Forest": { "Fortress Exterior from Overworld": [], @@ -1350,6 +1393,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Fortress Courtyard": [], }, + "Beneath the Vault Ladder Exit": { "Beneath the Vault Main": [], @@ -1366,6 +1410,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Beneath the Vault Ladder Exit": [], }, + "Fortress East Shortcut Lower": { "Fortress East Shortcut Upper": [["IG1"]], @@ -1374,6 +1419,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Fortress East Shortcut Lower": [], }, + "Eastern Vault Fortress": { "Eastern Vault Fortress Gold Door": [["IG2"], ["Fortress Exterior from Overworld", "Beneath the Vault Back", "Fortress Courtyard Upper"]], @@ -1382,6 +1428,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Eastern Vault Fortress": [["IG1"]], }, + "Fortress Grave Path Entry": { "Fortress Grave Path Combat": [], @@ -1418,6 +1465,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Fortress Grave Path by Grave": [], }, + "Fortress Arena": { "Fortress Arena Portal": [["Fortress Exterior from Overworld", "Beneath the Vault Back", "Eastern Vault Fortress"]], @@ -1426,6 +1474,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Fortress Arena": [], }, + "Lower Mountain": { "Lower Mountain Stairs": [], @@ -1434,6 +1483,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Lower Mountain": [], }, + "Monastery Back": { "Monastery Front": [["Hyperdash", "Zip"]], @@ -1448,6 +1498,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Monastery Back": [], }, + "Quarry Entry": { "Quarry Portal": [["Quarry Connector"]], @@ -1502,6 +1553,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Quarry Back": [], }, + "Rooted Ziggurat Upper Entry": { "Rooted Ziggurat Upper Front": [], @@ -1514,10 +1566,12 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Rooted Ziggurat Upper Front": [["Hyperdash"]], }, + "Rooted Ziggurat Middle Top": { "Rooted Ziggurat Middle Bottom": [], }, + "Rooted Ziggurat Lower Entry": { "Rooted Ziggurat Lower Front": [], @@ -1547,22 +1601,26 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Rooted Ziggurat Portal Room Entrance": [], }, - "Zig Skip Exit": { - "Rooted Ziggurat Lower Front": - [], - }, "Rooted Ziggurat Portal Room Entrance": { "Rooted Ziggurat Lower Back": [], }, + "Rooted Ziggurat Portal Room Exit": { + "Rooted Ziggurat Portal Room": + [], + }, + "Rooted Ziggurat Portal Room": { + "Rooted Ziggurat Portal Room Exit": + [["Rooted Ziggurat Lower Back"]], "Rooted Ziggurat Portal": [], }, "Rooted Ziggurat Portal": { - "Rooted Ziggurat Portal Room Exit": - [["Rooted Ziggurat Lower Back"]], + "Rooted Ziggurat Portal Room": + [], }, + "Swamp Front": { "Swamp Mid": [], @@ -1607,6 +1665,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Back of Swamp": [], }, + "Cathedral Entry": { "Cathedral to Gauntlet": [], @@ -1625,6 +1684,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Cathedral Main": [], }, + "Cathedral Gauntlet Checkpoint": { "Cathedral Gauntlet": [], @@ -1637,6 +1697,7 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Cathedral Gauntlet": [["Hyperdash"]], }, + "Far Shore": { "Far Shore to Spawn Region": [["Hyperdash"]], diff --git a/worlds/tunic/er_rules.py b/worlds/tunic/er_rules.py index 731bbf4758..cbad37d387 100644 --- a/worlds/tunic/er_rules.py +++ b/worlds/tunic/er_rules.py @@ -1,6 +1,6 @@ from typing import Dict, FrozenSet, Tuple, TYPE_CHECKING from worlds.generic.Rules import set_rule, add_rule, forbid_item -from .options import IceGrappling, LadderStorage, CombatLogic, EntranceLayout +from .options import IceGrappling, LadderStorage, CombatLogic from .rules import (has_ability, has_sword, has_melee, has_ice_grapple_logic, has_lantern, has_mask, can_ladder_storage, laurels_zip) from .er_data import Portal @@ -568,11 +568,17 @@ def set_er_region_rules(world: "TunicWorld", regions: Dict[str, Region], portal_ connecting_region=regions["West Garden before Terry"]) regions["West Garden Portal"].connect( + connecting_region=regions["West Garden by Portal"]) + regions["West Garden by Portal"].connect( + connecting_region=regions["West Garden Portal"], + rule=lambda state: has_ability(prayer, state, world) and state.has("Activate West Garden Fuse", player)) + + regions["West Garden by Portal"].connect( connecting_region=regions["West Garden Portal Item"], rule=lambda state: state.has(laurels, player)) regions["West Garden Portal Item"].connect( - connecting_region=regions["West Garden Portal"], - rule=lambda state: state.has(laurels, player) and has_ability(prayer, state, world)) + connecting_region=regions["West Garden by Portal"], + rule=lambda state: state.has(laurels, player)) # can ice grapple to and from the item behind the magic dagger house regions["West Garden Portal Item"].connect( @@ -660,14 +666,19 @@ def set_er_region_rules(world: "TunicWorld", regions: Dict[str, Region], portal_ # Library regions["Library Exterior Tree Region"].connect( + connecting_region=regions["Library Exterior by Tree"]) + regions["Library Exterior by Tree"].connect( + connecting_region=regions["Library Exterior Tree Region"], + rule=lambda state: has_ability(prayer, state, world)) + + regions["Library Exterior by Tree"].connect( connecting_region=regions["Library Exterior Ladder Region"], rule=lambda state: state.has_any({grapple, laurels}, player) and has_ladder("Ladders in Library", state, world)) regions["Library Exterior Ladder Region"].connect( - connecting_region=regions["Library Exterior Tree Region"], - rule=lambda state: has_ability(prayer, state, world) - and ((state.has(laurels, player) and has_ladder("Ladders in Library", state, world)) - or state.has(grapple, player))) + connecting_region=regions["Library Exterior by Tree"], + rule=lambda state: state.has(grapple, player) + or (state.has(laurels, player) and has_ladder("Ladders in Library", state, world))) regions["Library Hall Bookshelf"].connect( connecting_region=regions["Library Hall"], @@ -713,14 +724,19 @@ def set_er_region_rules(world: "TunicWorld", regions: Dict[str, Region], portal_ and has_ladder("Ladders in Library", state, world)) regions["Library Lab"].connect( - connecting_region=regions["Library Portal"], - rule=lambda state: has_ability(prayer, state, world) - and has_ladder("Ladders in Library", state, world)) - regions["Library Portal"].connect( + connecting_region=regions["Library Lab on Portal Pad"], + rule=lambda state: has_ladder("Ladders in Library", state, world)) + regions["Library Lab on Portal Pad"].connect( connecting_region=regions["Library Lab"], rule=lambda state: has_ladder("Ladders in Library", state, world) or state.has(laurels, player)) + regions["Library Lab on Portal Pad"].connect( + connecting_region=regions["Library Portal"], + rule=lambda state: has_ability(prayer, state, world)) + regions["Library Portal"].connect( + connecting_region=regions["Library Lab on Portal Pad"]) + regions["Library Lab"].connect( connecting_region=regions["Library Lab to Librarian"], rule=lambda state: has_ladder("Ladders in Library", state, world)) @@ -963,17 +979,17 @@ def set_er_region_rules(world: "TunicWorld", regions: Dict[str, Region], portal_ regions["Rooted Ziggurat Portal Room Entrance"].connect( connecting_region=regions["Rooted Ziggurat Lower Back"]) - # zig skip region only gets made if entrance rando and fewer shops are on - if options.entrance_rando and options.entrance_layout == EntranceLayout.option_fixed_shop: - regions["Zig Skip Exit"].connect( - connecting_region=regions["Rooted Ziggurat Lower Front"]) - regions["Rooted Ziggurat Portal"].connect( + connecting_region=regions["Rooted Ziggurat Portal Room"]) + regions["Rooted Ziggurat Portal Room"].connect( + connecting_region=regions["Rooted Ziggurat Portal"], + rule=lambda state: has_ability(prayer, state, world)) + + regions["Rooted Ziggurat Portal Room"].connect( connecting_region=regions["Rooted Ziggurat Portal Room Exit"], rule=lambda state: state.has("Activate Ziggurat Fuse", player)) regions["Rooted Ziggurat Portal Room Exit"].connect( - connecting_region=regions["Rooted Ziggurat Portal"], - rule=lambda state: has_ability(prayer, state, world)) + connecting_region=regions["Rooted Ziggurat Portal Room"]) # Swamp and Cathedral regions["Swamp Front"].connect(