Hylics 2: Remove Random Start option and replace it with Start Location option (#3289)
* Hylics 2: Remove Random Start option and replace it with Start Location option * remove choice * Readd random start to slot data * newlines * Add random_start as a Removed option
This commit is contained in:
parent
b78781ab3e
commit
6576b069f2
|
@ -1,5 +1,5 @@
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from Options import Choice, Toggle, DefaultOnToggle, DeathLink, PerGameCommonOptions
|
from Options import Choice, Removed, Toggle, DefaultOnToggle, DeathLink, PerGameCommonOptions
|
||||||
|
|
||||||
class PartyShuffle(Toggle):
|
class PartyShuffle(Toggle):
|
||||||
"""Shuffles party members into the pool.
|
"""Shuffles party members into the pool.
|
||||||
|
@ -18,10 +18,22 @@ class MedallionShuffle(Toggle):
|
||||||
"""Shuffles red medallions into the pool."""
|
"""Shuffles red medallions into the pool."""
|
||||||
display_name = "Shuffle Red Medallions"
|
display_name = "Shuffle Red Medallions"
|
||||||
|
|
||||||
class RandomStart(Toggle):
|
class StartLocation(Choice):
|
||||||
"""Start the randomizer in 1 of 4 positions.
|
"""Select the starting location from 1 of 4 positions."""
|
||||||
(Waynehouse, Viewax's Edifice, TV Island, Shield Facility)"""
|
display_name = "Start Location"
|
||||||
display_name = "Randomize 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):
|
class ExtraLogic(DefaultOnToggle):
|
||||||
"""Include some extra items in logic (CHARGE UP, 1x PAPER CUP) to prevent the game from becoming too difficult."""
|
"""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
|
party_shuffle: PartyShuffle
|
||||||
gesture_shuffle: GestureShuffle
|
gesture_shuffle: GestureShuffle
|
||||||
medallion_shuffle: MedallionShuffle
|
medallion_shuffle: MedallionShuffle
|
||||||
random_start: RandomStart
|
start_location: StartLocation
|
||||||
extra_items_in_logic: ExtraLogic
|
extra_items_in_logic: ExtraLogic
|
||||||
death_link: Hylics2DeathLink
|
death_link: Hylics2DeathLink
|
||||||
|
|
||||||
|
# Removed options
|
||||||
|
random_start: Removed
|
||||||
|
|
|
@ -132,8 +132,7 @@ def set_rules(hylics2world):
|
||||||
extra = hylics2world.options.extra_items_in_logic
|
extra = hylics2world.options.extra_items_in_logic
|
||||||
party = hylics2world.options.party_shuffle
|
party = hylics2world.options.party_shuffle
|
||||||
medallion = hylics2world.options.medallion_shuffle
|
medallion = hylics2world.options.medallion_shuffle
|
||||||
random_start = hylics2world.options.random_start
|
start_location = hylics2world.options.start_location
|
||||||
start_location = hylics2world.start_location
|
|
||||||
|
|
||||||
# Afterlife
|
# Afterlife
|
||||||
add_rule(world.get_location("Afterlife: TV", player),
|
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))
|
add_rule(i, lambda state: enter_hylemxylem(state, player))
|
||||||
|
|
||||||
# random start logic (default)
|
# random start logic (default)
|
||||||
if not random_start or random_start and start_location == "Waynehouse":
|
if start_location == "waynehouse":
|
||||||
# entrances
|
# entrances
|
||||||
for i in world.get_region("Viewax", player).entrances:
|
for i in world.get_region("Viewax", player).entrances:
|
||||||
add_rule(i, lambda state: (
|
add_rule(i, lambda state: (
|
||||||
|
@ -514,7 +513,7 @@ def set_rules(hylics2world):
|
||||||
add_rule(i, lambda state: airship(state, player))
|
add_rule(i, lambda state: airship(state, player))
|
||||||
|
|
||||||
# random start logic (Viewax's Edifice)
|
# 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:
|
for i in world.get_region("Waynehouse", player).entrances:
|
||||||
add_rule(i, lambda state: (
|
add_rule(i, lambda state: (
|
||||||
air_dash(state, player)
|
air_dash(state, player)
|
||||||
|
@ -544,8 +543,8 @@ def set_rules(hylics2world):
|
||||||
for i in world.get_region("Sage Labyrinth", player).entrances:
|
for i in world.get_region("Sage Labyrinth", player).entrances:
|
||||||
add_rule(i, lambda state: airship(state, player))
|
add_rule(i, lambda state: airship(state, player))
|
||||||
|
|
||||||
# random start logic (TV Island)
|
# start logic (TV Island)
|
||||||
elif random_start and start_location == "TV Island":
|
elif start_location == "tv_island":
|
||||||
for i in world.get_region("Waynehouse", player).entrances:
|
for i in world.get_region("Waynehouse", player).entrances:
|
||||||
add_rule(i, lambda state: airship(state, player))
|
add_rule(i, lambda state: airship(state, player))
|
||||||
for i in world.get_region("New Muldul", player).entrances:
|
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:
|
for i in world.get_region("Sage Labyrinth", player).entrances:
|
||||||
add_rule(i, lambda state: airship(state, player))
|
add_rule(i, lambda state: airship(state, player))
|
||||||
|
|
||||||
# random start logic (Shield Facility)
|
# start logic (Shield Facility)
|
||||||
elif random_start and start_location == "Shield Facility":
|
elif start_location == "shield_facility":
|
||||||
for i in world.get_region("Waynehouse", player).entrances:
|
for i in world.get_region("Waynehouse", player).entrances:
|
||||||
add_rule(i, lambda state: airship(state, player))
|
add_rule(i, lambda state: airship(state, player))
|
||||||
for i in world.get_region("New Muldul", player).entrances:
|
for i in world.get_region("New Muldul", player).entrances:
|
||||||
|
|
|
@ -39,8 +39,6 @@ class Hylics2World(World):
|
||||||
|
|
||||||
data_version = 3
|
data_version = 3
|
||||||
|
|
||||||
start_location = "Waynehouse"
|
|
||||||
|
|
||||||
|
|
||||||
def set_rules(self):
|
def set_rules(self):
|
||||||
Rules.set_rules(self)
|
Rules.set_rules(self)
|
||||||
|
@ -56,19 +54,6 @@ class Hylics2World(World):
|
||||||
return Hylics2Item(event, ItemClassification.progression_skip_balancing, None, self.player)
|
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):
|
def create_items(self):
|
||||||
# create item pool
|
# create item pool
|
||||||
pool = []
|
pool = []
|
||||||
|
@ -149,8 +134,8 @@ class Hylics2World(World):
|
||||||
slot_data: Dict[str, Any] = {
|
slot_data: Dict[str, Any] = {
|
||||||
"party_shuffle": self.options.party_shuffle.value,
|
"party_shuffle": self.options.party_shuffle.value,
|
||||||
"medallion_shuffle": self.options.medallion_shuffle.value,
|
"medallion_shuffle": self.options.medallion_shuffle.value,
|
||||||
"random_start" : self.options.random_start.value,
|
"random_start": int(self.options.start_location != "waynehouse"),
|
||||||
"start_location" : self.start_location,
|
"start_location" : self.options.start_location.current_option_name,
|
||||||
"death_link": self.options.death_link.value
|
"death_link": self.options.death_link.value
|
||||||
}
|
}
|
||||||
return slot_data
|
return slot_data
|
||||||
|
@ -189,14 +174,14 @@ class Hylics2World(World):
|
||||||
# create entrance and connect it to parent and destination regions
|
# create entrance and connect it to parent and destination regions
|
||||||
ent = Entrance(self.player, f"{reg.name} {k}", reg)
|
ent = Entrance(self.player, f"{reg.name} {k}", reg)
|
||||||
reg.exits.append(ent)
|
reg.exits.append(ent)
|
||||||
if k == "New Game" and self.options.random_start:
|
if k == "New Game":
|
||||||
if self.start_location == "Waynehouse":
|
if self.options.start_location == "waynehouse":
|
||||||
ent.connect(region_table[2])
|
ent.connect(region_table[2])
|
||||||
elif self.start_location == "Viewax's Edifice":
|
elif self.options.start_location == "viewaxs_edifice":
|
||||||
ent.connect(region_table[6])
|
ent.connect(region_table[6])
|
||||||
elif self.start_location == "TV Island":
|
elif self.options.start_location == "tv_island":
|
||||||
ent.connect(region_table[9])
|
ent.connect(region_table[9])
|
||||||
elif self.start_location == "Shield Facility":
|
elif self.options.start_location == "shield_facility":
|
||||||
ent.connect(region_table[11])
|
ent.connect(region_table[11])
|
||||||
else:
|
else:
|
||||||
for name, num in Exits.exit_lookup_table.items():
|
for name, num in Exits.exit_lookup_table.items():
|
||||||
|
|
Loading…
Reference in New Issue