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

@@ -5,7 +5,7 @@ from typing import TYPE_CHECKING, Dict, Optional, FrozenSet, Iterable
from BaseClasses import Location, Region
from .data import BASE_OFFSET, POKEDEX_OFFSET, data
from .data import BASE_OFFSET, NATIONAL_ID_TO_SPECIES_ID, POKEDEX_OFFSET, data
from .items import offset_item_value
if TYPE_CHECKING:
@@ -130,8 +130,14 @@ def create_locations_with_tags(world: "PokemonEmeraldWorld", regions: Dict[str,
location_data = data.locations[location_name]
location_id = offset_flag(location_data.flag)
if location_data.flag == 0:
location_id += POKEDEX_OFFSET + int(location_name[15:])
if location_data.flag == 0: # Dexsanity location
national_dex_id = int(location_name[-3:]) # Location names are formatted POKEDEX_REWARD_###
# Don't create this pokedex location if player can't find it in the wild
if NATIONAL_ID_TO_SPECIES_ID[national_dex_id] in world.blacklisted_wilds:
continue
location_id += POKEDEX_OFFSET + national_dex_id
location = PokemonEmeraldLocation(
world.player,