diff --git a/AdventureClient.py b/AdventureClient.py index 206c55df9abd..24c6a4c4fc58 100644 --- a/AdventureClient.py +++ b/AdventureClient.py @@ -112,7 +112,7 @@ def on_package(self, cmd: str, args: dict): if ': !' not in msg: self._set_message(msg, SYSTEM_MESSAGE_ID) elif cmd == "ReceivedItems": - msg = f"Received {', '.join([self.item_names.lookup_in_slot(item.item) for item in args['items']])}" + msg = f"Received {', '.join([self.item_names.lookup_in_game(item.item) for item in args['items']])}" self._set_message(msg, SYSTEM_MESSAGE_ID) elif cmd == "Retrieved": if f"adventure_{self.auth}_freeincarnates_used" in args["keys"]: diff --git a/CommonClient.py b/CommonClient.py index 8f1e64c0591b..19dd44f592a4 100644 --- a/CommonClient.py +++ b/CommonClient.py @@ -225,6 +225,9 @@ def lookup_in_game(self, code: int, game_name: typing.Optional[str] = None) -> s def lookup_in_slot(self, code: int, slot: typing.Optional[int] = None) -> str: """Returns the name for an item/location id in the context of a specific slot or own slot if `slot` is omitted. + + Use of `lookup_in_slot` should not be used when not connected to a server. If looking in own game, set + `ctx.game` and use `lookup_in_game` method instead. """ if slot is None: slot = self.ctx.slot diff --git a/Generate.py b/Generate.py index 1fbb9e76a483..d7dd6523e7f1 100644 --- a/Generate.py +++ b/Generate.py @@ -65,7 +65,7 @@ def get_seed_name(random_source) -> str: return f"{random_source.randint(0, pow(10, seeddigits) - 1)}".zfill(seeddigits) -def main(args=None): +def main(args=None) -> Tuple[argparse.Namespace, int]: # __name__ == "__main__" check so unittests that already imported worlds don't trip this. if __name__ == "__main__" and "worlds" in sys.modules: raise Exception("Worlds system should not be loaded before logging init.") @@ -237,8 +237,7 @@ def main(args=None): with open(os.path.join(args.outputpath if args.outputpath else ".", f"generate_{seed_name}.yaml"), "wt") as f: yaml.dump(important, f) - from Main import main as ERmain - return ERmain(erargs, seed) + return erargs, seed def read_weights_yamls(path) -> Tuple[Any, ...]: @@ -547,7 +546,9 @@ def roll_alttp_settings(ret: argparse.Namespace, weights): if __name__ == '__main__': import atexit confirmation = atexit.register(input, "Press enter to close.") - multiworld = main() + erargs, seed = main() + from Main import main as ERmain + multiworld = ERmain(erargs, seed) if __debug__: import gc import sys diff --git a/UndertaleClient.py b/UndertaleClient.py index cdc21c561ab8..415d7e7f21a3 100644 --- a/UndertaleClient.py +++ b/UndertaleClient.py @@ -247,8 +247,8 @@ async def process_undertale_cmd(ctx: UndertaleContext, cmd: str, args: dict): with open(os.path.join(ctx.save_game_folder, filename), "w") as f: toDraw = "" for i in range(20): - if i < len(str(ctx.item_names.lookup_in_slot(l.item))): - toDraw += str(ctx.item_names.lookup_in_slot(l.item))[i] + if i < len(str(ctx.item_names.lookup_in_game(l.item))): + toDraw += str(ctx.item_names.lookup_in_game(l.item))[i] else: break f.write(toDraw) diff --git a/WargrooveClient.py b/WargrooveClient.py index c5fdeb3532f5..39da044d659c 100644 --- a/WargrooveClient.py +++ b/WargrooveClient.py @@ -176,7 +176,7 @@ def on_package(self, cmd: str, args: dict): if not os.path.isfile(path): open(path, 'w').close() # Announcing commander unlocks - item_name = self.item_names.lookup_in_slot(network_item.item) + item_name = self.item_names.lookup_in_game(network_item.item) if item_name in faction_table.keys(): for commander in faction_table[item_name]: logger.info(f"{commander.name} has been unlocked!") @@ -197,7 +197,7 @@ def on_package(self, cmd: str, args: dict): open(print_path, 'w').close() with open(print_path, 'w') as f: f.write("Received " + - self.item_names.lookup_in_slot(network_item.item) + + self.item_names.lookup_in_game(network_item.item) + " from " + self.player_names[network_item.player]) f.close() @@ -342,7 +342,7 @@ def update_commander_data(self): faction_items = 0 faction_item_names = [faction + ' Commanders' for faction in faction_table.keys()] for network_item in self.items_received: - if self.item_names.lookup_in_slot(network_item.item) in faction_item_names: + if self.item_names.lookup_in_game(network_item.item) in faction_item_names: faction_items += 1 starting_groove = (faction_items - 1) * self.starting_groove_multiplier # Must be an integer larger than 0 diff --git a/Zelda1Client.py b/Zelda1Client.py index 6d7af0a94dcf..1154804fbf56 100644 --- a/Zelda1Client.py +++ b/Zelda1Client.py @@ -152,7 +152,7 @@ def get_payload(ctx: ZeldaContext): def reconcile_shops(ctx: ZeldaContext): - checked_location_names = [ctx.location_names.lookup_in_slot(location) for location in ctx.checked_locations] + checked_location_names = [ctx.location_names.lookup_in_game(location) for location in ctx.checked_locations] shops = [location for location in checked_location_names if "Shop" in location] left_slots = [shop for shop in shops if "Left" in shop] middle_slots = [shop for shop in shops if "Middle" in shop] @@ -190,7 +190,7 @@ async def parse_locations(locations_array, ctx: ZeldaContext, force: bool, zone= locations_checked = [] location = None for location in ctx.missing_locations: - location_name = ctx.location_names.lookup_in_slot(location) + location_name = ctx.location_names.lookup_in_game(location) if location_name in Locations.overworld_locations and zone == "overworld": status = locations_array[Locations.major_location_offsets[location_name]] diff --git a/docs/CODEOWNERS b/docs/CODEOWNERS index 9fbd4837960f..3b40d7e77a73 100644 --- a/docs/CODEOWNERS +++ b/docs/CODEOWNERS @@ -87,9 +87,6 @@ # Lingo /worlds/lingo/ @hatkirby -# Links Awakening DX -/worlds/ladx/ @zig-for - # Lufia II Ancient Cave /worlds/lufia2ac/ @el-u /worlds/lufia2ac/docs/ @wordfcuk @el-u @@ -218,6 +215,8 @@ # Final Fantasy (1) # /worlds/ff1/ +# Links Awakening DX +# /worlds/ladx/ ## Disabled Unmaintained Worlds diff --git a/test/hosting/generate.py b/test/hosting/generate.py index 356cbcca25a0..d5d39dc95ee0 100644 --- a/test/hosting/generate.py +++ b/test/hosting/generate.py @@ -26,6 +26,7 @@ def _generate_local_inner(games: Iterable[str], with TemporaryDirectory() as players_dir: with TemporaryDirectory() as output_dir: import Generate + import Main for n, game in enumerate(games, 1): player_path = Path(players_dir) / f"{n}.yaml" @@ -42,7 +43,7 @@ def _generate_local_inner(games: Iterable[str], sys.argv = [sys.argv[0], "--seed", str(hash(tuple(games))), "--player_files_path", players_dir, "--outputpath", output_dir] - Generate.main() + Main.main(*Generate.main()) output_files = list(Path(output_dir).glob('*.zip')) assert len(output_files) == 1 final_file = dest / output_files[0].name diff --git a/test/programs/test_generate.py b/test/programs/test_generate.py index 887a417ec9f9..9281c9c753cd 100644 --- a/test/programs/test_generate.py +++ b/test/programs/test_generate.py @@ -9,6 +9,7 @@ from tempfile import TemporaryDirectory import Generate +import Main class TestGenerateMain(unittest.TestCase): @@ -58,7 +59,7 @@ def test_generate_absolute(self): '--player_files_path', str(self.abs_input_dir), '--outputpath', self.output_tempdir.name] print(f'Testing Generate.py {sys.argv} in {os.getcwd()}') - Generate.main() + Main.main(*Generate.main()) self.assertOutput(self.output_tempdir.name) @@ -67,7 +68,7 @@ def test_generate_relative(self): '--player_files_path', str(self.rel_input_dir), '--outputpath', self.output_tempdir.name] print(f'Testing Generate.py {sys.argv} in {os.getcwd()}') - Generate.main() + Main.main(*Generate.main()) self.assertOutput(self.output_tempdir.name) @@ -86,7 +87,7 @@ def test_generate_yaml(self): sys.argv = [sys.argv[0], '--seed', '0', '--outputpath', self.output_tempdir.name] print(f'Testing Generate.py {sys.argv} in {os.getcwd()}, player_files_path={self.yaml_input_dir}') - Generate.main() + Main.main(*Generate.main()) finally: user_path.cached_path = user_path_backup diff --git a/worlds/alttp/Client.py b/worlds/alttp/Client.py index db7555f24615..8b7444655f84 100644 --- a/worlds/alttp/Client.py +++ b/worlds/alttp/Client.py @@ -339,7 +339,7 @@ async def track_locations(ctx, roomid, roomdata) -> bool: def new_check(location_id): new_locations.append(location_id) ctx.locations_checked.add(location_id) - location = ctx.location_names.lookup_in_slot(location_id) + location = ctx.location_names.lookup_in_game(location_id) snes_logger.info( f'New Check: {location} ' + f'({len(ctx.checked_locations) + 1 if ctx.checked_locations else len(ctx.locations_checked)}/' + @@ -552,7 +552,7 @@ async def game_watcher(self, ctx): item = ctx.items_received[recv_index] recv_index += 1 logging.info('Received %s from %s (%s) (%d/%d in list)' % ( - color(ctx.item_names.lookup_in_slot(item.item), 'red', 'bold'), + color(ctx.item_names.lookup_in_game(item.item), 'red', 'bold'), color(ctx.player_names[item.player], 'yellow'), ctx.location_names.lookup_in_slot(item.location, item.player), recv_index, len(ctx.items_received))) diff --git a/worlds/alttp/OverworldGlitchRules.py b/worlds/alttp/OverworldGlitchRules.py index 146fc2f0cac9..2da76234bd40 100644 --- a/worlds/alttp/OverworldGlitchRules.py +++ b/worlds/alttp/OverworldGlitchRules.py @@ -220,26 +220,7 @@ def get_invalid_bunny_revival_dungeons(): yield 'Sanctuary' -def no_logic_rules(world, player): - """ - Add OWG transitions to no logic player's world - """ - create_no_logic_connections(player, world, get_boots_clip_exits_lw(world.mode[player] == 'inverted')) - create_no_logic_connections(player, world, get_boots_clip_exits_dw(world.mode[player] == 'inverted', player)) - - # Glitched speed drops. - create_no_logic_connections(player, world, get_glitched_speed_drops_dw(world.mode[player] == 'inverted')) - - # Mirror clip spots. - if world.mode[player] != 'inverted': - create_no_logic_connections(player, world, get_mirror_clip_spots_dw()) - create_no_logic_connections(player, world, get_mirror_offset_spots_dw()) - else: - create_no_logic_connections(player, world, get_mirror_offset_spots_lw(player)) - - def overworld_glitch_connections(world, player): - # Boots-accessible locations. create_owg_connections(player, world, get_boots_clip_exits_lw(world.mode[player] == 'inverted')) create_owg_connections(player, world, get_boots_clip_exits_dw(world.mode[player] == 'inverted', player)) diff --git a/worlds/alttp/Rules.py b/worlds/alttp/Rules.py index eac810610b48..a9c8d5456a42 100644 --- a/worlds/alttp/Rules.py +++ b/worlds/alttp/Rules.py @@ -10,7 +10,7 @@ from .Bosses import GanonDefeatRule from .Items import item_factory, item_name_groups, item_table, progression_items from .Options import small_key_shuffle -from .OverworldGlitchRules import no_logic_rules, overworld_glitches_rules +from .OverworldGlitchRules import overworld_glitches_rules from .Regions import LTTPRegionType, location_table from .StateHelpers import (can_extend_magic, can_kill_most_things, can_lift_heavy_rocks, can_lift_rocks, @@ -33,7 +33,6 @@ def set_rules(world): 'WARNING! Seeds generated under this logic often require major glitches and may be impossible!') if world.players == 1: - no_logic_rules(world, player) for exit in world.get_region('Menu', player).exits: exit.hide_path = True return diff --git a/worlds/cv64/client.py b/worlds/cv64/client.py index bea8ce38825d..2430cc5ffc67 100644 --- a/worlds/cv64/client.py +++ b/worlds/cv64/client.py @@ -146,7 +146,7 @@ async def game_watcher(self, ctx: "BizHawkClientContext") -> None: text_color = bytearray([0xA2, 0x0B]) else: text_color = bytearray([0xA2, 0x02]) - received_text, num_lines = cv64_text_wrap(f"{ctx.item_names.lookup_in_slot(next_item.item)}\n" + received_text, num_lines = cv64_text_wrap(f"{ctx.item_names.lookup_in_game(next_item.item)}\n" f"from {ctx.player_names[next_item.player]}", 96) await bizhawk.guarded_write(ctx.bizhawk_ctx, [(0x389BE1, [next_item.item & 0xFF], "RDRAM"), diff --git a/worlds/dkc3/Client.py b/worlds/dkc3/Client.py index 8e4a1bf2a423..25b058f05f1b 100644 --- a/worlds/dkc3/Client.py +++ b/worlds/dkc3/Client.py @@ -86,7 +86,7 @@ async def game_watcher(self, ctx): for new_check_id in new_checks: ctx.locations_checked.add(new_check_id) - location = ctx.location_names.lookup_in_slot(new_check_id) + location = ctx.location_names.lookup_in_game(new_check_id) snes_logger.info( f'New Check: {location} ({len(ctx.locations_checked)}/{len(ctx.missing_locations) + len(ctx.checked_locations)})') await ctx.send_msgs([{"cmd": 'LocationChecks', "locations": [new_check_id]}]) @@ -99,7 +99,7 @@ async def game_watcher(self, ctx): item = ctx.items_received[recv_index] recv_index += 1 logging.info('Received %s from %s (%s) (%d/%d in list)' % ( - color(ctx.item_names.lookup_in_slot(item.item), 'red', 'bold'), + color(ctx.item_names.lookup_in_game(item.item), 'red', 'bold'), color(ctx.player_names[item.player], 'yellow'), ctx.location_names.lookup_in_slot(item.location, item.player), recv_index, len(ctx.items_received))) diff --git a/worlds/factorio/Client.py b/worlds/factorio/Client.py index 258a5445328c..23dfa0633eb4 100644 --- a/worlds/factorio/Client.py +++ b/worlds/factorio/Client.py @@ -247,7 +247,7 @@ async def game_watcher(ctx: FactorioContext): if ctx.locations_checked != research_data: bridge_logger.debug( f"New researches done: " - f"{[ctx.location_names.lookup_in_slot(rid) for rid in research_data - ctx.locations_checked]}") + f"{[ctx.location_names.lookup_in_game(rid) for rid in research_data - ctx.locations_checked]}") ctx.locations_checked = research_data await ctx.send_msgs([{"cmd": 'LocationChecks', "locations": tuple(research_data)}]) death_link_tick = data.get("death_link_tick", 0) @@ -360,7 +360,7 @@ async def factorio_server_watcher(ctx: FactorioContext): transfer_item: NetworkItem = ctx.items_received[ctx.send_index] item_id = transfer_item.item player_name = ctx.player_names[transfer_item.player] - item_name = ctx.item_names.lookup_in_slot(item_id) + item_name = ctx.item_names.lookup_in_game(item_id) factorio_server_logger.info(f"Sending {item_name} to Nauvis from {player_name}.") commands[ctx.send_index] = f"/ap-get-technology {item_name}\t{ctx.send_index}\t{player_name}" ctx.send_index += 1 diff --git a/worlds/kdl3/Client.py b/worlds/kdl3/Client.py index 6faa8206c2df..1ca21d550e67 100644 --- a/worlds/kdl3/Client.py +++ b/worlds/kdl3/Client.py @@ -330,7 +330,7 @@ async def game_watcher(self, ctx) -> None: item = ctx.items_received[recv_amount] recv_amount += 1 logging.info('Received %s from %s (%s) (%d/%d in list)' % ( - color(ctx.item_names.lookup_in_slot(item.item), 'red', 'bold'), + color(ctx.item_names.lookup_in_game(item.item), 'red', 'bold'), color(ctx.player_names[item.player], 'yellow'), ctx.location_names.lookup_in_slot(item.location, item.player), recv_amount, len(ctx.items_received))) @@ -415,7 +415,7 @@ async def game_watcher(self, ctx) -> None: for new_check_id in new_checks: ctx.locations_checked.add(new_check_id) - location = ctx.location_names.lookup_in_slot(new_check_id) + location = ctx.location_names.lookup_in_game(new_check_id) snes_logger.info( f'New Check: {location} ({len(ctx.locations_checked)}/' f'{len(ctx.missing_locations) + len(ctx.checked_locations)})') diff --git a/worlds/ladx/__init__.py b/worlds/ladx/__init__.py index e52bd9a14f3b..97daf7e26bdb 100644 --- a/worlds/ladx/__init__.py +++ b/worlds/ladx/__init__.py @@ -8,7 +8,7 @@ import bsdiff4 import settings -from BaseClasses import Entrance, Item, ItemClassification, Location, Tutorial +from BaseClasses import Entrance, Item, ItemClassification, Location, Tutorial, MultiWorld from Fill import fill_restrictive from worlds.AutoWorld import WebWorld, World from .Common import * @@ -435,6 +435,12 @@ def guess_icon_for_other_world(self, other): return "TRADING_ITEM_LETTER" + @classmethod + def stage_assert_generate(cls, multiworld: MultiWorld): + rom_file = get_base_rom_path() + if not os.path.exists(rom_file): + raise FileNotFoundError(rom_file) + def generate_output(self, output_directory: str): # copy items back to locations for r in self.multiworld.get_regions(self.player): diff --git a/worlds/lufia2ac/Client.py b/worlds/lufia2ac/Client.py index 1e8437d20e84..633bd93ef0c9 100644 --- a/worlds/lufia2ac/Client.py +++ b/worlds/lufia2ac/Client.py @@ -147,7 +147,7 @@ async def game_watcher(self, ctx: SNIContext) -> None: snes_items_received += 1 snes_logger.info("Received %s from %s (%s) (%d/%d in list)" % ( - ctx.item_names.lookup_in_slot(item.item), + ctx.item_names.lookup_in_game(item.item), ctx.player_names[item.player], ctx.location_names.lookup_in_slot(item.location, item.player), snes_items_received, len(ctx.items_received))) diff --git a/worlds/pokemon_rb/__init__.py b/worlds/pokemon_rb/__init__.py index 003e0a32e97d..5f527033289a 100644 --- a/worlds/pokemon_rb/__init__.py +++ b/worlds/pokemon_rb/__init__.py @@ -661,6 +661,9 @@ def fill_slot_data(self) -> dict: "dark_rock_tunnel_logic": self.multiworld.dark_rock_tunnel_logic[self.player].value, "split_card_key": self.multiworld.split_card_key[self.player].value, "all_elevators_locked": self.multiworld.all_elevators_locked[self.player].value, + "require_pokedex": self.multiworld.require_pokedex[self.player].value, + "area_1_to_1_mapping": self.multiworld.area_1_to_1_mapping[self.player].value, + "blind_trainers": self.multiworld.blind_trainers[self.player].value, } diff --git a/worlds/pokemon_rb/docs/setup_en.md b/worlds/pokemon_rb/docs/setup_en.md index 45b0175eac9d..773fb14da9e7 100644 --- a/worlds/pokemon_rb/docs/setup_en.md +++ b/worlds/pokemon_rb/docs/setup_en.md @@ -15,7 +15,7 @@ As we are using BizHawk, this guide is only applicable to Windows and Linux syst ## Optional Software -- [Pokémon Red and Blue Archipelago Map Tracker](https://github.com/j-imbo/pkmnrb_jim/releases/latest), for use with [PopTracker](https://github.com/black-sliver/PopTracker/releases) +- [Pokémon Red and Blue Archipelago Map Tracker](https://github.com/coveleski/rb_tracker/releases/latest), for use with [PopTracker](https://github.com/black-sliver/PopTracker/releases) ## Configuring BizHawk @@ -109,7 +109,7 @@ server uses password, type in the bottom textfield `/connect
: [p Pokémon Red and Blue has a fully functional map tracker that supports auto-tracking. -1. Download [Pokémon Red and Blue Archipelago Map Tracker](https://github.com/j-imbo/pkmnrb_jim/releases/latest) and [PopTracker](https://github.com/black-sliver/PopTracker/releases). +1. Download [Pokémon Red and Blue Archipelago Map Tracker](https://github.com/coveleski/rb_tracker/releases/latest) and [PopTracker](https://github.com/black-sliver/PopTracker/releases). 2. Open PopTracker, and load the Pokémon Red and Blue pack. 3. Click on the "AP" symbol at the top. 4. Enter the AP address, slot name and password. diff --git a/worlds/pokemon_rb/docs/setup_es.md b/worlds/pokemon_rb/docs/setup_es.md index 9d87db224bb7..6499c9501263 100644 --- a/worlds/pokemon_rb/docs/setup_es.md +++ b/worlds/pokemon_rb/docs/setup_es.md @@ -17,7 +17,7 @@ Al usar BizHawk, esta guía solo es aplicable en los sistemas de Windows y Linux ## Software Opcional -- [Tracker de mapa para Pokémon Red and Blue Archipelago](https://github.com/j-imbo/pkmnrb_jim/releases/latest), para usar con [PopTracker](https://github.com/black-sliver/PopTracker/releases) +- [Tracker de mapa para Pokémon Red and Blue Archipelago](https://github.com/coveleski/rb_tracker/releases/latest), para usar con [PopTracker](https://github.com/black-sliver/PopTracker/releases) ## Configurando BizHawk @@ -101,7 +101,7 @@ Ahora ya estás listo para tu aventura en Kanto. Pokémon Red and Blue tiene un mapa completamente funcional que soporta seguimiento automático. -1. Descarga el [Tracker de mapa para Pokémon Red and Blue Archipelago](https://github.com/j-imbo/pkmnrb_jim/releases/latest) y [PopTracker](https://github.com/black-sliver/PopTracker/releases). +1. Descarga el [Tracker de mapa para Pokémon Red and Blue Archipelago](https://github.com/coveleski/rb_tracker/releases/latest) y [PopTracker](https://github.com/black-sliver/PopTracker/releases). 2. Abre PopTracker, y carga el pack de Pokémon Red and Blue. 3. Haz clic en el símbolo "AP" en la parte superior. 4. Ingresa la dirección de AP, nombre del slot y contraseña (si es que hay). diff --git a/worlds/sc2/Client.py b/worlds/sc2/Client.py index e6696b782da2..8b9269cb0a03 100644 --- a/worlds/sc2/Client.py +++ b/worlds/sc2/Client.py @@ -243,10 +243,10 @@ def print_faction_title(): self.formatted_print(f" [u]{faction.name}[/u] ") for item_id in categorized_items[faction]: - item_name = self.ctx.item_names.lookup_in_slot(item_id) + item_name = self.ctx.item_names.lookup_in_game(item_id) received_child_items = items_received_set.intersection(parent_to_child.get(item_id, [])) matching_children = [child for child in received_child_items - if item_matches_filter(self.ctx.item_names.lookup_in_slot(child))] + if item_matches_filter(self.ctx.item_names.lookup_in_game(child))] received_items_of_this_type = items_received.get(item_id, []) item_is_match = item_matches_filter(item_name) if item_is_match or len(matching_children) > 0: @@ -1164,7 +1164,7 @@ def request_unfinished_missions(ctx: SC2Context) -> None: objectives = set(ctx.locations_for_mission(mission)) if objectives: remaining_objectives = objectives.difference(ctx.checked_locations) - unfinished_locations[mission] = [ctx.location_names.lookup_in_slot(location_id) for location_id in remaining_objectives] + unfinished_locations[mission] = [ctx.location_names.lookup_in_game(location_id) for location_id in remaining_objectives] else: unfinished_locations[mission] = [] diff --git a/worlds/sc2/ClientGui.py b/worlds/sc2/ClientGui.py index f9dcfc18eb4a..664bd5cee741 100644 --- a/worlds/sc2/ClientGui.py +++ b/worlds/sc2/ClientGui.py @@ -269,7 +269,7 @@ def sort_unfinished_locations(self, mission_name: str) -> Tuple[Dict[LocationTyp for loc in self.ctx.locations_for_mission(mission_name): if loc in self.ctx.missing_locations: count += 1 - locations[lookup_location_id_to_type[loc]].append(self.ctx.location_names.lookup_in_slot(loc)) + locations[lookup_location_id_to_type[loc]].append(self.ctx.location_names.lookup_in_game(loc)) plando_locations = [] for plando_loc in self.ctx.plando_locations: diff --git a/worlds/sm/Client.py b/worlds/sm/Client.py index 6d6dd08ba5df..b9c13433aeb7 100644 --- a/worlds/sm/Client.py +++ b/worlds/sm/Client.py @@ -123,7 +123,7 @@ async def game_watcher(self, ctx): location_id = locations_start_id + item_index ctx.locations_checked.add(location_id) - location = ctx.location_names.lookup_in_slot(location_id) + location = ctx.location_names.lookup_in_game(location_id) snes_logger.info( f'New Check: {location} ({len(ctx.locations_checked)}/{len(ctx.missing_locations) + len(ctx.checked_locations)})') await ctx.send_msgs([{"cmd": 'LocationChecks', "locations": [location_id]}]) @@ -151,7 +151,7 @@ async def game_watcher(self, ctx): snes_buffered_write(ctx, SM_RECV_QUEUE_WCOUNT, bytes([item_out_ptr & 0xFF, (item_out_ptr >> 8) & 0xFF])) logging.info('Received %s from %s (%s) (%d/%d in list)' % ( - color(ctx.item_names.lookup_in_slot(item.item), 'red', 'bold'), + color(ctx.item_names.lookup_in_game(item.item), 'red', 'bold'), color(ctx.player_names[item.player], 'yellow'), ctx.location_names.lookup_in_slot(item.location, item.player), item_out_ptr, len(ctx.items_received))) diff --git a/worlds/smw/Client.py b/worlds/smw/Client.py index 85bb3fe1ee16..91d59ab3b5f3 100644 --- a/worlds/smw/Client.py +++ b/worlds/smw/Client.py @@ -448,7 +448,7 @@ async def game_watcher(self, ctx): for new_check_id in new_checks: ctx.locations_checked.add(new_check_id) - location = ctx.location_names.lookup_in_slot(new_check_id) + location = ctx.location_names.lookup_in_game(new_check_id) snes_logger.info( f'New Check: {location} ({len(ctx.locations_checked)}/{len(ctx.missing_locations) + len(ctx.checked_locations)})') await ctx.send_msgs([{"cmd": 'LocationChecks', "locations": [new_check_id]}]) @@ -501,14 +501,14 @@ async def game_watcher(self, ctx): recv_index += 1 sending_game = ctx.slot_info[item.player].game logging.info('Received %s from %s (%s) (%d/%d in list)' % ( - color(ctx.item_names.lookup_in_slot(item.item), 'red', 'bold'), + color(ctx.item_names.lookup_in_game(item.item), 'red', 'bold'), color(ctx.player_names[item.player], 'yellow'), ctx.location_names.lookup_in_slot(item.location, item.player), recv_index, len(ctx.items_received))) if self.should_show_message(ctx, item): if item.item != 0xBC0012 and item.item not in trap_rom_data: # Don't send messages for Boss Tokens - item_name = ctx.item_names.lookup_in_slot(item.item) + item_name = ctx.item_names.lookup_in_game(item.item) player_name = ctx.player_names[item.player] receive_message = generate_received_text(item_name, player_name) @@ -516,7 +516,7 @@ async def game_watcher(self, ctx): snes_buffered_write(ctx, SMW_RECV_PROGRESS_ADDR, bytes([recv_index&0xFF, (recv_index>>8)&0xFF])) if item.item in trap_rom_data: - item_name = ctx.item_names.lookup_in_slot(item.item) + item_name = ctx.item_names.lookup_in_game(item.item) player_name = ctx.player_names[item.player] receive_message = generate_received_text(item_name, player_name) @@ -597,7 +597,7 @@ async def game_watcher(self, ctx): for loc_id in ctx.checked_locations: if loc_id not in ctx.locations_checked: ctx.locations_checked.add(loc_id) - loc_name = ctx.location_names.lookup_in_slot(loc_id) + loc_name = ctx.location_names.lookup_in_game(loc_id) if loc_name not in location_id_to_level_id: continue diff --git a/worlds/smz3/Client.py b/worlds/smz3/Client.py index 3c90ead0064c..028c44869a68 100644 --- a/worlds/smz3/Client.py +++ b/worlds/smz3/Client.py @@ -109,7 +109,7 @@ async def game_watcher(self, ctx): location_id = locations_start_id + convertLocSMZ3IDToAPID(item_index) ctx.locations_checked.add(location_id) - location = ctx.location_names.lookup_in_slot(location_id) + location = ctx.location_names.lookup_in_game(location_id) snes_logger.info(f'New Check: {location} ({len(ctx.locations_checked)}/{len(ctx.missing_locations) + len(ctx.checked_locations)})') await ctx.send_msgs([{"cmd": 'LocationChecks', "locations": [location_id]}]) @@ -132,7 +132,7 @@ async def game_watcher(self, ctx): item_out_ptr += 1 snes_buffered_write(ctx, SMZ3_RECV_PROGRESS_ADDR + recv_progress_addr_table_offset, bytes([item_out_ptr & 0xFF, (item_out_ptr >> 8) & 0xFF])) logging.info('Received %s from %s (%s) (%d/%d in list)' % ( - color(ctx.item_names.lookup_in_slot(item.item), 'red', 'bold'), color(ctx.player_names[item.player], 'yellow'), + color(ctx.item_names.lookup_in_game(item.item), 'red', 'bold'), color(ctx.player_names[item.player], 'yellow'), ctx.location_names.lookup_in_slot(item.location, item.player), item_out_ptr, len(ctx.items_received))) await snes_flush_writes(ctx) diff --git a/worlds/tunic/options.py b/worlds/tunic/options.py index ff9872ab4807..bf1dd860ae79 100644 --- a/worlds/tunic/options.py +++ b/worlds/tunic/options.py @@ -174,6 +174,13 @@ class ShuffleLadders(Toggle): class TunicPlandoConnections(PlandoConnections): + """ + Generic connection plando. Format is: + - entrance: "Entrance Name" + exit: "Exit Name" + percentage: 100 + Percentage is an integer from 0 to 100 which determines whether that connection will be made. Defaults to 100 if omitted. + """ entrances = {*(portal.name for portal in portal_mapping), "Shop", "Shop Portal"} exits = {*(portal.name for portal in portal_mapping), "Shop", "Shop Portal"} diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index 4335f9524f1e..05b3cf3a98e4 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -399,6 +399,16 @@ def make_options_adjustments(self, world: "WitnessWorld") -> None: mnt_lasers = world.options.mountain_lasers chal_lasers = world.options.challenge_lasers + # Victory Condition + if victory == "elevator": + self.VICTORY_LOCATION = "0x3D9A9" + elif victory == "challenge": + self.VICTORY_LOCATION = "0x0356B" + elif victory == "mountain_box_short": + self.VICTORY_LOCATION = "0x09F7F" + elif victory == "mountain_box_long": + self.VICTORY_LOCATION = "0xFFF00" + # Exclude panels from the post-game if shuffle_postgame is false. if not world.options.shuffle_postgame: adjustment_linesets_in_order += self.handle_postgame(world) @@ -418,17 +428,6 @@ def make_options_adjustments(self, world: "WitnessWorld") -> None: if not victory == "challenge": adjustment_linesets_in_order.append(["Disabled Locations:", "0x0A332"]) - # Victory Condition - - if victory == "elevator": - self.VICTORY_LOCATION = "0x3D9A9" - elif victory == "challenge": - self.VICTORY_LOCATION = "0x0356B" - elif victory == "mountain_box_short": - self.VICTORY_LOCATION = "0x09F7F" - elif victory == "mountain_box_long": - self.VICTORY_LOCATION = "0xFFF00" - # Long box can usually only be solved by opening Mountain Entry. However, if it requires 7 lasers or less # (challenge_lasers <= 7), you can now solve it without opening Mountain Entry first. # Furthermore, if the user sets mountain_lasers > 7, the box is rotated to not require Mountain Entry either. @@ -874,7 +873,7 @@ def __init__(self, world: "WitnessWorld", disabled_locations: Set[str], start_in self.PRECOMPLETED_LOCATIONS = set() self.EXCLUDED_LOCATIONS = set() self.ADDED_CHECKS = set() - self.VICTORY_LOCATION = "0x0356B" + self.VICTORY_LOCATION: str self.ALWAYS_EVENT_NAMES_BY_HEX = { "0x00509": "+1 Laser (Symmetry Laser)", diff --git a/worlds/yoshisisland/Client.py b/worlds/yoshisisland/Client.py index 2a710b046a70..98b0ff1a8c90 100644 --- a/worlds/yoshisisland/Client.py +++ b/worlds/yoshisisland/Client.py @@ -116,7 +116,7 @@ async def game_watcher(self, ctx: "SNIContext") -> None: for new_check_id in new_checks: ctx.locations_checked.add(new_check_id) - location = ctx.location_names.lookup_in_slot(new_check_id) + location = ctx.location_names.lookup_in_game(new_check_id) total_locations = len(ctx.missing_locations) + len(ctx.checked_locations) snes_logger.info(f"New Check: {location} ({len(ctx.locations_checked)}/{total_locations})") await ctx.send_msgs([{"cmd": "LocationChecks", "locations": [new_check_id]}]) @@ -127,7 +127,7 @@ async def game_watcher(self, ctx: "SNIContext") -> None: item = ctx.items_received[recv_index] recv_index += 1 logging.info("Received %s from %s (%s) (%d/%d in list)" % ( - color(ctx.item_names.lookup_in_slot(item.item), "red", "bold"), + color(ctx.item_names.lookup_in_game(item.item), "red", "bold"), color(ctx.player_names[item.player], "yellow"), ctx.location_names.lookup_in_slot(item.location, item.player), recv_index, len(ctx.items_received)))