Add randomize encounters feature (per-route + bulk)
Per-route: Randomize/Re-roll button in EncounterModal picks a uniform
random pokemon from eligible (non-duped) encounters. Bulk: new
POST /runs/{run_id}/encounters/bulk-randomize endpoint fills all
remaining routes in order, respecting dupes clause cascading, pinwheel
zones, and route group locking. Frontend Randomize All button on the
run page triggers the bulk endpoint with a confirm dialog.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,3 +33,7 @@ export function fetchEvolutions(pokemonId: number, region?: string): Promise<Evo
|
||||
export function fetchForms(pokemonId: number): Promise<Pokemon[]> {
|
||||
return api.get(`/pokemon/${pokemonId}/forms`)
|
||||
}
|
||||
|
||||
export function bulkRandomizeEncounters(runId: number): Promise<{ created: unknown[]; skippedRoutes: number }> {
|
||||
return api.post(`/runs/${runId}/encounters/bulk-randomize`, {})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user