| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | from typing import Dict, TYPE_CHECKING | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 14:53:54 -04:00
										 |  |  | from worlds.generic.Rules import set_rule, forbid_item, add_rule | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | from BaseClasses import CollectionState | 
					
						
							| 
									
										
										
										
											2025-03-07 19:43:02 -05:00
										 |  |  | from .options import LadderStorage, IceGrappling, HexagonQuestAbilityUnlockType | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | if TYPE_CHECKING: | 
					
						
							|  |  |  |     from . import TunicWorld | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | laurels = "Hero's Laurels" | 
					
						
							|  |  |  | grapple = "Magic Orb" | 
					
						
							|  |  |  | ice_dagger = "Magic Dagger" | 
					
						
							|  |  |  | fire_wand = "Magic Wand" | 
					
						
							| 
									
										
										
										
											2024-08-16 14:53:54 -04:00
										 |  |  | gun = "Gun" | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | lantern = "Lantern" | 
					
						
							|  |  |  | fairies = "Fairy" | 
					
						
							|  |  |  | coins = "Golden Coin" | 
					
						
							|  |  |  | prayer = "Pages 24-25 (Prayer)" | 
					
						
							|  |  |  | holy_cross = "Pages 42-43 (Holy Cross)" | 
					
						
							| 
									
										
										
										
											2024-02-16 17:25:20 -05:00
										 |  |  | icebolt = "Pages 52-53 (Icebolt)" | 
					
						
							| 
									
										
										
										
											2024-12-08 19:58:49 -05:00
										 |  |  | shield = "Shield" | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | key = "Key" | 
					
						
							|  |  |  | house_key = "Old House Key" | 
					
						
							|  |  |  | vault_key = "Fortress Vault Key" | 
					
						
							|  |  |  | mask = "Scavenger Mask" | 
					
						
							|  |  |  | red_hexagon = "Red Questagon" | 
					
						
							|  |  |  | green_hexagon = "Green Questagon" | 
					
						
							|  |  |  | blue_hexagon = "Blue Questagon" | 
					
						
							|  |  |  | gold_hexagon = "Gold Questagon" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  | # "Quarry - [East] Bombable Wall" is excluded from this list since it has slightly different rules | 
					
						
							| 
									
										
										
										
											2024-08-16 14:53:54 -04:00
										 |  |  | bomb_walls = ["East Forest - Bombable Wall", "Eastern Vault Fortress - [East Wing] Bombable Wall", | 
					
						
							|  |  |  |               "Overworld - [Central] Bombable Wall", "Overworld - [Southwest] Bombable Wall Near Fountain", | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |               "Quarry - [West] Upper Area Bombable Wall", "Ruined Atoll - [Northwest] Bombable Wall"] | 
					
						
							| 
									
										
										
										
											2024-08-16 14:53:54 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-07 19:43:02 -05:00
										 |  |  | def randomize_ability_unlocks(world: "TunicWorld") -> Dict[str, int]: | 
					
						
							|  |  |  |     random = world.random | 
					
						
							|  |  |  |     options = world.options | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     abilities = [prayer, holy_cross, icebolt] | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |     ability_requirement = [1, 1, 1] | 
					
						
							| 
									
										
										
										
											2025-03-07 19:43:02 -05:00
										 |  |  |     random.shuffle(abilities) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if options.hexagon_quest.value and options.hexagon_quest_ability_type == HexagonQuestAbilityUnlockType.option_hexagons: | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |         hexagon_goal = options.hexagon_goal.value | 
					
						
							|  |  |  |         # Set ability unlocks to 25, 50, and 75% of goal amount | 
					
						
							|  |  |  |         ability_requirement = [hexagon_goal // 4, hexagon_goal // 2, hexagon_goal * 3 // 4] | 
					
						
							| 
									
										
										
										
											2025-03-07 19:43:02 -05:00
										 |  |  |         if any(req == 0 for req in ability_requirement): | 
					
						
							|  |  |  |             ability_requirement = [1, 2, 3] | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |     return dict(zip(abilities, ability_requirement)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  | def has_ability(ability: str, state: CollectionState, world: "TunicWorld") -> bool: | 
					
						
							|  |  |  |     options = world.options | 
					
						
							|  |  |  |     ability_unlocks = world.ability_unlocks | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |     if not options.ability_shuffling: | 
					
						
							|  |  |  |         return True | 
					
						
							| 
									
										
										
										
											2025-03-07 19:43:02 -05:00
										 |  |  |     if options.hexagon_quest and options.hexagon_quest_ability_type == HexagonQuestAbilityUnlockType.option_hexagons: | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |         return state.has(gold_hexagon, world.player, ability_unlocks[ability]) | 
					
						
							|  |  |  |     return state.has(ability, world.player) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # a check to see if you can whack things in melee at all | 
					
						
							| 
									
										
										
										
											2024-12-15 16:40:36 -05:00
										 |  |  | def has_melee(state: CollectionState, player: int) -> bool: | 
					
						
							|  |  |  |     return state.has_any({"Stick", "Sword", "Sword Upgrade"}, player) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def has_sword(state: CollectionState, player: int) -> bool: | 
					
						
							|  |  |  |     return state.has("Sword", player) or state.has("Sword Upgrade", player, 2) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  | def laurels_zip(state: CollectionState, world: "TunicWorld") -> bool: | 
					
						
							|  |  |  |     return world.options.laurels_zips and state.has(laurels, world.player) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def has_ice_grapple_logic(long_range: bool, difficulty: IceGrappling, state: CollectionState, world: "TunicWorld") -> bool: | 
					
						
							|  |  |  |     if world.options.ice_grappling < difficulty: | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |         return False | 
					
						
							|  |  |  |     if not long_range: | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |         return state.has_all({ice_dagger, grapple}, world.player) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |     else: | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |         return state.has_all({ice_dagger, fire_wand, grapple}, world.player) and has_ability(icebolt, state, world) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  | def can_ladder_storage(state: CollectionState, world: "TunicWorld") -> bool: | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |     if not world.options.ladder_storage: | 
					
						
							|  |  |  |         return False | 
					
						
							|  |  |  |     if world.options.ladder_storage_without_items: | 
					
						
							|  |  |  |         return True | 
					
						
							| 
									
										
										
										
											2024-12-15 16:40:36 -05:00
										 |  |  |     return has_melee(state, world.player) or state.has_any((grapple, shield), world.player) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  | def has_mask(state: CollectionState, world: "TunicWorld") -> bool: | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |     return world.options.maskless or state.has(mask, world.player) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  | def has_lantern(state: CollectionState, world: "TunicWorld") -> bool: | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |     return world.options.lanternless or state.has(lantern, world.player) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  | def set_region_rules(world: "TunicWorld") -> None: | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |     player = world.player | 
					
						
							|  |  |  |     options = world.options | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     world.get_entrance("Overworld -> Overworld Holy Cross").access_rule = \ | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |         lambda state: has_ability(holy_cross, state, world) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     world.get_entrance("Overworld -> Beneath the Well").access_rule = \ | 
					
						
							| 
									
										
										
										
											2024-12-15 16:40:36 -05:00
										 |  |  |         lambda state: has_melee(state, player) or state.has(fire_wand, player) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     world.get_entrance("Overworld -> Dark Tomb").access_rule = \ | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |         lambda state: has_lantern(state, world) | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |     # laurels in, ladder storage in through the furnace, or ice grapple down the belltower | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     world.get_entrance("Overworld -> West Garden").access_rule = \ | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |         lambda state: (state.has(laurels, player) | 
					
						
							|  |  |  |                        or can_ladder_storage(state, world) | 
					
						
							|  |  |  |                        or has_ice_grapple_logic(False, IceGrappling.option_hard, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     world.get_entrance("Overworld -> Eastern Vault Fortress").access_rule = \ | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |         lambda state: state.has(laurels, player) \ | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |         or has_ice_grapple_logic(True, IceGrappling.option_easy, state, world) \ | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |         or can_ladder_storage(state, world) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |     # using laurels or ls to get in is covered by the -> Eastern Vault Fortress rules | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     world.get_entrance("Overworld -> Beneath the Vault").access_rule = \ | 
					
						
							| 
									
										
										
										
											2024-09-21 17:02:58 -04:00
										 |  |  |         lambda state: (has_lantern(state, world) and has_ability(prayer, state, world) | 
					
						
							|  |  |  |                        # there's some boxes in the way | 
					
						
							| 
									
										
										
										
											2024-12-15 16:40:36 -05:00
										 |  |  |                        and (has_melee(state, player) or state.has_any((gun, grapple, fire_wand), player))) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     world.get_entrance("Ruined Atoll -> Library").access_rule = \ | 
					
						
							| 
									
										
										
										
											2025-03-28 16:12:16 -04:00
										 |  |  |         lambda state: (state.has_any({grapple, laurels}, player) and has_ability(prayer, state, world) | 
					
						
							|  |  |  |                        and (has_sword(state, player) or state.has_any((fire_wand, gun), player))) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     world.get_entrance("Overworld -> Quarry").access_rule = \ | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |         lambda state: (has_sword(state, player) or state.has(fire_wand, player)) \ | 
					
						
							| 
									
										
										
										
											2024-08-16 14:53:54 -04:00
										 |  |  |         and (state.has_any({grapple, laurels, gun}, player) or can_ladder_storage(state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     world.get_entrance("Quarry Back -> Quarry").access_rule = \ | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |         lambda state: has_sword(state, player) or state.has(fire_wand, player) | 
					
						
							| 
									
										
										
										
											2025-02-23 11:02:30 -05:00
										 |  |  |     world.get_entrance("Quarry Back -> Monastery").access_rule = \ | 
					
						
							|  |  |  |         lambda state: state.has(laurels, player) | 
					
						
							|  |  |  |     world.get_entrance("Monastery -> Monastery Back").access_rule = \ | 
					
						
							|  |  |  |         lambda state: (has_sword(state, player) or state.has(fire_wand, player) | 
					
						
							|  |  |  |                        or laurels_zip(state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     world.get_entrance("Quarry -> Lower Quarry").access_rule = \ | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |         lambda state: has_mask(state, world) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     world.get_entrance("Lower Quarry -> Rooted Ziggurat").access_rule = \ | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |         lambda state: state.has(grapple, player) and has_ability(prayer, state, world) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     world.get_entrance("Swamp -> Cathedral").access_rule = \ | 
					
						
							| 
									
										
										
										
											2025-03-28 16:12:16 -04:00
										 |  |  |         lambda state: (state.has(laurels, player) and has_ability(prayer, state, world) and has_sword(state, player)) \ | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |         or has_ice_grapple_logic(False, IceGrappling.option_medium, state, world) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     world.get_entrance("Overworld -> Spirit Arena").access_rule = \ | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |         lambda state: ((state.has(gold_hexagon, player, options.hexagon_goal.value) if options.hexagon_quest.value | 
					
						
							|  |  |  |                        else state.has_all({red_hexagon, green_hexagon, blue_hexagon}, player) | 
					
						
							|  |  |  |                        and state.has_group_unique("Hero Relics", player, 6)) | 
					
						
							|  |  |  |                        and has_ability(prayer, state, world) and has_sword(state, player) | 
					
						
							|  |  |  |                        and state.has_any({lantern, laurels}, player)) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |     world.get_region("Quarry").connect(world.get_region("Rooted Ziggurat"), | 
					
						
							|  |  |  |                                        rule=lambda state: has_ice_grapple_logic(True, IceGrappling.option_hard, state, world) | 
					
						
							|  |  |  |                                        and has_ability(prayer, state, world)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if options.ladder_storage >= LadderStorage.option_medium: | 
					
						
							|  |  |  |         # ls at any ladder in a safe spot in quarry to get to the monastery rope entrance | 
					
						
							| 
									
										
											  
											
												TUNIC: Entrance rando Direction Pairs + Decoupled (#3761)
* Fix merge conflict
* Fix formatting, fix rule for heir access after merge
* Writing combat logic helpers
* More helpers!
* More logic!
* Rename has_stick to has_melee, some fixes per Medic's review
* Clamp max power from sword upgrades
* Wrote the rest of the helpers
* Remove unused import
* Apply item classifications
* Create the combat logic option
* Item classification varies based on option
* Add the shop sword logic stuff in
* Add the rules for the boss-only option
* Fix tiny issues
* Some early Overworld combat logic
* Fill out swamp combat logic
* Add note
* Bump up Boss Scav and Heir
* More revisions to combat logic
* Some changes, currently broken
* New system for power, kinda jank probably
* Revisions to new system, needs more balancing
* Cap attack upgrades
* Uncap mp power since it's directly related to damage output
* Voidlings
* Put together a table showing the vanilla-expected stats for each area
* Added some info on potion counts
* Made new helper functions
* Make has_required_stats
* Make has_combat_reqs
* Update er_rules for new combat reqs
* Fix all the broken things ever
* Remove outdated todo
* Make temp option for testing logic
* More flexible choices for combat items
* Hard require sword for bosses
* Temporarily default combat logic to on
* Finish writing overworld combat logic
* East Forest combat logic done
* Remove a few easy ones
* Finish beneath the well
* Dark Tomb combat logic
* West Garden combat logic
* make unit tests checkmark again
* Weird west garden dagger house edge case
* Try block for that weird west garden edge case
* Add quarry combat logic
* Update to filter out unreachable regions outside of ER
* Fortress Grave Path logic, and a couple fixes to the west garden logic
* Fortress east shortcut logic, and rewriting the try except blocks to use finally
* Refactor to use a new function cause wow there was a lot of repeated code
* Add combat logic to the other two sets of fortress fuses
* Add combat rules to beneath the vault
* Fix missing cathedral -> elevator connection
* Combat logic for cathedral to elevator
* Add cathedral main region, rename cathedral -> cathedral entry
* Setup cathedral combat logic
* Adjust locations' regions for ER
* Add laurels zip logic to the chest in the spike room in cathedral
* Add combat logic to frog's domain
* Move frog's domain locations to regions for combat logic
* Add new frog's domain regions for combat logic
* Update region name for frog's domain
* Fix typo
* Add more regions for lower zig
* Move around lower zig regions for combat logic
* Lower Zig combat logic
* Upper zig combat logic
* Fix typo
* Fix typos
* Fix missing world.
* Update combat logic description
* Add todo
* Add todo
* Don't make zig skip if er or fixed shop is off
* Make it so zig skip is only made with fewer shops and er
* Temporarily default combat logic on
* Update test to explicitly disable combat logic
* Update test_access.py
* Slight wording changes
* Fix bugs, refactor quarry regions so you can access chests in lower quarry with ice grapples
* Run through checks you can do with magic dagger
* Run through checks you can do with magic dagger
* Add rule for entering town portal of having equipment to deal with enemies
* Add rule for atoll near the 6 crabs surrounding a poor defenseless baby slorm
* Update the rule for the chest near the 6 crabs surrounding a slorm to also possibly require laurels
* Revamp combat logic function to work properly without melee
* Add laurels rules to combat logic chests
* Modify beneath the vault bridge rule to need a lantern if combat logic is on
* Put in money logic
* Dagger or combat for swamp big skeleton chest
* Remove the 100 moneys from logic
* Modify lower zig ls drop region destinations
* Remove completed todo
* Reword combat logic option description, remove test option
* Add combat logic to slot data
* Merge Silent's missing slot data bugfix PR #3628
* Remove test combat option
* Update combat logic description
* Fix secret gathering place issue
* Fix secret gathering place issue
* Fix lower zig ls rule
* Fix accidentally removed librarian rule
* Remove redundant rule
* Update gauntlet rule to hard-require a sword
* Add test for a problematic connection
* Adjust combat logic to deal with weird edge cases so it doesn't take stuff out of logic that was previously in logic
* Fix create_item classification
* Update some comments
* Update per exempt's suggestion
* Add combat logic to the well boss fight, reorder the combat logic stuff a little to better section them off
* Add EntranceLayout option
* Add back LogicRules as an invisible option, to not break old yamls
* Fix a bug with seed group, continue changing fixed shop to entrance layout
* Fix missed fixed shop -> entrance layout spot
* Fix bug in seed groups with fixed shop on and off
* Add entrance layout to the UT regen stuff
* Put direction. in, will add them later
* Remove unused elevation from portal class
* Got like half of them in
* Finish adding all of the directions
* Add combat rule for zig front to back
* Update per Medic's suggestion
* Update ladder storage without items option description
* Mess with state with collect and remove to save like 2 seconds (never again)
* Save even more time, still never going to do this again on anything else
* Add option check for collect and remove
* Add directions to shop portals
* Update direction in Portal with default
* Move Direction above Portal
* Add decoupled option, mess with plando connection stuff
* Merge, implement verify plando directions
* Condense the stuff in change and remove to less lines (thanks medic)
* Remove unused thing
* Swap to using logicmixin instead of prog_items (thanks Vi)
* Fix consistency in stat counters
* Add back something that was needed
* Fix mistake when adding back
* Making the fix better (thanks medic)
* Make it actually return false if it gets to the backup lists and fails them
* Fix stuff after merge
* Add outlet regions, create new regions as needed for them
* Put together part of decoupled and direction pairs
* make direction pairs work
* Make decoupled work
* Make fixed shop work again
* Fix a few minor bugs
* Fix a few minor bugs
* Fix plando
* god i love programming
* Reorder portal list
* Update portal sorter for variable shops
* Add missing parameter
* Some cleanup of prints and functions
* Fix typo
* it's aliiiiiive
* Make seed groups not sync decoupled
* Add test with full-shop plando
* Fix bug with vanilla portals
* Handle plando connections and direction pair errors
* Update plando checking for decoupled
* Fix typo
* Fix exception text to be shorter
* Add some more comments
* Add todo note
* Remove unused safety thing
* Remove extra plando connections definition in options
* Make seed groups in decoupled with overlapping but not fully overlapped plando connections interact nicely without messing with what the entrances look like in the spoiler log
* Fix weird edge case that is technically user error
* Add note to fixed shop
* Fix parsing shop names in UT
* Remove debug print
* Actually make UT work
* multiworld. to world.
* Fix typo from merge
* Make it so the shops show up in the entrance hints
* Fix bug in ladder storage rules
* Remove blank line
* # Conflicts:
#	worlds/tunic/__init__.py
#	worlds/tunic/er_data.py
#	worlds/tunic/er_rules.py
#	worlds/tunic/er_scripts.py
#	worlds/tunic/rules.py
#	worlds/tunic/test/test_access.py
* Fix issues after merge
* Update plando connections stuff in docs
* Fix library mistake
* has_stick -> has_melee
* has_stick -> has_melee
* Add a failsafe for direction pairing
* Fix playthrough crash bug
* Remove init from logicmixin
* Updates per code review (thanks hesto)
* has_stick to has_melee in newer update
* has_stick to has_melee in newer update
* # Conflicts:
#	worlds/tunic/__init__.py
#	worlds/tunic/combat_logic.py
#	worlds/tunic/er_data.py
#	worlds/tunic/er_rules.py
#	worlds/tunic/er_scripts.py
* Cleanup more stuff after merge
* Revert "Cleanup more stuff after merge"
This reverts commit a6ee9a93da8f2fcc4413de6df6927b246017889d.
* Revert "# Conflicts:"
This reverts commit c74ccd74a45b6ad6b9abe6e339d115a0c98baf30.
* Cleanup more stuff after merge
* Swap to .get for decoupled so it works with older games probably maybe
* Fix after merge
* Fix typo
* Fix UT support with fixed shop option
* Backport plando connections fix
* Fix issue with fixed shop + decoupled
* Make the error not duplicate the while loop condition
* Fix rule for quarry back to monastery
* Fix more stuff after merge
* Make it not output anything if you set plando connections but not ER
* Add obvious note to plando connections description
* Fix after merge
* add comment to commented out connection
---------
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
											
										 
											2025-05-06 12:33:21 -04:00
										 |  |  |         add_rule(world.get_entrance(entrance_name="Quarry Back -> Monastery"), | 
					
						
							|  |  |  |                  rule=lambda state: can_ladder_storage(state, world)) | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  | def set_location_rules(world: "TunicWorld") -> None: | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |     player = world.player | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     forbid_item(world.get_location("Secret Gathering Place - 20 Fairy Reward"), fairies, player) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # Ability Shuffle Exclusive Rules | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Far Shore - Page Pickup"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(prayer, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Fortress Courtyard - Chest Near Cave"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(prayer, state, world) | 
					
						
							|  |  |  |              or state.has(laurels, player) | 
					
						
							|  |  |  |              or can_ladder_storage(state, world) | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              or (has_ice_grapple_logic(True, IceGrappling.option_easy, state, world) | 
					
						
							|  |  |  |                  and has_lantern(state, world))) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Fortress Courtyard - Page Near Cave"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(prayer, state, world) or state.has(laurels, player) | 
					
						
							|  |  |  |              or can_ladder_storage(state, world) | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              or (has_ice_grapple_logic(True, IceGrappling.option_easy, state, world) | 
					
						
							|  |  |  |                  and has_lantern(state, world))) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("East Forest - Dancing Fox Spirit Holy Cross"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(holy_cross, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Forest Grave Path - Holy Cross Code by Grave"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(holy_cross, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("East Forest - Golden Obelisk Holy Cross"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(holy_cross, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Beneath the Well - [Powered Secret Room] Chest"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(prayer, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("West Garden - [North] Behind Holy Cross Door"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(holy_cross, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Library Hall - Holy Cross Chest"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(holy_cross, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Eastern Vault Fortress - [West Wing] Candles Holy Cross"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(holy_cross, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("West Garden - [Central Highlands] Holy Cross (Blue Lines)"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(holy_cross, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Quarry - [Back Entrance] Bushes Holy Cross"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(holy_cross, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Cathedral - Secret Legend Trophy Chest"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(holy_cross, state, world)) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # Overworld | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Overworld - [Southwest] Fountain Page"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Overworld - [Southwest] Grapple Chest Over Walkway"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has_any({grapple, laurels}, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Overworld - [Southwest] West Beach Guarded By Turret 2"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has_any({grapple, laurels}, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Far Shore - Secret Chest"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: state.has(laurels, player) and has_ability(prayer, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Overworld - [Southeast] Page on Pillar by Swamp"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Old House - Normal Chest"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(house_key, player) | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              or has_ice_grapple_logic(False, IceGrappling.option_medium, state, world) | 
					
						
							|  |  |  |              or laurels_zip(state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Old House - Holy Cross Chest"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(holy_cross, state, world) and ( | 
					
						
							|  |  |  |                      state.has(house_key, player) | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |                      or has_ice_grapple_logic(False, IceGrappling.option_medium, state, world) | 
					
						
							|  |  |  |                      or laurels_zip(state, world))) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Old House - Shield Pickup"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(house_key, player) | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              or has_ice_grapple_logic(False, IceGrappling.option_medium, state, world) | 
					
						
							|  |  |  |              or laurels_zip(state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Overworld - [Northwest] Page on Pillar by Dark Tomb"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Overworld - [Southwest] From West Garden"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Overworld - [West] Chest After Bell"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player) | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              or (has_lantern(state, world) and has_sword(state, player)) | 
					
						
							|  |  |  |              or can_ladder_storage(state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Overworld - [Northwest] Chest Beneath Quarry Gate"), | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              lambda state: state.has_any({grapple, laurels}, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Overworld - [East] Grapple Chest"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(grapple, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Special Shop - Secret Page Pickup"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Sealed Temple - Holy Cross Chest"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_ability(holy_cross, state, world) | 
					
						
							|  |  |  |              and (state.has(laurels, player) or (has_lantern(state, world) and (has_sword(state, player) | 
					
						
							|  |  |  |                                                                                 or state.has(fire_wand, player))) | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |                   or has_ice_grapple_logic(False, IceGrappling.option_medium, state, world))) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Sealed Temple - Page Pickup"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player) | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              or (has_lantern(state, world) and (has_sword(state, player) or state.has(fire_wand, player))) | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              or has_ice_grapple_logic(False, IceGrappling.option_medium, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("West Furnace - Lantern Pickup"), | 
					
						
							| 
									
										
										
										
											2024-12-15 16:40:36 -05:00
										 |  |  |              lambda state: has_melee(state, player) or state.has_any({fire_wand, laurels}, player)) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Secret Gathering Place - 10 Fairy Reward"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(fairies, player, 10)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Secret Gathering Place - 20 Fairy Reward"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(fairies, player, 20)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Coins in the Well - 3 Coins"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(coins, player, 3)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Coins in the Well - 6 Coins"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(coins, player, 6)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Coins in the Well - 10 Coins"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(coins, player, 10)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Coins in the Well - 15 Coins"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(coins, player, 15)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # East Forest | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("East Forest - Lower Grapple Chest"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(grapple, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("East Forest - Lower Dash Chest"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has_all({grapple, laurels}, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("East Forest - Ice Rod Grapple Chest"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has_all({grapple, ice_dagger, fire_wand}, player) | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              and has_ability(icebolt, state, world)) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # West Garden | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("West Garden - [North] Across From Page Pickup"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("West Garden - [West] In Flooded Walkway"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("West Garden - [West Lowlands] Tree Holy Cross Chest"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: state.has(laurels, player) and has_ability(holy_cross, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("West Garden - [East Lowlands] Page Behind Ice Dagger House"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: (state.has(laurels, player) and has_ability(prayer, state, world)) | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              or has_ice_grapple_logic(True, IceGrappling.option_easy, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("West Garden - [Central Lowlands] Below Left Walkway"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("West Garden - [Central Highlands] After Garden Knight"), | 
					
						
							| 
									
										
										
										
											2024-03-21 11:50:07 -04:00
										 |  |  |              lambda state: state.has(laurels, player) | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              or (has_lantern(state, world) and has_sword(state, player)) | 
					
						
							|  |  |  |              or can_ladder_storage(state, world)) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # Ruined Atoll | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Ruined Atoll - [West] Near Kevin Block"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player)) | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |     # ice grapple push a crab through the door | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Ruined Atoll - [East] Locked Room Lower Chest"), | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              lambda state: state.has(laurels, player) or state.has(key, player, 2) | 
					
						
							|  |  |  |              or has_ice_grapple_logic(False, IceGrappling.option_medium, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Ruined Atoll - [East] Locked Room Upper Chest"), | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              lambda state: state.has(laurels, player) or state.has(key, player, 2) | 
					
						
							|  |  |  |              or has_ice_grapple_logic(False, IceGrappling.option_medium, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Librarian - Hexagon Green"), | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              lambda state: has_sword(state, player)) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # Frog's Domain | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Frog's Domain - Side Room Grapple Secret"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has_any({grapple, laurels}, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Frog's Domain - Grapple Above Hot Tub"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has_any({grapple, laurels}, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Frog's Domain - Escape Chest"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has_any({grapple, laurels}, player)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-17 17:57:55 -04:00
										 |  |  |     # Library Lab | 
					
						
							|  |  |  |     set_rule(world.get_location("Library Lab - Page 1"), | 
					
						
							| 
									
										
										
										
											2024-12-15 16:40:36 -05:00
										 |  |  |              lambda state: has_melee(state, player) or state.has_any((fire_wand, gun), player)) | 
					
						
							| 
									
										
										
										
											2024-09-17 17:57:55 -04:00
										 |  |  |     set_rule(world.get_location("Library Lab - Page 2"), | 
					
						
							| 
									
										
										
										
											2024-12-15 16:40:36 -05:00
										 |  |  |              lambda state: has_melee(state, player) or state.has_any((fire_wand, gun), player)) | 
					
						
							| 
									
										
										
										
											2024-09-17 17:57:55 -04:00
										 |  |  |     set_rule(world.get_location("Library Lab - Page 3"), | 
					
						
							| 
									
										
										
										
											2024-12-15 16:40:36 -05:00
										 |  |  |              lambda state: has_melee(state, player) or state.has_any((fire_wand, gun), player)) | 
					
						
							| 
									
										
										
										
											2024-09-17 17:57:55 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |     # Eastern Vault Fortress | 
					
						
							| 
									
										
										
										
											2024-09-17 17:57:55 -04:00
										 |  |  |     # yes, you can clear the leaves with dagger | 
					
						
							|  |  |  |     # gun isn't included since it can only break one leaf pile at a time, and we don't check how much mana you have | 
					
						
							|  |  |  |     # but really, I expect the player to just throw a bomb at them if they don't have melee | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Fortress Leaf Piles - Secret Chest"), | 
					
						
							| 
									
										
										
										
											2024-12-15 16:40:36 -05:00
										 |  |  |              lambda state: state.has(laurels, player) and (has_melee(state, player) or state.has(ice_dagger, player))) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Fortress Arena - Siege Engine/Vault Key Pickup"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: has_sword(state, player) | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              and (has_ability(prayer, state, world) | 
					
						
							|  |  |  |                   or has_ice_grapple_logic(False, IceGrappling.option_medium, state, world))) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Fortress Arena - Hexagon Red"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: state.has(vault_key, player) | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              and (has_ability(prayer, state, world) | 
					
						
							|  |  |  |                   or has_ice_grapple_logic(False, IceGrappling.option_medium, state, world))) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # Beneath the Vault | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Beneath the Fortress - Bridge"), | 
					
						
							| 
									
										
										
										
											2025-03-05 18:18:27 -05:00
										 |  |  |              lambda state: has_lantern(state, world) and | 
					
						
							|  |  |  |                            (has_melee(state, player) or state.has_any((laurels, fire_wand, ice_dagger, gun), player))) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Beneath the Fortress - Obscured Behind Waterfall"), | 
					
						
							| 
									
										
										
										
											2024-12-15 16:40:36 -05:00
										 |  |  |              lambda state: has_melee(state, player) and has_lantern(state, world)) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # Quarry | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Quarry - [Central] Above Ladder Dash Chest"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Rooted Ziggurat Upper - Near Bridge Switch"), | 
					
						
							| 
									
										
										
										
											2024-06-27 08:01:35 -04:00
										 |  |  |              lambda state: has_sword(state, player) or state.has_all({fire_wand, laurels}, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Rooted Ziggurat Lower - Hexagon Blue"), | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              lambda state: has_sword(state, player)) | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # Swamp | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Cathedral Gauntlet - Gauntlet Reward"), | 
					
						
							| 
									
										
										
										
											2024-06-04 15:14:29 -04:00
										 |  |  |              lambda state: (state.has(fire_wand, player) and has_sword(state, player)) | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              and (state.has(laurels, player)  | 
					
						
							|  |  |  |                   or has_ice_grapple_logic(False, IceGrappling.option_medium, state, world))) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Swamp - [Entrance] Above Entryway"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Swamp - [South Graveyard] Upper Walkway Dash Chest"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Swamp - [Outside Cathedral] Obscured Behind Memorial"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: state.has(laurels, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Swamp - [South Graveyard] 4 Orange Skulls"), | 
					
						
							| 
									
										
										
										
											2024-01-12 14:32:15 -05:00
										 |  |  |              lambda state: has_sword(state, player)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Hero's Grave | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Hero's Grave - Tooth Relic"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: state.has(laurels, player) and has_ability(prayer, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Hero's Grave - Mushroom Relic"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: state.has(laurels, player) and has_ability(prayer, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Hero's Grave - Ash Relic"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: state.has(laurels, player) and has_ability(prayer, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Hero's Grave - Flowers Relic"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: state.has(laurels, player) and has_ability(prayer, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Hero's Grave - Effigy Relic"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: state.has(laurels, player) and has_ability(prayer, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Hero's Grave - Feathers Relic"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:50:12 -04:00
										 |  |  |              lambda state: state.has(laurels, player) and has_ability(prayer, state, world)) | 
					
						
							| 
									
										
										
										
											2024-07-05 16:36:55 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 14:53:54 -04:00
										 |  |  |     # Bombable Walls | 
					
						
							|  |  |  |     for location_name in bomb_walls: | 
					
						
							|  |  |  |         # has_sword is there because you can buy bombs in the shop | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |         set_rule(world.get_location(location_name), | 
					
						
							|  |  |  |                  lambda state: state.has(gun, player) | 
					
						
							|  |  |  |                  or has_sword(state, player) | 
					
						
							|  |  |  |                  or has_ice_grapple_logic(False, IceGrappling.option_hard, state, world)) | 
					
						
							| 
									
										
										
										
											2024-08-16 14:53:54 -04:00
										 |  |  |     add_rule(world.get_location("Cube Cave - Holy Cross Chest"), | 
					
						
							| 
									
										
										
										
											2024-09-08 08:42:59 -04:00
										 |  |  |              lambda state: state.has(gun, player) | 
					
						
							|  |  |  |              or has_sword(state, player) | 
					
						
							|  |  |  |              or has_ice_grapple_logic(False, IceGrappling.option_hard, state, world)) | 
					
						
							|  |  |  |     # can't ice grapple to this one, not enough space | 
					
						
							|  |  |  |     set_rule(world.get_location("Quarry - [East] Bombable Wall"), | 
					
						
							| 
									
										
										
										
											2024-08-16 14:53:54 -04:00
										 |  |  |              lambda state: state.has(gun, player) or has_sword(state, player)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-05 16:36:55 -04:00
										 |  |  |     # Shop | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Shop - Potion 1"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:36:55 -04:00
										 |  |  |              lambda state: has_sword(state, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Shop - Potion 2"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:36:55 -04:00
										 |  |  |              lambda state: has_sword(state, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Shop - Coin 1"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:36:55 -04:00
										 |  |  |              lambda state: has_sword(state, player)) | 
					
						
							| 
									
										
										
										
											2024-08-13 20:35:08 -04:00
										 |  |  |     set_rule(world.get_location("Shop - Coin 2"), | 
					
						
							| 
									
										
										
										
											2024-07-05 16:36:55 -04:00
										 |  |  |              lambda state: has_sword(state, player)) |