diff --git a/worlds/sa2b/Items.py b/worlds/sa2b/Items.py index 1672d0fffdb4..8ab510564d54 100644 --- a/worlds/sa2b/Items.py +++ b/worlds/sa2b/Items.py @@ -84,7 +84,9 @@ def __init__(self, name, classification: ItemClassification, code: int = None, p ItemName.cutscene_trap: ItemData(0xFF0039, False, True), ItemName.reverse_trap: ItemData(0xFF003A, False, True), ItemName.literature_trap: ItemData(0xFF003B, False, True), +} +minigame_trap_table = { ItemName.pong_trap: ItemData(0xFF0050, False, True), ItemName.platformer_trap: ItemData(0xFF0051, False, True), ItemName.fishing_trap: ItemData(0xFF0052, False, True), @@ -252,6 +254,7 @@ def __init__(self, name, classification: ItemClassification, code: int = None, p **upgrades_table, **junk_table, **trap_table, + **minigame_trap_table, **emeralds_table, **eggs_table, **fruits_table, @@ -271,6 +274,7 @@ def __init__(self, name, classification: ItemClassification, code: int = None, p "Seeds": list(seeds_table.keys()), "Hats": list(hats_table.keys()), "Traps": list(trap_table.keys()), + "Minigames": list(minigame_trap_table.keys()), } try: diff --git a/worlds/sa2b/Locations.py b/worlds/sa2b/Locations.py index a5f4cd692fcf..3b965137f198 100644 --- a/worlds/sa2b/Locations.py +++ b/worlds/sa2b/Locations.py @@ -2362,7 +2362,7 @@ def setup_locations(world: World, player: int, mission_map: typing.Dict[int, int elif world.options.kart_race_checks == 1: location_table.update({**kart_race_mini_location_table}) - if world.options.goal.value in [0, 2, 4, 5, 6]: + if world.options.goal.value in [0, 2, 4, 5, 6, 8]: location_table.update({**final_boss_location_table}) elif world.options.goal.value in [7]: location_table.update({**chaos_chao_location_table}) diff --git a/worlds/sa2b/Options.py b/worlds/sa2b/Options.py index 5cf8431fab7b..e631d52876b2 100644 --- a/worlds/sa2b/Options.py +++ b/worlds/sa2b/Options.py @@ -24,6 +24,8 @@ class Goal(Choice): Boss Rush Chaos Emerald Hunt: Find the Seven Chaos Emeralds, then beat all of the bosses in the Boss Rush, ending with Finalhazard Chaos Chao: Raise a Chaos Chao to win + + Minigame Madness: Win one of each Minigame Trap, then defeat Finalhazard """ display_name = "Goal" option_biolizard = 0 @@ -34,6 +36,7 @@ class Goal(Choice): option_cannons_core_boss_rush = 5 option_boss_rush_chaos_emerald_hunt = 6 option_chaos_chao = 7 + option_minigame_madness = 8 default = 0 @classmethod diff --git a/worlds/sa2b/Regions.py b/worlds/sa2b/Regions.py index 0e2eb60187db..baf5c20738e2 100644 --- a/worlds/sa2b/Regions.py +++ b/worlds/sa2b/Regions.py @@ -3,7 +3,7 @@ from BaseClasses import MultiWorld, Region, Entrance, ItemClassification from worlds.AutoWorld import World -from .Items import SA2BItem +from .Items import SA2BItem, minigame_trap_table from .Locations import SA2BLocation, boss_gate_location_table, boss_gate_set,\ chao_stat_swim_table, chao_stat_fly_table, chao_stat_run_table,\ chao_stat_power_table, chao_stat_stamina_table,\ @@ -2237,7 +2237,7 @@ def create_regions(multiworld: MultiWorld, world: World, player: int, active_loc grand_prix_region = create_region(multiworld, player, active_locations, LocationName.grand_prix_region, grand_prix_region_locations) conditional_regions += [grand_prix_region] - elif world.options.goal in [0, 2, 4, 5, 6]: + elif world.options.goal in [0, 2, 4, 5, 6, 8]: biolizard_region_locations = [ LocationName.finalhazard, ] @@ -2392,6 +2392,9 @@ def connect_regions(multiworld: MultiWorld, world: World, player: int, gates: ty elif world.options.goal == 7: connect(multiworld, player, names, LocationName.gate_0_region, LocationName.chaos_chao, lambda state: (state.has_all(chao_animal_event_location_table.keys(), player))) + elif world.options.goal == 8: + connect(multiworld, player, names, LocationName.gate_0_region, LocationName.biolizard_region, + lambda state: (state.has_all(minigame_trap_table.keys(), player))) for i in range(len(gates[0].gate_levels)): connect(multiworld, player, names, LocationName.gate_0_region, shuffleable_regions[gates[0].gate_levels[i]]) diff --git a/worlds/sa2b/__init__.py b/worlds/sa2b/__init__.py index 3144dd65f573..a070a786378d 100644 --- a/worlds/sa2b/__init__.py +++ b/worlds/sa2b/__init__.py @@ -8,7 +8,7 @@ from .AestheticData import chao_name_conversion, sample_chao_names, totally_real_item_names, \ all_exits, all_destinations, multi_rooms, single_rooms, room_to_exits_map, exit_to_room_map, valid_kindergarten_exits from .GateBosses import get_gate_bosses, get_boss_rush_bosses, get_boss_name -from .Items import SA2BItem, ItemData, item_table, upgrades_table, emeralds_table, junk_table, trap_table, item_groups, \ +from .Items import SA2BItem, ItemData, item_table, upgrades_table, emeralds_table, junk_table, minigame_trap_table, item_groups, \ eggs_table, fruits_table, seeds_table, hats_table, animals_table, chaos_drives_table from .Locations import SA2BLocation, all_locations, setup_locations, chao_animal_event_location_table, black_market_location_table from .Missions import get_mission_table, get_mission_count_table, get_first_and_last_cannons_core_missions @@ -197,7 +197,7 @@ def create_regions(self): # Not Generate Basic self.black_market_costs = dict() - if self.options.goal.value in [0, 2, 4, 5, 6]: + if self.options.goal.value in [0, 2, 4, 5, 6, 8]: self.multiworld.get_location(LocationName.finalhazard, self.player).place_locked_item(self.create_item(ItemName.maria)) elif self.options.goal.value == 1: self.multiworld.get_location(LocationName.green_hill, self.player).place_locked_item(self.create_item(ItemName.maria)) @@ -222,13 +222,18 @@ def create_regions(self): if self.options.goal.value != 3: # Fill item pool with all required items for item in {**upgrades_table}: - itempool += [self.create_item(item, False, self.options.goal.value)] + itempool += [self.create_item(item, None, self.options.goal.value)] if self.options.goal.value in [1, 2, 6]: # Some flavor of Chaos Emerald Hunt for item in {**emeralds_table}: itempool.append(self.create_item(item)) + if self.options.goal.value in [8]: + # Minigame Madness + for item in {**minigame_trap_table}: + itempool.append(self.create_item(item, ItemClassification.progression | ItemClassification.trap)) + # Black Market itempool += [self.create_item(ItemName.market_token) for _ in range(self.options.black_market_slots.value)] @@ -296,7 +301,7 @@ def create_regions(self): non_required_emblems = (total_emblem_count - max_required_emblems) junk_count = math.floor(non_required_emblems * (self.options.junk_fill_percentage.value / 100.0)) - itempool += [self.create_item(ItemName.emblem, True) for _ in range(non_required_emblems - junk_count)] + itempool += [self.create_item(ItemName.emblem, ItemClassification.filler) for _ in range(non_required_emblems - junk_count)] # Carve Traps out of junk_count trap_weights = [] @@ -376,11 +381,11 @@ def create_regions(self): - def create_item(self, name: str, force_non_progression=False, goal=0) -> Item: + def create_item(self, name: str, force_classification=None, goal=0) -> Item: data = item_table[name] - if force_non_progression: - classification = ItemClassification.filler + if force_classification is not None: + classification = force_classification elif name == ItemName.emblem or \ name in emeralds_table.keys() or \ (name == ItemName.knuckles_shovel_claws and goal in [4, 5]):