From 7c8d102c1760b519dfdc2fd5143849cc4db162e6 Mon Sep 17 00:00:00 2001 From: Scipio Wright Date: Thu, 19 Dec 2024 23:45:29 -0500 Subject: [PATCH] TUNIC: Logic for bushes in guard house 2 upper and belltower (#4371) * Logic for bushes in guard house 2 upper * Fix typo * also do it for forest belltower * i love the dumb ice grapples --- worlds/tunic/er_data.py | 25 +++++++++++++++++++------ worlds/tunic/er_rules.py | 25 +++++++++++++++++++++++-- worlds/tunic/locations.py | 2 +- 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/worlds/tunic/er_data.py b/worlds/tunic/er_data.py index 9794f4a8..1dc06d58 100644 --- a/worlds/tunic/er_data.py +++ b/worlds/tunic/er_data.py @@ -175,7 +175,7 @@ portal_mapping: List[Portal] = [ Portal(name="Temple Door Exit", region="Sealed Temple", destination="Overworld Redux", tag="_main"), - Portal(name="Forest Belltower to Fortress", region="Forest Belltower Main", + Portal(name="Forest Belltower to Fortress", region="Forest Belltower Main behind bushes", destination="Fortress Courtyard", tag="_"), Portal(name="Forest Belltower to Forest", region="Forest Belltower Lower", destination="East Forest Redux", tag="_"), @@ -221,7 +221,7 @@ portal_mapping: List[Portal] = [ Portal(name="Guard House 2 Lower Exit", region="Guard House 2 Lower", destination="East Forest Redux", tag="_lower"), - Portal(name="Guard House 2 Upper Exit", region="Guard House 2 Upper", + Portal(name="Guard House 2 Upper Exit", region="Guard House 2 Upper before bushes", destination="East Forest Redux", tag="_upper"), Portal(name="Guard Captain Room Non-Gate Exit", region="Forest Boss Room", @@ -601,6 +601,7 @@ tunic_er_regions: Dict[str, RegionInfo] = { "Sealed Temple Rafters": RegionInfo("Temple"), "Forest Belltower Upper": RegionInfo("Forest Belltower"), "Forest Belltower Main": RegionInfo("Forest Belltower"), + "Forest Belltower Main behind bushes": RegionInfo("Forest Belltower"), "Forest Belltower Lower": RegionInfo("Forest Belltower"), "East Forest": RegionInfo("East Forest Redux"), "East Forest Dance Fox Spot": RegionInfo("East Forest Redux"), @@ -608,7 +609,8 @@ tunic_er_regions: Dict[str, RegionInfo] = { "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"), - "Guard House 2 Upper": RegionInfo("East Forest Redux Interior"), + "Guard House 2 Upper before bushes": RegionInfo("East Forest Redux Interior"), + "Guard House 2 Upper after bushes": RegionInfo("East Forest Redux Interior"), "Guard House 2 Lower": RegionInfo("East Forest Redux Interior"), "Forest Boss Room": RegionInfo("Forest Boss Room"), "Forest Grave Path Main": RegionInfo("Sword Access"), @@ -1026,6 +1028,12 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Forest Belltower Main": { "Forest Belltower Lower": [], + "Forest Belltower Main behind bushes": + [], + }, + "Forest Belltower Main behind bushes": { + "Forest Belltower Main": + [], }, "East Forest": { @@ -1057,13 +1065,18 @@ traversal_requirements: Dict[str, Dict[str, List[List[str]]]] = { "Guard House 1 East": [["Hyperdash"], ["LS1"]], }, - - "Guard House 2 Upper": { + "Guard House 2 Upper before bushes": { + "Guard House 2 Upper after bushes": + [], + }, + "Guard House 2 Upper after bushes": { "Guard House 2 Lower": [], + "Guard House 2 Upper before bushes": + [], }, "Guard House 2 Lower": { - "Guard House 2 Upper": + "Guard House 2 Upper after bushes": [], }, diff --git a/worlds/tunic/er_rules.py b/worlds/tunic/er_rules.py index 16352310..6e9ae551 100644 --- a/worlds/tunic/er_rules.py +++ b/worlds/tunic/er_rules.py @@ -40,6 +40,12 @@ def can_shop(state: CollectionState, world: "TunicWorld") -> bool: return has_sword(state, world.player) and state.can_reach_region("Shop", world.player) +# for the ones that are not early bushes where ER can screw you over a bit +def can_get_past_bushes(state: CollectionState, world: "TunicWorld") -> bool: + # add in glass cannon + stick for grass rando + return has_sword(state, world.player) or state.has_any((fire_wand, laurels, gun), world.player) + + def set_er_region_rules(world: "TunicWorld", regions: Dict[str, Region], portal_pairs: Dict[Portal, Portal]) -> None: player = world.player options = world.options @@ -437,6 +443,14 @@ def set_er_region_rules(world: "TunicWorld", regions: Dict[str, Region], portal_ connecting_region=regions["Forest Belltower Lower"], rule=lambda state: has_ladder("Ladder to East Forest", state, world)) + regions["Forest Belltower Main behind bushes"].connect( + connecting_region=regions["Forest Belltower Main"], + rule=lambda state: can_get_past_bushes(state, world) + or has_ice_grapple_logic(False, IceGrappling.option_easy, state, world)) + # you can use the slimes to break the bushes + regions["Forest Belltower Main"].connect( + connecting_region=regions["Forest Belltower Main behind bushes"]) + # ice grapple up to dance fox spot, and vice versa regions["East Forest"].connect( connecting_region=regions["East Forest Dance Fox Spot"], @@ -467,11 +481,18 @@ def set_er_region_rules(world: "TunicWorld", regions: Dict[str, Region], portal_ connecting_region=regions["Guard House 1 East"], rule=lambda state: state.has(laurels, player)) - regions["Guard House 2 Upper"].connect( + regions["Guard House 2 Upper before bushes"].connect( + connecting_region=regions["Guard House 2 Upper after bushes"], + rule=lambda state: can_get_past_bushes(state, world)) + regions["Guard House 2 Upper after bushes"].connect( + connecting_region=regions["Guard House 2 Upper before bushes"], + rule=lambda state: can_get_past_bushes(state, world)) + + regions["Guard House 2 Upper after bushes"].connect( connecting_region=regions["Guard House 2 Lower"], rule=lambda state: has_ladder("Ladders to Lower Forest", state, world)) regions["Guard House 2 Lower"].connect( - connecting_region=regions["Guard House 2 Upper"], + connecting_region=regions["Guard House 2 Upper after bushes"], rule=lambda state: has_ladder("Ladders to Lower Forest", state, world)) # ice grapple from upper grave path exit to the rest of it diff --git a/worlds/tunic/locations.py b/worlds/tunic/locations.py index 5ea309fb..c44852e8 100644 --- a/worlds/tunic/locations.py +++ b/worlds/tunic/locations.py @@ -41,7 +41,7 @@ location_table: Dict[str, TunicLocationData] = { "Dark Tomb - Skulls Chest": TunicLocationData("Dark Tomb", "Dark Tomb Upper"), "Dark Tomb - Spike Maze Near Stairs": TunicLocationData("Dark Tomb", "Dark Tomb Main"), "Dark Tomb - 1st Laser Room Obscured": TunicLocationData("Dark Tomb", "Dark Tomb Main"), - "Guardhouse 2 - Upper Floor": TunicLocationData("East Forest", "Guard House 2 Upper"), + "Guardhouse 2 - Upper Floor": TunicLocationData("East Forest", "Guard House 2 Upper after bushes"), "Guardhouse 2 - Bottom Floor Secret": TunicLocationData("East Forest", "Guard House 2 Lower"), "Guardhouse 1 - Upper Floor Obscured": TunicLocationData("East Forest", "Guard House 1 East"), "Guardhouse 1 - Upper Floor": TunicLocationData("East Forest", "Guard House 1 East"),