Pokémon R/B: Fix broken options (#2162)

This commit is contained in:
Alchav
2023-09-10 17:38:56 -04:00
committed by GitHub
parent 5eef7a34d3
commit 0e21a3e121
3 changed files with 15 additions and 14 deletions

View File

@@ -238,18 +238,19 @@ def generate_output(self, output_directory: str):
data[address] = 0 if "Elevator" in connected_map_name else warp_to_ids[i]
data[address + 1] = map_ids[connected_map_name]
for i, gym_leader in enumerate(("Pewter Gym - Brock TM", "Cerulean Gym - Misty TM",
"Vermilion Gym - Lt. Surge TM", "Celadon Gym - Erika TM",
"Fuchsia Gym - Koga TM", "Saffron Gym - Sabrina TM",
"Cinnabar Gym - Blaine TM", "Viridian Gym - Giovanni TM")):
item_name = self.multiworld.get_location(gym_leader, self.player).item.name
if item_name.startswith("TM"):
try:
tm = int(item_name[2:4])
move = poke_data.moves[self.local_tms[tm - 1]]["id"]
data[rom_addresses["Gym_Leader_Moves"] + (2 * i)] = move
except KeyError:
pass
if not self.multiworld.key_items_only[self.player]:
for i, gym_leader in enumerate(("Pewter Gym - Brock TM", "Cerulean Gym - Misty TM",
"Vermilion Gym - Lt. Surge TM", "Celadon Gym - Erika TM",
"Fuchsia Gym - Koga TM", "Saffron Gym - Sabrina TM",
"Cinnabar Gym - Blaine TM", "Viridian Gym - Giovanni TM")):
item_name = self.multiworld.get_location(gym_leader, self.player).item.name
if item_name.startswith("TM"):
try:
tm = int(item_name[2:4])
move = poke_data.moves[self.local_tms[tm - 1]]["id"]
data[rom_addresses["Gym_Leader_Moves"] + (2 * i)] = move
except KeyError:
pass
def set_trade_mon(address, loc):
mon = self.multiworld.get_location(loc, self.player).item.name