diff --git a/worlds/hylics2/Options.py b/worlds/hylics2/Options.py index 85cf36b15640..0c50fb42beb4 100644 --- a/worlds/hylics2/Options.py +++ b/worlds/hylics2/Options.py @@ -1,5 +1,5 @@ from dataclasses import dataclass -from Options import Choice, Toggle, DefaultOnToggle, DeathLink, PerGameCommonOptions +from Options import Choice, Removed, Toggle, DefaultOnToggle, DeathLink, PerGameCommonOptions class PartyShuffle(Toggle): """Shuffles party members into the pool. @@ -18,10 +18,22 @@ class MedallionShuffle(Toggle): """Shuffles red medallions into the pool.""" display_name = "Shuffle Red Medallions" -class RandomStart(Toggle): - """Start the randomizer in 1 of 4 positions. - (Waynehouse, Viewax's Edifice, TV Island, Shield Facility)""" - display_name = "Randomize Start Location" +class StartLocation(Choice): + """Select the starting location from 1 of 4 positions.""" + display_name = "Start Location" + option_waynehouse = 0 + option_viewaxs_edifice = 1 + option_tv_island = 2 + option_shield_facility = 3 + default = 0 + + @classmethod + def get_option_name(cls, value: int) -> str: + if value == 1: + return "Viewax's Edifice" + if value == 2: + return "TV Island" + return super().get_option_name(value) class ExtraLogic(DefaultOnToggle): """Include some extra items in logic (CHARGE UP, 1x PAPER CUP) to prevent the game from becoming too difficult.""" @@ -37,6 +49,9 @@ class Hylics2Options(PerGameCommonOptions): party_shuffle: PartyShuffle gesture_shuffle: GestureShuffle medallion_shuffle: MedallionShuffle - random_start: RandomStart + start_location: StartLocation extra_items_in_logic: ExtraLogic - death_link: Hylics2DeathLink \ No newline at end of file + death_link: Hylics2DeathLink + + # Removed options + random_start: Removed diff --git a/worlds/hylics2/Rules.py b/worlds/hylics2/Rules.py index 2ecd14909715..3914054193ce 100644 --- a/worlds/hylics2/Rules.py +++ b/worlds/hylics2/Rules.py @@ -132,8 +132,7 @@ def set_rules(hylics2world): extra = hylics2world.options.extra_items_in_logic party = hylics2world.options.party_shuffle medallion = hylics2world.options.medallion_shuffle - random_start = hylics2world.options.random_start - start_location = hylics2world.start_location + start_location = hylics2world.options.start_location # Afterlife add_rule(world.get_location("Afterlife: TV", player), @@ -499,7 +498,7 @@ def set_rules(hylics2world): add_rule(i, lambda state: enter_hylemxylem(state, player)) # random start logic (default) - if not random_start or random_start and start_location == "Waynehouse": + if start_location == "waynehouse": # entrances for i in world.get_region("Viewax", player).entrances: add_rule(i, lambda state: ( @@ -514,7 +513,7 @@ def set_rules(hylics2world): add_rule(i, lambda state: airship(state, player)) # random start logic (Viewax's Edifice) - elif random_start and start_location == "Viewax's Edifice": + elif start_location == "viewaxs_edifice": for i in world.get_region("Waynehouse", player).entrances: add_rule(i, lambda state: ( air_dash(state, player) @@ -544,8 +543,8 @@ def set_rules(hylics2world): for i in world.get_region("Sage Labyrinth", player).entrances: add_rule(i, lambda state: airship(state, player)) - # random start logic (TV Island) - elif random_start and start_location == "TV Island": + # start logic (TV Island) + elif start_location == "tv_island": for i in world.get_region("Waynehouse", player).entrances: add_rule(i, lambda state: airship(state, player)) for i in world.get_region("New Muldul", player).entrances: @@ -563,8 +562,8 @@ def set_rules(hylics2world): for i in world.get_region("Sage Labyrinth", player).entrances: add_rule(i, lambda state: airship(state, player)) - # random start logic (Shield Facility) - elif random_start and start_location == "Shield Facility": + # start logic (Shield Facility) + elif start_location == "shield_facility": for i in world.get_region("Waynehouse", player).entrances: add_rule(i, lambda state: airship(state, player)) for i in world.get_region("New Muldul", player).entrances: @@ -578,4 +577,4 @@ def set_rules(hylics2world): for i in world.get_region("TV Island", player).entrances: add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Sage Labyrinth", player).entrances: - add_rule(i, lambda state: airship(state, player)) \ No newline at end of file + add_rule(i, lambda state: airship(state, player)) diff --git a/worlds/hylics2/__init__.py b/worlds/hylics2/__init__.py index 93ec43f842bf..be7ebf199127 100644 --- a/worlds/hylics2/__init__.py +++ b/worlds/hylics2/__init__.py @@ -39,8 +39,6 @@ class Hylics2World(World): data_version = 3 - start_location = "Waynehouse" - def set_rules(self): Rules.set_rules(self) @@ -56,19 +54,6 @@ def create_event(self, event: str): return Hylics2Item(event, ItemClassification.progression_skip_balancing, None, self.player) - # set random starting location if option is enabled - def generate_early(self): - if self.options.random_start: - i = self.random.randint(0, 3) - if i == 0: - self.start_location = "Waynehouse" - elif i == 1: - self.start_location = "Viewax's Edifice" - elif i == 2: - self.start_location = "TV Island" - elif i == 3: - self.start_location = "Shield Facility" - def create_items(self): # create item pool pool = [] @@ -149,8 +134,8 @@ def fill_slot_data(self) -> Dict[str, Any]: slot_data: Dict[str, Any] = { "party_shuffle": self.options.party_shuffle.value, "medallion_shuffle": self.options.medallion_shuffle.value, - "random_start" : self.options.random_start.value, - "start_location" : self.start_location, + "random_start": int(self.options.start_location != "waynehouse"), + "start_location" : self.options.start_location.current_option_name, "death_link": self.options.death_link.value } return slot_data @@ -189,14 +174,14 @@ def create_regions(self) -> None: # create entrance and connect it to parent and destination regions ent = Entrance(self.player, f"{reg.name} {k}", reg) reg.exits.append(ent) - if k == "New Game" and self.options.random_start: - if self.start_location == "Waynehouse": + if k == "New Game": + if self.options.start_location == "waynehouse": ent.connect(region_table[2]) - elif self.start_location == "Viewax's Edifice": + elif self.options.start_location == "viewaxs_edifice": ent.connect(region_table[6]) - elif self.start_location == "TV Island": + elif self.options.start_location == "tv_island": ent.connect(region_table[9]) - elif self.start_location == "Shield Facility": + elif self.options.start_location == "shield_facility": ent.connect(region_table[11]) else: for name, num in Exits.exit_lookup_table.items():