Skip to content

Commit

Permalink
Add option groups
Browse files Browse the repository at this point in the history
  • Loading branch information
lilDavid committed Jul 2, 2024
1 parent e939895 commit a7c7375
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
8 changes: 5 additions & 3 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .data import data_path
from .items import WL4Item, ap_id_from_wl4_data, filter_item_names, filter_items, item_table
from .locations import location_name_to_id, location_table
from .options import Goal, GoldenJewels, PoolJewels, WL4Options
from .options import Goal, GoldenJewels, PoolJewels, WL4Options, wl4_option_groups
from .regions import connect_regions, create_regions
from .rom import MD5_JP, MD5_US_EU, WL4ProcedurePatch, write_tokens
from .rules import set_access_rules
Expand All @@ -28,8 +28,6 @@ class RomFile(settings.UserFilePath):


class WL4Web(WebWorld):
theme = 'jungle'

setup_en = Tutorial(
'Multiworld Setup Guide',
'A guide to setting up the Wario Land 4 randomizer connected to an Archipelago Multiworld.',
Expand All @@ -39,7 +37,9 @@ class WL4Web(WebWorld):
['lil David']
)

theme = 'jungle'
tutorials = [setup_en]
option_groups = wl4_option_groups


class WL4World(World):
Expand All @@ -61,6 +61,8 @@ class WL4World(World):
if data[1] is not None}
location_name_to_id = location_name_to_id

required_client_version = (0, 5, 0)

item_name_groups = {
'Golden Treasure': {
'Golden Tree Pot',
Expand Down
33 changes: 29 additions & 4 deletions options.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dataclasses import dataclass

from Options import Choice, PerGameCommonOptions, Toggle, DeathLink, Range
from Options import Choice, PerGameCommonOptions, Toggle, DeathLink, Range, OptionGroup


class Goal(Choice):
Expand Down Expand Up @@ -184,20 +184,45 @@ class WarioVoiceShuffle(Toggle):
display_name = "Shuffle Wario's voices"


wl4_option_groups = [
OptionGroup("Goal Options", [
Goal,
GoldenTreasureCount,
]),
OptionGroup("World", [
Difficulty,
PoolJewels,
GoldenJewels,
RequiredJewels,
OpenDoors,
Portal,
]),
OptionGroup("Quality of Life", [
MultiworldSend,
TrapBehavior,
SmashThroughHardBlocks,
]),
OptionGroup("Cosmetic", [
MusicShuffle,
WarioVoiceShuffle,
]),
]


@dataclass
class WL4Options(PerGameCommonOptions):
logic: Logic
death_link: DeathLink
goal: Goal
golden_treasure_count: GoldenTreasureCount
difficulty: Difficulty
logic: Logic
pool_jewels: PoolJewels
golden_jewels: GoldenJewels
required_jewels: RequiredJewels
open_doors: OpenDoors
portal: Portal
smash_through_hard_blocks: SmashThroughHardBlocks
send_locations_to_server: MultiworldSend
trap_behavior: TrapBehavior
death_link: DeathLink
smash_through_hard_blocks: SmashThroughHardBlocks
music_shuffle: MusicShuffle
wario_voice_shuffle: WarioVoiceShuffle

0 comments on commit a7c7375

Please sign in to comment.