mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-27 20:13:19 -07:00
Merge branch 'ArchipelagoMW:main' into main
This commit is contained in:
@@ -1453,14 +1453,6 @@ class Tutorial(NamedTuple):
|
||||
authors: List[str]
|
||||
|
||||
|
||||
class OptionGroup(NamedTuple):
|
||||
"""Define a grouping of options"""
|
||||
name: str
|
||||
"""Name of the group to categorize this option in for display on the WebHost and in generated YAMLS."""
|
||||
options: List[Type[Options.Option]]
|
||||
"""Options to be in the defined group. """
|
||||
|
||||
|
||||
class PlandoOptions(IntFlag):
|
||||
none = 0b0000
|
||||
items = 0b0001
|
||||
|
||||
@@ -1123,6 +1123,14 @@ class DeathLinkMixin:
|
||||
death_link: DeathLink
|
||||
|
||||
|
||||
class OptionGroup(typing.NamedTuple):
|
||||
"""Define a grouping of options."""
|
||||
name: str
|
||||
"""Name of the group to categorize these options in for display on the WebHost and in generated YAMLS."""
|
||||
options: typing.List[typing.Type[Option[typing.Any]]]
|
||||
"""Options to be in the defined group."""
|
||||
|
||||
|
||||
def generate_yaml_templates(target_folder: typing.Union[str, "pathlib.Path"], generate_hidden: bool = True):
|
||||
import os
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ group.
|
||||
|
||||
```python
|
||||
from worlds.AutoWorld import WebWorld
|
||||
from BaseClasses import OptionGroup
|
||||
from Options import OptionGroup
|
||||
|
||||
class MyWorldWeb(WebWorld):
|
||||
option_groups = [
|
||||
|
||||
@@ -169,6 +169,11 @@ Root: HKCR; Subkey: "{#MyAppName}pkmnepatch"; ValueData: "Ar
|
||||
Root: HKCR; Subkey: "{#MyAppName}pkmnepatch\DefaultIcon"; ValueData: "{app}\ArchipelagoBizHawkClient.exe,0"; ValueType: string; ValueName: "";
|
||||
Root: HKCR; Subkey: "{#MyAppName}pkmnepatch\shell\open\command"; ValueData: """{app}\ArchipelagoBizHawkClient.exe"" ""%1"""; ValueType: string; ValueName: "";
|
||||
|
||||
Root: HKCR; Subkey: ".apmlss"; ValueData: "{#MyAppName}mlsspatch"; Flags: uninsdeletevalue; ValueType: string; ValueName: "";
|
||||
Root: HKCR; Subkey: "{#MyAppName}mlsspatch"; ValueData: "Archipelago Mario & Luigi Superstar Saga Patch"; Flags: uninsdeletekey; ValueType: string; ValueName: "";
|
||||
Root: HKCR; Subkey: "{#MyAppName}mlsspatch\DefaultIcon"; ValueData: "{app}\ArchipelagoBizHawkClient.exe,0"; ValueType: string; ValueName: "";
|
||||
Root: HKCR; Subkey: "{#MyAppName}mlsspatch\shell\open\command"; ValueData: """{app}\ArchipelagoBizHawkClient.exe"" ""%1"""; ValueType: string; ValueName: "";
|
||||
|
||||
Root: HKCR; Subkey: ".apcv64"; ValueData: "{#MyAppName}cv64patch"; Flags: uninsdeletevalue; ValueType: string; ValueName: "";
|
||||
Root: HKCR; Subkey: "{#MyAppName}cv64patch"; ValueData: "Archipelago Castlevania 64 Patch"; Flags: uninsdeletekey; ValueType: string; ValueName: "";
|
||||
Root: HKCR; Subkey: "{#MyAppName}cv64patch\DefaultIcon"; ValueData: "{app}\ArchipelagoBizHawkClient.exe,0"; ValueType: string; ValueName: "";
|
||||
|
||||
@@ -3,6 +3,7 @@ import unittest
|
||||
from Fill import distribute_items_restrictive
|
||||
from NetUtils import encode
|
||||
from worlds.AutoWorld import AutoWorldRegister, call_all
|
||||
from worlds import failed_world_loads
|
||||
from . import setup_solo_multiworld
|
||||
|
||||
|
||||
@@ -47,3 +48,7 @@ class TestImplemented(unittest.TestCase):
|
||||
for key, data in multiworld.worlds[1].fill_slot_data().items():
|
||||
self.assertIsInstance(key, str, "keys in slot data must be a string")
|
||||
self.assertIsInstance(encode(data), str, f"object {type(data).__name__} not serializable.")
|
||||
|
||||
def test_no_failed_world_loads(self):
|
||||
if failed_world_loads:
|
||||
self.fail(f"The following worlds failed to load: {failed_world_loads}")
|
||||
|
||||
@@ -11,11 +11,11 @@ from dataclasses import make_dataclass
|
||||
from typing import (Any, Callable, ClassVar, Dict, FrozenSet, List, Mapping,
|
||||
Optional, Set, TextIO, Tuple, TYPE_CHECKING, Type, Union)
|
||||
|
||||
from Options import ExcludeLocations, ItemLinks, LocalItems, NonLocalItems, PerGameCommonOptions, \
|
||||
PriorityLocations, \
|
||||
StartHints, \
|
||||
StartInventory, StartInventoryPool, StartLocationHints
|
||||
from BaseClasses import CollectionState, OptionGroup
|
||||
from Options import (
|
||||
ExcludeLocations, ItemLinks, LocalItems, NonLocalItems, OptionGroup, PerGameCommonOptions,
|
||||
PriorityLocations, StartHints, StartInventory, StartInventoryPool, StartLocationHints
|
||||
)
|
||||
from BaseClasses import CollectionState
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from BaseClasses import MultiWorld, Item, Location, Tutorial, Region, Entrance
|
||||
|
||||
@@ -47,19 +47,10 @@ class MLSSClient(BizHawkClient):
|
||||
# Check ROM name/patch version
|
||||
rom_name_bytes = await bizhawk.read(ctx.bizhawk_ctx, [(0xA0, 14, "ROM")])
|
||||
rom_name = bytes([byte for byte in rom_name_bytes[0] if byte != 0]).decode("UTF-8")
|
||||
if not rom_name.startswith("MARIO&LUIGIU"):
|
||||
return False
|
||||
if rom_name == "MARIO&LUIGIUA8":
|
||||
if not rom_name.startswith("MARIO&LUIGIUA8"):
|
||||
logger.info(
|
||||
"ERROR: You appear to be running an unpatched version of Mario & Luigi Superstar Saga. "
|
||||
"You need to generate a patch file and use it to create a patched ROM."
|
||||
)
|
||||
return False
|
||||
if rom_name != "MARIO&LUIGIUAP":
|
||||
logger.info(
|
||||
"ERROR: The patch file used to create this ROM is not compatible with "
|
||||
"this client. Double check your client version against the version being "
|
||||
"used by the generator."
|
||||
"ERROR: You have opened a game that is not Mario & Luigi Superstar Saga. "
|
||||
"Please make sure you are opening the correct ROM."
|
||||
)
|
||||
return False
|
||||
except UnicodeDecodeError:
|
||||
|
||||
@@ -299,7 +299,7 @@ def connect(
|
||||
target: str,
|
||||
rule: typing.Optional[typing.Callable] = None,
|
||||
reach: typing.Optional[bool] = False,
|
||||
) -> Entrance | None:
|
||||
) -> typing.Optional[Entrance]:
|
||||
source_region = world.multiworld.get_region(source, world.player)
|
||||
target_region = world.multiworld.get_region(target, world.player)
|
||||
|
||||
@@ -317,7 +317,4 @@ def connect(
|
||||
|
||||
source_region.exits.append(connection)
|
||||
connection.connect(target_region)
|
||||
if reach:
|
||||
return connection
|
||||
else:
|
||||
return None
|
||||
return connection if reach else None
|
||||
|
||||
@@ -272,9 +272,6 @@ def write_tokens(world: "MLSSWorld", patch: MLSSProcedurePatch) -> None:
|
||||
# Bake seed name into ROM
|
||||
patch.write_token(APTokenTypes.WRITE, 0xDF00A0, world.multiworld.seed_name.encode("UTF-8"))
|
||||
|
||||
# Bake patch into header
|
||||
patch.write_token(APTokenTypes.WRITE, 0xAD, "P".encode("UTF-8"))
|
||||
|
||||
# Intro Skip
|
||||
patch.write_token(
|
||||
APTokenTypes.WRITE,
|
||||
|
||||
Binary file not shown.
@@ -193,7 +193,7 @@ class Yugioh06World(World):
|
||||
self.multiworld.push_precollected(self.create_item(Banlist_Items[banlist]))
|
||||
|
||||
if not self.removed_challenges:
|
||||
challenge = list((Limited_Duels | Theme_Duels).keys())
|
||||
challenge = list(({**Limited_Duels, **Theme_Duels}).keys())
|
||||
noc = len(challenge) - max(
|
||||
self.options.third_tier_5_campaign_boss_challenges.value
|
||||
if self.options.third_tier_5_campaign_boss_unlock_condition == "challenges"
|
||||
@@ -238,9 +238,9 @@ class Yugioh06World(World):
|
||||
structure_deck = self.options.structure_deck.current_key
|
||||
self.multiworld.regions += [
|
||||
self.create_region("Menu", None, ["to Deck Edit", "to Campaign", "to Challenges", "to Card Shop"]),
|
||||
self.create_region("Campaign", Bonuses | Campaign_Opponents),
|
||||
self.create_region("Campaign", {**Bonuses, **Campaign_Opponents}),
|
||||
self.create_region("Challenges"),
|
||||
self.create_region("Card Shop", Required_Cards | collection_events),
|
||||
self.create_region("Card Shop", {**Required_Cards, **collection_events}),
|
||||
self.create_region("Structure Deck", get_deck_content_locations(structure_deck)),
|
||||
]
|
||||
|
||||
@@ -308,7 +308,7 @@ class Yugioh06World(World):
|
||||
|
||||
challenge_region = self.get_region("Challenges")
|
||||
# Challenges
|
||||
for challenge, lid in (Limited_Duels | Theme_Duels).items():
|
||||
for challenge, lid in ({**Limited_Duels, **Theme_Duels}).items():
|
||||
if challenge in self.removed_challenges:
|
||||
continue
|
||||
region = self.create_region(challenge, {challenge: lid, challenge + " Complete": None})
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
structure_contents: dict[str, set] = {
|
||||
from typing import Dict, Set
|
||||
|
||||
structure_contents: Dict[str, Set] = {
|
||||
"dragons_roar": {
|
||||
"Luster Dragon",
|
||||
"Armed Dragon LV3",
|
||||
@@ -77,5 +79,5 @@ structure_contents: dict[str, set] = {
|
||||
}
|
||||
|
||||
|
||||
def get_deck_content_locations(deck: str) -> dict[str, str]:
|
||||
def get_deck_content_locations(deck: str) -> Dict[str, str]:
|
||||
return {f"{deck} {i}": content for i, content in enumerate(structure_contents[deck])}
|
||||
|
||||
Reference in New Issue
Block a user