diff --git a/worlds/mm_recomp/Items.py b/worlds/mm_recomp/Items.py index 13b42b4c..7d573163 100644 --- a/worlds/mm_recomp/Items.py +++ b/worlds/mm_recomp/Items.py @@ -23,18 +23,18 @@ class MMRItemData(NamedTuple): "Progressive Magic": MMRItemData( code=0x3469420020000, type=ItemClassification.progression, - can_create=lambda options: options.shuffle_great_fairy_rewards.value, + can_create=lambda options: options.shuffle_great_fairy_rewards.value != 1, num_exist=2 ), "Great Spin Attack": MMRItemData( code=0x3469420020001, type=ItemClassification.useful, - can_create=lambda options: options.shuffle_great_fairy_rewards.value + can_create=lambda options: options.shuffle_great_fairy_rewards.value != 1 ), "Double Defense": MMRItemData( code=0x3469420020003, type=ItemClassification.useful, - can_create=lambda options: options.shuffle_great_fairy_rewards.value + can_create=lambda options: options.shuffle_great_fairy_rewards.value != 1 ), "Bomber's Notebook": MMRItemData( code=0x3469420000050, @@ -195,7 +195,7 @@ class MMRItemData(NamedTuple): "Great Fairy Mask": MMRItemData( code=0x3469420000086, type=ItemClassification.progression, - can_create=lambda options: options.shuffle_great_fairy_rewards.value + can_create=lambda options: options.shuffle_great_fairy_rewards.value != 1 ), "Gibdo Mask": MMRItemData( code=0x3469420000087, @@ -271,7 +271,7 @@ class MMRItemData(NamedTuple): "Great Fairy Sword": MMRItemData( code=0x346942000003B, type=ItemClassification.progression, - can_create=lambda options: options.shuffle_great_fairy_rewards.value + can_create=lambda options: options.shuffle_great_fairy_rewards.value != 1 ), "Progressive Bow": MMRItemData( code=0x3469420000022, @@ -508,13 +508,13 @@ class MMRItemData(NamedTuple): "Blue Rupee": MMRItemData( code=0x3469420000002, type=ItemClassification.filler, - num_exist=14 + num_exist=12 # ~ num_exist=6 ), "Red Rupee": MMRItemData( code=0x3469420000004, type=ItemClassification.filler, - num_exist=45 + num_exist=41 # ~ num_exist=29 ), "Purple Rupee": MMRItemData( diff --git a/worlds/mm_recomp/Locations.py b/worlds/mm_recomp/Locations.py index ecd10792..9686d965 100644 --- a/worlds/mm_recomp/Locations.py +++ b/worlds/mm_recomp/Locations.py @@ -339,11 +339,13 @@ def can_create_heart_location(shp, c_or_p, loc_index): ), "North Clock Town Great Fairy Reward": MMRLocationData( region="Clock Town", - address=0x3469420030000 + address=0x3469420030000, + can_create=lambda options: options.shuffle_great_fairy_rewards.value != 0 ), "North Clock Town Great Fairy Reward (Has Transformation Mask)": MMRLocationData( region="Clock Town", - address=0x3469420000086 + address=0x3469420000086, + can_create=lambda options: options.shuffle_great_fairy_rewards.value != 0 ), "West Clock Town Lottery Any Day": MMRLocationData( region="Clock Town", @@ -777,7 +779,8 @@ def can_create_heart_location(shp, c_or_p, loc_index): ), "Woodfall Great Fairy Reward": MMRLocationData( region="Woodfall", - address=0x3469420030001 + address=0x3469420030001, + can_create=lambda options: options.shuffle_great_fairy_rewards.value != 0 ), "Woodfall Temple Entrance Chest SF": MMRLocationData( region="Woodfall Temple", @@ -1001,7 +1004,8 @@ def can_create_heart_location(shp, c_or_p, loc_index): ), "Snowhead Great Fairy Reward": MMRLocationData( region="Snowhead Temple", - address=0x3469420030002 + address=0x3469420030002, + can_create=lambda options: options.shuffle_great_fairy_rewards.value != 0 ), "Snowhead Temple Elevator Room Invisible Platform Chest SF": MMRLocationData( region="Snowhead Temple", @@ -1215,7 +1219,8 @@ def can_create_heart_location(shp, c_or_p, loc_index): ), "Great Bay Great Fairy Reward": MMRLocationData( region="Zora Cape", - address=0x3469420030003 + address=0x3469420030003, + can_create=lambda options: options.shuffle_great_fairy_rewards.value != 0 ), "Zora Hall Shop Item 1": MMRLocationData( region="Zora Hall", @@ -1654,7 +1659,8 @@ def can_create_heart_location(shp, c_or_p, loc_index): ), "Stone Tower Great Fairy Reward": MMRLocationData( region="Ikana Canyon", - address=0x3469420030004 + address=0x3469420030004, + can_create=lambda options: options.shuffle_great_fairy_rewards.value != 0 ), "Ikana Well Final Chest": MMRLocationData( region="Beneath the Well", diff --git a/worlds/mm_recomp/Options.py b/worlds/mm_recomp/Options.py index 04cc77eb..4e52a708 100644 --- a/worlds/mm_recomp/Options.py +++ b/worlds/mm_recomp/Options.py @@ -167,9 +167,17 @@ class Cowsanity(Toggle): display_name = "Shuffle Cows" -class ShuffleGreatFairyRewards(Toggle): - """Choose whether to shuffle Great Fairy rewards.""" +class ShuffleGreatFairyRewards(Choice): + """Choose how Great Fairy rewards are shuffled. + + disabled: Great Fairy rewards won't be shuffled into the pool. + vanilla: Great Fairy rewards will be vanilla. For example, Magic will be behind Clock Town and Snowhead rewards. + enabled: Great Fairy rewards will be shuffled. Any item can be shuffled at their locations.""" display_name = "Shuffle Great Fairy Rewards" + option_disabled = 0 + option_vanilla = 1 + option_enabled = 2 + default = 0 class RequiredStrayFairies(Range): diff --git a/worlds/mm_recomp/__init__.py b/worlds/mm_recomp/__init__.py index b2696ff3..b3291fa3 100644 --- a/worlds/mm_recomp/__init__.py +++ b/worlds/mm_recomp/__init__.py @@ -2,7 +2,7 @@ from typing import Dict from typing import TextIO -from BaseClasses import Region, Tutorial +from BaseClasses import Region, Tutorial, ItemClassification from worlds.AutoWorld import WebWorld, World from .Items import MMRItem, item_data_table, item_table, code_to_item_table from .Locations import MMRLocation, location_data_table, location_table, code_to_location_table, locked_locations @@ -37,7 +37,7 @@ class MMRWorld(World): options = MMROptions location_name_to_id = location_table item_name_to_id = item_table - + prices_ints: List[int] prices: str @@ -66,9 +66,16 @@ def generate_early(self): self.prices += str(price) + " " self.prices = self.prices[:-1] - + def create_item(self, name: str) -> MMRItem: - return MMRItem(name, item_data_table[name].type, item_data_table[name].code, self.player) + if (name == "Stray Fairy (Clock Town)" or + name == "Stray Fairy (Woodfall)" or + name == "Stray Fairy (Snowhead)" or + name == "Stray Fairy (Great Bay)" or + name == "Stray Fairy (Stone Tower)") and self.options.shuffle_great_fairy_rewards == 0: + return MMRItem(name, ItemClassification.filler, item_data_table[name].code, self.player) + else: + return MMRItem(name, item_data_table[name].type, item_data_table[name].code, self.player) def place(self, location, item): player = self.player @@ -98,11 +105,11 @@ def create_items(self) -> None: if self.options.shieldless.value: mw.itempool.append(self.create_item("Progressive Shield")) - + if self.options.start_with_soaring.value: mw.push_precollected(self.create_item("Song of Soaring")) self.create_and_add_filler_items() - + if self.options.shuffle_spiderhouse_reward.value: mw.itempool.append(self.create_item("Progressive Wallet")) @@ -120,22 +127,25 @@ def create_items(self) -> None: mw.itempool.append(self.create_item("Red Rupee")) mw.itempool.append(self.create_item("Purple Rupee")) mw.itempool.append(self.create_item("Gold Rupee")) - + if self.options.scrubsanity.value != 0: self.create_and_add_filler_items(4) - + if self.options.shopsanity.value != 0: self.create_and_add_filler_items(27) if self.options.shopsanity.value == 2: self.create_and_add_filler_items(11) - + if self.options.cowsanity.value != 0: self.create_and_add_filler_items(8) - + if self.options.intro_checks.value: self.create_and_add_filler_items(1) + if self.options.shuffle_great_fairy_rewards.value != 0: + self.create_and_add_filler_items(6) + shp = self.options.starting_hearts.value if self.options.starting_hearts_are_containers_or_pieces.value == 0: for i in range(0, int((12 - shp)/4)): @@ -204,9 +214,8 @@ def create_regions(self) -> None: self.place(code_to_location_table[0x3469420062700 | i], "Swamp Skulltula Token") if i != 0: self.place(code_to_location_table[0x3469420062800 | i], "Ocean Skulltula Token") - - if not self.options.shuffle_great_fairy_rewards.value: + if self.options.shuffle_great_fairy_rewards.value == 1: #vanilla self.place("North Clock Town Great Fairy Reward", "Progressive Magic") self.place("North Clock Town Great Fairy Reward (Has Transformation Mask)", "Great Fairy Mask") self.place("Woodfall Great Fairy Reward", "Great Spin Attack")