Skip to content

Commit

Permalink
TUNIC: Implement support for connection plando (ArchipelagoMW#2864)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScipioWright authored and EmilyV99 committed Apr 15, 2024
1 parent 86c7cc6 commit 2757fc9
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 121 deletions.
2 changes: 1 addition & 1 deletion worlds/tunic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def fill_slot_data(self) -> Dict[str, Any]:
"logic_rules": self.options.logic_rules.value,
"lanternless": self.options.lanternless.value,
"maskless": self.options.maskless.value,
"entrance_rando": self.options.entrance_rando.value,
"entrance_rando": bool(self.options.entrance_rando.value),
"Hexagon Quest Prayer": self.ability_unlocks["Pages 24-25 (Prayer)"],
"Hexagon Quest Holy Cross": self.ability_unlocks["Pages 42-43 (Holy Cross)"],
"Hexagon Quest Icebolt": self.ability_unlocks["Pages 52-53 (Icebolt)"],
Expand Down
20 changes: 19 additions & 1 deletion worlds/tunic/docs/en_TUNIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,22 @@ For the Entrance Randomizer:
Bombs, consumables (non-bomb ones), weapons, melee weapons (stick and sword), keys, hexagons, offerings, hero relics, cards, golden treasures, money, pages, and abilities (the three ability pages). There are also a few groups being used for singular items: laurels, orb, dagger, magic rod, holy cross, prayer, icebolt, and progressive sword.

## What location groups are there?
Holy cross (for all holy cross checks), fairies (for the two fairy checks), well (for the coin well checks), and shop. Additionally, for checks that do not fall into the above categories, the name of the region is the name of the location group.
Holy cross (for all holy cross checks), fairies (for the two fairy checks), well (for the coin well checks), and shop. Additionally, for checks that do not fall into the above categories, the name of the region is the name of the location group.

## Is Connection Plando supported?
Yes. The host needs to enable it in their `host.yaml`, and the player's yaml needs to contain a plando_connections block.
Example:
```
plando_connections:
- entrance: Stick House Entrance
exit: Stick House Exit
- entrance: Special Shop Exit
exit: Stairs to Top of the Mountain
```
Notes:
- The Entrance Randomizer option must be enabled for it to work.
- The `direction` field is not supported. Connections are always coupled.
- For a list of entrance names, check `er_data.py` in the TUNIC world folder or generate a game with the Entrance Randomizer option enabled and check the spoiler log.
- There is no limit to the number of Shops hard-coded into place.
- If you have more than one shop in a scene, you may be wrong warped when exiting a shop.
- If you have a shop in every scene, and you have an odd number of shops, it will error out.
6 changes: 0 additions & 6 deletions worlds/tunic/er_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,12 +682,6 @@ class Hint(IntEnum):
"Hero Relic - Library": RegionInfo("RelicVoid", dead_end=DeadEnd.all_cats, hint=Hint.region),
"Hero Relic - Swamp": RegionInfo("RelicVoid", dead_end=DeadEnd.all_cats, hint=Hint.region),
"Purgatory": RegionInfo("Purgatory"),
"Shop Entrance 1": RegionInfo("Shop", dead_end=DeadEnd.all_cats),
"Shop Entrance 2": RegionInfo("Shop", dead_end=DeadEnd.all_cats),
"Shop Entrance 3": RegionInfo("Shop", dead_end=DeadEnd.all_cats),
"Shop Entrance 4": RegionInfo("Shop", dead_end=DeadEnd.all_cats),
"Shop Entrance 5": RegionInfo("Shop", dead_end=DeadEnd.all_cats),
"Shop Entrance 6": RegionInfo("Shop", dead_end=DeadEnd.all_cats),
"Shop": RegionInfo("Shop", dead_end=DeadEnd.all_cats),
"Spirit Arena": RegionInfo("Spirit Arena", dead_end=DeadEnd.all_cats, hint=Hint.region),
"Spirit Arena Victory": RegionInfo("Spirit Arena", dead_end=DeadEnd.all_cats)
Expand Down
13 changes: 0 additions & 13 deletions worlds/tunic/er_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,19 +619,6 @@ def set_er_region_rules(world: "TunicWorld", ability_unlocks: Dict[str, int], re
connecting_region=regions["Far Shore"])

# Misc
regions["Shop Entrance 1"].connect(
connecting_region=regions["Shop"])
regions["Shop Entrance 2"].connect(
connecting_region=regions["Shop"])
regions["Shop Entrance 3"].connect(
connecting_region=regions["Shop"])
regions["Shop Entrance 4"].connect(
connecting_region=regions["Shop"])
regions["Shop Entrance 5"].connect(
connecting_region=regions["Shop"])
regions["Shop Entrance 6"].connect(
connecting_region=regions["Shop"])

regions["Spirit Arena"].connect(
connecting_region=regions["Spirit Arena Victory"],
rule=lambda state: (state.has(gold_hexagon, player, world.options.hexagon_goal.value) if
Expand Down
Loading

0 comments on commit 2757fc9

Please sign in to comment.