Pokemon Emerald: Add Free Fly Blacklist ()

Co-authored-by: Jasper den Brok <jasper.den.brok@gmail.com>
This commit is contained in:
Jasper den Brok 2025-01-24 22:30:21 +01:00 committed by GitHub
parent 7474c27372
commit 3d1d6908c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 12 deletions
worlds/pokemon_emerald

View File

@ -33,6 +33,18 @@ VISITED_EVENT_NAME_TO_ID = {
"EVENT_VISITED_SOUTHERN_ISLAND": 17,
}
BLACKLIST_OPTION_TO_VISITED_EVENT = {
"Slateport City": "EVENT_VISITED_SLATEPORT_CITY",
"Mauville City": "EVENT_VISITED_MAUVILLE_CITY",
"Verdanturf Town": "EVENT_VISITED_VERDANTURF_TOWN",
"Fallarbor Town": "EVENT_VISITED_FALLARBOR_TOWN",
"Lavaridge Town": "EVENT_VISITED_LAVARIDGE_TOWN",
"Fortree City": "EVENT_VISITED_FORTREE_CITY",
"Lilycove City": "EVENT_VISITED_LILYCOVE_CITY",
"Mossdeep City": "EVENT_VISITED_MOSSDEEP_CITY",
"Sootopolis City": "EVENT_VISITED_SOOTOPOLIS_CITY",
"Ever Grande City": "EVENT_VISITED_EVER_GRANDE_CITY",
}
class PokemonEmeraldLocation(Location):
game: str = "Pokemon Emerald"
@ -129,18 +141,10 @@ def set_free_fly(world: "PokemonEmeraldWorld") -> None:
# If not enabled, set it to Littleroot Town by default
fly_location_name = "EVENT_VISITED_LITTLEROOT_TOWN"
if world.options.free_fly_location:
fly_location_name = world.random.choice([
"EVENT_VISITED_SLATEPORT_CITY",
"EVENT_VISITED_MAUVILLE_CITY",
"EVENT_VISITED_VERDANTURF_TOWN",
"EVENT_VISITED_FALLARBOR_TOWN",
"EVENT_VISITED_LAVARIDGE_TOWN",
"EVENT_VISITED_FORTREE_CITY",
"EVENT_VISITED_LILYCOVE_CITY",
"EVENT_VISITED_MOSSDEEP_CITY",
"EVENT_VISITED_SOOTOPOLIS_CITY",
"EVENT_VISITED_EVER_GRANDE_CITY",
])
blacklisted_locations = set(BLACKLIST_OPTION_TO_VISITED_EVENT[city] for city in world.options.free_fly_blacklist.value)
free_fly_locations = sorted(set(BLACKLIST_OPTION_TO_VISITED_EVENT.values()) - blacklisted_locations)
if free_fly_locations:
fly_location_name = world.random.choice(free_fly_locations)
world.free_fly_location_id = VISITED_EVENT_NAME_TO_ID[fly_location_name]

View File

@ -725,6 +725,24 @@ class FreeFlyLocation(Toggle):
"""
display_name = "Free Fly Location"
class FreeFlyBlacklist(OptionSet):
"""
Disables specific locations as valid free fly locations.
Has no effect if Free Fly Location is disabled.
"""
display_name = "Free Fly Blacklist"
valid_keys = [
"Slateport City",
"Mauville City",
"Verdanturf Town",
"Fallarbor Town",
"Lavaridge Town",
"Fortree City",
"Lilycove City",
"Mossdeep City",
"Sootopolis City",
"Ever Grande City",
]
class HmRequirements(Choice):
"""
@ -876,6 +894,7 @@ class PokemonEmeraldOptions(PerGameCommonOptions):
extra_bumpy_slope: ExtraBumpySlope
modify_118: ModifyRoute118
free_fly_location: FreeFlyLocation
free_fly_blacklist: FreeFlyBlacklist
hm_requirements: HmRequirements
turbo_a: TurboA