Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pokémon R/B: Migrate support into Bizhawk Client #2466

Merged
merged 39 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ba8e9ab
BizHawkClient: Add client and connector
Zunawe Jul 8, 2023
fd0bec4
BizHawkClient: Add launcher component and inno_setup lines
Zunawe Jul 8, 2023
0e4d73e
BizHawkClient: Misc stability updates and small improvements
Zunawe Jul 10, 2023
ebb58a7
BizHawkClient: Add docstrings
Zunawe Jul 10, 2023
de4955e
BizHawkClient: Pull in changes from other branch
Zunawe Jul 15, 2023
8dd4b2e
BizHawkClient: Fix no handler message not displaying after changed ROMs
Zunawe Jul 15, 2023
b3a731b
BizHawkClient: Remove extra print statement from lua
Zunawe Jul 15, 2023
5e61db0
BizHawkClient: Change version command to use raw strings
Zunawe Jul 15, 2023
6c029d2
BizHawkClient: Change script version to single integer
Zunawe Jul 15, 2023
9603f16
BizHawkClient: Add newline to version for lua script
Zunawe Aug 3, 2023
311502b
BizHawkClient: Call send_connect from BizHawkClient's watcher loop
Zunawe Aug 3, 2023
7b30378
BizHawkClient: Add handling for failed request getting script version
Zunawe Aug 3, 2023
eda1308
BizHawkClient: Have base64.lua check lua version explicitly for bit o…
Zunawe Aug 3, 2023
b59429f
BizHawkClient: Update connector script for slightly better errors and…
Zunawe Aug 3, 2023
f05e7e5
BizHawkClient: Remove accidentally added print statements
Zunawe Aug 3, 2023
254a9aa
BizHawkClient: Fix connector server not closing correctly
Zunawe Aug 4, 2023
5190ac3
BizHawkClient: Move some connector code around, some linting
Zunawe Aug 4, 2023
d56404c
BizHawkClient: Small cleanup in lua
Zunawe Aug 4, 2023
d57ed99
BizHawkClient: Lua linting
Zunawe Aug 10, 2023
0929b6c
BizHawkClient: Remove outdated sentences in docstrings
Zunawe Aug 10, 2023
92bd09a
Merge remote-tracking branch 'upstream/main' into bh-client
Zunawe Aug 16, 2023
361c0b5
BizHawkClient: Correctly null check patch file arg
Zunawe Aug 16, 2023
55df7b0
BizHawkClient: Initialize logging
Zunawe Aug 16, 2023
4e2151a
BizHawkClient: Move code to worlds/_bizhawk
Zunawe Aug 29, 2023
f7b5881
BizHawkClient: Add license to connector lua, add types to docs
Zunawe Aug 29, 2023
e87f0b2
BizHawkClient: Add module docstrings
Zunawe Aug 29, 2023
d42fe0a
BizhawkClient Pokemon
Alchav Sep 3, 2023
ee6bdc1
Merge branch 'main' into bh-client-pkmn
Alchav Nov 13, 2023
2f20cdf
Merge branch 'main' into bh-client-pkmn
Alchav Nov 13, 2023
90ba66b
Migrate Pokémon Red and Blue support to Bizhawk Client
Alchav Nov 15, 2023
478c396
Prevent more than 10 Progressive Card Keys from creating glitch items
Alchav Nov 15, 2023
931dc50
Clean up client debug data
Alchav Nov 15, 2023
43f4e07
Merge branch 'main' into bh-client-pkmn
Alchav Nov 16, 2023
ee381dd
Remove erroneously-readded Launcher Component stuff
Alchav Nov 16, 2023
4416d8a
Uncomment SignTool
Alchav Nov 16, 2023
3425cfa
Read money along with everything else + various code cleanup
Alchav Nov 16, 2023
4279783
Simplify BCD conversion
Alchav Nov 16, 2023
60e3450
Fix TM Move Rando items
Alchav Nov 17, 2023
1f396ba
Use stored_data instead of current_energy_link_value
Alchav Nov 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
382 changes: 0 additions & 382 deletions PokemonClient.py

This file was deleted.

224 changes: 0 additions & 224 deletions data/lua/connector_pkmn_rb.lua

This file was deleted.

8 changes: 4 additions & 4 deletions inno_setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ Root: HKCR; Subkey: "{#MyAppName}n64zpf\shell\open\command"; ValueData: """{

Root: HKCR; Subkey: ".apred"; ValueData: "{#MyAppName}pkmnrpatch"; Flags: uninsdeletevalue; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}pkmnrpatch"; ValueData: "Archipelago Pokemon Red Patch"; Flags: uninsdeletekey; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}pkmnrpatch\DefaultIcon"; ValueData: "{app}\ArchipelagoPokemonClient.exe,0"; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}pkmnrpatch\shell\open\command"; ValueData: """{app}\ArchipelagoPokemonClient.exe"" ""%1"""; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}pkmnrpatch\DefaultIcon"; ValueData: "{app}\ArchipelagoBizHawkClient.exe,0"; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}pkmnrpatch\shell\open\command"; ValueData: """{app}\ArchipelagoBizHawkClient.exe"" ""%1"""; ValueType: string; ValueName: "";

Root: HKCR; Subkey: ".apblue"; ValueData: "{#MyAppName}pkmnbpatch"; Flags: uninsdeletevalue; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}pkmnbpatch"; ValueData: "Archipelago Pokemon Blue Patch"; Flags: uninsdeletekey; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}pkmnbpatch\DefaultIcon"; ValueData: "{app}\ArchipelagoPokemonClient.exe,0"; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}pkmnbpatch\shell\open\command"; ValueData: """{app}\ArchipelagoPokemonClient.exe"" ""%1"""; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}pkmnbpatch\DefaultIcon"; ValueData: "{app}\ArchipelagoBizHawkClient.exe,0"; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}pkmnbpatch\shell\open\command"; ValueData: """{app}\ArchipelagoBizHawkClient.exe"" ""%1"""; ValueType: string; ValueName: "";

Root: HKCR; Subkey: ".apbn3"; ValueData: "{#MyAppName}bn3bpatch"; Flags: uninsdeletevalue; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}bn3bpatch"; ValueData: "Archipelago MegaMan Battle Network 3 Patch"; Flags: uninsdeletekey; ValueType: string; ValueName: "";
Expand Down
2 changes: 0 additions & 2 deletions worlds/LauncherComponents.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ def launch_textclient():
Component('OoT Adjuster', 'OoTAdjuster'),
# FF1
Component('FF1 Client', 'FF1Client'),
# Pokémon
Component('Pokemon Client', 'PokemonClient', file_identifier=SuffixIdentifier('.apred', '.apblue')),
# TLoZ
Component('Zelda 1 Client', 'Zelda1Client', file_identifier=SuffixIdentifier('.aptloz')),
# ChecksFinder
Expand Down
21 changes: 10 additions & 11 deletions worlds/pokemon_rb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
import settings
import typing
import threading
import base64
from copy import deepcopy
from typing import TextIO

from Utils import __version__
from BaseClasses import Item, MultiWorld, Tutorial, ItemClassification, LocationProgressType
from Fill import fill_restrictive, FillError, sweep_from_pool
from worlds.AutoWorld import World, WebWorld
Expand All @@ -22,6 +24,7 @@
from .level_scaling import level_scaling
from . import logic
from . import poke_data
from . import client


class PokemonSettings(settings.Group):
Expand All @@ -36,16 +39,8 @@ class BlueRomFile(settings.UserFilePath):
copy_to = "Pokemon Blue (UE) [S][!].gb"
md5s = [BlueDeltaPatch.hash]

class RomStart(str):
"""
Set this to false to never autostart a rom (such as after patching)
True for operating system default program
Alternatively, a path to a program to open the .gb file with
"""

red_rom_file: RedRomFile = RedRomFile(RedRomFile.copy_to)
blue_rom_file: BlueRomFile = BlueRomFile(BlueRomFile.copy_to)
rom_start: typing.Union[RomStart, bool] = True


class PokemonWebWorld(WebWorld):
Expand Down Expand Up @@ -141,9 +136,6 @@ def encode_name(name, t):
else:
self.rival_name = encode_name(self.multiworld.rival_name[self.player].value, "Rival")

if len(self.multiworld.player_name[self.player].encode()) > 16:
raise Exception(f"Player name too long for {self.multiworld.get_player_name(self.player)}. Player name cannot exceed 16 bytes for Pokémon Red and Blue.")

if not self.multiworld.badgesanity[self.player]:
self.multiworld.non_local_items[self.player].value -= self.item_name_groups["Badges"]

Expand Down Expand Up @@ -621,6 +613,13 @@ def stage_generate_output(cls, multiworld, output_directory):
def generate_output(self, output_directory: str):
generate_output(self, output_directory)

def modify_multidata(self, multidata: dict):
rom_name = bytearray(f'AP{__version__.replace(".", "")[0:3]}_{self.player}_{self.multiworld.seed:11}\0',
'utf8')[:21]
rom_name.extend([0] * (21 - len(rom_name)))
new_name = base64.b64encode(bytes(rom_name)).decode()
multidata["connect_names"][new_name] = multidata["connect_names"][self.multiworld.player_name[self.player]]

def write_spoiler_header(self, spoiler_handle: TextIO):
spoiler_handle.write(f"Cerulean Cave Total Key Items: {self.multiworld.cerulean_cave_key_items_condition[self.player].total}\n")
spoiler_handle.write(f"Elite Four Total Key Items: {self.multiworld.elite_four_key_items_condition[self.player].total}\n")
Expand Down
Binary file modified worlds/pokemon_rb/basepatch_blue.bsdiff4
Binary file not shown.
Binary file modified worlds/pokemon_rb/basepatch_red.bsdiff4
Binary file not shown.
Loading
Loading