Skip to content

Commit

Permalink
TUNIC: Swap from multiworld.get to world.get for applicable things (#…
Browse files Browse the repository at this point in the history
…3789)

* Swap from multiworld.get to world.get for applicable things

* Why was this even here in the first place?
  • Loading branch information
ScipioWright authored Aug 14, 2024
1 parent 169da1b commit 0af31c7
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 196 deletions.
23 changes: 10 additions & 13 deletions worlds/tunic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ def stage_generate_early(cls, multiworld: MultiWorld) -> None:
if is_mismatched:
raise Exception(f"TUNIC: Conflict between seed group {group}'s plando "
f"connection {group_cxn.entrance} <-> {group_cxn.exit} and "
f"{tunic.multiworld.get_player_name(tunic.player)}'s plando "
f"connection {cxn.entrance} <-> {cxn.exit}")
f"{tunic.player_name}'s plando connection {cxn.entrance} <-> {cxn.exit}")
if new_cxn:
cls.seed_groups[group]["plando"].value.append(cxn)

Expand Down Expand Up @@ -187,17 +186,17 @@ def create_items(self) -> None:
if self.options.laurels_location:
laurels = self.create_item("Hero's Laurels")
if self.options.laurels_location == "6_coins":
self.multiworld.get_location("Coins in the Well - 6 Coins", self.player).place_locked_item(laurels)
self.get_location("Coins in the Well - 6 Coins").place_locked_item(laurels)
elif self.options.laurels_location == "10_coins":
self.multiworld.get_location("Coins in the Well - 10 Coins", self.player).place_locked_item(laurels)
self.get_location("Coins in the Well - 10 Coins").place_locked_item(laurels)
elif self.options.laurels_location == "10_fairies":
self.multiworld.get_location("Secret Gathering Place - 10 Fairy Reward", self.player).place_locked_item(laurels)
self.get_location("Secret Gathering Place - 10 Fairy Reward").place_locked_item(laurels)
items_to_create["Hero's Laurels"] = 0

if self.options.keys_behind_bosses:
for rgb_hexagon, location in hexagon_locations.items():
hex_item = self.create_item(gold_hexagon if self.options.hexagon_quest else rgb_hexagon)
self.multiworld.get_location(location, self.player).place_locked_item(hex_item)
self.get_location(location).place_locked_item(hex_item)
items_to_create[rgb_hexagon] = 0
items_to_create[gold_hexagon] -= 3

Expand Down Expand Up @@ -297,15 +296,15 @@ def create_regions(self) -> None:
self.multiworld.regions.append(region)

for region_name, exits in tunic_regions.items():
region = self.multiworld.get_region(region_name, self.player)
region = self.get_region(region_name)
region.add_exits(exits)

for location_name, location_id in self.location_name_to_id.items():
region = self.multiworld.get_region(location_table[location_name].region, self.player)
region = self.get_region(location_table[location_name].region)
location = TunicLocation(self.player, location_name, location_id, region)
region.locations.append(location)

victory_region = self.multiworld.get_region("Spirit Arena", self.player)
victory_region = self.get_region("Spirit Arena")
victory_location = TunicLocation(self.player, "The Heir", None, victory_region)
victory_location.place_locked_item(TunicItem("Victory", ItemClassification.progression, None, self.player))
self.multiworld.completion_condition[self.player] = lambda state: state.has("Victory", self.player)
Expand Down Expand Up @@ -339,10 +338,8 @@ def extend_hint_information(self, hint_data: Dict[int, Dict[int, str]]) -> None:
name, connection = paths[location.parent_region]
except KeyError:
# logic bug, proceed with warning since it takes a long time to update AP
warning(f"{location.name} is not logically accessible for "
f"{self.multiworld.get_file_safe_player_name(self.player)}. "
"Creating entrance hint Inaccessible. "
"Please report this to the TUNIC rando devs.")
warning(f"{location.name} is not logically accessible for {self.player_name}. "
"Creating entrance hint Inaccessible. Please report this to the TUNIC rando devs.")
hint_text = "Inaccessible"
else:
while connection != ("Menu", None):
Expand Down
Loading

0 comments on commit 0af31c7

Please sign in to comment.