Pokemon Emerald: Change dexsanity to not create locations for blacklisted wilds (#3056)

This commit is contained in:
Bryce Wilson
2024-05-04 13:44:38 -06:00
committed by GitHub
parent 005fc4e864
commit 7603b4a88f
3 changed files with 21 additions and 10 deletions

View File

@@ -242,9 +242,9 @@ def randomize_wild_encounters(world: "PokemonEmeraldWorld") -> None:
RandomizeWildPokemon.option_match_type,
RandomizeWildPokemon.option_match_base_stats_and_type,
}
catch_em_all = world.options.dexsanity == Toggle.option_true
catch_em_all_placed = set()
already_placed = set()
num_placeable_species = NUM_REAL_SPECIES - len(world.blacklisted_wilds)
priority_species = [data.constants["SPECIES_WAILORD"], data.constants["SPECIES_RELICANTH"]]
@@ -290,8 +290,8 @@ def randomize_wild_encounters(world: "PokemonEmeraldWorld") -> None:
# If dexsanity/catch 'em all mode, blacklist already placed species
# until every species has been placed once
if catch_em_all and len(catch_em_all_placed) < NUM_REAL_SPECIES:
blacklists[1].append(catch_em_all_placed)
if world.options.dexsanity and len(already_placed) < num_placeable_species:
blacklists[1].append(already_placed)
# Blacklist from player options
blacklists[2].append(world.blacklisted_wilds)
@@ -329,8 +329,8 @@ def randomize_wild_encounters(world: "PokemonEmeraldWorld") -> None:
new_species_id = world.random.choice(candidates).species_id
species_old_to_new_map[species_id] = new_species_id
if catch_em_all and map_data.name not in POSTGAME_MAPS:
catch_em_all_placed.add(new_species_id)
if world.options.dexsanity and map_data.name not in POSTGAME_MAPS:
already_placed.add(new_species_id)
# Actually create the new list of slots and encounter table
new_slots: List[int] = []