diff --git a/worlds/grinch/Items.py b/worlds/grinch/Items.py index 3b30fe45..3954e15a 100644 --- a/worlds/grinch/Items.py +++ b/worlds/grinch/Items.py @@ -142,4 +142,13 @@ TRAPS_TABLE: dict[str, GrinchItemData] = { [GrinchRamData(0x80010000, value=0x05), GrinchRamData(0x8008FB94, value=1)]), "Rocket Spring Trap": GrinchItemData("Traps", 607, IC.trap, [GrinchRamData()]), "Who sent me here?": GrinchItemData("Traps", 608, IC.trap, [GrinchRamData(0x8008FB94, value=1)]) +} + +ALL_ITEMS_TABLE: dict[str, GrinchItemData] = { + **GADGETS_TABLE, + **MISSION_ITEMS_TABLE, + **SLEIGH_PARTS_TABLE, + **KEYS_TABLE, + **MISC_ITEMS_TABLE, + **TRAPS_TABLE } \ No newline at end of file diff --git a/worlds/grinch/Locations.py b/worlds/grinch/Locations.py index f7c552bb..704fb6e4 100644 --- a/worlds/grinch/Locations.py +++ b/worlds/grinch/Locations.py @@ -1,10 +1,21 @@ +from typing import NamedTuple, Optional + from BaseClasses import Location +from BaseClasses import ItemClassification as IC + +class GrinchLocationData(NamedTuple): + region: str + type: str + code: Optional[int] + classification: IC + update_ram_addr: Optional[list[GrinchRamData]] = None + value: Optional[int] = None #I can either set or add either hex or unsigned values through Client.py + binary_bit_pos: Optional[int] = None + bit_size: int = 1 class GrinchLocation(Location): - region: str - code: Optional[int] + game: str = "The Grinch" location_group: str - update_ram_addr: Optional[list[GrinchRamData]] grinch_locations = { #Visitsanity @@ -127,4 +138,5 @@ grinch_locations = { "Grinch Copter Blueprint - Who Lake South Shore - Submarine World - Above Surface": GrinchLocationData("Grinch Copter Blueprints", 1212, [GrinchRamData()]), "Grinch Copter Blueprint - Who Lake South Shore - Submarine World - Underwater": GrinchLocationData("Grinch Copter Blueprints", 1213, [GrinchRamData()]), "Grinch Copter Blueprint - Who Lake North Shore - Mayor's Villa - Tree Branch": GrinchLocationData("Grinch Copter Blueprints", 1214, [GrinchRamData()]), - "Grinch Copter Blueprint - Who Lake North Shore - Mayor's Villa - Cave": GrinchLocationData("Grinch Copter Blueprints", 1215, [GrinchRamData()]), \ No newline at end of file + "Grinch Copter Blueprint - Who Lake North Shore - Mayor's Villa - Cave": GrinchLocationData("Grinch Copter Blueprints", 1215, [GrinchRamData()]) +} \ No newline at end of file diff --git a/worlds/grinch/Options.py b/worlds/grinch/Options.py index 9680a7b1..08618a8f 100644 --- a/worlds/grinch/Options.py +++ b/worlds/grinch/Options.py @@ -1,11 +1,15 @@ -from Options import FreeText, NumericOption, Toggle, DefaultOnToggle, Choice, TextChoice, Range, NamedRange, OptionList +from dataclasses import dataclass -class KeyType(Choice): - """Selects whether you want your access items to be separated or progressive""" - display_name = "Key Type" - option_separated = 0 - option_progressive = 1 - default = 0 +from Options import FreeText, NumericOption, Toggle, DefaultOnToggle, Choice, TextChoice, Range, NamedRange, OptionList, \ + PerGameCommonOptions + + +class ProgressiveVacuum(DefaultOnToggle): + """ + Determines whether you get access to main areas progressively + Default: Whoville > Who Forest > Who Dump > Who Lake + """ + display_name = "Progressive Vacuum Access" # class StartingArea(Choice): # """ @@ -19,9 +23,9 @@ class KeyType(Choice): # class Supadow(Toggle): # """Enables completing minigames through the Supadows in Mount Crumpit as checks. (9 locations)""" -# display_name = "Supadow Minigame Locations" -# -# +# display_name = "Supadow Minigame Locations"# + + # class Gifts(Toggle): # """Missions that require you to squash every present in a level. (4 locations)""" # display_name = "Gift Collection Locations" @@ -32,6 +36,11 @@ class KeyType(Choice): # display_name = "Movesanity" -class RottenEggs(Toggle): +class UnlimitedRottenEggs(Toggle): """Determine whether or not you run out of rotten eggs when you utilize your gadgets.""" - display_name = "Unlimited Rotten Eggs" \ No newline at end of file + display_name = "Unlimited Rotten Eggs" + +@dataclass +class GrinchOptions(PerGameCommonOptions):#DeathLinkMixin + progressive_vacuum: ProgressiveVacuum + unlimited_rotten_eggs: UnlimitedRottenEggs \ No newline at end of file diff --git a/worlds/grinch/Regions.py b/worlds/grinch/Regions.py index 5b68b319..700b8bbb 100644 --- a/worlds/grinch/Regions.py +++ b/worlds/grinch/Regions.py @@ -2,25 +2,33 @@ from BaseClasses import Region, MultiWorld from .Locations import GrinchLocation, grinch_locations from .Options import GrinchOptions -def create_regions(player: int, world: World, options: GrinchOptions): - mainareas_list = [ - "Whoville", - "Who Forest", - "Who Dump", - "Who Lake" - ] +mainareas_list = [ + "Mount Crumpit", + "Whoville", + "Who Forest", + "Who Dump", + "Who Lake" +] - subareas_list = [ - "Post Office", - "City Hall", - "Countdown to X-Mas Tower", - "Ski Resort", - "Civic Center", - "Minefield", - "Outside Power Plant", - "Inside Power Plant", - "Submarine World", - "Scout's Hut", - "North Shore", - "Mayor's Villa" - ] \ No newline at end of file +subareas_list = [ + "Post Office", + "City Hall", + "Countdown to X-Mas Tower", + "Ski Resort", + "Civic Center", + "Minefield", + "Outside Power Plant", + "Inside Power Plant", + "Submarine World", + "Scout's Hut", + "North Shore", + "Mayor's Villa", + "Sleigh Room" +] + +supadow_list = [ + "Spin N' Win Supadow", + "Dankamania Supadow", + "The Copter Race Contest Supadow" +] +def create_regions(player: int, world: World, options: GrinchOptions): diff --git a/worlds/grinch/Rules.py b/worlds/grinch/Rules.py index a92485a0..99a0b892 100644 --- a/worlds/grinch/Rules.py +++ b/worlds/grinch/Rules.py @@ -1,4 +1,4 @@ -def set_rules(world: World, world: World, options: GrinchOptions, int): +def set_rules(world: World, options: GrinchOptions, int): rules_dict = { diff --git a/worlds/grinch/__init__.py b/worlds/grinch/__init__.py index d8cad97a..7884468c 100644 --- a/worlds/grinch/__init__.py +++ b/worlds/grinch/__init__.py @@ -1 +1,10 @@ -class GrinchWorld(world): \ No newline at end of file +from typing import ClassVar + +from worlds.AutoWorld import World + +from . import Options + +class GrinchWorld(World): + game: ClassVar[str] = "The Grinch" + options_dataclass = Options.GrinchOptions + options = Options.GrinchOptions \ No newline at end of file