Skip to content

Commit

Permalink
Zillion: "item counts" OptionGroup (ArchipelagoMW#3338)
Browse files Browse the repository at this point in the history
  • Loading branch information
beauxq authored and sflavelle committed Jun 20, 2024
1 parent d382265 commit e380072
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion worlds/zillion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from .gen_data import GenData
from .logic import cs_to_zz_locs
from .region import ZillionLocation, ZillionRegion
from .options import ZillionOptions, validate
from .options import ZillionOptions, validate, z_option_groups
from .id_maps import ZillionSlotInfo, get_slot_info, item_name_to_id as _item_name_to_id, \
loc_name_to_id as _loc_name_to_id, make_id_to_others, \
zz_reg_name_to_reg_name, base_id
Expand Down Expand Up @@ -62,6 +62,8 @@ class ZillionWebWorld(WebWorld):
["beauxq"]
)]

option_groups = z_option_groups


class ZillionWorld(World):
"""
Expand Down
10 changes: 9 additions & 1 deletion worlds/zillion/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import ClassVar, Dict, Tuple
from typing_extensions import TypeGuard # remove when Python >= 3.10

from Options import DefaultOnToggle, NamedRange, PerGameCommonOptions, Range, Toggle, Choice
from Options import Choice, DefaultOnToggle, NamedRange, OptionGroup, PerGameCommonOptions, Range, Toggle

from zilliandomizer.options import (
Options as ZzOptions, char_to_gun, char_to_jump, ID,
Expand Down Expand Up @@ -279,6 +279,14 @@ class ZillionOptions(PerGameCommonOptions):
room_gen: ZillionRoomGen


z_option_groups = [
OptionGroup("item counts", [
ZillionIDCardCount, ZillionBreadCount, ZillionOpaOpaCount, ZillionZillionCount,
ZillionFloppyDiskCount, ZillionScopeCount, ZillionRedIDCardCount
])
]


def convert_item_counts(ic: "Counter[str]") -> ZzItemCounts:
tr: ZzItemCounts = {
ID.card: ic["ID Card"],
Expand Down

0 comments on commit e380072

Please sign in to comment.