develop #19

Merged
TheFurya merged 17 commits from develop into main 2026-02-13 09:32:50 +01:00
5 changed files with 862 additions and 97067 deletions
Showing only changes of commit b7be099aee - Show all commits

View File

@@ -0,0 +1,11 @@
---
# nuzlocke-tracker-opg6
title: Exclude Max Raid den routes from Sword/Shield game data
status: completed
type: task
priority: normal
created_at: 2026-02-13T08:17:07Z
updated_at: 2026-02-13T08:17:53Z
---
Sword/Shield game JSONs contain ~561 den child routes out of ~1,007 total entries (~56%). These are Max Raid Battle dens named like '(Den I - ...)'. Add a filter_den_routes() function in processing.py and call it in __main__.py for sword-shield only, then re-run the import.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -19,7 +19,7 @@ from pathlib import Path
from .loader import load_pokedb_data, load_seed_config from .loader import load_pokedb_data, load_seed_config
from .mappings import PokemonMapper, LocationMapper, build_version_map, map_encounter_method from .mappings import PokemonMapper, LocationMapper, build_version_map, map_encounter_method
from .output import sort_routes, merge_special_encounters, write_game_json, write_games_json, write_pokemon_json from .output import sort_routes, merge_special_encounters, write_game_json, write_games_json, write_pokemon_json
from .processing import filter_encounters_for_game, process_encounters, build_routes from .processing import filter_encounters_for_game, process_encounters, build_routes, filter_den_routes
from .sprites import download_all_sprites, download_sprites from .sprites import download_all_sprites, download_sprites
SEEDS_DIR_CANDIDATES = [ SEEDS_DIR_CANDIDATES = [
@@ -200,6 +200,10 @@ def main(argv: list[str] | None = None) -> None:
# Build route hierarchy # Build route hierarchy
routes = build_routes(encounters_by_area, location_mapper) routes = build_routes(encounters_by_area, location_mapper)
# Filter out Max Raid den child routes (Sword/Shield only)
if vg_key == "sword-shield":
routes = filter_den_routes(routes)
# Merge special encounters (starters, gifts, fossils) # Merge special encounters (starters, gifts, fossils)
routes = merge_special_encounters(routes, config, vg_key, pokemon_mapper) routes = merge_special_encounters(routes, config, vg_key, pokemon_mapper)

View File

@@ -341,3 +341,15 @@ def build_routes(
)) ))
return routes return routes
def filter_den_routes(routes: list[Route]) -> list[Route]:
"""Remove Max Raid den child routes from the route list.
Dens are identified by "(Den " in the child route name.
Only children are filtered — parent routes are kept.
"""
for route in routes:
if route.children:
route.children = [c for c in route.children if "(Den " not in c.name]
return routes