Unified Professor Oak Tracker hub (ORAS and Luminescent Platinum) with Docker and Unraid setup
This commit is contained in:
commit
f86f5d8bef
61 files changed
+58805
No files matched your search
@@ -0,0 +1,28 @@
|
||||
# Pokémon Omega Ruby & Alpha Sapphire — Professor Oak Challenge Tracker
|
||||
|
||||
A dark-mode web application modeled on the **Luminescent 2.1 Professor Oak Tracker** spreadsheet, rebuilt for **Pokémon Alpha Sapphire** and **Pokémon Omega Ruby (Nintendo 3DS)** with Gym Leader level-cap progression, per-route trainer checklists, and multiple save profiles per version.
|
||||
|
||||
## Features
|
||||
|
||||
- **Omega Ruby & Alpha Sapphire Modes:** Switch cleanly between **Pokémon Alpha Sapphire** (410 Solo POC Pokémon) and **Pokémon Omega Ruby** (410 Solo POC Pokémon) in the header, automatically adapting version-exclusive wild encounters, Mirage Fossils/Legendaries, Southern Island (`Latias` / `Latios`), and **Team Aqua** vs. **Team Magma** battles.
|
||||
- **Multiple Save Profiles per Game:** Create, rename, delete, and swap between independent save profiles (`Save 1`, custom challenge runs, etc.) for either version—complete with per-save caught counts and isolated JSON backup exports/imports.
|
||||
- **Global Caught Sync:** Checking any Pokémon **Caught** inside any route encounter table, Mirage Spot, evolution checklist, species modal, or the Pokédex table immediately highlights every occurrence of that species across the entire tracker in mint green (`#B7E1CD`), matching the signature conditional-formatting rule from the reference spreadsheet.
|
||||
- **10 Level-Capped Badge Checkpoints:** Tracks every section from **Pre-Badge 1 (Roxanne · Lv. 14)** through **Pre-Elite Four (Champion Steven · Lv. 59)** and **Post-Game**, scheduling evolutions at the earliest checkpoint whose upcoming Gym Leader / Champion level cap allows them (`≤ Lv. 14`, `16`, `21`, `28`, `30`, `35`, `45`, `46`, `59`, `79`). Includes an optional **Secret Super Training** toggle (off by default) if you prefer skipping 510-EV minigames and waiting for overworld / NPC / Dive Shard stones.
|
||||
- **Route-Level Collapsible Trainer & Gym Cards:** Expand regular route trainers, Gyms, Rival lineups (adapting to your chosen starter), Team Aqua/Magma raids, Victory Road, Pokémon League, and Delta Episode battles directly under the route header where they take place, with defeated checkboxes.
|
||||
- **Mutually Exclusive Choices:** All Hoenn starters, Route 111 fossils, and post-game starter gifts appear directly in the checklist—checking one option automatically locks out the alternatives in Strict Solo mode (and unchecking it unlocks them again). Switch **Strict Solo Cartridge / Show All** in the toolbar to view trade evolutions and opposite-version exclusives too.
|
||||
- **Sortable & Searchable Pokédex, ORAS Movedex, External Guides & Sprites:** Sort by `Hoenn #`, `Nat #`, `Name`, `Caught`, `Earliest Milestone`, or `Evolution Method`. Every Pokédex row includes an arrow popup menu linking straight to **Serebii (Gen 6)**, **Bulbapedia**, **Pokémon Database**, and **Smogon**. Clicking any Pokémon opens its Regular & Shiny ORAS sprites, evolution family with evolution item icons, all route locations, and a searchable **ORAS Movedex** (Level-Up, TM/HM, Move Tutor, and Egg moves).
|
||||
- **Zero-Dependency & Offline-Ready:** Built with standard ES modules, CSS, and Node.js built-ins—no npm install required. Sprites and item icons load from [PokeAPI/sprites](https://github.com/PokeAPI/sprites), or automatically from `assets/sprites/` if you download the `sprites/` folder locally. Progress auto-saves to `localStorage` and supports JSON export/import backups.
|
||||
|
||||
## Running Locally
|
||||
|
||||
```bash
|
||||
node server.mjs
|
||||
```
|
||||
|
||||
Then open [http://127.0.0.1:4173](http://127.0.0.1:4173) in your browser.
|
||||
|
||||
## Running Tests
|
||||
|
||||
```bash
|
||||
node --test tests/*.test.mjs
|
||||
```
|
||||
@@ -0,0 +1,14 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Omega Ruby & Alpha Sapphire — Professor Oak Challenge Tracker</title>
|
||||
<link rel="stylesheet" href="./src/styles/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="./src/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "professor-oak-tracker-oras",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"description": "Professor Oak Challenge tracker webapp for Pokémon Alpha Sapphire (3DS), modeled on the Luminescent 2.1 Professor Oak Tracker spreadsheet and architected for Omega Ruby expansion.",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "node server.mjs",
|
||||
"test": "node --test tests/*.test.mjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
import http from 'node:http';
|
||||
import fs from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const PORT = Number(process.env.PORT || 4173);
|
||||
const HOST = process.env.HOST || '127.0.0.1';
|
||||
|
||||
const MIME_TYPES = {
|
||||
'.html': 'text/html; charset=utf-8',
|
||||
'.js': 'application/javascript; charset=utf-8',
|
||||
'.mjs': 'application/javascript; charset=utf-8',
|
||||
'.css': 'text/css; charset=utf-8',
|
||||
'.json': 'application/json; charset=utf-8',
|
||||
'.svg': 'image/svg+xml',
|
||||
'.png': 'image/png',
|
||||
'.ico': 'image/x-icon',
|
||||
};
|
||||
|
||||
export function createStaticServer(rootDir = __dirname) {
|
||||
const resolvedRoot = path.resolve(rootDir);
|
||||
|
||||
return http.createServer(async (req, res) => {
|
||||
try {
|
||||
const rawPath = (req.url || '/').split('?')[0];
|
||||
const decodedRaw = decodeURIComponent(rawPath);
|
||||
if (decodedRaw.split(/[\\/]/).includes('..')) {
|
||||
res.writeHead(403, { 'Content-Type': 'text/plain; charset=utf-8' });
|
||||
res.end('Forbidden');
|
||||
return;
|
||||
}
|
||||
|
||||
const reqUrl = new URL(req.url || '/', 'http://localhost');
|
||||
let relPath = decodeURIComponent(reqUrl.pathname);
|
||||
if (relPath === '/api/assets-status') {
|
||||
const localSpritesDir = path.join(resolvedRoot, 'assets', 'sprites', 'pokemon');
|
||||
const dirStat = await fs.stat(localSpritesDir).catch(() => null);
|
||||
res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'no-cache' });
|
||||
res.end(JSON.stringify({ hasLocalSprites: Boolean(dirStat?.isDirectory()) }));
|
||||
return;
|
||||
}
|
||||
if (relPath === '/') relPath = '/index.html';
|
||||
|
||||
const targetPath = path.resolve(resolvedRoot, '.' + relPath);
|
||||
if (targetPath !== resolvedRoot && !targetPath.startsWith(resolvedRoot + path.sep)) {
|
||||
res.writeHead(403, { 'Content-Type': 'text/plain; charset=utf-8' });
|
||||
res.end('Forbidden');
|
||||
return;
|
||||
}
|
||||
|
||||
const stat = await fs.stat(targetPath).catch(() => null);
|
||||
if (!stat || !stat.isFile()) {
|
||||
res.writeHead(404, { 'Content-Type': 'text/plain; charset=utf-8' });
|
||||
res.end('Not found');
|
||||
return;
|
||||
}
|
||||
|
||||
const ext = path.extname(targetPath).toLowerCase();
|
||||
const contentType = MIME_TYPES[ext] || 'application/octet-stream';
|
||||
const content = await fs.readFile(targetPath);
|
||||
res.writeHead(200, {
|
||||
'Content-Type': contentType,
|
||||
'Cache-Control': 'no-cache',
|
||||
});
|
||||
res.end(content);
|
||||
} catch (err) {
|
||||
res.writeHead(500, { 'Content-Type': 'text/plain; charset=utf-8' });
|
||||
res.end(`Server error: ${err.message}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
||||
const server = createStaticServer();
|
||||
server.listen(PORT, HOST, () => {
|
||||
console.log(`Professor Oak Tracker running at http://${HOST}:${PORT}`);
|
||||
});
|
||||
}
|
||||
+461
@@ -0,0 +1,461 @@
|
||||
import { createTrackerStore, computeGameProgress } from './state/tracker-store.js';
|
||||
import { renderHeader } from './ui/header.js';
|
||||
import { renderSidebar } from './ui/sidebar.js';
|
||||
import { renderRoutesView } from './ui/routes-view.js';
|
||||
import { renderPokedexView } from './ui/pokedex-view.js';
|
||||
import { renderGuideView } from './ui/guide-view.js';
|
||||
import { renderProfileModal, renderSpeciesModal } from './ui/modal.js';
|
||||
import { setSpriteBaseUrl } from './ui/sprites.js';
|
||||
|
||||
export function mountApp(rootEl, store = createTrackerStore()) {
|
||||
let toastTimeout = null;
|
||||
|
||||
function showToast(message) {
|
||||
let toast = document.getElementById('poc-toast');
|
||||
if (!toast) {
|
||||
toast = document.createElement('div');
|
||||
toast.id = 'poc-toast';
|
||||
toast.className = 'poc-toast';
|
||||
document.body.appendChild(toast);
|
||||
}
|
||||
toast.textContent = message;
|
||||
toast.classList.add('visible');
|
||||
clearTimeout(toastTimeout);
|
||||
toastTimeout = setTimeout(() => toast.classList.remove('visible'), 2600);
|
||||
}
|
||||
|
||||
function positionExternalMenu(openMenu) {
|
||||
if (!openMenu) return;
|
||||
const trigger = rootEl.querySelector(
|
||||
`[data-open-ext-menu="${openMenu.speciesId}"][data-ext-context="${openMenu.context}"]`,
|
||||
);
|
||||
const menu = rootEl.querySelector(
|
||||
`[data-ext-menu-panel="${openMenu.speciesId}"][data-ext-context="${openMenu.context}"]`,
|
||||
);
|
||||
if (!trigger || !menu) return;
|
||||
|
||||
const rect = trigger.getBoundingClientRect();
|
||||
const menuWidth = menu.offsetWidth || 244;
|
||||
const menuHeight = menu.offsetHeight || 228;
|
||||
const margin = 8;
|
||||
|
||||
let top = rect.bottom + 4;
|
||||
if (top + menuHeight > window.innerHeight - margin && rect.top - menuHeight - 4 > margin) {
|
||||
top = rect.top - menuHeight - 4;
|
||||
}
|
||||
|
||||
let left = rect.right - menuWidth;
|
||||
if (left < margin) {
|
||||
left = rect.left;
|
||||
}
|
||||
left = Math.max(margin, Math.min(left, window.innerWidth - menuWidth - margin));
|
||||
|
||||
menu.style.position = 'fixed';
|
||||
menu.style.top = `${Math.round(top)}px`;
|
||||
menu.style.left = `${Math.round(left)}px`;
|
||||
}
|
||||
|
||||
function render() {
|
||||
const activeEl = document.activeElement;
|
||||
const focusedSearchId =
|
||||
activeEl && (activeEl.id === 'global-search' || activeEl.id === 'movedex-search')
|
||||
? activeEl.id
|
||||
: null;
|
||||
const selStart = focusedSearchId ? activeEl.selectionStart : null;
|
||||
const selEnd = focusedSearchId ? activeEl.selectionEnd : null;
|
||||
|
||||
const state = store.getState();
|
||||
const game = store.getGame();
|
||||
const progress = computeGameProgress(game, state.caught, state.ruleset);
|
||||
const profiles = store.getProfilesWithCounts();
|
||||
|
||||
let mainHtml = '';
|
||||
if (state.activeTab === 'routes') {
|
||||
mainHtml = renderRoutesView(game, state, progress);
|
||||
} else if (state.activeTab === 'pokedex') {
|
||||
mainHtml = renderPokedexView(store, state);
|
||||
} else {
|
||||
mainHtml = renderGuideView(game);
|
||||
}
|
||||
|
||||
rootEl.innerHTML = `
|
||||
<div class="app-shell">
|
||||
${renderHeader(game, state, progress, profiles)}
|
||||
<div class="workspace-grid ${state.activeTab === 'guide' ? 'no-rail' : ''}">
|
||||
${state.activeTab === 'guide' ? '' : renderSidebar(game, state, progress)}
|
||||
<main class="main-pane" id="main-pane">${mainHtml}</main>
|
||||
</div>
|
||||
${renderSpeciesModal(game, state)}
|
||||
${renderProfileModal(game, state)}
|
||||
</div>
|
||||
`;
|
||||
|
||||
positionExternalMenu(state.openExternalMenu);
|
||||
|
||||
if (state.profileModal) {
|
||||
const profileInput = rootEl.querySelector('#profile-name-input');
|
||||
if (profileInput) {
|
||||
profileInput.focus();
|
||||
profileInput.select();
|
||||
}
|
||||
} else if (focusedSearchId) {
|
||||
const searchEl = rootEl.querySelector(`#${focusedSearchId}`);
|
||||
if (searchEl) {
|
||||
searchEl.focus();
|
||||
if (selStart !== null && selEnd !== null) {
|
||||
searchEl.setSelectionRange(selStart, selEnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
const state = store.getState();
|
||||
const activeProfile = store.getActiveProfile();
|
||||
const profileSlug = (activeProfile?.name || 'save-1')
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9]+/g, '-')
|
||||
.replace(/^-|-$/g, '') || 'save';
|
||||
const json = store.exportJson();
|
||||
const blob = new Blob([json], { type: 'application/json' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = `${state.gameId}-${profileSlug}-poc-save-${new Date().toISOString().slice(0, 10)}.json`;
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
showToast(`Exported "${activeProfile?.name || 'Save'}" backup (.json)`);
|
||||
}
|
||||
|
||||
function handleImport() {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.accept = '.json,application/json';
|
||||
input.addEventListener('change', async () => {
|
||||
const file = input.files?.[0];
|
||||
if (!file) return;
|
||||
try {
|
||||
const text = await file.text();
|
||||
const count = store.importJson(text);
|
||||
showToast(`Imported ${count} caught Pokémon`);
|
||||
} catch (err) {
|
||||
showToast(`Import failed: ${err.message}`);
|
||||
}
|
||||
});
|
||||
input.click();
|
||||
}
|
||||
|
||||
rootEl.addEventListener('click', (e) => {
|
||||
const extTriggerBtn = e.target.closest('[data-open-ext-menu]');
|
||||
if (extTriggerBtn) {
|
||||
store.toggleExternalMenu(
|
||||
extTriggerBtn.dataset.openExtMenu,
|
||||
extTriggerBtn.dataset.extContext || 'pokedex',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const extMenuItem = e.target.closest('.ext-links-menu a.ext-links-item');
|
||||
if (extMenuItem) {
|
||||
// Allow browser to follow target="_blank" link before closing the popup DOM node
|
||||
setTimeout(() => store.closeExternalMenu(), 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.target.closest('.ext-links-menu')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const hadExternalMenu = store.closeExternalMenu();
|
||||
if (hadExternalMenu && e.target.classList.contains('modal-backdrop')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const modalToggleBtn = e.target.closest('[data-toggle-species-btn]');
|
||||
if (modalToggleBtn) {
|
||||
store.toggleCaught(modalToggleBtn.dataset.toggleSpeciesBtn);
|
||||
return;
|
||||
}
|
||||
|
||||
const inspectBtn = e.target.closest('[data-inspect-species]');
|
||||
if (inspectBtn) {
|
||||
store.setSelectedSpeciesId(inspectBtn.dataset.inspectSpecies);
|
||||
return;
|
||||
}
|
||||
|
||||
const tabBtn = e.target.closest('[data-tab]');
|
||||
if (tabBtn) {
|
||||
store.setActiveTab(tabBtn.dataset.tab);
|
||||
return;
|
||||
}
|
||||
|
||||
const jumpTabBtn = e.target.closest('[data-jump-tab]');
|
||||
if (jumpTabBtn) {
|
||||
store.setActiveTab(jumpTabBtn.dataset.jumpTab);
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
return;
|
||||
}
|
||||
|
||||
const sectionBtn = e.target.closest('[data-section-id]');
|
||||
if (sectionBtn) {
|
||||
store.setActiveSectionId(sectionBtn.dataset.sectionId);
|
||||
return;
|
||||
}
|
||||
|
||||
const jumpSectionBtn = e.target.closest('[data-jump-section]');
|
||||
if (jumpSectionBtn) {
|
||||
store.setActiveTab('routes');
|
||||
store.setActiveSectionId(jumpSectionBtn.dataset.jumpSection);
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
return;
|
||||
}
|
||||
|
||||
const markSectionBtn = e.target.closest('[data-mark-section]');
|
||||
if (markSectionBtn) {
|
||||
const value = markSectionBtn.dataset.markValue === '1';
|
||||
store.setSectionCaught(markSectionBtn.dataset.markSection, value);
|
||||
return;
|
||||
}
|
||||
|
||||
const areaToggleBtn = e.target.closest('[data-toggle-area]');
|
||||
if (areaToggleBtn) {
|
||||
store.toggleAreaCollapsed(areaToggleBtn.dataset.toggleArea);
|
||||
return;
|
||||
}
|
||||
|
||||
const groupToggleBtn = e.target.closest('[data-toggle-group]');
|
||||
if (groupToggleBtn) {
|
||||
store.toggleGroupCollapsed(groupToggleBtn.dataset.toggleGroup);
|
||||
return;
|
||||
}
|
||||
|
||||
const areaTrainersToggleBtn = e.target.closest('[data-toggle-area-trainers]');
|
||||
if (areaTrainersToggleBtn) {
|
||||
store.toggleAreaTrainersExpanded(areaTrainersToggleBtn.dataset.toggleAreaTrainers);
|
||||
return;
|
||||
}
|
||||
|
||||
const dexFilterBtn = e.target.closest('[data-dex-filter]');
|
||||
if (dexFilterBtn) {
|
||||
store.setPokedexFilter(dexFilterBtn.dataset.dexFilter);
|
||||
return;
|
||||
}
|
||||
|
||||
const switchGameBtn = e.target.closest('[data-switch-game]');
|
||||
if (switchGameBtn) {
|
||||
store.switchGame(switchGameBtn.dataset.switchGame);
|
||||
return;
|
||||
}
|
||||
|
||||
const movedexTabBtn = e.target.closest('[data-movedex-tab]');
|
||||
if (movedexTabBtn) {
|
||||
store.setMovedexTab(movedexTabBtn.dataset.movedexTab);
|
||||
return;
|
||||
}
|
||||
|
||||
const sortBtn = e.target.closest('[data-sort-col]');
|
||||
if (sortBtn) {
|
||||
store.setPokedexSort(sortBtn.dataset.sortCol);
|
||||
return;
|
||||
}
|
||||
|
||||
const actionEl = e.target.closest('[data-action]');
|
||||
if (actionEl) {
|
||||
const action = actionEl.dataset.action;
|
||||
if (action === 'close-modal') {
|
||||
if (
|
||||
e.target.classList.contains('modal-backdrop') ||
|
||||
actionEl.tagName === 'BUTTON'
|
||||
) {
|
||||
store.setSelectedSpeciesId(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (action === 'close-profile-modal') {
|
||||
if (
|
||||
e.target.classList.contains('modal-backdrop') ||
|
||||
actionEl.tagName === 'BUTTON'
|
||||
) {
|
||||
store.setProfileModal(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (action === 'new-profile') {
|
||||
store.setProfileModal({ mode: 'create' });
|
||||
return;
|
||||
}
|
||||
if (action === 'rename-profile') {
|
||||
store.setProfileModal({ mode: 'rename', profileId: store.getState().profileId });
|
||||
return;
|
||||
}
|
||||
if (action === 'delete-profile') {
|
||||
const activeProfile = store.getActiveProfile();
|
||||
if (
|
||||
store.getState().profiles.length > 1 &&
|
||||
window.confirm(`Delete save profile "${activeProfile?.name || 'Save'}" for ${store.getGame().title}?`)
|
||||
) {
|
||||
store.deleteProfile(activeProfile?.id);
|
||||
showToast('Save profile deleted');
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (action === 'clear-search') {
|
||||
store.setSearchQuery('');
|
||||
return;
|
||||
}
|
||||
if (action === 'clear-movedex-search') {
|
||||
store.setMovedexSearch('');
|
||||
return;
|
||||
}
|
||||
if (action === 'expand-all') {
|
||||
store.setAllCollapsed(false);
|
||||
return;
|
||||
}
|
||||
if (action === 'collapse-all') {
|
||||
store.setAllCollapsed(true);
|
||||
return;
|
||||
}
|
||||
if (action === 'scroll-top') {
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
return;
|
||||
}
|
||||
if (action === 'reset-filters') {
|
||||
store.setSearchQuery('');
|
||||
store.setUncaughtOnly(false);
|
||||
store.setMethodFilter('all');
|
||||
store.setActiveSectionId('all');
|
||||
return;
|
||||
}
|
||||
if (action === 'export-json') {
|
||||
handleExport();
|
||||
return;
|
||||
}
|
||||
if (action === 'import-json') {
|
||||
handleImport();
|
||||
return;
|
||||
}
|
||||
if (action === 'reset-progress') {
|
||||
const activeProfile = store.getActiveProfile();
|
||||
if (
|
||||
window.confirm(
|
||||
`Reset all caught & trainer progress for ${store.getGame().title} (${activeProfile?.name || 'Save 1'})?`,
|
||||
)
|
||||
) {
|
||||
store.resetProgress();
|
||||
showToast('Save progress reset');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
rootEl.addEventListener('submit', (e) => {
|
||||
if (e.target.id === 'profile-modal-form') {
|
||||
e.preventDefault();
|
||||
const mode = e.target.dataset.profileMode;
|
||||
const profileId = e.target.dataset.profileId;
|
||||
const input = e.target.querySelector('#profile-name-input');
|
||||
const value = input?.value?.trim();
|
||||
if (!value) return;
|
||||
if (mode === 'rename') {
|
||||
store.renameProfile(profileId, value);
|
||||
showToast(`Renamed save to "${value}"`);
|
||||
} else {
|
||||
const created = store.createProfile(value);
|
||||
showToast(`Created save "${created.name}"`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
rootEl.addEventListener('input', (e) => {
|
||||
if (e.target.id === 'global-search') {
|
||||
store.setSearchQuery(e.target.value);
|
||||
} else if (e.target.id === 'movedex-search') {
|
||||
store.setMovedexSearch(e.target.value);
|
||||
}
|
||||
});
|
||||
|
||||
rootEl.addEventListener('change', (e) => {
|
||||
if (e.target.dataset.toggleSpecies) {
|
||||
store.toggleCaught(e.target.dataset.toggleSpecies);
|
||||
} else if (e.target.dataset.toggleTrainer) {
|
||||
store.toggleTrainerDefeated(e.target.dataset.toggleTrainer);
|
||||
} else if (e.target.id === 'profile-select') {
|
||||
store.switchProfile(e.target.value);
|
||||
} else if (e.target.id === 'uncaught-only-toggle') {
|
||||
store.setUncaughtOnly(e.target.checked);
|
||||
} else if (e.target.id === 'super-training-toggle') {
|
||||
store.setIncludeSuperTraining(e.target.checked);
|
||||
showToast(
|
||||
e.target.checked
|
||||
? 'Secret Super Training stones enabled (Pre-Badge 1/3/7 unlocks)'
|
||||
: 'Secret Super Training skipped (overworld / Shard stone timing)',
|
||||
);
|
||||
} else if (e.target.id === 'method-filter') {
|
||||
store.setMethodFilter(e.target.value);
|
||||
} else if (e.target.id === 'ruleset-select') {
|
||||
store.setRuleset(e.target.value);
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Escape') {
|
||||
const current = store.getState();
|
||||
if (current.openExternalMenu) {
|
||||
store.closeExternalMenu();
|
||||
} else if (current.profileModal) {
|
||||
store.setProfileModal(null);
|
||||
} else if (current.selectedSpeciesId) {
|
||||
store.setSelectedSpeciesId(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener(
|
||||
'scroll',
|
||||
(e) => {
|
||||
if (!store.getState().openExternalMenu) return;
|
||||
if (e.target instanceof Element && e.target.closest('.ext-links-menu')) return;
|
||||
store.closeExternalMenu();
|
||||
},
|
||||
true,
|
||||
);
|
||||
|
||||
rootEl.addEventListener(
|
||||
'error',
|
||||
(e) => {
|
||||
const img = e.target;
|
||||
if (typeof HTMLImageElement === 'undefined' || !(img instanceof HTMLImageElement)) return;
|
||||
const fallback = img.dataset.fallbackSrc;
|
||||
if (fallback && img.src !== fallback) {
|
||||
img.dataset.fallbackSrc = '';
|
||||
img.src = fallback;
|
||||
} else {
|
||||
img.classList.add('sprite-broken');
|
||||
}
|
||||
},
|
||||
true,
|
||||
);
|
||||
|
||||
store.subscribe(render);
|
||||
render();
|
||||
|
||||
if (typeof fetch === 'function') {
|
||||
fetch('./api/assets-status')
|
||||
.then((res) => (res.ok ? res.json() : null))
|
||||
.then((data) => {
|
||||
if (data?.hasLocalSprites) {
|
||||
setSpriteBaseUrl('./assets/sprites');
|
||||
render();
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
return store;
|
||||
}
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
const root = document.getElementById('app');
|
||||
if (root) {
|
||||
mountApp(root);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,40 @@
|
||||
import {
|
||||
ALPHA_SAPPHIRE_DATA,
|
||||
ALPHA_SAPPHIRE_SUPER_TRAINING_DATA,
|
||||
} from './alpha-sapphire.js';
|
||||
import {
|
||||
OMEGA_RUBY_DATA,
|
||||
OMEGA_RUBY_SUPER_TRAINING_DATA,
|
||||
} from './omega-ruby.js';
|
||||
|
||||
/**
|
||||
* Registry of supported games (defaulting to skipping Secret Super Training stones).
|
||||
*/
|
||||
export const GAMES = {
|
||||
[ALPHA_SAPPHIRE_DATA.id]: ALPHA_SAPPHIRE_DATA,
|
||||
[OMEGA_RUBY_DATA.id]: OMEGA_RUBY_DATA,
|
||||
};
|
||||
|
||||
const GAME_VARIANTS = {
|
||||
[ALPHA_SAPPHIRE_DATA.id]: {
|
||||
standard: ALPHA_SAPPHIRE_DATA,
|
||||
superTraining: ALPHA_SAPPHIRE_SUPER_TRAINING_DATA,
|
||||
},
|
||||
[OMEGA_RUBY_DATA.id]: {
|
||||
standard: OMEGA_RUBY_DATA,
|
||||
superTraining: OMEGA_RUBY_SUPER_TRAINING_DATA,
|
||||
},
|
||||
};
|
||||
|
||||
export const UPCOMING_GAMES = [];
|
||||
|
||||
export const DEFAULT_GAME_ID = ALPHA_SAPPHIRE_DATA.id;
|
||||
|
||||
export function getGame(gameId = DEFAULT_GAME_ID, { includeSuperTraining = false } = {}) {
|
||||
const variants = GAME_VARIANTS[gameId] || GAME_VARIANTS[DEFAULT_GAME_ID];
|
||||
return includeSuperTraining ? variants.superTraining : variants.standard;
|
||||
}
|
||||
|
||||
export function listGames() {
|
||||
return Object.values(GAMES);
|
||||
}
|
||||
@@ -0,0 +1,393 @@
|
||||
import {
|
||||
ALPHA_SAPPHIRE_TRAINERS_BY_AREA,
|
||||
ALPHA_SAPPHIRE_EXTRA_AREAS,
|
||||
mon,
|
||||
trainer,
|
||||
} from './alpha-sapphire-trainers.js';
|
||||
|
||||
function cloneWithOrIds(trainers) {
|
||||
return structuredClone(trainers).map((t) => ({
|
||||
...t,
|
||||
id: t.id.replace(/^as-/, 'or-'),
|
||||
}));
|
||||
}
|
||||
|
||||
function replaceTrainer(list, trainerId, replacement) {
|
||||
const idx = list.findIndex((t) => t.id === trainerId);
|
||||
if (idx === -1) {
|
||||
throw new Error(`Omega Ruby trainer override target not found: ${trainerId}`);
|
||||
}
|
||||
list[idx] = replacement;
|
||||
}
|
||||
|
||||
const byArea = {};
|
||||
for (const [areaId, trainers] of Object.entries(ALPHA_SAPPHIRE_TRAINERS_BY_AREA)) {
|
||||
byArea[areaId] = cloneWithOrIds(trainers);
|
||||
}
|
||||
|
||||
// 1. Petalburg Woods: Team Magma Grunt
|
||||
replaceTrainer(
|
||||
byArea['petalburg-woods'],
|
||||
'or-pwoods-aqua',
|
||||
trainer('or-pwoods-magma', 'Team Magma Grunt', 'Team Magma', 'Devon Researcher Event', [mon('Poochyena', 9)], {
|
||||
reward: '₽360 · Exp. Share',
|
||||
}),
|
||||
);
|
||||
|
||||
// 2. Rusturf Tunnel: Team Magma Grunt
|
||||
replaceTrainer(
|
||||
byArea['rusturf-tunnel'],
|
||||
'or-rusturf-aqua',
|
||||
trainer('or-rusturf-magma', 'Team Magma Grunt', 'Team Magma', 'Rusturf Tunnel', [mon('Poochyena', 13)], {
|
||||
reward: 'Devon Parts & Peeko rescued · Super Potion',
|
||||
}),
|
||||
);
|
||||
|
||||
// 3. Slateport Oceanic Museum: Team Magma Grunts
|
||||
replaceTrainer(
|
||||
byArea['slateport-city'],
|
||||
'or-museum-aqua-1',
|
||||
trainer('or-museum-magma-1', 'Team Magma Grunt #1', 'Team Magma', 'Oceanic Museum 2F', [mon('Numel', 16)], {
|
||||
reward: 'Story Progression',
|
||||
}),
|
||||
);
|
||||
replaceTrainer(
|
||||
byArea['slateport-city'],
|
||||
'or-museum-aqua-2',
|
||||
trainer('or-museum-magma-2', 'Team Magma Grunt #2', 'Team Magma', 'Oceanic Museum 2F', [mon('Numel', 16)], {
|
||||
reward: 'Devon Parts delivered · Maxie encounter',
|
||||
}),
|
||||
);
|
||||
|
||||
// 4. Meteor Falls 1F: Multi Battle vs Magma Admin Tabitha & Grunt
|
||||
replaceTrainer(
|
||||
byArea['meteor-falls-main'],
|
||||
'or-mf-shelly-multi',
|
||||
trainer(
|
||||
'or-mf-tabitha-multi',
|
||||
'Team Magma Admin Tabitha & Grunt',
|
||||
'Team Magma',
|
||||
'Meteor Falls 1F (Prof. Cozmo Event)',
|
||||
[mon('Koffing', 23), mon('Mightyena', 23), mon('Numel', 25)],
|
||||
{
|
||||
reward: 'Story progression (Team Magma flees to Mt. Chimney)',
|
||||
note: 'Multi Battle w/ Rival',
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
// 5. Route 115: Collector Hector uses Seviper in Omega Ruby
|
||||
replaceTrainer(
|
||||
byArea['route-115-north'],
|
||||
'or-r115-hector',
|
||||
trainer('or-r115-hector', 'Collector Hector', 'Trainer', 'South Beach (Omega Ruby)', [mon('Seviper', 24)]),
|
||||
);
|
||||
|
||||
// 6. Southern Island: Magma Admin Courtney & Grunt (Latios gift)
|
||||
replaceTrainer(
|
||||
byArea['route-118-southern-island'],
|
||||
'or-si-matt',
|
||||
trainer(
|
||||
'or-si-courtney',
|
||||
'Team Magma Admin Courtney & Grunt',
|
||||
'Team Magma',
|
||||
'Southern Island (Story)',
|
||||
[mon('Camerupt', 31), mon('Koffing', 29)],
|
||||
{
|
||||
reward: 'Latios (Lv. 30) & Mega Bracelet',
|
||||
note: 'Multi Battle w/ Steven Stone',
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
// 7. Route 119 Weather Institute: Team Magma Grunts & Admin Tabitha
|
||||
replaceTrainer(
|
||||
byArea['route-119'],
|
||||
'or-wi-aqua-1',
|
||||
trainer(
|
||||
'or-wi-magma-1',
|
||||
'Team Magma Grunt #1',
|
||||
'Team Magma',
|
||||
'Weather Institute 1F',
|
||||
[mon('Mightyena', 28), mon('Golbat', 28)],
|
||||
),
|
||||
);
|
||||
replaceTrainer(
|
||||
byArea['route-119'],
|
||||
'or-wi-aqua-2',
|
||||
trainer('or-wi-magma-2', 'Team Magma Grunt #2', 'Team Magma', 'Weather Institute 1F', [mon('Koffing', 30)]),
|
||||
);
|
||||
replaceTrainer(
|
||||
byArea['route-119'],
|
||||
'or-wi-aqua-3',
|
||||
trainer(
|
||||
'or-wi-magma-3',
|
||||
'Team Magma Grunt #3',
|
||||
'Team Magma',
|
||||
'Weather Institute 2F',
|
||||
[mon('Numel', 28), mon('Mightyena', 28)],
|
||||
),
|
||||
);
|
||||
replaceTrainer(
|
||||
byArea['route-119'],
|
||||
'or-wi-aqua-4',
|
||||
trainer('or-wi-magma-4', 'Team Magma Grunt #4', 'Team Magma', 'Weather Institute 2F', [mon('Golbat', 30)]),
|
||||
);
|
||||
replaceTrainer(
|
||||
byArea['route-119'],
|
||||
'or-wi-shelly',
|
||||
trainer('or-wi-tabitha', 'Team Magma Admin Tabitha', 'Team Magma', 'Weather Institute 2F', [mon('Camerupt', 32)], {
|
||||
reward: 'Castform (Lv. 30) gifted after victory',
|
||||
}),
|
||||
);
|
||||
|
||||
// 8. Mt. Pyre Summit: Team Magma Grunts & Admin Courtney
|
||||
replaceTrainer(
|
||||
byArea['mt-pyre'],
|
||||
'or-pyre-aqua-1',
|
||||
trainer('or-pyre-magma-1', 'Team Magma Grunt #1', 'Team Magma', 'Summit', [mon('Koffing', 36)]),
|
||||
);
|
||||
replaceTrainer(
|
||||
byArea['mt-pyre'],
|
||||
'or-pyre-aqua-2',
|
||||
trainer(
|
||||
'or-pyre-magma-2',
|
||||
'Team Magma Grunt #2',
|
||||
'Team Magma',
|
||||
'Summit',
|
||||
[mon('Numel', 33), mon('Mightyena', 35)],
|
||||
),
|
||||
);
|
||||
replaceTrainer(
|
||||
byArea['mt-pyre'],
|
||||
'or-pyre-aqua-3',
|
||||
trainer(
|
||||
'or-pyre-magma-3',
|
||||
'Team Magma Grunt #3',
|
||||
'Team Magma',
|
||||
'Summit',
|
||||
[mon('Mightyena', 34), mon('Golbat', 34)],
|
||||
),
|
||||
);
|
||||
replaceTrainer(
|
||||
byArea['mt-pyre'],
|
||||
'or-pyre-matt',
|
||||
trainer('or-pyre-courtney', 'Team Magma Admin Courtney', 'Team Magma', 'Summit', [mon('Camerupt', 38)], {
|
||||
reward: '₽3,800 · Red Orb / Story progression',
|
||||
}),
|
||||
);
|
||||
|
||||
export const OMEGA_RUBY_TRAINERS_BY_AREA = byArea;
|
||||
|
||||
export const OMEGA_RUBY_EXTRA_AREAS = ALPHA_SAPPHIRE_EXTRA_AREAS.map((area) => {
|
||||
const cloned = {
|
||||
...area,
|
||||
trainers: cloneWithOrIds(area.trainers),
|
||||
};
|
||||
|
||||
if (area.id === 'mt-chimney') {
|
||||
cloned.subtitle = 'Team Magma showdown for the Meteorite';
|
||||
cloned.trainers = [
|
||||
trainer(
|
||||
'or-chimney-magma',
|
||||
'Team Magma Grunt',
|
||||
'Team Magma',
|
||||
'Summit',
|
||||
[mon('Poochyena', 22), mon('Koffing', 22)],
|
||||
{ reward: '₽880' },
|
||||
),
|
||||
trainer(
|
||||
'or-chimney-tabitha',
|
||||
'Team Magma Admin Tabitha',
|
||||
'Team Magma',
|
||||
'Summit',
|
||||
[mon('Koffing', 24), mon('Numel', 24)],
|
||||
{ reward: '₽2,400' },
|
||||
),
|
||||
trainer(
|
||||
'or-chimney-maxie',
|
||||
'Team Magma Leader Maxie',
|
||||
'Team Magma',
|
||||
'Machine Summit',
|
||||
[mon('Mightyena', 25), mon('Golbat', 25), mon('Camerupt', 27)],
|
||||
{ reward: '₽4,320 · Meteorite recovered' },
|
||||
),
|
||||
];
|
||||
} else if (area.id === 'lilycove-aqua-hideout') {
|
||||
cloned.id = 'lilycove-magma-hideout';
|
||||
cloned.name = 'Lilycove City & Team Magma Hideout';
|
||||
cloned.subtitle = 'Rival battle outside Department Store + Team Magma Hideout raid';
|
||||
const lilycoveRival = cloned.trainers[0];
|
||||
cloned.trainers = [
|
||||
lilycoveRival,
|
||||
trainer(
|
||||
'or-hideout-magma-1',
|
||||
'Team Magma Grunt #1',
|
||||
'Team Magma',
|
||||
'Hideout 1F South',
|
||||
[mon('Koffing', 35), mon('Numel', 35)],
|
||||
{ reward: '₽1,400' },
|
||||
),
|
||||
trainer(
|
||||
'or-hideout-magma-2',
|
||||
'Team Magma Grunt #2',
|
||||
'Team Magma',
|
||||
'Hideout 1F North',
|
||||
[mon('Numel', 35), mon('Koffing', 35)],
|
||||
{ reward: '₽1,400' },
|
||||
),
|
||||
trainer('or-hideout-magma-3', 'Team Magma Grunt #3', 'Team Magma', 'B1F Corridor', [mon('Mightyena', 37)], {
|
||||
reward: '₽1,480',
|
||||
}),
|
||||
trainer('or-hideout-magma-4', 'Team Magma Grunt #4', 'Team Magma', 'B1F Corridor', [mon('Golbat', 37)], {
|
||||
reward: '₽1,480',
|
||||
}),
|
||||
trainer(
|
||||
'or-hideout-magma-5',
|
||||
'Team Magma Grunt #5',
|
||||
'Team Magma',
|
||||
'Warp & Lab Rooms',
|
||||
[mon('Mightyena', 34), mon('Golbat', 36)],
|
||||
{ reward: '₽1,440' },
|
||||
),
|
||||
trainer('or-hideout-magma-6', 'Team Magma Grunt #6', 'Team Magma', 'Deep Chamber', [mon('Numel', 37)], {
|
||||
reward: '₽1,480',
|
||||
}),
|
||||
trainer(
|
||||
'or-hideout-horde',
|
||||
'Team Magma Grunts (Horde)',
|
||||
'Team Magma',
|
||||
'Submarine Room',
|
||||
[
|
||||
mon('Poochyena', 18),
|
||||
mon('Poochyena', 18),
|
||||
mon('Poochyena', 18),
|
||||
mon('Poochyena', 18),
|
||||
mon('Poochyena', 18),
|
||||
],
|
||||
{ reward: '₽720', note: 'Horde Battle (5 Grunts)' },
|
||||
),
|
||||
trainer('or-hideout-courtney', 'Team Magma Admin Courtney', 'Team Magma', 'Submarine Dock', [mon('Camerupt', 39)], {
|
||||
reward: '₽3,900 · Master Ball inside side room',
|
||||
}),
|
||||
];
|
||||
} else if (area.id === 'seafloor-cavern') {
|
||||
cloned.subtitle = 'Team Magma base where Maxie awakens Primal Groudon';
|
||||
cloned.trainers = [
|
||||
trainer(
|
||||
'or-seafloor-magma-1',
|
||||
'Team Magma Grunt #1',
|
||||
'Team Magma',
|
||||
'Room 1',
|
||||
[mon('Numel', 39), mon('Mightyena', 39)],
|
||||
{ reward: '₽1,560' },
|
||||
),
|
||||
trainer('or-seafloor-magma-2', 'Team Magma Grunt #2', 'Team Magma', 'Room 1', [mon('Golbat', 41)], {
|
||||
reward: '₽1,640',
|
||||
}),
|
||||
trainer('or-seafloor-magma-3', 'Team Magma Grunt #3', 'Team Magma', 'Room 2', [mon('Numel', 41)]),
|
||||
trainer('or-seafloor-magma-4', 'Team Magma Grunt #4', 'Team Magma', 'Room 3', [mon('Weezing', 41)]),
|
||||
trainer(
|
||||
'or-seafloor-magma-5',
|
||||
'Team Magma Grunt #5',
|
||||
'Team Magma',
|
||||
'Room 7',
|
||||
[mon('Mightyena', 38), mon('Weezing', 40)],
|
||||
),
|
||||
trainer(
|
||||
'or-seafloor-maxie',
|
||||
'Team Magma Leader Maxie',
|
||||
'Team Magma',
|
||||
'Room 10 (Deepest Chamber)',
|
||||
[mon('Mightyena', 41), mon('Weezing', 41), mon('Crobat', 41), mon('Camerupt', 43, 'Mega Evolves')],
|
||||
{ reward: 'Triggers Primal Groudon & Cave of Origin climax' },
|
||||
),
|
||||
];
|
||||
} else if (area.id === 'delta-petalburg') {
|
||||
cloned.trainers = [
|
||||
trainer(
|
||||
'or-delta-petalburg-courtney',
|
||||
'Team Magma Admin Courtney',
|
||||
'Delta Episode',
|
||||
'Outside Wally’s House',
|
||||
[mon('Camerupt', 53)],
|
||||
{ reward: '₽5,300' },
|
||||
),
|
||||
];
|
||||
} else if (area.id === 'delta-rustboro') {
|
||||
cloned.subtitle = 'Three consecutive Team Magma Grunt fights outside Devon Corporation';
|
||||
cloned.trainers = [
|
||||
trainer(
|
||||
'or-delta-devon-magma-1',
|
||||
'Team Magma Grunt #1',
|
||||
'Team Magma',
|
||||
'Devon Corp Gate',
|
||||
[mon('Mightyena', 48), mon('Golbat', 50)],
|
||||
{ reward: '₽2,000' },
|
||||
),
|
||||
trainer('or-delta-devon-magma-2', 'Team Magma Grunt #2', 'Team Magma', 'Devon Corp Gate', [mon('Weezing', 51)]),
|
||||
trainer(
|
||||
'or-delta-devon-magma-3',
|
||||
'Team Magma Grunt #3',
|
||||
'Team Magma',
|
||||
'Devon Corp Gate',
|
||||
[mon('Golbat', 49), mon('Camerupt', 49)],
|
||||
),
|
||||
];
|
||||
} else if (area.id === 'delta-space-center') {
|
||||
cloned.subtitle = 'Team Magma assault + Tag Battle alongside Steven';
|
||||
cloned.trainers = [
|
||||
trainer(
|
||||
'or-delta-space-horde',
|
||||
'Team Magma Grunts (Horde)',
|
||||
'Team Magma',
|
||||
'Space Center 1F',
|
||||
[
|
||||
mon('Mightyena', 25),
|
||||
mon('Mightyena', 25),
|
||||
mon('Mightyena', 25),
|
||||
mon('Mightyena', 25),
|
||||
mon('Mightyena', 25),
|
||||
],
|
||||
{ note: 'Horde Battle (5 Grunts)' },
|
||||
),
|
||||
trainer(
|
||||
'or-delta-space-courtney',
|
||||
'Magma Admin Courtney & Grunt',
|
||||
'Delta Episode',
|
||||
'Space Center 2F',
|
||||
[mon('Camerupt', 55, 'Mega Evolves'), mon('Weezing', 51), mon('Mightyena', 51)],
|
||||
{ reward: '₽7,540', note: 'Multi Battle w/ Steven Stone' },
|
||||
),
|
||||
];
|
||||
} else if (area.id === 'delta-aqua-hideout') {
|
||||
cloned.id = 'delta-magma-hideout';
|
||||
cloned.name = 'Team Magma Hideout (Delta Episode Revisit)';
|
||||
cloned.subtitle = 'High-level rematch Grunts while pursuing Zinnia to Maxie’s chamber';
|
||||
cloned.trainers = [
|
||||
trainer('or-delta-hideout-1', 'Team Magma Grunt #1', 'Team Magma', 'Hideout 1F', [
|
||||
mon('Weezing', 49),
|
||||
mon('Numel', 49),
|
||||
]),
|
||||
trainer('or-delta-hideout-2', 'Team Magma Grunt #2', 'Team Magma', 'Hideout 1F', [mon('Golbat', 51)]),
|
||||
trainer('or-delta-hideout-3', 'Team Magma Grunt #3', 'Team Magma', 'Hideout B1F', [
|
||||
mon('Mightyena', 48),
|
||||
mon('Golbat', 50),
|
||||
]),
|
||||
trainer('or-delta-hideout-4', 'Team Magma Grunt #4', 'Team Magma', 'Hideout B1F', [mon('Mightyena', 51)]),
|
||||
trainer('or-delta-hideout-5', 'Team Magma Grunt #5', 'Team Magma', 'Hideout B1F', [
|
||||
mon('Numel', 49),
|
||||
mon('Weezing', 49),
|
||||
]),
|
||||
trainer('or-delta-hideout-6', 'Team Magma Grunt #6', 'Team Magma', 'Deep Chamber', [mon('Numel', 51)], {
|
||||
reward: 'Cameruptite gifted by Tabitha & Maxie after cutscenes',
|
||||
}),
|
||||
];
|
||||
} else if (area.insertAfterAreaId === 'lilycove-aqua-hideout') {
|
||||
cloned.insertAfterAreaId = 'lilycove-magma-hideout';
|
||||
} else if (area.insertAfterAreaId === 'delta-aqua-hideout') {
|
||||
cloned.insertAfterAreaId = 'delta-magma-hideout';
|
||||
}
|
||||
|
||||
return cloned;
|
||||
});
|
||||
@@ -0,0 +1,316 @@
|
||||
import { HOENN_BASE_DATA, attachTrainerAreas } from './alpha-sapphire.js';
|
||||
import {
|
||||
OMEGA_RUBY_TRAINERS_BY_AREA,
|
||||
OMEGA_RUBY_EXTRA_AREAS,
|
||||
} from './omega-ruby-trainers.js';
|
||||
import { applySuperTrainingOption } from './super-training.js';
|
||||
|
||||
function getSection(data, sectionId) {
|
||||
const section = data.sections.find((s) => s.id === sectionId);
|
||||
if (!section) throw new Error(`Missing section: ${sectionId}`);
|
||||
return section;
|
||||
}
|
||||
|
||||
function getArea(section, areaId) {
|
||||
const area = section.areas.find((a) => a.id === areaId);
|
||||
if (!area) throw new Error(`Missing area ${areaId} in ${section.id}`);
|
||||
return area;
|
||||
}
|
||||
|
||||
function swapSpeciesInArea(area, fromId, toEntry) {
|
||||
let replaced = 0;
|
||||
for (const group of area.groups) {
|
||||
for (let i = 0; i < group.entries.length; i++) {
|
||||
if (group.entries[i].speciesId === fromId) {
|
||||
group.entries[i] = { ...group.entries[i], ...toEntry };
|
||||
replaced++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (replaced === 0) {
|
||||
throw new Error(`Expected species "${fromId}" in area "${area.id}" for Omega Ruby swap`);
|
||||
}
|
||||
}
|
||||
|
||||
function removeSpeciesInArea(area, speciesId) {
|
||||
let removed = 0;
|
||||
for (const group of area.groups) {
|
||||
const before = group.entries.length;
|
||||
group.entries = group.entries.filter((e) => e.speciesId !== speciesId);
|
||||
removed += before - group.entries.length;
|
||||
}
|
||||
if (removed === 0) {
|
||||
throw new Error(`Expected species "${speciesId}" to remove in area "${area.id}"`);
|
||||
}
|
||||
}
|
||||
|
||||
function createOmegaRubyData() {
|
||||
const data = structuredClone(HOENN_BASE_DATA);
|
||||
data.id = 'omega-ruby';
|
||||
data.title = 'Pokémon Omega Ruby';
|
||||
data.shortTitle = 'Omega Ruby';
|
||||
data.accentColor = '#ef4444';
|
||||
data.themeClass = 'version-or';
|
||||
|
||||
// Section 1: Pre-Badge 1 (Seedot / Nuzleaf / Shiftry replace Lotad / Lombre / Ludicolo)
|
||||
const s1 = getSection(data, 'pre-badge-1');
|
||||
s1.summary =
|
||||
'Everything reachable from Littleroot Town through Rustboro City, Route 116, and Rusturf Tunnel before challenging Roxanne. Level Cap: Lv. 14 (Nosepass) — only evolutions achievable at ≤ Lv. 14 (such as Beautifly, Dustox, Nuzleaf/Shiftry, and Delcatty) are required here.';
|
||||
swapSpeciesInArea(getArea(s1, 'route-102'), 'lotad', {
|
||||
speciesId: 'seedot',
|
||||
notes: 'Omega Ruby exclusive',
|
||||
});
|
||||
const s1Evos = getArea(s1, 'pre-badge-1-evolutions');
|
||||
swapSpeciesInArea(s1Evos, 'lombre', {
|
||||
speciesId: 'nuzleaf',
|
||||
rate: 'Lv. 14',
|
||||
levels: 'From Seedot',
|
||||
});
|
||||
swapSpeciesInArea(s1Evos, 'ludicolo', {
|
||||
speciesId: 'shiftry',
|
||||
rate: 'Stone',
|
||||
levels: 'Leaf Stone',
|
||||
notes: 'Secret Super Training (Venusaur) · Lv. 14 Nuzleaf',
|
||||
});
|
||||
|
||||
// Section 2: Pre-Badge 2 (Granite Cave 1F only; B1F/B2F wait for Mach Bike in Mauville)
|
||||
const s2 = getSection(data, 'pre-badge-2');
|
||||
s2.summary =
|
||||
'Sail with Mr. Briney to Dewford Town, pick up the Old Rod (sail back to Route 102 / Petalburg for Goldeen after delivering Steven’s Letter), and explore Granite Cave 1F for Abra & Geodude (B1F/B2F wait for the Mach Bike in Mauville). Level Cap: Lv. 16 (Makuhita) — unlocks Stage-1 Starter evolutions and Kadabra.';
|
||||
|
||||
// Section 3: Pre-Badge 3 (Granite Cave B2F Mawile, Route 110 Minun, Route 117 Illumise)
|
||||
const s3 = getSection(data, 'pre-badge-3');
|
||||
s3.summary =
|
||||
'Explore Slateport City (Incense shop & Cosplay Pikachu), Route 110, Mauville City (grab the Mach Bike -> backtrack to Granite Cave B1F/B2F for Aron & Mawile!), Route 117 (Pokémon Day Care!), and Route 111 South. Level Cap: Lv. 21 (Magneton) — unlocks Lv. 18–21 evolutions including Gyarados, Kirlia/Gallade, Vileplume/Bellossom, and Roserade.';
|
||||
swapSpeciesInArea(getArea(s3, 'granite-cave-basement'), 'sableye', {
|
||||
speciesId: 'mawile',
|
||||
notes: 'B2F · Omega Ruby exclusive',
|
||||
});
|
||||
const r110 = getArea(s3, 'route-110');
|
||||
r110.groups[0].entries = r110.groups[0].entries.map((e) =>
|
||||
e.speciesId === 'plusle'
|
||||
? { ...e, speciesId: 'minun', notes: 'Omega Ruby Walking (Plusle in AS)' }
|
||||
: e,
|
||||
);
|
||||
r110.groups[1].entries = r110.groups[1].entries.map((e) => {
|
||||
if (e.speciesId === 'plusle') {
|
||||
return { ...e, speciesId: 'minun', rate: 'Common', notes: 'Common Horde in Omega Ruby' };
|
||||
}
|
||||
if (e.speciesId === 'minun') {
|
||||
return { ...e, speciesId: 'plusle', rate: 'Rare', notes: 'Rare Horde in Omega Ruby' };
|
||||
}
|
||||
return e;
|
||||
});
|
||||
const r117 = getArea(s3, 'route-117');
|
||||
r117.groups[0].entries = r117.groups[0].entries.map((e) => {
|
||||
if (e.speciesId === 'volbeat') {
|
||||
return { ...e, speciesId: 'illumise', notes: 'More common in Omega Ruby' };
|
||||
}
|
||||
if (e.speciesId === 'illumise') {
|
||||
return { ...e, speciesId: 'volbeat', notes: 'Rare in Omega Ruby' };
|
||||
}
|
||||
return e;
|
||||
});
|
||||
|
||||
// Section 4: Pre-Badge 4 (Fiery Path Koffing/Grimer swap, Nuzleaf/Seedot, Zangoose, Solrock)
|
||||
const s4 = getSection(data, 'pre-badge-4');
|
||||
const fiery = getArea(s4, 'fiery-path');
|
||||
fiery.groups[0].entries = fiery.groups[0].entries.map((e) => {
|
||||
if (e.speciesId === 'grimer') {
|
||||
return { ...e, speciesId: 'koffing', notes: 'Common in Omega Ruby (5% in AS)' };
|
||||
}
|
||||
if (e.speciesId === 'koffing') {
|
||||
return { ...e, speciesId: 'grimer', notes: 'Rare in Omega Ruby (30% in AS)' };
|
||||
}
|
||||
return e;
|
||||
});
|
||||
fiery.groups[1].entries = fiery.groups[1].entries.map((e) =>
|
||||
e.speciesId === 'grimer'
|
||||
? { ...e, speciesId: 'koffing', notes: 'Omega Ruby Horde' }
|
||||
: e,
|
||||
);
|
||||
const r114 = getArea(s4, 'route-114');
|
||||
swapSpeciesInArea(r114, 'lombre', {
|
||||
speciesId: 'nuzleaf',
|
||||
notes: 'Omega Ruby exclusive',
|
||||
});
|
||||
swapSpeciesInArea(r114, 'seviper', {
|
||||
speciesId: 'zangoose',
|
||||
notes: 'Omega Ruby exclusive',
|
||||
});
|
||||
swapSpeciesInArea(r114, 'lotad', {
|
||||
speciesId: 'seedot',
|
||||
notes: 'Omega Ruby exclusive',
|
||||
});
|
||||
swapSpeciesInArea(getArea(s4, 'meteor-falls-main'), 'lunatone', {
|
||||
speciesId: 'solrock',
|
||||
notes: 'Omega Ruby exclusive',
|
||||
});
|
||||
|
||||
// Section 6: Pre-Badge 6 (Latios replaces Latias on Southern Island)
|
||||
const s6 = getSection(data, 'pre-badge-6');
|
||||
s6.summary =
|
||||
'Defeating Norman unlocks HM03 Surf! Cross Route 118 for the Good Rod, receive Latios on Southern Island, grab Castform & Feebas on Route 119, reach Route 115 North, and sweep Route 120. Level Cap: Lv. 35 (Altaria) — unlocks Lv. 32–35 evolutions, Surf/Rod evolutions, and Milotic.';
|
||||
swapSpeciesInArea(getArea(s6, 'route-118-southern-island'), 'latias', {
|
||||
speciesId: 'latios',
|
||||
notes: 'Joins on Southern Island (Omega Ruby) w/ Latiosite',
|
||||
});
|
||||
|
||||
// Section 7: Pre-Badge 7 (Team Magma Hideout wording)
|
||||
const s7 = getSection(data, 'pre-badge-7');
|
||||
s7.summary =
|
||||
'Explore Routes 121–123, Safari Zone, Mt. Pyre, Shoal Cave, Team Magma Hideout, and Super Rod waters. Level Cap: Lv. 45 (Solrock & Lunatone) — unlocks final Starters, Fossils, Slaking, Exploud, Aggron, Flygon, Wailord, and Walrein.';
|
||||
|
||||
// Section 8: Pre-Badge 8 (Groudon, Throh, Skrelp, Ho-Oh, Dome/Armor/Plume fossils, Palkia, Tornadus, Reshiram)
|
||||
const s8 = getSection(data, 'pre-badge-8');
|
||||
s8.summary =
|
||||
'HM07 Dive unlocks Underwater, Seafloor Cavern, and Cave of Origin (Groudon). Dealing with Primal Groudon unlocks the Eon Flute, National Pokédex (talk to Prof. Birch!), DexNav Hidden Pokémon, New Mauville, Mirage Spots, Soaring, and Legendaries. Level Cap: Lv. 46 (Milotic) — Lv. 48+ evolutions (including Dragalge) wait for Victory Road / Post-Game.';
|
||||
|
||||
const caveOrigin = getArea(s8, 'cave-of-origin-story');
|
||||
caveOrigin.name = 'Cave of Origin & Post-Groudon Unlocks';
|
||||
swapSpeciesInArea(caveOrigin, 'kyogre', {
|
||||
speciesId: 'groudon',
|
||||
notes: 'Omega Ruby exclusive · unlocks NatDex & Soaring',
|
||||
});
|
||||
|
||||
const dexEarly = getArea(s8, 'dexnav-early-routes');
|
||||
dexEarly.subtitle = 'Unlocked after dealing with Groudon + getting National Dex from Birch';
|
||||
|
||||
const dexMidLate = getArea(s8, 'dexnav-mid-late-routes');
|
||||
swapSpeciesInArea(dexMidLate, 'sawk', {
|
||||
speciesId: 'throh',
|
||||
notes: 'Route 112 · Omega Ruby exclusive',
|
||||
});
|
||||
swapSpeciesInArea(dexMidLate, 'clauncher', {
|
||||
speciesId: 'skrelp',
|
||||
notes: 'Routes 105–109 · Omega Ruby exclusive',
|
||||
});
|
||||
|
||||
const scorched = getArea(s8, 'new-mauville-scorched-slab');
|
||||
for (const group of scorched.groups) {
|
||||
for (const e of group.entries) {
|
||||
if (e.speciesId === 'heatran') {
|
||||
e.notes = 'Scorched Slab B3F after Groudon';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const seaMauville = getArea(s8, 'sea-mauville-specials');
|
||||
seaMauville.subtitle = 'Spiritomb & Omega Ruby Exclusive Ho-Oh';
|
||||
swapSpeciesInArea(seaMauville, 'lugia', {
|
||||
speciesId: 'ho-oh',
|
||||
notes: 'Scanner -> Clear Bell (Slateport) · Omega Ruby exclusive',
|
||||
});
|
||||
|
||||
const soaring = getArea(s8, 'soaring-wild-flocks');
|
||||
soaring.subtitle = 'Levels: 40 – 50 (Eon Flute unlocked after Groudon)';
|
||||
|
||||
const mirage = getArea(s8, 'mirage-spots');
|
||||
swapSpeciesInArea(mirage, 'omanyte', {
|
||||
speciesId: 'kabuto',
|
||||
notes: 'Dome Fossil · Omega Ruby exclusive',
|
||||
});
|
||||
swapSpeciesInArea(mirage, 'cranidos', {
|
||||
speciesId: 'shieldon',
|
||||
notes: 'Armor Fossil · Omega Ruby exclusive',
|
||||
});
|
||||
swapSpeciesInArea(mirage, 'tirtouga', {
|
||||
speciesId: 'archen',
|
||||
notes: 'Plume Fossil · Omega Ruby exclusive',
|
||||
});
|
||||
|
||||
const legMirage = getArea(s8, 'legendary-mirage-spots');
|
||||
for (const group of legMirage.groups) {
|
||||
for (const e of group.entries) {
|
||||
if (e.speciesId === 'raikou') e.notes = 'Trackless Forest (Ho-Oh in party; :00–:20)';
|
||||
if (e.speciesId === 'entei') e.notes = 'Trackless Forest (Ho-Oh in party; :20–:40)';
|
||||
if (e.speciesId === 'suicune') e.notes = 'Trackless Forest (Ho-Oh in party; :40–:00)';
|
||||
}
|
||||
}
|
||||
swapSpeciesInArea(legMirage, 'dialga', {
|
||||
speciesId: 'palkia',
|
||||
notes: 'Rift w/ Uxie, Mesprit, Azelf · Omega Ruby exclusive',
|
||||
});
|
||||
swapSpeciesInArea(legMirage, 'thundurus', {
|
||||
speciesId: 'tornadus',
|
||||
notes: 'Storm Cloud w/ Castform · Omega Ruby exclusive',
|
||||
});
|
||||
swapSpeciesInArea(legMirage, 'zekrom', {
|
||||
speciesId: 'reshiram',
|
||||
notes: 'Fabled Cave (Lv. 100 in party) · Omega Ruby exclusive',
|
||||
});
|
||||
|
||||
const s8Evos = getArea(s8, 'pre-badge-8-breeding-evos');
|
||||
swapSpeciesInArea(s8Evos, 'omastar', {
|
||||
speciesId: 'kabutops',
|
||||
rate: 'Lv. 40',
|
||||
levels: 'From Kabuto',
|
||||
});
|
||||
swapSpeciesInArea(s8Evos, 'rampardos', {
|
||||
speciesId: 'bastiodon',
|
||||
rate: 'Lv. 30',
|
||||
levels: 'From Shieldon',
|
||||
});
|
||||
swapSpeciesInArea(s8Evos, 'carracosta', {
|
||||
speciesId: 'archeops',
|
||||
rate: 'Lv. 37',
|
||||
levels: 'From Archen',
|
||||
});
|
||||
// Skrelp -> Dragalge evolves at Lv. 48 (> Wallace Lv. 46), so Dragalge unlocks in Pre-Elite 4
|
||||
removeSpeciesInArea(s8Evos, 'clawitzer');
|
||||
|
||||
// Section 9: Pre-Elite 4 (Solrock, Mawile, and Dragalge Lv. 48)
|
||||
const s9 = getSection(data, 'pre-elite-4');
|
||||
s9.summary =
|
||||
'Wallace awards the Rain Badge and HM05 Waterfall! Ascend the waterfall inside Meteor Falls (B1F Back Room) for Bagon -> Shelgon -> Salamence, and clear Victory Road. Level Cap: Lv. 59 (Steven’s Metagross) — unlocks Lv. 48–59 evolutions (Dragalge, Garchomp, Haxorus, Klinklang, Zweilous, Mandibuzz, Volcarona).';
|
||||
swapSpeciesInArea(getArea(s9, 'meteor-falls-backroom'), 'lunatone', {
|
||||
speciesId: 'solrock',
|
||||
notes: 'Omega Ruby exclusive',
|
||||
});
|
||||
swapSpeciesInArea(getArea(s9, 'victory-road'), 'sableye', {
|
||||
speciesId: 'mawile',
|
||||
notes: 'Omega Ruby exclusive',
|
||||
});
|
||||
getArea(s9, 'pre-e4-evolutions').groups[0].entries.unshift({
|
||||
speciesId: 'dragalge',
|
||||
rate: 'Lv. 48',
|
||||
levels: 'From Skrelp',
|
||||
notes: 'Omega Ruby exclusive',
|
||||
});
|
||||
|
||||
// Section 10: Post-Game (Mawile in Sky Pillar Walking)
|
||||
const s10 = getSection(data, 'post-game');
|
||||
swapSpeciesInArea(getArea(s10, 'sky-pillar-delta'), 'sableye', {
|
||||
speciesId: 'mawile',
|
||||
notes: 'Omega Ruby exclusive',
|
||||
});
|
||||
|
||||
// Update guide stones & Solo exclusions for Omega Ruby
|
||||
data.guide.superTrainingStones = data.guide.superTrainingStones.map((row) => {
|
||||
if (row.stone === 'Water Stone') {
|
||||
return { ...row, usedFor: 'Staryu -> Starmie, Eevee -> Vaporeon' };
|
||||
}
|
||||
if (row.stone === 'Leaf Stone') {
|
||||
return {
|
||||
...row,
|
||||
usedFor: 'Nuzleaf -> Shiftry (Pre-Badge 1 at Lv. 14), Gloom -> Vileplume (Pre-Badge 3)',
|
||||
};
|
||||
}
|
||||
return row;
|
||||
});
|
||||
|
||||
data.guide.soloExclusions = [
|
||||
{
|
||||
category: 'Alpha Sapphire Exclusives (21)',
|
||||
list: 'Lotad, Lombre, Ludicolo, Sableye, Seviper, Lunatone, Latias, Kyogre, Omanyte, Omastar, Lugia, Cranidos, Rampardos, Dialga, Sawk, Tirtouga, Carracosta, Thundurus, Zekrom, Clauncher, Clawitzer',
|
||||
},
|
||||
...data.guide.soloExclusions.slice(1),
|
||||
];
|
||||
|
||||
return attachTrainerAreas(data, OMEGA_RUBY_TRAINERS_BY_AREA, OMEGA_RUBY_EXTRA_AREAS);
|
||||
}
|
||||
|
||||
const OMEGA_RUBY_RAW = createOmegaRubyData();
|
||||
|
||||
export const OMEGA_RUBY_DATA = applySuperTrainingOption(OMEGA_RUBY_RAW, false);
|
||||
export const OMEGA_RUBY_SUPER_TRAINING_DATA = applySuperTrainingOption(OMEGA_RUBY_RAW, true);
|
||||
@@ -0,0 +1,283 @@
|
||||
/**
|
||||
* Overworld / Shard / Gift stone locations used when Secret Super Training is skipped.
|
||||
*/
|
||||
const OVERWORLD_STONE_SOURCES = {
|
||||
'Water Stone': 'Route 124 Treasure Hunter (Blue Shard via Dive · Pre-Badge 8)',
|
||||
'Dawn Stone': 'Victory Road exit (Wally gift · Pre-Elite 4) / Sea Mauville Room 1 Sisters 5% rematch',
|
||||
'Moon Stone': 'Meteor Falls 1F (west of waterfall · Pre-Badge 4), Jagged Pass',
|
||||
'Sun Stone': 'Mossdeep Space Center 1F Sailor gift (Pre-Badge 7), Inverse Battle / Secret Pal',
|
||||
'Leaf Stone': 'Route 119 (Surf · Pre-Badge 6), Route 124 Green Shard (Dive · Pre-Badge 8)',
|
||||
'Fire Stone': 'Fiery Path (Strength · Pre-Badge 5), Route 124 Red Shard (Dive · Pre-Badge 8)',
|
||||
'Thunder Stone': 'New Mauville ground item & Route 124 Yellow Shard (Dive · Pre-Badge 8)',
|
||||
'Shiny Stone': 'Route 121 northern grass (Cut · Pre-Badge 7), Inverse Battle / Secret Pal',
|
||||
'Dusk Stone': 'Mt. Pyre (Pre-Badge 7), Inverse Battle / Secret Pal',
|
||||
};
|
||||
|
||||
const OVERWORLD_USED_FOR = {
|
||||
'Water Stone': {
|
||||
as: 'Lombre -> Ludicolo (Pre-Badge 8), Staryu -> Starmie (Pre-Badge 8), Eevee -> Vaporeon (Pre-Badge 8)',
|
||||
or: 'Staryu -> Starmie (Pre-Badge 8), Eevee -> Vaporeon (Pre-Badge 8)',
|
||||
},
|
||||
'Dawn Stone': {
|
||||
both: '♂ Kirlia -> Gallade (Pre-Elite 4), ♀ Snorunt -> Froslass (Pre-Elite 4)',
|
||||
},
|
||||
'Moon Stone': {
|
||||
both: 'Skitty -> Delcatty (Pre-Badge 4), Jigglypuff -> Wigglytuff (Pre-Badge 6), Clefairy -> Clefable, Munna -> Musharna',
|
||||
},
|
||||
'Sun Stone': {
|
||||
both: 'Gloom -> Bellossom (Pre-Badge 7), Sunkern -> Sunflora, Cottonee -> Whimsicott, Petilil -> Lilligant',
|
||||
},
|
||||
'Leaf Stone': {
|
||||
as: 'Gloom -> Vileplume (Pre-Badge 6 · Route 119)',
|
||||
or: 'Nuzleaf -> Shiftry (Pre-Badge 6 · Route 119), Gloom -> Vileplume (Pre-Badge 8 · Route 124 Green Shard)',
|
||||
},
|
||||
'Thunder Stone': {
|
||||
both: 'Pikachu -> Raichu (Pre-Badge 8), Eevee -> Jolteon (Pre-Badge 8), Eelektrik -> Eelektross (Pre-Badge 8)',
|
||||
},
|
||||
'Shiny Stone': {
|
||||
both: 'Roselia -> Roserade (Pre-Badge 7 · Route 121), Togetic -> Togekiss, Minccino -> Cinccino',
|
||||
},
|
||||
};
|
||||
|
||||
function getSection(data, sectionId) {
|
||||
return data.sections.find((s) => s.id === sectionId);
|
||||
}
|
||||
|
||||
function getArea(section, areaId) {
|
||||
return section?.areas.find((a) => a.id === areaId);
|
||||
}
|
||||
|
||||
function getEvolutionGroup(section, areaId) {
|
||||
const area = getArea(section, areaId);
|
||||
return {
|
||||
area,
|
||||
group: area?.groups.find((g) => g.method === 'Evolution'),
|
||||
};
|
||||
}
|
||||
|
||||
function removeSpecies(entries, speciesIds) {
|
||||
const target = new Set(speciesIds);
|
||||
return entries.filter((entry) => !target.has(entry.speciesId));
|
||||
}
|
||||
|
||||
function enrichSuperTrainingGuide(data, includeSuperTraining) {
|
||||
const isOr = data.id === 'omega-ruby';
|
||||
if (!data.guide) return;
|
||||
|
||||
data.guide.superTrainingStones = (data.guide.superTrainingStones || []).map((row) => {
|
||||
const overworldSource = OVERWORLD_STONE_SOURCES[row.stone] || '';
|
||||
if (includeSuperTraining) {
|
||||
return { ...row, overworldSource };
|
||||
}
|
||||
const override = OVERWORLD_USED_FOR[row.stone];
|
||||
const usedFor = override
|
||||
? (isOr ? override.or : override.as) || override.both || row.usedFor
|
||||
: row.usedFor;
|
||||
return { ...row, overworldSource, usedFor };
|
||||
});
|
||||
|
||||
if (!includeSuperTraining && Array.isArray(data.guide.grindingTips)) {
|
||||
data.guide.grindingTips = data.guide.grindingTips.map((tip) => {
|
||||
if (!tip.title.startsWith('Secret Super Training')) return tip;
|
||||
return {
|
||||
title: 'Secret Super Training (Currently Skipped — Optional Toggle)',
|
||||
detail:
|
||||
'You currently have Secret Super Training stones disabled, so early stone evolutions wait for deterministic overworld pickups and shards: Moon Stone in Meteor Falls 1F (Pre-Badge 4), Leaf Stone on Route 119 (Pre-Badge 6), Sun Stone at Mossdeep Space Center & Shiny Stone on Route 121 (Pre-Badge 7), Water/Thunder/Leaf Shards on Route 124 & New Mauville (Pre-Badge 8), and Wally’s Dawn Stone on Victory Road (Pre-Elite 4). Turn on "Secret Super Training" in the header anytime to include the 510-EV minigame unlocks.',
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a game dataset variant configured either to skip Secret Super Training
|
||||
* stones (default) or require them at the earliest level-cap checkpoint.
|
||||
*/
|
||||
export function applySuperTrainingOption(baseGameData, includeSuperTraining = false) {
|
||||
const data = structuredClone(baseGameData);
|
||||
const enabled = Boolean(includeSuperTraining);
|
||||
const isOr = data.id === 'omega-ruby';
|
||||
data.includeSuperTraining = enabled;
|
||||
|
||||
if (enabled) {
|
||||
const s7 = getSection(data, 'pre-badge-7');
|
||||
const { group: s7Evo } = getEvolutionGroup(s7, 'pre-badge-7-evolutions');
|
||||
if (s7Evo) {
|
||||
const stNotes = {
|
||||
raichu: 'Secret Super Training (Stunfisk) · From Safari Zone Pikachu',
|
||||
starmie: 'Secret Super Training (Blastoise) · From Staryu',
|
||||
froslass: 'Secret Super Training (Gallade) · Lv. 42+ ♀ Snorunt',
|
||||
};
|
||||
s7Evo.entries = s7Evo.entries.map((entry) =>
|
||||
stNotes[entry.speciesId] ? { ...entry, notes: stNotes[entry.speciesId] } : entry,
|
||||
);
|
||||
}
|
||||
enrichSuperTrainingGuide(data, true);
|
||||
return data;
|
||||
}
|
||||
|
||||
// Pre-Badge 1: Delcatty (Moon) & Ludicolo/Shiftry (Water/Leaf) wait for later stones
|
||||
const s1 = getSection(data, 'pre-badge-1');
|
||||
if (s1) {
|
||||
s1.summary = isOr
|
||||
? 'Everything reachable from Littleroot Town through Rustboro City, Route 116, and Rusturf Tunnel before challenging Roxanne. Level Cap: Lv. 14 (Nosepass) — only evolutions achievable at ≤ Lv. 14 (such as Beautifly, Dustox, and Nuzleaf) are required here. (Skitty -> Delcatty & Nuzleaf -> Shiftry wait for later overworld Moon/Leaf Stones while Secret Super Training is skipped.)'
|
||||
: 'Everything reachable from Littleroot Town through Rustboro City, Route 116, and Rusturf Tunnel before challenging Roxanne. Level Cap: Lv. 14 (Nosepass) — only evolutions achievable at ≤ Lv. 14 (such as Beautifly, Dustox, and Lombre) are required here. (Skitty -> Delcatty & Lombre -> Ludicolo wait for later overworld Moon/Water Stones while Secret Super Training is skipped.)';
|
||||
const { area: s1Area, group: s1Evo } = getEvolutionGroup(s1, 'pre-badge-1-evolutions');
|
||||
if (s1Area && s1Evo) {
|
||||
s1Area.name = 'Pre-Badge 1 Evolutions';
|
||||
s1Evo.entries = removeSpecies(s1Evo.entries, ['delcatty', 'ludicolo', 'shiftry']);
|
||||
}
|
||||
}
|
||||
|
||||
// Pre-Badge 3: Gallade (Dawn), Vileplume (Leaf), Bellossom (Sun), Roserade (Shiny) wait
|
||||
const s3 = getSection(data, 'pre-badge-3');
|
||||
if (s3) {
|
||||
s3.summary = isOr
|
||||
? 'Explore Slateport City (Incense shop & Cosplay Pikachu), Route 110, Mauville City (grab the Mach Bike -> backtrack to Granite Cave B1F/B2F for Aron & Mawile!), Route 117 (Pokémon Day Care!), and Route 111 South. Level Cap: Lv. 21 (Magneton) — unlocks Lv. 18–21 evolutions including Gyarados and Kirlia.'
|
||||
: 'Explore Slateport City (Incense shop & Cosplay Pikachu), Route 110, Mauville City (grab the Mach Bike -> backtrack to Granite Cave B1F/B2F for Aron & Sableye!), Route 117 (Pokémon Day Care!), and Route 111 South. Level Cap: Lv. 21 (Magneton) — unlocks Lv. 18–21 evolutions including Gyarados and Kirlia.';
|
||||
const { group: s3Evo } = getEvolutionGroup(s3, 'pre-badge-3-evolutions');
|
||||
if (s3Evo) {
|
||||
s3Evo.entries = removeSpecies(s3Evo.entries, ['gallade', 'vileplume', 'bellossom', 'roserade']);
|
||||
}
|
||||
}
|
||||
|
||||
// Pre-Badge 4: Meteor Falls 1F Moon Stone -> Delcatty
|
||||
const s4 = getSection(data, 'pre-badge-4');
|
||||
if (s4) {
|
||||
s4.summary =
|
||||
'Dynamo Badge unlocks HM06 Rock Smash! Catch Nosepass in Granite Cave, sweep Routes 112–114, Fiery Path, Meteor Falls (grab the 1F Moon Stone for Delcatty!), Jagged Pass, and grab the Wynaut Egg in Lavaridge. Level Cap: Lv. 28 (Torkoal) — unlocks Lv. 22–28 evolutions including Delcatty, Crobat, Breloom, Graveler, Manectric, and Machoke.';
|
||||
const { group: s4Evo } = getEvolutionGroup(s4, 'pre-badge-4-evolutions');
|
||||
if (s4Evo) {
|
||||
s4Evo.entries = [
|
||||
{
|
||||
speciesId: 'delcatty',
|
||||
rate: 'Stone',
|
||||
levels: 'Moon Stone',
|
||||
notes: 'Meteor Falls 1F Moon Stone (west of waterfall) · From Skitty',
|
||||
},
|
||||
...s4Evo.entries,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// Pre-Badge 6: Route 119 static Leaf Stone (Surf) -> Vileplume (AS) or Shiftry (OR)
|
||||
const s6 = getSection(data, 'pre-badge-6');
|
||||
if (s6) {
|
||||
const { area: s6Area, group: s6Evo } = getEvolutionGroup(s6, 'pre-badge-6-evolutions');
|
||||
if (s6Area && s6Evo) {
|
||||
s6Area.subtitle =
|
||||
'Evolutions achievable at ≤ Lv. 35 (Winona’s Altaria); Max Beauty Feebas, Route 119 Leaf Stone & Moon Stone Wigglytuff';
|
||||
const leafEntry = isOr
|
||||
? {
|
||||
speciesId: 'shiftry',
|
||||
rate: 'Stone',
|
||||
levels: 'Leaf Stone',
|
||||
notes: 'Route 119 Leaf Stone (Surf) · From Nuzleaf',
|
||||
}
|
||||
: {
|
||||
speciesId: 'vileplume',
|
||||
rate: 'Stone',
|
||||
levels: 'Leaf Stone',
|
||||
notes: 'Route 119 Leaf Stone (Surf) · From Gloom',
|
||||
};
|
||||
s6Evo.entries = [leafEntry, ...s6Evo.entries];
|
||||
}
|
||||
}
|
||||
|
||||
// Pre-Badge 7: Raichu (Thunder), Starmie (Water), Froslass (Dawn) leave;
|
||||
// Bellossom (Mossdeep Space Center Sun Stone) & Roserade (Route 121 Cut Shiny Stone) arrive.
|
||||
const s7 = getSection(data, 'pre-badge-7');
|
||||
if (s7) {
|
||||
const { area: s7Area, group: s7Evo } = getEvolutionGroup(s7, 'pre-badge-7-evolutions');
|
||||
if (s7Area && s7Evo) {
|
||||
s7Area.subtitle =
|
||||
'Evolutions achievable at ≤ Lv. 45 (Tate & Liza’s Solrock/Lunatone) + Space Center Sun Stone, Route 121 Shiny Stone & Safari Breeding';
|
||||
const filtered = removeSpecies(s7Evo.entries, ['raichu', 'starmie', 'froslass']);
|
||||
s7Evo.entries = [
|
||||
{
|
||||
speciesId: 'bellossom',
|
||||
rate: 'Stone',
|
||||
levels: 'Sun Stone',
|
||||
notes: 'Mossdeep Space Center 1F Sailor gift · From Gloom',
|
||||
},
|
||||
{
|
||||
speciesId: 'roserade',
|
||||
rate: 'Stone',
|
||||
levels: 'Shiny Stone',
|
||||
notes: 'Route 121 northern grass (Cut) · From Roselia',
|
||||
},
|
||||
...filtered,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// Pre-Badge 8: Dive unlocks Route 124 Treasure Hunter Shards & New Mauville Thunder Stone
|
||||
const s8 = getSection(data, 'pre-badge-8');
|
||||
if (s8) {
|
||||
const { group: s8Evo } = getEvolutionGroup(s8, 'pre-badge-8-breeding-evos');
|
||||
if (s8Evo) {
|
||||
const waterLeafOrEntries = isOr
|
||||
? [
|
||||
{
|
||||
speciesId: 'vileplume',
|
||||
rate: 'Stone',
|
||||
levels: 'Leaf Stone',
|
||||
notes:
|
||||
'Route 124 Treasure Hunter (Green Shard via Dive) · From Gloom (Route 119 Leaf Stone used on Shiftry)',
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
speciesId: 'ludicolo',
|
||||
rate: 'Stone',
|
||||
levels: 'Water Stone',
|
||||
notes: 'Route 124 Treasure Hunter (Blue Shard via Dive) · From Lombre',
|
||||
},
|
||||
];
|
||||
s8Evo.entries = [
|
||||
...waterLeafOrEntries,
|
||||
{
|
||||
speciesId: 'raichu',
|
||||
rate: 'Stone',
|
||||
levels: 'Thunder Stone',
|
||||
notes: 'New Mauville ground item / Route 124 Yellow Shard · From Pikachu',
|
||||
},
|
||||
{
|
||||
speciesId: 'starmie',
|
||||
rate: 'Stone',
|
||||
levels: 'Water Stone',
|
||||
notes: 'Route 124 Treasure Hunter (Blue Shard via Dive) · From Staryu',
|
||||
},
|
||||
...s8Evo.entries,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// Pre-Elite 4: Victory Road exit (Wally's Dawn Stone gift) + Sea Mauville Sisters rematch
|
||||
const s9 = getSection(data, 'pre-elite-4');
|
||||
if (s9) {
|
||||
const { area: s9Area, group: s9Evo } = getEvolutionGroup(s9, 'pre-e4-evolutions');
|
||||
if (s9Area && s9Evo) {
|
||||
s9Area.subtitle =
|
||||
'Evolutions achievable at ≤ Lv. 59 (Champion Steven’s Metagross) + Victory Road Dawn Stone';
|
||||
s9Evo.entries = [
|
||||
{
|
||||
speciesId: 'gallade',
|
||||
rate: 'Stone',
|
||||
levels: 'Dawn Stone (♂ Kirlia)',
|
||||
notes: 'Victory Road exit (Wally gift) · From ♂ Kirlia',
|
||||
},
|
||||
{
|
||||
speciesId: 'froslass',
|
||||
rate: 'Stone',
|
||||
levels: 'Dawn Stone (♀ Snorunt)',
|
||||
notes: 'Wally Dawn Stone gift / Sea Mauville Room 1 Sisters 5% rematch (or Secret Pal)',
|
||||
},
|
||||
...s9Evo.entries,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
enrichSuperTrainingGuide(data, false);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
// Auto-generated from PokeAPI v2 CSV data (version_group_id = 16: omega-ruby-alpha-sapphire).
|
||||
// Tuples: [name, type, category, power, accuracy, pp, machineLabel]
|
||||
export const ORAS_MOVES = {"1":["Pound","Normal","Physical",40,100,35,null],"2":["Karate Chop","Fighting","Physical",50,100,25,null],"3":["Double Slap","Normal","Physical",15,85,10,null],"4":["Comet Punch","Normal","Physical",18,85,15,null],"5":["Mega Punch","Normal","Physical",80,85,20,null],"6":["Pay Day","Normal","Physical",40,100,20,null],"7":["Fire Punch","Fire","Physical",75,100,15,null],"8":["Ice Punch","Ice","Physical",75,100,15,null],"9":["Thunder Punch","Electric","Physical",75,100,15,null],"10":["Scratch","Normal","Physical",40,100,35,null],"11":["Vise Grip","Normal","Physical",55,100,30,null],"12":["Guillotine","Normal","Physical",null,30,5,null],"13":["Razor Wind","Normal","Special",80,100,10,null],"14":["Swords Dance","Normal","Status",null,null,20,"TM75"],"15":["Cut","Normal","Physical",50,95,30,"HM01"],"16":["Gust","Flying","Special",40,100,35,null],"17":["Wing Attack","Flying","Physical",60,100,35,null],"18":["Whirlwind","Normal","Status",null,null,20,null],"19":["Fly","Flying","Physical",90,95,15,"HM02"],"20":["Bind","Normal","Physical",15,85,20,null],"21":["Slam","Normal","Physical",80,75,20,null],"22":["Vine Whip","Grass","Physical",45,100,25,null],"23":["Stomp","Normal","Physical",65,100,20,null],"24":["Double Kick","Fighting","Physical",30,100,30,null],"25":["Mega Kick","Normal","Physical",120,75,5,null],"26":["Jump Kick","Fighting","Physical",100,95,10,null],"27":["Rolling Kick","Fighting","Physical",60,85,15,null],"28":["Sand Attack","Ground","Status",null,100,15,null],"29":["Headbutt","Normal","Physical",70,100,15,null],"30":["Horn Attack","Normal","Physical",65,100,25,null],"31":["Fury Attack","Normal","Physical",15,85,20,null],"32":["Horn Drill","Normal","Physical",null,30,5,null],"33":["Tackle","Normal","Physical",50,100,35,null],"34":["Body Slam","Normal","Physical",85,100,15,null],"35":["Wrap","Normal","Physical",15,90,20,null],"36":["Take Down","Normal","Physical",90,85,20,null],"37":["Thrash","Normal","Physical",120,100,10,null],"38":["Double-Edge","Normal","Physical",120,100,15,null],"39":["Tail Whip","Normal","Status",null,100,30,null],"40":["Poison Sting","Poison","Physical",15,100,35,null],"41":["Twineedle","Bug","Physical",25,100,20,null],"42":["Pin Missile","Bug","Physical",25,95,20,null],"43":["Leer","Normal","Status",null,100,30,null],"44":["Bite","Dark","Physical",60,100,25,null],"45":["Growl","Normal","Status",null,100,40,null],"46":["Roar","Normal","Status",null,null,20,"TM05"],"47":["Sing","Normal","Status",null,55,15,null],"48":["Supersonic","Normal","Status",null,55,20,null],"49":["Sonic Boom","Normal","Special",null,90,20,null],"50":["Disable","Normal","Status",null,100,20,null],"51":["Acid","Poison","Special",40,100,30,null],"52":["Ember","Fire","Special",40,100,25,null],"53":["Flamethrower","Fire","Special",90,100,15,"TM35"],"54":["Mist","Ice","Status",null,null,30,null],"55":["Water Gun","Water","Special",40,100,25,null],"56":["Hydro Pump","Water","Special",110,80,5,null],"57":["Surf","Water","Special",90,100,15,"HM03"],"58":["Ice Beam","Ice","Special",90,100,10,"TM13"],"59":["Blizzard","Ice","Special",110,70,5,"TM14"],"60":["Psybeam","Psychic","Special",65,100,20,null],"61":["Bubble Beam","Water","Special",65,100,20,null],"62":["Aurora Beam","Ice","Special",65,100,20,null],"63":["Hyper Beam","Normal","Special",150,90,5,"TM15"],"64":["Peck","Flying","Physical",35,100,35,null],"65":["Drill Peck","Flying","Physical",80,100,20,null],"66":["Submission","Fighting","Physical",80,80,20,null],"67":["Low Kick","Fighting","Physical",null,100,20,null],"68":["Counter","Fighting","Physical",null,100,20,null],"69":["Seismic Toss","Fighting","Physical",null,100,20,null],"70":["Strength","Normal","Physical",80,100,15,"HM04"],"71":["Absorb","Grass","Special",20,100,25,null],"72":["Mega Drain","Grass","Special",40,100,15,null],"73":["Leech Seed","Grass","Status",null,90,10,null],"74":["Growth","Normal","Status",null,null,20,null],"75":["Razor Leaf","Grass","Physical",55,95,25,null],"76":["Solar Beam","Grass","Special",120,100,10,"TM22"],"77":["Poison Powder","Poison","Status",null,75,35,null],"78":["Stun Spore","Grass","Status",null,75,30,null],"79":["Sleep Powder","Grass","Status",null,75,15,null],"80":["Petal Dance","Grass","Special",120,100,10,null],"81":["String Shot","Bug","Status",null,95,40,null],"82":["Dragon Rage","Dragon","Special",null,100,10,null],"83":["Fire Spin","Fire","Special",35,85,15,null],"84":["Thunder Shock","Electric","Special",40,100,30,null],"85":["Thunderbolt","Electric","Special",90,100,15,"TM24"],"86":["Thunder Wave","Electric","Status",null,100,20,"TM73"],"87":["Thunder","Electric","Special",110,70,10,"TM25"],"88":["Rock Throw","Rock","Physical",50,90,15,null],"89":["Earthquake","Ground","Physical",100,100,10,"TM26"],"90":["Fissure","Ground","Physical",null,30,5,null],"91":["Dig","Ground","Physical",80,100,10,"TM28"],"92":["Toxic","Poison","Status",null,90,10,"TM06"],"93":["Confusion","Psychic","Special",50,100,25,null],"94":["Psychic","Psychic",Line truncated
|
||||
|
||||
export const ORAS_MOVESETS_BY_NAT_ID = {"13":{"lv":[[40,1],[81,1],[450,15]],"tm":[],"tut":[450,527],"egg":[]},"14":{"lv":[[106,1],[106,7]],"tm":[],"tut":[450,527,334],"egg":[]},"15":{"lv":[[31,1],[31,10],[116,13],[41,16],[99,19],[228,22],[390,25],[42,28],[97,31],[372,34],[398,37],[283,40],[565,45]],"tm":[92,474,237,241,63,182,355,218,76,216,280,104,188,332,263,156,213,168,496,206,512,371,416,148,14,522,404,611,398,207,214,369,164,290,590,15,249],"tut":[450,529,527,283,202,282,173,366],"egg":[]},"16":{"lv":[[33,1],[28,5],[16,9],[98,13],[18,17],[239,21],[297,25],[97,29],[17,33],[355,37],[366,41],[119,45],[403,49],[542,53]],"tm":[92,237,241,182,240,355,218,216,104,332,263,156,213,168,496,211,207,214,369,164,290,590,19],"tut":[257,143,173,366,253],"egg":[314,403,413,432,185,193,228,211,253]},"17":{"lv":[[33,1],[28,1],[16,1],[28,5],[16,9],[98,13],[18,17],[239,22],[297,27],[97,32],[17,37],[355,42],[366,47],[119,52],[403,57],[542,62]],"tm":[92,237,241,182,240,355,218,216,104,332,263,156,213,168,496,211,207,214,369,164,290,590,19],"tut":[257,143,173,366,253],"egg":[]},"18":{"lv":[[542,1],[33,1],[28,1],[16,1],[98,1],[28,5],[16,9],[98,13],[18,17],[239,22],[297,27],[97,32],[17,38],[355,44],[366,50],[119,56],[403,62],[542,68]],"tm":[92,237,241,63,182,240,355,218,216,104,332,263,156,213,168,496,211,416,207,214,369,164,290,590,19],"tut":[257,143,173,366,253],"egg":[]},"19":{"lv":[[33,1],[39,1],[98,4],[116,7],[44,10],[228,13],[158,16],[389,19],[242,22],[372,25],[162,28],[38,31],[283,34]],"tm":[92,237,241,269,58,59,182,240,218,85,87,216,91,247,104,263,156,213,168,496,451,514,86,447,207,214,369,164,528,290,590,15,249],"tut":[343,283,196,231,387,351,173,162,253,428],"egg":[44,68,515,172,154,387,382,279,179,103,253]},"20":{"lv":[[14,1],[33,1],[39,1],[98,1],[116,1],[98,4],[116,7],[44,10],[228,13],[158,16],[389,19],[184,20],[242,24],[372,29],[162,34],[38,39],[283,44]],"tm":[46,92,237,241,269,58,59,63,182,240,218,85,87,216,91,247,104,263,156,213,168,496,451,514,416,86,14,447,207,214,369,164,528,290,590,15,70,249],"tut":[343,283,196,231,387,351,173,162,253,428],"egg":[]},"25":{"lv":[[39,1],[84,1],[45,5],[589,7],[98,10],[486,13],[86,18],[364,21],[104,23],[209,26],[609,29],[435,34],[21,37],[85,42],[97,45],[528,50],[113,53],[87,58]],"tm":[92,237,113,182,240,218,85,87,216,91,280,104,263,156,213,496,497,374,451,148,521,86,447,207,214,164,528,290,590,70,249],"tut":[343,527,264,270,231,282,393,351,324,173,9],"egg":[]},"26":{"lv":[[84,1],[39,1],[98,1],[85,1]],"tm":[92,237,63,113,182,240,218,85,87,216,91,280,104,263,156,213,168,496,497,411,374,451,416,148,521,86,447,207,214,164,528,290,590,70,249],"tut":[343,527,264,270,231,282,393,351,324,173,9],"egg":[]},"27":{"lv":[[10,1],[111,1],[28,3],[40,5],[205,7],[229,9],[210,11],[222,14],[129,17],[154,20],[328,23],[163,26],[91,30],[360,34],[14,38],[201,42],[89,46]],"tm":[468,92,237,241,182,219,218,89,216,91,280,104,201,317,332,263,156,213,168,496,374,421,360,14,523,157,404,398,207,214,164,290,590,15,70,249],"tut":[343,414,264,231,282,173,446,162],"egg":[498,68,306,203,175,232,341,400,229,431,563]},"28":{"lv":[[10,1],[111,1],[28,1],[40,1],[28,3],[40,5],[205,7],[229,9],[210,11],[222,14],[129,17],[154,20],[306,22],[328,24],[163,28],[91,33],[360,38],[14,43],[201,48],[89,53]],"tm":[468,92,237,241,63,182,219,218,89,216,91,280,104,201,317,332,263,156,213,168,496,411,374,421,416,444,360,14,523,157,404,398,207,214,164,290,590,15,70,249],"tut":[343,414,264,231,282,173,446,162],"egg":[]},"35":{"lv":[[495,1],[361,1],[574,1],[1,1],[45,1],[227,1],[47,7],[3,10],[111,13],[266,16],[516,19],[358,22],[107,25],[500,28],[118,31],[322,34],[381,37],[34,40],[236,43],[585,46],[356,49],[309,50],[361,55],[495,58]],"tm":[473,347,92,237,241,58,59,113,182,240,219,218,76,85,87,216,91,94,247,280,104,115,53,126,263,156,213,496,497,374,451,510,514,148,86,244,138,447,207,214,164,290,612,605,590,70,249],"tut":[495,340,343,409,283,7,264,356,215,270,304,8,196,231,282,387,277,278,272,351,324,289,173,446,9,271,352,472,428],"egg":[]},"36":{"lv":[[574,1],[47,1],[3,1],[107,1],[118,1]],"tm":[473,347,92,237,241,58,59,63,113,182,240,219,218,76,85,87,216,91,94,247,280,104,115,53,126,263,156,213,496,497,411,374,451,510,514,416,148,86,244,138,447,207,214,164,290,612,605,590,70,249],"tut":[495,340,343,409,283,7,264,356,215,270,304,8,196,231,282,387,277,278,272,351,324,289,173,446,9,271,352,472,428],"egg":[]},"37":{"lv":[[52,1],[39,4],[46,7],[608,9],[98,10],[109,12],[83,15],[371,18],[261,20],[185,23],[506,26],[481,28],[326,31],[219,34],[53,36],[286,39],[126,42],[288,44],[445,47],[517,50]],"tm":[46,92,237,241,182,219,218,216,91,104,53,126,263,488,156,213,496,315,412,510,261,371,244,207,214,164,290,399,590],"tut":[343,492,257,231,220,272,173,180,428],"egg":[445,50,326,185,175,394,257,506,336,95,384,290,180,541]},"38":{"lv":[[286,1],[417,1],[53,1],[98,1],[109,1],[219,1]],"tm":[473,347,46,92,237,241,63,182,219,218,76,216,91,104,53,126,263,488,156,213,496,315,412,510,261,371,416,244,138,207,214,164,290,399,590],"tut":[343,492,257,231,220,272,173,180,Line truncated
|
||||
|
||||
function decodeMove(moveId, extra = {}) {
|
||||
const raw = ORAS_MOVES[moveId];
|
||||
if (!raw) return null;
|
||||
const [name, type, category, power, accuracy, pp, machine] = raw;
|
||||
return {
|
||||
id: moveId,
|
||||
name,
|
||||
type,
|
||||
category,
|
||||
power,
|
||||
accuracy,
|
||||
pp,
|
||||
machine,
|
||||
...extra,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns complete Omega Ruby & Alpha Sapphire learnset arrays for a National Dex id.
|
||||
*/
|
||||
export function getPokemonMoveset(natId) {
|
||||
const raw = ORAS_MOVESETS_BY_NAT_ID[natId];
|
||||
if (!raw) {
|
||||
return { levelUp: [], machine: [], tutor: [], egg: [], totalUniqueMoves: 0 };
|
||||
}
|
||||
const lightSet = new Set(raw.lightEgg || []);
|
||||
const uniqueIds = new Set();
|
||||
|
||||
const levelUp = raw.lv
|
||||
.map(([id, level]) => {
|
||||
uniqueIds.add(id);
|
||||
return decodeMove(id, { level });
|
||||
})
|
||||
.filter(Boolean);
|
||||
|
||||
const machine = raw.tm
|
||||
.map((id) => {
|
||||
uniqueIds.add(id);
|
||||
return decodeMove(id);
|
||||
})
|
||||
.filter(Boolean);
|
||||
|
||||
const tutor = raw.tut
|
||||
.map((id) => {
|
||||
uniqueIds.add(id);
|
||||
return decodeMove(id);
|
||||
})
|
||||
.filter(Boolean);
|
||||
|
||||
const egg = raw.egg
|
||||
.map((id) => {
|
||||
uniqueIds.add(id);
|
||||
return decodeMove(id, lightSet.has(id) ? { note: 'Volt Tackle (Light Ball)' } : {});
|
||||
})
|
||||
.filter(Boolean);
|
||||
|
||||
return {
|
||||
levelUp,
|
||||
machine,
|
||||
tutor,
|
||||
egg,
|
||||
totalUniqueMoves: uniqueIds.size,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
// Auto-generated Gen 6 (ORAS / XY) base stats & abilities parsed from Serebii pokedex-xy.
|
||||
export const ORAS_STATS_BY_ID = {"treecko":{"baseStats":{"hp":40,"atk":45,"def":35,"spa":65,"spd":55,"spe":70,"total":310},"abilities":["Overgrow","Unburden (HA)"]},"grovyle":{"baseStats":{"hp":50,"atk":65,"def":45,"spa":85,"spd":65,"spe":95,"total":405},"abilities":["Overgrow","Unburden (HA)"]},"sceptile":{"baseStats":{"hp":70,"atk":85,"def":65,"spa":105,"spd":85,"spe":120,"total":530},"abilities":["Overgrow","Unburden (HA)"]},"torchic":{"baseStats":{"hp":45,"atk":60,"def":40,"spa":70,"spd":50,"spe":45,"total":310},"abilities":["Blaze","Speed Boost (HA)"]},"combusken":{"baseStats":{"hp":60,"atk":85,"def":60,"spa":85,"spd":60,"spe":55,"total":405},"abilities":["Blaze","Speed Boost (HA)"]},"blaziken":{"baseStats":{"hp":80,"atk":120,"def":70,"spa":110,"spd":70,"spe":80,"total":530},"abilities":["Blaze","Speed Boost (HA)"]},"mudkip":{"baseStats":{"hp":50,"atk":70,"def":50,"spa":50,"spd":50,"spe":40,"total":310},"abilities":["Torrent","Damp (HA)"]},"marshtomp":{"baseStats":{"hp":70,"atk":85,"def":70,"spa":60,"spd":70,"spe":50,"total":405},"abilities":["Torrent","Damp (HA)"]},"swampert":{"baseStats":{"hp":100,"atk":110,"def":90,"spa":85,"spd":90,"spe":60,"total":535},"abilities":["Torrent","Damp (HA)"]},"poochyena":{"baseStats":{"hp":35,"atk":55,"def":35,"spa":30,"spd":30,"spe":35,"total":220},"abilities":["Run Away","Quick Feet","Rattled (HA)"]},"mightyena":{"baseStats":{"hp":70,"atk":90,"def":70,"spa":60,"spd":60,"spe":70,"total":420},"abilities":["Intimidate","Quick Feet","Moxie (HA)"]},"zigzagoon":{"baseStats":{"hp":38,"atk":30,"def":41,"spa":30,"spd":41,"spe":60,"total":240},"abilities":["Pickup","Gluttony","Quick Feet (HA)"]},"linoone":{"baseStats":{"hp":78,"atk":70,"def":61,"spa":50,"spd":61,"spe":100,"total":420},"abilities":["Pickup","Gluttony","Quick Feet (HA)"]},"wurmple":{"baseStats":{"hp":45,"atk":45,"def":35,"spa":20,"spd":30,"spe":20,"total":195},"abilities":["Shield Dust","Run Away (HA)"]},"silcoon":{"baseStats":{"hp":50,"atk":35,"def":55,"spa":25,"spd":25,"spe":15,"total":205},"abilities":["Shed Skin"]},"beautifly":{"baseStats":{"hp":60,"atk":70,"def":50,"spa":100,"spd":50,"spe":65,"total":395},"abilities":["Swarm","Rivalry (HA)"]},"cascoon":{"baseStats":{"hp":50,"atk":35,"def":55,"spa":25,"spd":25,"spe":15,"total":205},"abilities":["Shed Skin"]},"dustox":{"baseStats":{"hp":60,"atk":50,"def":70,"spa":50,"spd":90,"spe":65,"total":385},"abilities":["Shield Dust","Compoundeyes (HA)"]},"lotad":{"baseStats":{"hp":40,"atk":30,"def":30,"spa":40,"spd":50,"spe":30,"total":220},"abilities":["Swift Swim","Rain Dish","Own Tempo (HA)"]},"lombre":{"baseStats":{"hp":60,"atk":50,"def":50,"spa":60,"spd":70,"spe":50,"total":340},"abilities":["Swift Swim","Rain Dish","Own Tempo (HA)"]},"ludicolo":{"baseStats":{"hp":80,"atk":70,"def":70,"spa":90,"spd":100,"spe":70,"total":480},"abilities":["Swift Swim","Rain Dish","Own Tempo (HA)"]},"seedot":{"baseStats":{"hp":40,"atk":40,"def":50,"spa":30,"spd":30,"spe":30,"total":220},"abilities":["Chlorophyll","Early Bird","Pickpocket (HA)"]},"nuzleaf":{"baseStats":{"hp":70,"atk":70,"def":40,"spa":60,"spd":40,"spe":60,"total":340},"abilities":["Chlorophyll","Early Bird","Pickpocket (HA)"]},"shiftry":{"baseStats":{"hp":90,"atk":100,"def":60,"spa":90,"spd":60,"spe":80,"total":480},"abilities":["Chlorophyll","Early Bird","Pickpocket (HA)"]},"taillow":{"baseStats":{"hp":40,"atk":55,"def":30,"spa":30,"spd":30,"spe":85,"total":270},"abilities":["Guts","Scrappy (HA)"]},"swellow":{"baseStats":{"hp":60,"atk":85,"def":60,"spa":50,"spd":50,"spe":125,"total":430},"abilities":["Guts","Scrappy (HA)"]},"wingull":{"baseStats":{"hp":40,"atk":30,"def":30,"spa":55,"spd":30,"spe":85,"total":270},"abilities":["Keen Eye","Rain Dish (HA)"]},"pelipper":{"baseStats":{"hp":60,"atk":50,"def":100,"spa":85,"spd":70,"spe":65,"total":430},"abilities":["Keen Eye","Rain Dish (HA)"]},"ralts":{"baseStats":{"hp":28,"atk":25,"def":25,"spa":45,"spd":35,"spe":40,"total":198},"abilities":["Synchronize","Trace","Telepathy (HA)"]},"kirlia":{"baseStats":{"hp":38,"atk":35,"def":35,"spa":65,"spd":55,"spe":50,"total":278},"abilities":["Synchronize","Trace","Telepathy (HA)"]},"gardevoir":{"baseStats":{"hp":68,"atk":65,"def":65,"spa":125,"spd":115,"spe":80,"total":518},"abilities":["Synchronize","Trace","Telepathy (HA)"]},"gallade":{"baseStats":{"hp":68,"atk":125,"def":65,"spa":65,"spd":115,"spe":80,"total":518},"abilities":["Steadfast","Justified (HA)"]},"surskit":{"baseStats":{"hp":40,"atk":30,"def":32,"spa":50,"spd":52,"spe":65,"total":269},"abilities":["Swift Swim","Rain Dish (HA)"]},"masquerain":{"baseStats":{"hp":70,"atk":60,"def":62,"spa":80,"spd":82,"spe":60,"total":414},"abilities":["Intimidate","Unnerve (HA)"]},"shroomish":{"baseStats":{"hp":60,"atk":40,"def":60,"spa":40,"spd":60,"spe":35,"total":295},"abilities":["Effect Spore","Poison Heal","Quick Feet (HA)"]},"breloom":{"baseStats":{"hp":60,"atk":130,"def":80,"spa":60,"spd":60,"spe":70,"total":460},"abilities":["Effect Spore","Poison Heal","Technician (HA)"]},"sLine truncated
|
||||
@@ -0,0 +1,542 @@
|
||||
/**
|
||||
* Master species catalog for ORAS (Alpha Sapphire first, shared with future Omega Ruby support).
|
||||
*
|
||||
* Fields:
|
||||
* - id: stable kebab-case identifier
|
||||
* - natId: National Pokédex number
|
||||
* - hoennId: Gen VI Hoenn Pokédex number (1..211) or null
|
||||
* - name: display name
|
||||
* - types: elemental type array
|
||||
* - evolvesFrom: parent species id (or null)
|
||||
* - evolutionMethod: concise obtain/evolution summary matching spreadsheet column D style
|
||||
* - availability: 'all' | 'as-only' | 'or-only' | 'trade-evo' | 'eon-ticket' | 'event-only' | 'dual-game-legendary'
|
||||
* - soloNotes: optional POC ruleset note
|
||||
*/
|
||||
|
||||
import { ORAS_STATS_BY_ID } from './species-stats.js';
|
||||
|
||||
function sp(id, natId, hoennId, name, types, evolvesFrom = null, evolutionMethod = '', availability = 'all', soloNotes = '') {
|
||||
const statsEntry = ORAS_STATS_BY_ID[id];
|
||||
return {
|
||||
id,
|
||||
natId,
|
||||
hoennId,
|
||||
name,
|
||||
types,
|
||||
evolvesFrom,
|
||||
evolutionMethod,
|
||||
availability,
|
||||
soloNotes,
|
||||
baseStats: statsEntry?.baseStats || null,
|
||||
abilities: statsEntry?.abilities || [],
|
||||
};
|
||||
}
|
||||
|
||||
export const SPECIES_LIST = [
|
||||
// =========================================================================
|
||||
// GEN VI HOENN POKÉDEX (#001 – #211)
|
||||
// =========================================================================
|
||||
sp('treecko', 252, 1, 'Treecko', ['Grass'], null, 'Starter Choice (Route 101)'),
|
||||
sp('grovyle', 253, 2, 'Grovyle', ['Grass'], 'treecko', 'Level 16'),
|
||||
sp('sceptile', 254, 3, 'Sceptile', ['Grass'], 'grovyle', 'Level 36'),
|
||||
sp('torchic', 255, 4, 'Torchic', ['Fire'], null, 'Starter Choice (Route 101)'),
|
||||
sp('combusken', 256, 5, 'Combusken', ['Fire', 'Fighting'], 'torchic', 'Level 16'),
|
||||
sp('blaziken', 257, 6, 'Blaziken', ['Fire', 'Fighting'], 'combusken', 'Level 36'),
|
||||
sp('mudkip', 258, 7, 'Mudkip', ['Water'], null, 'Starter Choice (Route 101)'),
|
||||
sp('marshtomp', 259, 8, 'Marshtomp', ['Water', 'Ground'], 'mudkip', 'Level 16'),
|
||||
sp('swampert', 260, 9, 'Swampert', ['Water', 'Ground'], 'marshtomp', 'Level 36'),
|
||||
|
||||
sp('poochyena', 261, 10, 'Poochyena', ['Dark'], null, ''),
|
||||
sp('mightyena', 262, 11, 'Mightyena', ['Dark'], 'poochyena', 'Level 18'),
|
||||
sp('zigzagoon', 263, 12, 'Zigzagoon', ['Normal'], null, ''),
|
||||
sp('linoone', 264, 13, 'Linoone', ['Normal'], 'zigzagoon', 'Level 20'),
|
||||
sp('wurmple', 265, 14, 'Wurmple', ['Bug'], null, ''),
|
||||
sp('silcoon', 266, 15, 'Silcoon', ['Bug'], 'wurmple', 'Level 7 (Personality)'),
|
||||
sp('beautifly', 267, 16, 'Beautifly', ['Bug', 'Flying'], 'silcoon', 'Level 10'),
|
||||
sp('cascoon', 268, 17, 'Cascoon', ['Bug'], 'wurmple', 'Level 7 (Personality)'),
|
||||
sp('dustox', 269, 18, 'Dustox', ['Bug', 'Poison'], 'cascoon', 'Level 10'),
|
||||
|
||||
sp('lotad', 270, 19, 'Lotad', ['Water', 'Grass'], null, '', 'as-only', 'Alpha Sapphire exclusive'),
|
||||
sp('lombre', 271, 20, 'Lombre', ['Water', 'Grass'], 'lotad', 'Level 14', 'as-only', 'Alpha Sapphire exclusive'),
|
||||
sp('ludicolo', 272, 21, 'Ludicolo', ['Water', 'Grass'], 'lombre', 'Water Stone', 'as-only', 'Alpha Sapphire exclusive'),
|
||||
sp('seedot', 273, 22, 'Seedot', ['Grass'], null, '', 'or-only', 'Omega Ruby exclusive'),
|
||||
sp('nuzleaf', 274, 23, 'Nuzleaf', ['Grass', 'Dark'], 'seedot', 'Level 14', 'or-only', 'Omega Ruby exclusive'),
|
||||
sp('shiftry', 275, 24, 'Shiftry', ['Grass', 'Dark'], 'nuzleaf', 'Leaf Stone', 'or-only', 'Omega Ruby exclusive'),
|
||||
|
||||
sp('taillow', 276, 25, 'Taillow', ['Normal', 'Flying'], null, ''),
|
||||
sp('swellow', 277, 26, 'Swellow', ['Normal', 'Flying'], 'taillow', 'Level 22'),
|
||||
sp('wingull', 278, 27, 'Wingull', ['Water', 'Flying'], null, ''),
|
||||
sp('pelipper', 279, 28, 'Pelipper', ['Water', 'Flying'], 'wingull', 'Level 25'),
|
||||
sp('ralts', 280, 29, 'Ralts', ['Psychic', 'Fairy'], null, ''),
|
||||
sp('kirlia', 281, 30, 'Kirlia', ['Psychic', 'Fairy'], 'ralts', 'Level 20'),
|
||||
sp('gardevoir', 282, 31, 'Gardevoir', ['Psychic', 'Fairy'], 'kirlia', 'Level 30'),
|
||||
sp('gallade', 475, 32, 'Gallade', ['Psychic', 'Fighting'], 'kirlia', 'Dawn Stone (Male Kirlia)'),
|
||||
sp('surskit', 283, 33, 'Surskit', ['Bug', 'Water'], null, ''),
|
||||
sp('masquerain', 284, 34, 'Masquerain', ['Bug', 'Flying'], 'surskit', 'Level 22'),
|
||||
sp('shroomish', 285, 35, 'Shroomish', ['Grass'], null, ''),
|
||||
sp('breloom', 286, 36, 'Breloom', ['Grass', 'Fighting'], 'shroomish', 'Level 23'),
|
||||
sp('slakoth', 287, 37, 'Slakoth', ['Normal'], null, ''),
|
||||
sp('vigoroth', 288, 38, 'Vigoroth', ['Normal'], 'slakoth', 'Level 18'),
|
||||
sp('slaking', 289, 39, 'Slaking', ['Normal'], 'vigoroth', 'Level 36'),
|
||||
|
||||
sp('abra', 63, 40, 'Abra', ['Psychic'], null, ''),
|
||||
sp('kadabra', 64, 41, 'Kadabra', ['Psychic'], 'abra', 'Level 16'),
|
||||
sp('alakazam', 65, 42, 'Alakazam', ['Psychic'], 'kadabra', 'Trade', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('nincada', 290, 43, 'Nincada', ['Bug', 'Ground'], null, ''),
|
||||
sp('ninjask', 291, 44, 'Ninjask', ['Bug', 'Flying'], 'nincada', 'Level 20'),
|
||||
sp('shedinja', 292, 45, 'Shedinja', ['Bug', 'Ghost'], 'nincada', 'Level 20 (Empty party slot + Poké Ball)'),
|
||||
sp('whismur', 293, 46, 'Whismur', ['Normal'], null, ''),
|
||||
sp('loudred', 294, 47, 'Loudred', ['Normal'], 'whismur', 'Level 20'),
|
||||
sp('exploud', 295, 48, 'Exploud', ['Normal'], 'loudred', 'Level 40'),
|
||||
sp('makuhita', 296, 49, 'Makuhita', ['Fighting'], null, 'Rustboro Trade (for Slakoth) or Granite Cave'),
|
||||
sp('hariyama', 297, 50, 'Hariyama', ['Fighting'], 'makuhita', 'Level 24'),
|
||||
|
||||
sp('goldeen', 118, 51, 'Goldeen', ['Water'], null, ''),
|
||||
sp('seaking', 119, 52, 'Seaking', ['Water'], 'goldeen', 'Level 33'),
|
||||
sp('magikarp', 129, 53, 'Magikarp', ['Water'], null, ''),
|
||||
sp('gyarados', 130, 54, 'Gyarados', ['Water', 'Flying'], 'magikarp', 'Level 20'),
|
||||
sp('azurill', 298, 55, 'Azurill', ['Normal', 'Fairy'], null, 'Breed Marill/Azumarill holding Sea Incense'),
|
||||
sp('marill', 183, 56, 'Marill', ['Water', 'Fairy'], 'azurill', 'Friendship'),
|
||||
sp('azumarill', 184, 57, 'Azumarill', ['Water', 'Fairy'], 'marill', 'Level 18'),
|
||||
sp('geodude', 74, 58, 'Geodude', ['Rock', 'Ground'], null, ''),
|
||||
sp('graveler', 75, 59, 'Graveler', ['Rock', 'Ground'], 'geodude', 'Level 25'),
|
||||
sp('golem', 76, 60, 'Golem', ['Rock', 'Ground'], 'graveler', 'Trade', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('nosepass', 299, 61, 'Nosepass', ['Rock'], null, ''),
|
||||
sp('probopass', 476, 62, 'Probopass', ['Rock', 'Steel'], 'nosepass', 'Level up in New Mauville'),
|
||||
sp('skitty', 300, 63, 'Skitty', ['Normal'], null, ''),
|
||||
sp('delcatty', 301, 64, 'Delcatty', ['Normal'], 'skitty', 'Moon Stone'),
|
||||
|
||||
sp('zubat', 41, 65, 'Zubat', ['Poison', 'Flying'], null, ''),
|
||||
sp('golbat', 42, 66, 'Golbat', ['Poison', 'Flying'], 'zubat', 'Level 22'),
|
||||
sp('crobat', 169, 67, 'Crobat', ['Poison', 'Flying'], 'golbat', 'Friendship'),
|
||||
sp('tentacool', 72, 68, 'Tentacool', ['Water', 'Poison'], null, ''),
|
||||
sp('tentacruel', 73, 69, 'Tentacruel', ['Water', 'Poison'], 'tentacool', 'Level 30'),
|
||||
sp('sableye', 302, 70, 'Sableye', ['Dark', 'Ghost'], null, '', 'as-only', 'Alpha Sapphire exclusive'),
|
||||
sp('mawile', 303, 71, 'Mawile', ['Steel', 'Fairy'], null, '', 'or-only', 'Omega Ruby exclusive'),
|
||||
sp('aron', 304, 72, 'Aron', ['Steel', 'Rock'], null, ''),
|
||||
sp('lairon', 305, 73, 'Lairon', ['Steel', 'Rock'], 'aron', 'Level 32'),
|
||||
sp('aggron', 306, 74, 'Aggron', ['Steel', 'Rock'], 'lairon', 'Level 42'),
|
||||
sp('machop', 66, 75, 'Machop', ['Fighting'], null, ''),
|
||||
sp('machoke', 67, 76, 'Machoke', ['Fighting'], 'machop', 'Level 28'),
|
||||
sp('machamp', 68, 77, 'Machamp', ['Fighting'], 'machoke', 'Trade', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('meditite', 307, 78, 'Meditite', ['Fighting', 'Psychic'], null, ''),
|
||||
sp('medicham', 308, 79, 'Medicham', ['Fighting', 'Psychic'], 'meditite', 'Level 37'),
|
||||
|
||||
sp('electrike', 309, 80, 'Electrike', ['Electric'], null, ''),
|
||||
sp('manectric', 310, 81, 'Manectric', ['Electric'], 'electrike', 'Level 26'),
|
||||
sp('plusle', 311, 82, 'Plusle', ['Electric'], null, ''),
|
||||
sp('minun', 312, 83, 'Minun', ['Electric'], null, ''),
|
||||
sp('magnemite', 81, 84, 'Magnemite', ['Electric', 'Steel'], null, ''),
|
||||
sp('magneton', 82, 85, 'Magneton', ['Electric', 'Steel'], 'magnemite', 'Level 30'),
|
||||
sp('magnezone', 462, 86, 'Magnezone', ['Electric', 'Steel'], 'magneton', 'Level up in New Mauville'),
|
||||
sp('voltorb', 100, 87, 'Voltorb', ['Electric'], null, ''),
|
||||
sp('electrode', 101, 88, 'Electrode', ['Electric'], 'voltorb', 'Level 30'),
|
||||
sp('volbeat', 313, 89, 'Volbeat', ['Bug'], null, ''),
|
||||
sp('illumise', 314, 90, 'Illumise', ['Bug'], null, ''),
|
||||
sp('oddish', 43, 91, 'Oddish', ['Grass', 'Poison'], null, ''),
|
||||
sp('gloom', 44, 92, 'Gloom', ['Grass', 'Poison'], 'oddish', 'Level 21'),
|
||||
sp('vileplume', 45, 93, 'Vileplume', ['Grass', 'Poison'], 'gloom', 'Leaf Stone'),
|
||||
sp('bellossom', 182, 94, 'Bellossom', ['Grass'], 'gloom', 'Sun Stone'),
|
||||
sp('doduo', 84, 95, 'Doduo', ['Normal', 'Flying'], null, ''),
|
||||
sp('dodrio', 85, 96, 'Dodrio', ['Normal', 'Flying'], 'doduo', 'Level 31'),
|
||||
sp('budew', 406, 97, 'Budew', ['Grass', 'Poison'], null, 'Breed Roselia/Roserade holding Rose Incense'),
|
||||
sp('roselia', 315, 98, 'Roselia', ['Grass', 'Poison'], 'budew', 'Friendship (Daytime)'),
|
||||
sp('roserade', 407, 99, 'Roserade', ['Grass', 'Poison'], 'roselia', 'Shiny Stone'),
|
||||
sp('gulpin', 316, 100, 'Gulpin', ['Poison'], null, ''),
|
||||
sp('swalot', 317, 101, 'Swalot', ['Poison'], 'gulpin', 'Level 26'),
|
||||
|
||||
sp('carvanha', 318, 102, 'Carvanha', ['Water', 'Dark'], null, ''),
|
||||
sp('sharpedo', 319, 103, 'Sharpedo', ['Water', 'Dark'], 'carvanha', 'Level 30'),
|
||||
sp('wailmer', 320, 104, 'Wailmer', ['Water'], null, ''),
|
||||
sp('wailord', 321, 105, 'Wailord', ['Water'], 'wailmer', 'Level 40'),
|
||||
sp('numel', 322, 106, 'Numel', ['Fire', 'Ground'], null, ''),
|
||||
sp('camerupt', 323, 107, 'Camerupt', ['Fire', 'Ground'], 'numel', 'Level 33'),
|
||||
sp('slugma', 218, 108, 'Slugma', ['Fire'], null, ''),
|
||||
sp('magcargo', 219, 109, 'Magcargo', ['Fire', 'Rock'], 'slugma', 'Level 38'),
|
||||
sp('torkoal', 324, 110, 'Torkoal', ['Fire'], null, ''),
|
||||
sp('grimer', 88, 111, 'Grimer', ['Poison'], null, ''),
|
||||
sp('muk', 89, 112, 'Muk', ['Poison'], 'grimer', 'Level 38'),
|
||||
sp('koffing', 109, 113, 'Koffing', ['Poison'], null, ''),
|
||||
sp('weezing', 110, 114, 'Weezing', ['Poison'], 'koffing', 'Level 35'),
|
||||
sp('spoink', 325, 115, 'Spoink', ['Psychic'], null, ''),
|
||||
sp('grumpig', 326, 116, 'Grumpig', ['Psychic'], 'spoink', 'Level 32'),
|
||||
sp('sandshrew', 27, 117, 'Sandshrew', ['Ground'], null, ''),
|
||||
sp('sandslash', 28, 118, 'Sandslash', ['Ground'], 'sandshrew', 'Level 22'),
|
||||
sp('spinda', 327, 119, 'Spinda', ['Normal'], null, ''),
|
||||
sp('skarmory', 227, 120, 'Skarmory', ['Steel', 'Flying'], null, ''),
|
||||
sp('trapinch', 328, 121, 'Trapinch', ['Ground'], null, ''),
|
||||
sp('vibrava', 329, 122, 'Vibrava', ['Ground', 'Dragon'], 'trapinch', 'Level 35'),
|
||||
sp('flygon', 330, 123, 'Flygon', ['Ground', 'Dragon'], 'vibrava', 'Level 45'),
|
||||
sp('cacnea', 331, 124, 'Cacnea', ['Grass'], null, ''),
|
||||
sp('cacturne', 332, 125, 'Cacturne', ['Grass', 'Dark'], 'cacnea', 'Level 32'),
|
||||
|
||||
sp('swablu', 333, 126, 'Swablu', ['Normal', 'Flying'], null, ''),
|
||||
sp('altaria', 334, 127, 'Altaria', ['Dragon', 'Flying'], 'swablu', 'Level 35'),
|
||||
sp('zangoose', 335, 128, 'Zangoose', ['Normal'], null, '', 'or-only', 'Omega Ruby exclusive'),
|
||||
sp('seviper', 336, 129, 'Seviper', ['Poison'], null, '', 'as-only', 'Alpha Sapphire exclusive'),
|
||||
sp('lunatone', 337, 130, 'Lunatone', ['Rock', 'Psychic'], null, '', 'as-only', 'Alpha Sapphire exclusive'),
|
||||
sp('solrock', 338, 131, 'Solrock', ['Rock', 'Psychic'], null, '', 'or-only', 'Omega Ruby exclusive'),
|
||||
sp('barboach', 339, 132, 'Barboach', ['Water', 'Ground'], null, ''),
|
||||
sp('whiscash', 340, 133, 'Whiscash', ['Water', 'Ground'], 'barboach', 'Level 30'),
|
||||
sp('corphish', 341, 134, 'Corphish', ['Water'], null, ''),
|
||||
sp('crawdaunt', 342, 135, 'Crawdaunt', ['Water', 'Dark'], 'corphish', 'Level 30'),
|
||||
sp('baltoy', 343, 136, 'Baltoy', ['Ground', 'Psychic'], null, ''),
|
||||
sp('claydol', 344, 137, 'Claydol', ['Ground', 'Psychic'], 'baltoy', 'Level 36'),
|
||||
sp('lileep', 345, 138, 'Lileep', ['Rock', 'Grass'], null, 'Revive Root Fossil (Route 111 Desert choice)'),
|
||||
sp('cradily', 346, 139, 'Cradily', ['Rock', 'Grass'], 'lileep', 'Level 40'),
|
||||
sp('anorith', 347, 140, 'Anorith', ['Rock', 'Bug'], null, 'Revive Claw Fossil (Route 111 Desert choice)'),
|
||||
sp('armaldo', 348, 141, 'Armaldo', ['Rock', 'Bug'], 'anorith', 'Level 40'),
|
||||
sp('igglybuff', 174, 142, 'Igglybuff', ['Normal', 'Fairy'], null, 'Breed Jigglypuff/Wigglytuff'),
|
||||
sp('jigglypuff', 39, 143, 'Jigglypuff', ['Normal', 'Fairy'], 'igglybuff', 'Friendship'),
|
||||
sp('wigglytuff', 40, 144, 'Wigglytuff', ['Normal', 'Fairy'], 'jigglypuff', 'Moon Stone'),
|
||||
sp('feebas', 349, 145, 'Feebas', ['Water'], null, ''),
|
||||
sp('milotic', 350, 146, 'Milotic', ['Water'], 'feebas', 'Max Beauty (Pokéblocks) + Level Up'),
|
||||
sp('castform', 351, 147, 'Castform', ['Normal'], null, 'Weather Institute Gift (Route 119)'),
|
||||
sp('staryu', 120, 148, 'Staryu', ['Water'], null, ''),
|
||||
sp('starmie', 121, 149, 'Starmie', ['Water', 'Psychic'], 'staryu', 'Water Stone'),
|
||||
sp('kecleon', 352, 150, 'Kecleon', ['Normal'], null, ''),
|
||||
sp('shuppet', 353, 151, 'Shuppet', ['Ghost'], null, ''),
|
||||
sp('banette', 354, 152, 'Banette', ['Ghost'], 'shuppet', 'Level 37'),
|
||||
sp('duskull', 355, 153, 'Duskull', ['Ghost'], null, ''),
|
||||
sp('dusclops', 356, 154, 'Dusclops', ['Ghost'], 'duskull', 'Level 37'),
|
||||
sp('dusknoir', 477, 155, 'Dusknoir', ['Ghost'], 'dusclops', 'Trade holding Reaper Cloth', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
|
||||
sp('tropius', 357, 156, 'Tropius', ['Grass', 'Flying'], null, ''),
|
||||
sp('chingling', 433, 157, 'Chingling', ['Psychic'], null, 'Breed Chimecho holding Pure Incense'),
|
||||
sp('chimecho', 358, 158, 'Chimecho', ['Psychic'], 'chingling', 'Friendship (Nighttime)'),
|
||||
sp('absol', 359, 159, 'Absol', ['Dark'], null, ''),
|
||||
sp('vulpix', 37, 160, 'Vulpix', ['Fire'], null, ''),
|
||||
sp('ninetales', 38, 161, 'Ninetales', ['Fire'], 'vulpix', 'Fire Stone'),
|
||||
sp('pichu', 172, 162, 'Pichu', ['Electric'], null, 'Breed Pikachu/Raichu (Cosplay Pikachu cannot breed)'),
|
||||
sp('pikachu', 25, 163, 'Pikachu', ['Electric'], 'pichu', 'Friendship (Cosplay Pikachu at Slateport; wild in Safari Zone)'),
|
||||
sp('raichu', 26, 164, 'Raichu', ['Electric'], 'pikachu', 'Thunder Stone (Cosplay Pikachu cannot evolve)'),
|
||||
sp('psyduck', 54, 165, 'Psyduck', ['Water'], null, ''),
|
||||
sp('golduck', 55, 166, 'Golduck', ['Water'], 'psyduck', 'Level 33'),
|
||||
sp('wynaut', 360, 167, 'Wynaut', ['Psychic'], null, 'Lavaridge Town Gift Egg (or breed holding Lax Incense)'),
|
||||
sp('wobbuffet', 202, 168, 'Wobbuffet', ['Psychic'], 'wynaut', 'Level 15'),
|
||||
sp('natu', 177, 169, 'Natu', ['Psychic', 'Flying'], null, 'Breed Xatu'),
|
||||
sp('xatu', 178, 170, 'Xatu', ['Psychic', 'Flying'], 'natu', 'Level 25 (or Safari Zone SW / Mirage Spots)'),
|
||||
sp('girafarig', 203, 171, 'Girafarig', ['Normal', 'Psychic'], null, ''),
|
||||
sp('phanpy', 231, 172, 'Phanpy', ['Ground'], null, 'Breed Donphan'),
|
||||
sp('donphan', 232, 173, 'Donphan', ['Ground'], 'phanpy', 'Level 25 (or Safari Zone NE / Mirage Mountains)'),
|
||||
sp('pinsir', 127, 174, 'Pinsir', ['Bug'], null, ''),
|
||||
sp('heracross', 214, 175, 'Heracross', ['Bug', 'Fighting'], null, ''),
|
||||
sp('rhyhorn', 111, 176, 'Rhyhorn', ['Ground', 'Rock'], null, ''),
|
||||
sp('rhydon', 112, 177, 'Rhydon', ['Ground', 'Rock'], 'rhyhorn', 'Level 42'),
|
||||
sp('rhyperior', 464, 178, 'Rhyperior', ['Ground', 'Rock'], 'rhydon', 'Trade holding Protector', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('snorunt', 361, 179, 'Snorunt', ['Ice'], null, ''),
|
||||
sp('glalie', 362, 180, 'Glalie', ['Ice'], 'snorunt', 'Level 42'),
|
||||
sp('froslass', 478, 181, 'Froslass', ['Ice', 'Ghost'], 'snorunt', 'Dawn Stone (Female Snorunt)'),
|
||||
sp('spheal', 363, 182, 'Spheal', ['Ice', 'Water'], null, ''),
|
||||
sp('sealeo', 364, 183, 'Sealeo', ['Ice', 'Water'], 'spheal', 'Level 32'),
|
||||
sp('walrein', 365, 184, 'Walrein', ['Ice', 'Water'], 'sealeo', 'Level 44'),
|
||||
sp('clamperl', 366, 185, 'Clamperl', ['Water'], null, ''),
|
||||
sp('huntail', 367, 186, 'Huntail', ['Water'], 'clamperl', 'Trade holding Deep Sea Tooth', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('gorebyss', 368, 187, 'Gorebyss', ['Water'], 'clamperl', 'Trade holding Deep Sea Scale', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('relicanth', 369, 188, 'Relicanth', ['Water', 'Rock'], null, ''),
|
||||
sp('corsola', 222, 189, 'Corsola', ['Water', 'Rock'], null, ''),
|
||||
sp('chinchou', 170, 190, 'Chinchou', ['Water', 'Electric'], null, ''),
|
||||
sp('lanturn', 171, 191, 'Lanturn', ['Water', 'Electric'], 'chinchou', 'Level 27'),
|
||||
sp('luvdisc', 370, 192, 'Luvdisc', ['Water'], null, ''),
|
||||
sp('horsea', 116, 193, 'Horsea', ['Water'], null, ''),
|
||||
sp('seadra', 117, 194, 'Seadra', ['Water'], 'horsea', 'Level 32'),
|
||||
sp('kingdra', 230, 195, 'Kingdra', ['Water', 'Dragon'], 'seadra', 'Trade holding Dragon Scale', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('bagon', 371, 196, 'Bagon', ['Dragon'], null, ''),
|
||||
sp('shelgon', 372, 197, 'Shelgon', ['Dragon'], 'bagon', 'Level 30'),
|
||||
sp('salamence', 373, 198, 'Salamence', ['Dragon', 'Flying'], 'shelgon', 'Level 50'),
|
||||
sp('beldum', 374, 199, 'Beldum', ['Steel', 'Psychic'], null, "Post-Game Gift (Steven's House, Mossdeep)"),
|
||||
sp('metang', 375, 200, 'Metang', ['Steel', 'Psychic'], 'beldum', 'Level 20'),
|
||||
sp('metagross', 376, 201, 'Metagross', ['Steel', 'Psychic'], 'metang', 'Level 45'),
|
||||
|
||||
sp('regirock', 377, 202, 'Regirock', ['Rock'], null, 'Static (Desert Ruins)'),
|
||||
sp('regice', 378, 203, 'Regice', ['Ice'], null, 'Static (Island Cave)'),
|
||||
sp('registeel', 379, 204, 'Registeel', ['Steel'], null, 'Static (Ancient Tomb)'),
|
||||
sp('latias', 380, 205, 'Latias', ['Dragon', 'Psychic'], null, 'Story Gift (Southern Island in AS / Eon Ticket in OR)', 'as-only', 'Story Gift in Alpha Sapphire; Eon Ticket only in Omega Ruby'),
|
||||
sp('latios', 381, 206, 'Latios', ['Dragon', 'Psychic'], null, 'Story Gift (Southern Island in OR / Eon Ticket in AS)', 'or-only', 'Story Gift in Omega Ruby; Eon Ticket only in Alpha Sapphire'),
|
||||
sp('kyogre', 382, 207, 'Kyogre', ['Water'], null, 'Static (Cave of Origin)', 'as-only', 'Alpha Sapphire exclusive'),
|
||||
sp('groudon', 383, 208, 'Groudon', ['Ground'], null, 'Static (Cave of Origin)', 'or-only', 'Omega Ruby exclusive'),
|
||||
sp('rayquaza', 384, 209, 'Rayquaza', ['Dragon', 'Flying'], null, 'Static (Sky Pillar — Delta Episode)'),
|
||||
sp('jirachi', 385, 210, 'Jirachi', ['Steel', 'Psychic'], null, 'Event Mythical', 'event-only', 'Event-only Mythical (unobtainable solo)'),
|
||||
sp('deoxys', 386, 211, 'Deoxys', ['Psychic'], null, 'Static (Sky Pillar / Space — Delta Episode)'),
|
||||
|
||||
// =========================================================================
|
||||
// NATIONAL POKÉDEX POKÉMON RELEVANT TO ALPHA SAPPHIRE (& OMEGA RUBY)
|
||||
// =========================================================================
|
||||
sp('weedle', 13, null, 'Weedle', ['Bug', 'Poison'], null, 'Breed Kakuna/Beedrill'),
|
||||
sp('kakuna', 14, null, 'Kakuna', ['Bug', 'Poison'], 'weedle', 'Level 7'),
|
||||
sp('beedrill', 15, null, 'Beedrill', ['Bug', 'Poison'], 'kakuna', 'Level 10'),
|
||||
sp('pidgey', 16, null, 'Pidgey', ['Normal', 'Flying'], null, 'Breed Pidgeotto/Pidgeot'),
|
||||
sp('pidgeotto', 17, null, 'Pidgeotto', ['Normal', 'Flying'], 'pidgey', 'Level 18'),
|
||||
sp('pidgeot', 18, null, 'Pidgeot', ['Normal', 'Flying'], 'pidgeotto', 'Level 36'),
|
||||
sp('rattata', 19, null, 'Rattata', ['Normal'], null, ''),
|
||||
sp('raticate', 20, null, 'Raticate', ['Normal'], 'rattata', 'Level 20'),
|
||||
sp('cleffa', 173, null, 'Cleffa', ['Fairy'], null, 'Breed Clefairy/Clefable'),
|
||||
sp('clefairy', 35, null, 'Clefairy', ['Fairy'], 'cleffa', 'Friendship'),
|
||||
sp('clefable', 36, null, 'Clefable', ['Fairy'], 'clefairy', 'Moon Stone'),
|
||||
sp('paras', 46, null, 'Paras', ['Bug', 'Grass'], null, ''),
|
||||
sp('parasect', 47, null, 'Parasect', ['Bug', 'Grass'], 'paras', 'Level 24'),
|
||||
sp('venonat', 48, null, 'Venonat', ['Bug', 'Poison'], null, 'Breed Venomoth'),
|
||||
sp('venomoth', 49, null, 'Venomoth', ['Bug', 'Poison'], 'venonat', 'Level 31'),
|
||||
sp('diglett', 50, null, 'Diglett', ['Ground'], null, ''),
|
||||
sp('dugtrio', 51, null, 'Dugtrio', ['Ground'], 'diglett', 'Level 26'),
|
||||
sp('meowth', 52, null, 'Meowth', ['Normal'], null, 'Breed Persian'),
|
||||
sp('persian', 53, null, 'Persian', ['Normal'], 'meowth', 'Level 28'),
|
||||
sp('mankey', 56, null, 'Mankey', ['Fighting'], null, ''),
|
||||
sp('primeape', 57, null, 'Primeape', ['Fighting'], 'mankey', 'Level 28'),
|
||||
sp('growlithe', 58, null, 'Growlithe', ['Fire'], null, ''),
|
||||
sp('arcanine', 59, null, 'Arcanine', ['Fire'], 'growlithe', 'Fire Stone'),
|
||||
sp('ponyta', 77, null, 'Ponyta', ['Fire'], null, ''),
|
||||
sp('rapidash', 78, null, 'Rapidash', ['Fire'], 'ponyta', 'Level 40'),
|
||||
sp('slowpoke', 79, null, 'Slowpoke', ['Water', 'Psychic'], null, ''),
|
||||
sp('slowbro', 80, null, 'Slowbro', ['Water', 'Psychic'], 'slowpoke', 'Level 37'),
|
||||
sp('slowking', 199, null, 'Slowking', ['Water', 'Psychic'], 'slowpoke', "Trade holding King's Rock", 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('seel', 86, null, 'Seel', ['Water'], null, ''),
|
||||
sp('dewgong', 87, null, 'Dewgong', ['Water', 'Ice'], 'seel', 'Level 34'),
|
||||
sp('onix', 95, null, 'Onix', ['Rock', 'Ground'], null, ''),
|
||||
sp('steelix', 208, null, 'Steelix', ['Steel', 'Ground'], 'onix', 'Trade holding Metal Coat', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('drowzee', 96, null, 'Drowzee', ['Psychic'], null, 'Breed Hypno'),
|
||||
sp('hypno', 97, null, 'Hypno', ['Psychic'], 'drowzee', 'Level 26'),
|
||||
sp('krabby', 98, null, 'Krabby', ['Water'], null, ''),
|
||||
sp('kingler', 99, null, 'Kingler', ['Water'], 'krabby', 'Level 28'),
|
||||
sp('tyrogue', 236, null, 'Tyrogue', ['Fighting'], null, ''),
|
||||
sp('hitmonlee', 106, null, 'Hitmonlee', ['Fighting'], 'tyrogue', 'Level 20 (Atk > Def)'),
|
||||
sp('hitmonchan', 107, null, 'Hitmonchan', ['Fighting'], 'tyrogue', 'Level 20 (Atk < Def)'),
|
||||
sp('hitmontop', 237, null, 'Hitmontop', ['Fighting'], 'tyrogue', 'Level 20 (Atk = Def)'),
|
||||
sp('happiny', 440, null, 'Happiny', ['Normal'], null, 'Mirage Spot or Breed Chansey holding Luck Incense'),
|
||||
sp('chansey', 113, null, 'Chansey', ['Normal'], 'happiny', 'Level up holding Oval Stone (Daytime)'),
|
||||
sp('blissey', 242, null, 'Blissey', ['Normal'], 'chansey', 'Friendship'),
|
||||
sp('tangela', 114, null, 'Tangela', ['Grass'], null, ''),
|
||||
sp('tangrowth', 465, null, 'Tangrowth', ['Grass'], 'tangela', 'Level up knowing Ancient Power (Lv. 38)'),
|
||||
sp('ditto', 132, null, 'Ditto', ['Normal'], null, ''),
|
||||
sp('eevee', 133, null, 'Eevee', ['Normal'], null, ''),
|
||||
sp('vaporeon', 134, null, 'Vaporeon', ['Water'], 'eevee', 'Water Stone'),
|
||||
sp('jolteon', 135, null, 'Jolteon', ['Electric'], 'eevee', 'Thunder Stone'),
|
||||
sp('flareon', 136, null, 'Flareon', ['Fire'], 'eevee', 'Fire Stone'),
|
||||
sp('espeon', 196, null, 'Espeon', ['Psychic'], 'eevee', 'Friendship (Daytime)'),
|
||||
sp('umbreon', 197, null, 'Umbreon', ['Dark'], 'eevee', 'Friendship (Nighttime)'),
|
||||
sp('leafeon', 470, null, 'Leafeon', ['Grass'], 'eevee', 'Level up near Moss Rock (Petalburg Woods)'),
|
||||
sp('glaceon', 471, null, 'Glaceon', ['Ice'], 'eevee', 'Level up near Ice Rock (Shoal Cave Ice Room)'),
|
||||
sp('sylveon', 700, null, 'Sylveon', ['Fairy'], 'eevee', '2+ Affection Hearts (Pokémon-Amie) + Fairy move + Level up'),
|
||||
sp('porygon', 137, null, 'Porygon', ['Normal'], null, ''),
|
||||
sp('porygon2', 233, null, 'Porygon2', ['Normal'], 'porygon', 'Trade holding Up-Grade', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('porygon-z', 474, null, 'Porygon-Z', ['Normal'], 'porygon2', 'Trade holding Dubious Disc', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('omanyte', 138, null, 'Omanyte', ['Rock', 'Water'], null, 'Revive Helix Fossil (Mirage Rock Smash)', 'as-only', 'Alpha Sapphire exclusive fossil'),
|
||||
sp('omastar', 139, null, 'Omastar', ['Rock', 'Water'], 'omanyte', 'Level 40', 'as-only', 'Alpha Sapphire exclusive fossil'),
|
||||
sp('kabuto', 140, null, 'Kabuto', ['Rock', 'Water'], null, 'Revive Dome Fossil (Mirage Rock Smash)', 'or-only', 'Omega Ruby exclusive fossil'),
|
||||
sp('kabutops', 141, null, 'Kabutops', ['Rock', 'Water'], 'kabuto', 'Level 40', 'or-only', 'Omega Ruby exclusive fossil'),
|
||||
sp('aerodactyl', 142, null, 'Aerodactyl', ['Rock', 'Flying'], null, 'Revive Old Amber (Mirage Rock Smash)'),
|
||||
|
||||
// Johto
|
||||
sp('chikorita', 152, null, 'Chikorita', ['Grass'], null, 'Post-E4 Gift Choice (Birch)'),
|
||||
sp('bayleef', 153, null, 'Bayleef', ['Grass'], 'chikorita', 'Level 16'),
|
||||
sp('meganium', 154, null, 'Meganium', ['Grass'], 'bayleef', 'Level 32'),
|
||||
sp('cyndaquil', 155, null, 'Cyndaquil', ['Fire'], null, 'Post-E4 Gift Choice (Birch)'),
|
||||
sp('quilava', 156, null, 'Quilava', ['Fire'], 'cyndaquil', 'Level 14'),
|
||||
sp('typhlosion', 157, null, 'Typhlosion', ['Fire'], 'quilava', 'Level 36'),
|
||||
sp('totodile', 158, null, 'Totodile', ['Water'], null, 'Post-E4 Gift Choice (Birch)'),
|
||||
sp('croconaw', 159, null, 'Croconaw', ['Water'], 'totodile', 'Level 18'),
|
||||
sp('feraligatr', 160, null, 'Feraligatr', ['Water'], 'croconaw', 'Level 30'),
|
||||
sp('spinarak', 167, null, 'Spinarak', ['Bug', 'Poison'], null, 'Breed Ariados'),
|
||||
sp('ariados', 168, null, 'Ariados', ['Bug', 'Poison'], 'spinarak', 'Level 22'),
|
||||
sp('togepi', 175, null, 'Togepi', ['Fairy'], null, 'Lavaridge Town Gift Egg (after Primal Kyogre/NatDex)'),
|
||||
sp('togetic', 176, null, 'Togetic', ['Fairy', 'Flying'], 'togepi', 'Friendship'),
|
||||
sp('togekiss', 468, null, 'Togekiss', ['Fairy', 'Flying'], 'togetic', 'Shiny Stone'),
|
||||
sp('aipom', 190, null, 'Aipom', ['Normal'], null, ''),
|
||||
sp('ambipom', 424, null, 'Ambipom', ['Normal'], 'aipom', 'Level up knowing Double Hit (Lv. 32)'),
|
||||
sp('sunkern', 191, null, 'Sunkern', ['Grass'], null, ''),
|
||||
sp('sunflora', 192, null, 'Sunflora', ['Grass'], 'sunkern', 'Sun Stone'),
|
||||
sp('murkrow', 198, null, 'Murkrow', ['Dark', 'Flying'], null, ''),
|
||||
sp('honchkrow', 430, null, 'Honchkrow', ['Dark', 'Flying'], 'murkrow', 'Dusk Stone'),
|
||||
sp('misdreavus', 200, null, 'Misdreavus', ['Ghost'], null, ''),
|
||||
sp('mismagius', 429, null, 'Mismagius', ['Ghost'], 'misdreavus', 'Dusk Stone'),
|
||||
sp('unown', 201, null, 'Unown', ['Psychic'], null, ''),
|
||||
sp('pineco', 204, null, 'Pineco', ['Bug'], null, 'Breed Forretress'),
|
||||
sp('forretress', 205, null, 'Forretress', ['Bug', 'Steel'], 'pineco', 'Level 31'),
|
||||
sp('remoraid', 223, null, 'Remoraid', ['Water'], null, ''),
|
||||
sp('octillery', 224, null, 'Octillery', ['Water'], 'remoraid', 'Level 25'),
|
||||
sp('delibird', 225, null, 'Delibird', ['Ice', 'Flying'], null, ''),
|
||||
sp('mantine', 226, null, 'Mantine', ['Water', 'Flying'], 'mantyke', 'Level up w/ Remoraid in party (or 1% Surf)'),
|
||||
sp('stantler', 234, null, 'Stantler', ['Normal'], null, ''),
|
||||
sp('elekid', 239, null, 'Elekid', ['Electric'], null, ''),
|
||||
sp('electabuzz', 125, null, 'Electabuzz', ['Electric'], 'elekid', 'Level 30'),
|
||||
sp('electivire', 466, null, 'Electivire', ['Electric'], 'electabuzz', 'Trade holding Electirizer', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('magby', 240, null, 'Magby', ['Fire'], null, ''),
|
||||
sp('magmar', 126, null, 'Magmar', ['Fire'], 'magby', 'Level 30'),
|
||||
sp('magmortar', 467, null, 'Magmortar', ['Fire'], 'magmar', 'Trade holding Magmarizer', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('raikou', 243, null, 'Raikou', ['Electric'], null, 'Trackless Forest (Lugia/Ho-Oh in party; :00-:20)'),
|
||||
sp('entei', 244, null, 'Entei', ['Fire'], null, 'Trackless Forest (Lugia/Ho-Oh in party; :20-:40)'),
|
||||
sp('suicune', 245, null, 'Suicune', ['Water'], null, 'Trackless Forest (Lugia/Ho-Oh in party; :40-:00)'),
|
||||
sp('lugia', 249, null, 'Lugia', ['Psychic', 'Flying'], null, 'Sea Mauville (Tidal Bell)', 'as-only', 'Alpha Sapphire exclusive'),
|
||||
sp('ho-oh', 250, null, 'Ho-Oh', ['Fire', 'Flying'], null, 'Sea Mauville (Clear Bell)', 'or-only', 'Omega Ruby exclusive'),
|
||||
|
||||
// Sinnoh
|
||||
sp('turtwig', 387, null, 'Turtwig', ['Grass'], null, 'Post-Delta E4 Rematch Gift Choice (Birch)'),
|
||||
sp('grotle', 388, null, 'Grotle', ['Grass'], 'turtwig', 'Level 18'),
|
||||
sp('torterra', 389, null, 'Torterra', ['Grass', 'Ground'], 'grotle', 'Level 32'),
|
||||
sp('chimchar', 390, null, 'Chimchar', ['Fire'], null, 'Post-Delta E4 Rematch Gift Choice (Birch)'),
|
||||
sp('monferno', 391, null, 'Monferno', ['Fire', 'Fighting'], 'chimchar', 'Level 14'),
|
||||
sp('infernape', 392, null, 'Infernape', ['Fire', 'Fighting'], 'monferno', 'Level 36'),
|
||||
sp('piplup', 393, null, 'Piplup', ['Water'], null, 'Post-Delta E4 Rematch Gift Choice (Birch)'),
|
||||
sp('prinplup', 394, null, 'Prinplup', ['Water'], 'piplup', 'Level 16'),
|
||||
sp('empoleon', 395, null, 'Empoleon', ['Water', 'Steel'], 'prinplup', 'Level 36'),
|
||||
sp('kricketot', 401, null, 'Kricketot', ['Bug'], null, 'Breed Kricketune'),
|
||||
sp('kricketune', 402, null, 'Kricketune', ['Bug'], 'kricketot', 'Level 10'),
|
||||
sp('shinx', 403, null, 'Shinx', ['Electric'], null, 'Breed Luxio'),
|
||||
sp('luxio', 404, null, 'Luxio', ['Electric'], 'shinx', 'Level 15'),
|
||||
sp('luxray', 405, null, 'Luxray', ['Electric'], 'luxio', 'Level 30'),
|
||||
sp('cranidos', 408, null, 'Cranidos', ['Rock'], null, 'Revive Skull Fossil (Mirage Rock Smash)', 'as-only', 'Alpha Sapphire exclusive fossil'),
|
||||
sp('rampardos', 409, null, 'Rampardos', ['Rock'], 'cranidos', 'Level 30', 'as-only', 'Alpha Sapphire exclusive fossil'),
|
||||
sp('shieldon', 410, null, 'Shieldon', ['Rock', 'Steel'], null, 'Revive Armor Fossil (Mirage Rock Smash)', 'or-only', 'Omega Ruby exclusive fossil'),
|
||||
sp('bastiodon', 411, null, 'Bastiodon', ['Rock', 'Steel'], 'shieldon', 'Level 30', 'or-only', 'Omega Ruby exclusive fossil'),
|
||||
sp('cherubi', 420, null, 'Cherubi', ['Grass'], null, 'Breed Cherrim'),
|
||||
sp('cherrim', 421, null, 'Cherrim', ['Grass'], 'cherubi', 'Level 25'),
|
||||
sp('shellos', 422, null, 'Shellos', ['Water'], null, ''),
|
||||
sp('gastrodon', 423, null, 'Gastrodon', ['Water', 'Ground'], 'shellos', 'Level 30'),
|
||||
sp('drifloon', 425, null, 'Drifloon', ['Ghost', 'Flying'], null, ''),
|
||||
sp('drifblim', 426, null, 'Drifblim', ['Ghost', 'Flying'], 'drifloon', 'Level 28'),
|
||||
sp('buneary', 427, null, 'Buneary', ['Normal'], null, ''),
|
||||
sp('lopunny', 428, null, 'Lopunny', ['Normal'], 'buneary', 'Friendship'),
|
||||
sp('glameow', 431, null, 'Glameow', ['Normal'], null, ''),
|
||||
sp('purugly', 432, null, 'Purugly', ['Normal'], 'glameow', 'Level 38'),
|
||||
sp('bronzor', 436, null, 'Bronzor', ['Steel', 'Psychic'], null, ''),
|
||||
sp('bronzong', 437, null, 'Bronzong', ['Steel', 'Psychic'], 'bronzor', 'Level 33'),
|
||||
sp('chatot', 441, null, 'Chatot', ['Normal', 'Flying'], null, ''),
|
||||
sp('spiritomb', 442, null, 'Spiritomb', ['Ghost', 'Dark'], null, 'Static (Sea Mauville Odd Keystone room)'),
|
||||
sp('gible', 443, null, 'Gible', ['Dragon', 'Ground'], null, ''),
|
||||
sp('gabite', 444, null, 'Gabite', ['Dragon', 'Ground'], 'gible', 'Level 24'),
|
||||
sp('garchomp', 445, null, 'Garchomp', ['Dragon', 'Ground'], 'gabite', 'Level 48'),
|
||||
sp('skorupi', 451, null, 'Skorupi', ['Poison', 'Bug'], null, ''),
|
||||
sp('drapion', 452, null, 'Drapion', ['Poison', 'Dark'], 'skorupi', 'Level 40'),
|
||||
sp('finneon', 456, null, 'Finneon', ['Water'], null, ''),
|
||||
sp('lumineon', 457, null, 'Lumineon', ['Water'], 'finneon', 'Level 31'),
|
||||
sp('mantyke', 458, null, 'Mantyke', ['Water', 'Flying'], null, 'Battle Resort Surf (or breed Mantine w/ Wave Incense)'),
|
||||
sp('uxie', 480, null, 'Uxie', ['Psychic'], null, 'Nameless Cavern (3 Max-Friendship Pokémon; 20:00-21:00)'),
|
||||
sp('mesprit', 481, null, 'Mesprit', ['Psychic'], null, 'Nameless Cavern (3 Max-Friendship Pokémon; 04:00-19:59)'),
|
||||
sp('azelf', 482, null, 'Azelf', ['Psychic'], null, 'Nameless Cavern (3 Max-Friendship Pokémon; 21:00-03:59)'),
|
||||
sp('dialga', 483, null, 'Dialga', ['Steel', 'Dragon'], null, 'Soaring Dimensional Rift (Uxie, Mesprit, Azelf in party)', 'as-only', 'Alpha Sapphire exclusive'),
|
||||
sp('palkia', 484, null, 'Palkia', ['Water', 'Dragon'], null, 'Soaring Dimensional Rift (Uxie, Mesprit, Azelf in party)', 'or-only', 'Omega Ruby exclusive'),
|
||||
sp('heatran', 485, null, 'Heatran', ['Fire', 'Steel'], null, 'Static (Scorched Slab B3F after Primal Kyogre/Groudon)'),
|
||||
sp('regigigas', 486, null, 'Regigigas', ['Normal'], null, 'Island Cave (Post-E4, Regirock/Registeel + nicknamed Regice w/ ice item, Daytime)'),
|
||||
sp('giratina', 487, null, 'Giratina', ['Ghost', 'Dragon'], null, 'Soaring Dimensional Rift (Dialga & Palkia in party)', 'dual-game-legendary', 'Requires both Dialga & Palkia (needs trade in Solo POC)'),
|
||||
sp('cresselia', 488, null, 'Cresselia', ['Psychic'], null, 'Static (Crescent Isle daily Mirage Spot)'),
|
||||
|
||||
// Unova
|
||||
sp('snivy', 495, null, 'Snivy', ['Grass'], null, 'Post-Delta Episode Gift Choice (Birch)'),
|
||||
sp('servine', 496, null, 'Servine', ['Grass'], 'snivy', 'Level 17'),
|
||||
sp('serperior', 497, null, 'Serperior', ['Grass'], 'servine', 'Level 36'),
|
||||
sp('tepig', 498, null, 'Tepig', ['Fire'], null, 'Post-Delta Episode Gift Choice (Birch)'),
|
||||
sp('pignite', 499, null, 'Pignite', ['Fire', 'Fighting'], 'tepig', 'Level 17'),
|
||||
sp('emboar', 500, null, 'Emboar', ['Fire', 'Fighting'], 'pignite', 'Level 36'),
|
||||
sp('oshawott', 501, null, 'Oshawott', ['Water'], null, 'Post-Delta Episode Gift Choice (Birch)'),
|
||||
sp('dewott', 502, null, 'Dewott', ['Water'], 'oshawott', 'Level 17'),
|
||||
sp('samurott', 503, null, 'Samurott', ['Water'], 'dewott', 'Level 36'),
|
||||
sp('lillipup', 506, null, 'Lillipup', ['Normal'], null, ''),
|
||||
sp('herdier', 507, null, 'Herdier', ['Normal'], 'lillipup', 'Level 16'),
|
||||
sp('stoutland', 508, null, 'Stoutland', ['Normal'], 'herdier', 'Level 32'),
|
||||
sp('munna', 517, null, 'Munna', ['Psychic'], null, ''),
|
||||
sp('musharna', 518, null, 'Musharna', ['Psychic'], 'munna', 'Moon Stone'),
|
||||
sp('pidove', 519, null, 'Pidove', ['Normal', 'Flying'], null, ''),
|
||||
sp('tranquill', 520, null, 'Tranquill', ['Normal', 'Flying'], 'pidove', 'Level 21'),
|
||||
sp('unfezant', 521, null, 'Unfezant', ['Normal', 'Flying'], 'tranquill', 'Level 32'),
|
||||
sp('blitzle', 522, null, 'Blitzle', ['Electric'], null, 'Breed Zebstrika'),
|
||||
sp('zebstrika', 523, null, 'Zebstrika', ['Electric'], 'blitzle', 'Level 27'),
|
||||
sp('roggenrola', 524, null, 'Roggenrola', ['Rock'], null, ''),
|
||||
sp('boldore', 525, null, 'Boldore', ['Rock'], 'roggenrola', 'Level 25'),
|
||||
sp('gigalith', 526, null, 'Gigalith', ['Rock'], 'boldore', 'Trade', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('drilbur', 529, null, 'Drilbur', ['Ground'], null, 'Breed Excadrill'),
|
||||
sp('excadrill', 530, null, 'Excadrill', ['Ground', 'Steel'], 'drilbur', 'Level 31'),
|
||||
sp('audino', 531, null, 'Audino', ['Normal'], null, ''),
|
||||
sp('timburr', 532, null, 'Timburr', ['Fighting'], null, ''),
|
||||
sp('gurdurr', 533, null, 'Gurdurr', ['Fighting'], 'timburr', 'Level 25'),
|
||||
sp('conkeldurr', 534, null, 'Conkeldurr', ['Fighting'], 'gurdurr', 'Trade', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
sp('tympole', 535, null, 'Tympole', ['Water'], null, ''),
|
||||
sp('palpitoad', 536, null, 'Palpitoad', ['Water', 'Ground'], 'tympole', 'Level 25'),
|
||||
sp('seismitoad', 537, null, 'Seismitoad', ['Water', 'Ground'], 'palpitoad', 'Level 36'),
|
||||
sp('throh', 538, null, 'Throh', ['Fighting'], null, '', 'or-only', 'Omega Ruby exclusive'),
|
||||
sp('sawk', 539, null, 'Sawk', ['Fighting'], null, '', 'as-only', 'Alpha Sapphire exclusive'),
|
||||
sp('sewaddle', 540, null, 'Sewaddle', ['Bug', 'Grass'], null, ''),
|
||||
sp('swadloon', 541, null, 'Swadloon', ['Bug', 'Grass'], 'sewaddle', 'Level 20'),
|
||||
sp('leavanny', 542, null, 'Leavanny', ['Bug', 'Grass'], 'swadloon', 'Friendship'),
|
||||
sp('cottonee', 546, null, 'Cottonee', ['Grass', 'Fairy'], null, ''),
|
||||
sp('whimsicott', 547, null, 'Whimsicott', ['Grass', 'Fairy'], 'cottonee', 'Sun Stone'),
|
||||
sp('petilil', 548, null, 'Petilil', ['Grass'], null, ''),
|
||||
sp('lilligant', 549, null, 'Lilligant', ['Grass'], 'petilil', 'Sun Stone'),
|
||||
sp('sandile', 551, null, 'Sandile', ['Ground', 'Dark'], null, ''),
|
||||
sp('krokorok', 552, null, 'Krokorok', ['Ground', 'Dark'], 'sandile', 'Level 29'),
|
||||
sp('krookodile', 553, null, 'Krookodile', ['Ground', 'Dark'], 'krokorok', 'Level 40'),
|
||||
sp('darumaka', 554, null, 'Darumaka', ['Fire'], null, 'Breed Darmanitan'),
|
||||
sp('darmanitan', 555, null, 'Darmanitan', ['Fire'], 'darumaka', 'Level 35'),
|
||||
sp('maractus', 556, null, 'Maractus', ['Grass'], null, ''),
|
||||
sp('dwebble', 557, null, 'Dwebble', ['Bug', 'Rock'], null, ''),
|
||||
sp('crustle', 558, null, 'Crustle', ['Bug', 'Rock'], 'dwebble', 'Level 34'),
|
||||
sp('scraggy', 559, null, 'Scraggy', ['Dark', 'Fighting'], null, ''),
|
||||
sp('scrafty', 560, null, 'Scrafty', ['Dark', 'Fighting'], 'scraggy', 'Level 39'),
|
||||
sp('yamask', 562, null, 'Yamask', ['Ghost'], null, 'Breed Cofagrigus'),
|
||||
sp('cofagrigus', 563, null, 'Cofagrigus', ['Ghost'], 'yamask', 'Level 34'),
|
||||
sp('tirtouga', 564, null, 'Tirtouga', ['Water', 'Rock'], null, 'Revive Cover Fossil (Mirage Rock Smash)', 'as-only', 'Alpha Sapphire exclusive fossil'),
|
||||
sp('carracosta', 565, null, 'Carracosta', ['Water', 'Rock'], 'tirtouga', 'Level 37', 'as-only', 'Alpha Sapphire exclusive fossil'),
|
||||
sp('archen', 566, null, 'Archen', ['Rock', 'Flying'], null, 'Revive Plume Fossil (Mirage Rock Smash)', 'or-only', 'Omega Ruby exclusive fossil'),
|
||||
sp('archeops', 567, null, 'Archeops', ['Rock', 'Flying'], 'archen', 'Level 37', 'or-only', 'Omega Ruby exclusive fossil'),
|
||||
sp('trubbish', 568, null, 'Trubbish', ['Poison'], null, ''),
|
||||
sp('garbodor', 569, null, 'Garbodor', ['Poison'], 'trubbish', 'Level 36'),
|
||||
sp('zorua', 570, null, 'Zorua', ['Dark'], null, ''),
|
||||
sp('zoroark', 571, null, 'Zoroark', ['Dark'], 'zorua', 'Level 30'),
|
||||
sp('minccino', 572, null, 'Minccino', ['Normal'], null, ''),
|
||||
sp('cinccino', 573, null, 'Cinccino', ['Normal'], 'minccino', 'Shiny Stone'),
|
||||
sp('gothita', 574, null, 'Gothita', ['Psychic'], null, ''),
|
||||
sp('gothorita', 575, null, 'Gothorita', ['Psychic'], 'gothita', 'Level 32'),
|
||||
sp('gothitelle', 576, null, 'Gothitelle', ['Psychic'], 'gothorita', 'Level 41'),
|
||||
sp('deerling', 585, null, 'Deerling', ['Normal', 'Grass'], null, ''),
|
||||
sp('sawsbuck', 586, null, 'Sawsbuck', ['Normal', 'Grass'], 'deerling', 'Level 34'),
|
||||
sp('frillish', 592, null, 'Frillish', ['Water', 'Ghost'], null, ''),
|
||||
sp('jellicent', 593, null, 'Jellicent', ['Water', 'Ghost'], 'frillish', 'Level 40'),
|
||||
sp('alomomola', 594, null, 'Alomomola', ['Water'], null, ''),
|
||||
sp('joltik', 595, null, 'Joltik', ['Bug', 'Electric'], null, ''),
|
||||
sp('galvantula', 596, null, 'Galvantula', ['Bug', 'Electric'], 'joltik', 'Level 36'),
|
||||
sp('klink', 599, null, 'Klink', ['Steel'], null, ''),
|
||||
sp('klang', 600, null, 'Klang', ['Steel'], 'klink', 'Level 38'),
|
||||
sp('klinklang', 601, null, 'Klinklang', ['Steel'], 'klang', 'Level 49'),
|
||||
sp('tynamo', 602, null, 'Tynamo', ['Electric'], null, ''),
|
||||
sp('eelektrik', 603, null, 'Eelektrik', ['Electric'], 'tynamo', 'Level 39'),
|
||||
sp('eelektross', 604, null, 'Eelektross', ['Electric'], 'eelektrik', 'Thunder Stone'),
|
||||
sp('elgyem', 605, null, 'Elgyem', ['Psychic'], null, ''),
|
||||
sp('beheeyem', 606, null, 'Beheeyem', ['Psychic'], 'elgyem', 'Level 42'),
|
||||
sp('axew', 610, null, 'Axew', ['Dragon'], null, ''),
|
||||
sp('fraxure', 611, null, 'Fraxure', ['Dragon'], 'axew', 'Level 38'),
|
||||
sp('haxorus', 612, null, 'Haxorus', ['Dragon'], 'fraxure', 'Level 48'),
|
||||
sp('cubchoo', 613, null, 'Cubchoo', ['Ice'], null, ''),
|
||||
sp('beartic', 614, null, 'Beartic', ['Ice'], 'cubchoo', 'Level 37'),
|
||||
sp('druddigon', 621, null, 'Druddigon', ['Dragon'], null, ''),
|
||||
sp('bouffalant', 626, null, 'Bouffalant', ['Normal'], null, ''),
|
||||
sp('rufflet', 627, null, 'Rufflet', ['Normal', 'Flying'], null, 'Mirage Mountain (North of Lilycove) or Breed Braviary'),
|
||||
sp('braviary', 628, null, 'Braviary', ['Normal', 'Flying'], 'rufflet', 'Level 54 (or Soaring in Sky)'),
|
||||
sp('vullaby', 629, null, 'Vullaby', ['Dark', 'Flying'], null, 'Mirage Mountain (Northeast)'),
|
||||
sp('mandibuzz', 630, null, 'Mandibuzz', ['Dark', 'Flying'], 'vullaby', 'Level 54'),
|
||||
sp('deino', 633, null, 'Deino', ['Dark', 'Dragon'], null, ''),
|
||||
sp('zweilous', 634, null, 'Zweilous', ['Dark', 'Dragon'], 'deino', 'Level 50'),
|
||||
sp('hydreigon', 635, null, 'Hydreigon', ['Dark', 'Dragon'], 'zweilous', 'Level 64'),
|
||||
sp('larvesta', 636, null, 'Larvesta', ['Bug', 'Fire'], null, ''),
|
||||
sp('volcarona', 637, null, 'Volcarona', ['Bug', 'Fire'], 'larvesta', 'Level 59'),
|
||||
sp('cobalion', 638, null, 'Cobalion', ['Steel', 'Fighting'], null, 'Pathless Plain (3 Max-EV Pokémon; Sun/Wed/Fri)'),
|
||||
sp('terrakion', 639, null, 'Terrakion', ['Rock', 'Fighting'], null, 'Pathless Plain (3 Max-EV Pokémon; Tue/Sat)'),
|
||||
sp('virizion', 640, null, 'Virizion', ['Grass', 'Fighting'], null, 'Pathless Plain (3 Max-EV Pokémon; Mon/Thu)'),
|
||||
sp('tornadus', 641, null, 'Tornadus', ['Flying'], null, 'Soaring Storm Cloud (Castform in party)', 'or-only', 'Omega Ruby exclusive'),
|
||||
sp('thundurus', 642, null, 'Thundurus', ['Electric', 'Flying'], null, 'Soaring Storm Cloud (Castform in party)', 'as-only', 'Alpha Sapphire exclusive'),
|
||||
sp('reshiram', 643, null, 'Reshiram', ['Dragon', 'Fire'], null, 'Fabled Cave (Lv. 100 Pokémon in party)', 'or-only', 'Omega Ruby exclusive'),
|
||||
sp('zekrom', 644, null, 'Zekrom', ['Dragon', 'Electric'], null, 'Fabled Cave (Lv. 100 Pokémon in party)', 'as-only', 'Alpha Sapphire exclusive'),
|
||||
sp('landorus', 645, null, 'Landorus', ['Ground', 'Flying'], null, 'Soaring Storm Cloud (Tornadus & Thundurus in party)', 'dual-game-legendary', 'Requires both Tornadus & Thundurus (needs trade in Solo POC)'),
|
||||
sp('kyurem', 646, null, 'Kyurem', ['Dragon', 'Ice'], null, 'Gnarled Den (Reshiram & Zekrom in party)', 'dual-game-legendary', 'Requires both Reshiram & Zekrom (needs trade in Solo POC)'),
|
||||
|
||||
// Kalos species catchable in ORAS
|
||||
sp('binacle', 688, null, 'Binacle', ['Rock', 'Water'], null, 'Mirage Island Rock Smash (South of Rt. 134 / Pacifidlog)'),
|
||||
sp('barbaracle', 689, null, 'Barbaracle', ['Rock', 'Water'], 'binacle', 'Level 39'),
|
||||
sp('skrelp', 690, null, 'Skrelp', ['Poison', 'Water'], null, '', 'or-only', 'Omega Ruby exclusive'),
|
||||
sp('dragalge', 691, null, 'Dragalge', ['Poison', 'Dragon'], 'skrelp', 'Level 48', 'or-only', 'Omega Ruby exclusive'),
|
||||
sp('clauncher', 692, null, 'Clauncher', ['Water'], null, '', 'as-only', 'Alpha Sapphire exclusive'),
|
||||
sp('clawitzer', 693, null, 'Clawitzer', ['Water'], 'clauncher', 'Level 37', 'as-only', 'Alpha Sapphire exclusive'),
|
||||
sp('klefki', 707, null, 'Klefki', ['Steel', 'Fairy'], null, ''),
|
||||
sp('phantump', 708, null, 'Phantump', ['Ghost', 'Grass'], null, ''),
|
||||
sp('trevenant', 709, null, 'Trevenant', ['Ghost', 'Grass'], 'phantump', 'Trade', 'trade-evo', 'Requires Trade (unavailable in Solo POC)'),
|
||||
];
|
||||
|
||||
export const SPECIES_BY_ID = Object.fromEntries(SPECIES_LIST.map((s) => [s.id, s]));
|
||||
@@ -0,0 +1,878 @@
|
||||
import { SPECIES_LIST, SPECIES_BY_ID } from '../data/species.js';
|
||||
import { GAMES, getGame, DEFAULT_GAME_ID } from '../data/games/index.js';
|
||||
|
||||
const STORAGE_PREFIX = 'poc-tracker:v1:';
|
||||
const META_STORAGE_KEY = `${STORAGE_PREFIX}app-meta`;
|
||||
|
||||
function computeValidTrainerIds(game) {
|
||||
return new Set(
|
||||
(game?.sections || []).flatMap((section) => [
|
||||
...(section.trainers || []).map((trainer) => trainer.id),
|
||||
...(section.areas || []).flatMap((area) =>
|
||||
(area.trainers || []).map((trainer) => trainer.id),
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
export function isSpeciesSoloAvailableForGame(species, gameId) {
|
||||
if (!species) return false;
|
||||
switch (species.availability) {
|
||||
case 'all':
|
||||
return true;
|
||||
case 'as-only':
|
||||
return gameId === 'alpha-sapphire';
|
||||
case 'or-only':
|
||||
return gameId === 'omega-ruby';
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes earliest unlock milestone, all appearance locations, and exclusive choice groups.
|
||||
*/
|
||||
export function indexGameSpecies(game) {
|
||||
const earliestBySpecies = new Map();
|
||||
const locationsBySpecies = new Map();
|
||||
const choiceBySpecies = new Map();
|
||||
const groupBranches = new Map(); // groupId -> Map<optionValue, Set<speciesId>>
|
||||
|
||||
for (const section of game.sections) {
|
||||
for (const area of section.areas) {
|
||||
for (const group of area.groups) {
|
||||
for (const entry of group.entries) {
|
||||
if (!earliestBySpecies.has(entry.speciesId)) {
|
||||
earliestBySpecies.set(entry.speciesId, {
|
||||
sectionId: section.id,
|
||||
badgeNumber: section.badgeNumber,
|
||||
shortName: section.shortName,
|
||||
title: section.title,
|
||||
areaId: area.id,
|
||||
areaName: area.name,
|
||||
method: group.method,
|
||||
});
|
||||
}
|
||||
|
||||
if (!locationsBySpecies.has(entry.speciesId)) {
|
||||
locationsBySpecies.set(entry.speciesId, []);
|
||||
}
|
||||
locationsBySpecies.get(entry.speciesId).push({
|
||||
sectionId: section.id,
|
||||
sectionShortName: section.shortName,
|
||||
areaId: area.id,
|
||||
areaName: area.name,
|
||||
method: group.method,
|
||||
rate: entry.rate,
|
||||
levels: entry.levels,
|
||||
notes: entry.notes || '',
|
||||
choiceGroup: entry.choiceGroup || null,
|
||||
choiceOption: entry.choiceOption || null,
|
||||
});
|
||||
|
||||
if (entry.choiceGroup && entry.choiceOption) {
|
||||
choiceBySpecies.set(entry.speciesId, {
|
||||
groupId: entry.choiceGroup,
|
||||
optionValue: entry.choiceOption,
|
||||
});
|
||||
if (!groupBranches.has(entry.choiceGroup)) {
|
||||
groupBranches.set(entry.choiceGroup, new Map());
|
||||
}
|
||||
const optMap = groupBranches.get(entry.choiceGroup);
|
||||
if (!optMap.has(entry.choiceOption)) {
|
||||
optMap.set(entry.choiceOption, new Set());
|
||||
}
|
||||
optMap.get(entry.choiceOption).add(entry.speciesId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { earliestBySpecies, locationsBySpecies, choiceBySpecies, groupBranches };
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines which exclusive option (if any) is active per choiceGroup based on `caughtSet`,
|
||||
* and which species are locked out when `ruleset === 'solo'`.
|
||||
*/
|
||||
export function getExclusiveChoiceState(game, caughtSet, ruleset = 'solo') {
|
||||
const { choiceBySpecies, groupBranches } = indexGameSpecies(game);
|
||||
const selectedByGroup = new Map();
|
||||
const lockedBySpecies = new Map();
|
||||
|
||||
for (const [groupId, optMap] of groupBranches.entries()) {
|
||||
let chosenOption = null;
|
||||
for (const [optValue, spSet] of optMap.entries()) {
|
||||
for (const spId of spSet) {
|
||||
if (caughtSet.has(spId)) {
|
||||
chosenOption = optValue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (chosenOption) break;
|
||||
}
|
||||
|
||||
const groupMeta = game.exclusiveGroups?.[groupId];
|
||||
const chosenLabel = chosenOption ? groupMeta?.options?.[chosenOption] || chosenOption : null;
|
||||
selectedByGroup.set(groupId, {
|
||||
groupId,
|
||||
groupLabel: groupMeta?.label || groupId,
|
||||
chosenOption,
|
||||
chosenLabel,
|
||||
});
|
||||
|
||||
if (ruleset === 'solo' && chosenOption) {
|
||||
for (const [optValue, spSet] of optMap.entries()) {
|
||||
if (optValue === chosenOption) continue;
|
||||
for (const spId of spSet) {
|
||||
if (!caughtSet.has(spId)) {
|
||||
lockedBySpecies.set(spId, {
|
||||
groupId,
|
||||
groupLabel: groupMeta?.label || groupId,
|
||||
chosenOption,
|
||||
chosenLabel,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { choiceBySpecies, groupBranches, selectedByGroup, lockedBySpecies };
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes per-section unique new unlocks, cumulative POC totals, and overall progress.
|
||||
* Exclusive choice groups (starters, fossils, post-game gifts) count once per group in solo mode
|
||||
* rather than inflating totals across all mutually exclusive branches.
|
||||
*/
|
||||
export function computeGameProgress(game, caughtSet, ruleset = 'solo') {
|
||||
const { earliestBySpecies, choiceBySpecies, groupBranches } = indexGameSpecies(game);
|
||||
const { selectedByGroup } = getExclusiveChoiceState(game, caughtSet, ruleset);
|
||||
|
||||
const uniqueNewBySection = new Map(game.sections.map((s) => [s.id, []]));
|
||||
const countedGroups = new Set();
|
||||
|
||||
for (const [speciesId, earliest] of earliestBySpecies.entries()) {
|
||||
const choiceInfo = ruleset === 'solo' ? choiceBySpecies.get(speciesId) : null;
|
||||
if (choiceInfo) {
|
||||
const sel = selectedByGroup.get(choiceInfo.groupId);
|
||||
const optMap = groupBranches.get(choiceInfo.groupId);
|
||||
// Pick the chosen option if selected; otherwise represent the group with its first option
|
||||
const representativeOption = sel?.chosenOption || optMap?.keys().next().value;
|
||||
if (choiceInfo.optionValue !== representativeOption) {
|
||||
continue;
|
||||
}
|
||||
countedGroups.add(choiceInfo.groupId);
|
||||
}
|
||||
|
||||
const list = uniqueNewBySection.get(earliest.sectionId);
|
||||
if (list) list.push(speciesId);
|
||||
}
|
||||
|
||||
let cumulativeTotal = 0;
|
||||
let cumulativeCaught = 0;
|
||||
|
||||
const sections = game.sections.map((section) => {
|
||||
const newIds = uniqueNewBySection.get(section.id) || [];
|
||||
let newCaught = 0;
|
||||
for (const id of newIds) {
|
||||
if (caughtSet.has(id)) newCaught++;
|
||||
}
|
||||
cumulativeTotal += newIds.length;
|
||||
cumulativeCaught += newCaught;
|
||||
|
||||
const presentIds = new Set();
|
||||
const sectionGroupChecked = new Set();
|
||||
for (const area of section.areas) {
|
||||
for (const group of area.groups) {
|
||||
for (const entry of group.entries) {
|
||||
const choiceInfo = ruleset === 'solo' ? choiceBySpecies.get(entry.speciesId) : null;
|
||||
if (choiceInfo) {
|
||||
const sel = selectedByGroup.get(choiceInfo.groupId);
|
||||
const optMap = groupBranches.get(choiceInfo.groupId);
|
||||
const rep = sel?.chosenOption || optMap?.keys().next().value;
|
||||
if (choiceInfo.optionValue !== rep) continue;
|
||||
sectionGroupChecked.add(choiceInfo.groupId);
|
||||
}
|
||||
presentIds.add(entry.speciesId);
|
||||
}
|
||||
}
|
||||
}
|
||||
let presentCaught = 0;
|
||||
for (const id of presentIds) {
|
||||
if (caughtSet.has(id)) presentCaught++;
|
||||
}
|
||||
|
||||
return {
|
||||
id: section.id,
|
||||
badgeNumber: section.badgeNumber,
|
||||
shortName: section.shortName,
|
||||
levelCap: section.levelCap ?? null,
|
||||
newTotal: newIds.length,
|
||||
newCaught,
|
||||
newRemaining: newIds.length - newCaught,
|
||||
cumulativeTotal,
|
||||
cumulativeCaught,
|
||||
presentTotal: presentIds.size,
|
||||
presentCaught,
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
totalObtainable: cumulativeTotal,
|
||||
totalCaught: cumulativeCaught,
|
||||
totalRemaining: cumulativeTotal - cumulativeCaught,
|
||||
percent: cumulativeTotal > 0 ? Math.round((cumulativeCaught / cumulativeTotal) * 1000) / 10 : 0,
|
||||
sections,
|
||||
};
|
||||
}
|
||||
|
||||
export function createTrackerStore({
|
||||
gameId: initialGameId = null,
|
||||
profileId: initialProfileId = null,
|
||||
storage = typeof globalThis.localStorage !== 'undefined' ? globalThis.localStorage : null,
|
||||
} = {}) {
|
||||
function defaultMeta(preferredGameId) {
|
||||
return {
|
||||
activeGameId: preferredGameId || DEFAULT_GAME_ID,
|
||||
profilesByGame: {},
|
||||
};
|
||||
}
|
||||
|
||||
let meta = defaultMeta(initialGameId ? getGame(initialGameId).id : DEFAULT_GAME_ID);
|
||||
|
||||
if (storage) {
|
||||
try {
|
||||
const rawMeta = storage.getItem(META_STORAGE_KEY);
|
||||
if (rawMeta) {
|
||||
const parsed = JSON.parse(rawMeta);
|
||||
if (!initialGameId && parsed?.activeGameId && GAMES[parsed.activeGameId]) {
|
||||
meta.activeGameId = parsed.activeGameId;
|
||||
}
|
||||
if (parsed?.profilesByGame && typeof parsed.profilesByGame === 'object') {
|
||||
meta.profilesByGame = parsed.profilesByGame;
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// Ignore corrupt app metadata cleanly
|
||||
}
|
||||
}
|
||||
|
||||
function ensureGameProfiles(targetGameId) {
|
||||
const existing = meta.profilesByGame[targetGameId];
|
||||
const validList = Array.isArray(existing?.profiles)
|
||||
? existing.profiles.filter((p) => p && typeof p.id === 'string' && typeof p.name === 'string')
|
||||
: [];
|
||||
|
||||
if (validList.length === 0) {
|
||||
validList.push({
|
||||
id: 'default',
|
||||
name: 'Save 1',
|
||||
createdAt: new Date().toISOString(),
|
||||
});
|
||||
}
|
||||
|
||||
const activeOk = validList.some((p) => p.id === existing?.activeProfileId);
|
||||
meta.profilesByGame[targetGameId] = {
|
||||
activeProfileId: activeOk ? existing.activeProfileId : validList[0].id,
|
||||
profiles: validList,
|
||||
};
|
||||
return meta.profilesByGame[targetGameId];
|
||||
}
|
||||
|
||||
function getSaveKey(targetGameId, targetProfileId) {
|
||||
return targetProfileId === 'default'
|
||||
? `${STORAGE_PREFIX}${targetGameId}`
|
||||
: `${STORAGE_PREFIX}${targetGameId}:${targetProfileId}`;
|
||||
}
|
||||
|
||||
function saveMeta() {
|
||||
if (!storage) return;
|
||||
try {
|
||||
storage.setItem(META_STORAGE_KEY, JSON.stringify(meta));
|
||||
} catch {
|
||||
// Ignore storage quota errors
|
||||
}
|
||||
}
|
||||
|
||||
const initialEntry = ensureGameProfiles(meta.activeGameId);
|
||||
if (initialProfileId && initialEntry.profiles.some((p) => p.id === initialProfileId)) {
|
||||
initialEntry.activeProfileId = initialProfileId;
|
||||
}
|
||||
|
||||
let validTrainerIds = computeValidTrainerIds(getGame(meta.activeGameId));
|
||||
|
||||
const state = {
|
||||
gameId: meta.activeGameId,
|
||||
profileId: initialEntry.activeProfileId,
|
||||
profiles: initialEntry.profiles.map((p) => ({ ...p })),
|
||||
caught: new Set(),
|
||||
ruleset: 'solo', // 'solo' | 'all'
|
||||
includeSuperTraining: false,
|
||||
activeTab: 'routes', // 'routes' | 'pokedex' | 'guide'
|
||||
activeSectionId: 'all',
|
||||
searchQuery: '',
|
||||
uncaughtOnly: false,
|
||||
methodFilter: 'all',
|
||||
collapsedAreas: new Set(),
|
||||
collapsedGroups: new Set(),
|
||||
defeatedTrainers: new Set(),
|
||||
expandedTrainerAreas: new Set(),
|
||||
pokedexFilter: 'all', // 'all' | 'hoenn' | 'national'
|
||||
pokedexSort: { column: 'hoennId', direction: 'asc' },
|
||||
selectedSpeciesId: null,
|
||||
movedexTab: 'levelUp', // 'levelUp' | 'machine' | 'tutor' | 'egg' | 'all'
|
||||
movedexSearch: '',
|
||||
openExternalMenu: null, // null | { speciesId, context }
|
||||
profileModal: null, // null | { mode: 'create' | 'rename', profileId? }
|
||||
};
|
||||
|
||||
const listeners = new Set();
|
||||
|
||||
function syncProfilesToState() {
|
||||
const entry = ensureGameProfiles(state.gameId);
|
||||
state.profileId = entry.activeProfileId;
|
||||
state.profiles = entry.profiles.map((p) => ({ ...p }));
|
||||
}
|
||||
|
||||
function loadActiveSave() {
|
||||
const currentGame = getGame(state.gameId);
|
||||
validTrainerIds = computeValidTrainerIds(currentGame);
|
||||
if (
|
||||
state.activeSectionId !== 'all' &&
|
||||
!currentGame.sections.some((s) => s.id === state.activeSectionId)
|
||||
) {
|
||||
state.activeSectionId = 'all';
|
||||
}
|
||||
|
||||
state.caught = new Set();
|
||||
state.ruleset = 'solo';
|
||||
state.includeSuperTraining = false;
|
||||
state.collapsedAreas = new Set();
|
||||
state.collapsedGroups = new Set();
|
||||
state.defeatedTrainers = new Set();
|
||||
state.expandedTrainerAreas = new Set();
|
||||
state.selectedSpeciesId = null;
|
||||
state.openExternalMenu = null;
|
||||
state.movedexSearch = '';
|
||||
|
||||
if (!storage) return;
|
||||
try {
|
||||
const raw = storage.getItem(getSaveKey(state.gameId, state.profileId));
|
||||
if (!raw) return;
|
||||
const parsed = JSON.parse(raw);
|
||||
if (Array.isArray(parsed.caught)) {
|
||||
state.caught = new Set(parsed.caught.filter((id) => Boolean(SPECIES_BY_ID[id])));
|
||||
}
|
||||
if (parsed.ruleset === 'solo' || parsed.ruleset === 'all') {
|
||||
state.ruleset = parsed.ruleset;
|
||||
}
|
||||
if (typeof parsed.includeSuperTraining === 'boolean') {
|
||||
state.includeSuperTraining = parsed.includeSuperTraining;
|
||||
}
|
||||
if (Array.isArray(parsed.collapsedAreas)) {
|
||||
state.collapsedAreas = new Set(parsed.collapsedAreas);
|
||||
}
|
||||
if (Array.isArray(parsed.collapsedGroups)) {
|
||||
state.collapsedGroups = new Set(parsed.collapsedGroups);
|
||||
}
|
||||
if (Array.isArray(parsed.defeatedTrainers)) {
|
||||
state.defeatedTrainers = new Set(
|
||||
parsed.defeatedTrainers.filter(
|
||||
(id) => typeof id === 'string' && (!validTrainerIds.size || validTrainerIds.has(id)),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (Array.isArray(parsed.expandedTrainerAreas)) {
|
||||
state.expandedTrainerAreas = new Set(parsed.expandedTrainerAreas);
|
||||
}
|
||||
} catch {
|
||||
// Ignore corrupt storage silently and keep defaults
|
||||
}
|
||||
}
|
||||
|
||||
function save() {
|
||||
if (!storage) return;
|
||||
try {
|
||||
storage.setItem(
|
||||
getSaveKey(state.gameId, state.profileId),
|
||||
JSON.stringify({
|
||||
version: 1,
|
||||
gameId: state.gameId,
|
||||
profileId: state.profileId,
|
||||
caught: [...state.caught],
|
||||
ruleset: state.ruleset,
|
||||
includeSuperTraining: state.includeSuperTraining,
|
||||
collapsedAreas: [...state.collapsedAreas],
|
||||
collapsedGroups: [...state.collapsedGroups],
|
||||
defeatedTrainers: [...state.defeatedTrainers],
|
||||
expandedTrainerAreas: [...state.expandedTrainerAreas],
|
||||
updatedAt: new Date().toISOString(),
|
||||
}),
|
||||
);
|
||||
} catch {
|
||||
// Ignore storage quota errors
|
||||
}
|
||||
}
|
||||
|
||||
function notify() {
|
||||
for (const listener of listeners) {
|
||||
listener(state);
|
||||
}
|
||||
}
|
||||
|
||||
loadActiveSave();
|
||||
|
||||
return {
|
||||
getState() {
|
||||
return state;
|
||||
},
|
||||
getGame() {
|
||||
return getGame(state.gameId, { includeSuperTraining: state.includeSuperTraining });
|
||||
},
|
||||
getActiveProfile() {
|
||||
return state.profiles.find((p) => p.id === state.profileId) || state.profiles[0];
|
||||
},
|
||||
getProfilesWithCounts() {
|
||||
return state.profiles.map((p) => {
|
||||
let caughtCount = 0;
|
||||
if (p.id === state.profileId) {
|
||||
caughtCount = state.caught.size;
|
||||
} else if (storage) {
|
||||
try {
|
||||
const raw = storage.getItem(getSaveKey(state.gameId, p.id));
|
||||
if (raw) {
|
||||
const parsed = JSON.parse(raw);
|
||||
if (Array.isArray(parsed?.caught)) {
|
||||
caughtCount = parsed.caught.filter((id) => Boolean(SPECIES_BY_ID[id])).length;
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// Ignore unreadable profile save
|
||||
}
|
||||
}
|
||||
return { ...p, caughtCount, isActive: p.id === state.profileId };
|
||||
});
|
||||
},
|
||||
subscribe(listener) {
|
||||
listeners.add(listener);
|
||||
return () => listeners.delete(listener);
|
||||
},
|
||||
isSpeciesLocked(speciesId) {
|
||||
const { lockedBySpecies } = getExclusiveChoiceState(this.getGame(), state.caught, state.ruleset);
|
||||
return lockedBySpecies.get(speciesId) || null;
|
||||
},
|
||||
toggleCaught(speciesId) {
|
||||
if (!SPECIES_BY_ID[speciesId]) return false;
|
||||
if (state.caught.has(speciesId)) {
|
||||
state.caught.delete(speciesId);
|
||||
} else {
|
||||
if (this.isSpeciesLocked(speciesId)) {
|
||||
return false;
|
||||
}
|
||||
state.caught.add(speciesId);
|
||||
}
|
||||
save();
|
||||
notify();
|
||||
return true;
|
||||
},
|
||||
setCaught(speciesId, value) {
|
||||
if (!SPECIES_BY_ID[speciesId]) return false;
|
||||
if (value) {
|
||||
if (this.isSpeciesLocked(speciesId)) {
|
||||
return false;
|
||||
}
|
||||
state.caught.add(speciesId);
|
||||
} else {
|
||||
state.caught.delete(speciesId);
|
||||
}
|
||||
save();
|
||||
notify();
|
||||
return true;
|
||||
},
|
||||
setSectionCaught(sectionId, value = true) {
|
||||
const currentGame = this.getGame();
|
||||
const { earliestBySpecies, choiceBySpecies } = indexGameSpecies(currentGame);
|
||||
const { selectedByGroup } = getExclusiveChoiceState(currentGame, state.caught, state.ruleset);
|
||||
|
||||
for (const [speciesId, earliest] of earliestBySpecies.entries()) {
|
||||
if (earliest.sectionId !== sectionId) continue;
|
||||
|
||||
if (value) {
|
||||
const choice = state.ruleset === 'solo' ? choiceBySpecies.get(speciesId) : null;
|
||||
if (choice) {
|
||||
const sel = selectedByGroup.get(choice.groupId);
|
||||
// Do not auto-pick an exclusive branch if user hasn't chosen one yet;
|
||||
// only check entries in the already-chosen branch.
|
||||
if (!sel?.chosenOption || sel.chosenOption !== choice.optionValue) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
state.caught.add(speciesId);
|
||||
} else {
|
||||
state.caught.delete(speciesId);
|
||||
}
|
||||
}
|
||||
save();
|
||||
notify();
|
||||
},
|
||||
setRuleset(ruleset) {
|
||||
state.ruleset = ruleset === 'all' ? 'all' : 'solo';
|
||||
save();
|
||||
notify();
|
||||
},
|
||||
setIncludeSuperTraining(flag) {
|
||||
const next = Boolean(flag);
|
||||
if (state.includeSuperTraining === next) return;
|
||||
state.includeSuperTraining = next;
|
||||
save();
|
||||
notify();
|
||||
},
|
||||
setActiveTab(tab) {
|
||||
state.activeTab = tab;
|
||||
state.openExternalMenu = null;
|
||||
notify();
|
||||
},
|
||||
setActiveSectionId(sectionId) {
|
||||
state.activeSectionId = sectionId;
|
||||
notify();
|
||||
},
|
||||
setSearchQuery(query) {
|
||||
state.searchQuery = query;
|
||||
notify();
|
||||
},
|
||||
setUncaughtOnly(flag) {
|
||||
state.uncaughtOnly = Boolean(flag);
|
||||
notify();
|
||||
},
|
||||
setMethodFilter(method) {
|
||||
state.methodFilter = method || 'all';
|
||||
notify();
|
||||
},
|
||||
toggleAreaCollapsed(areaId) {
|
||||
if (state.collapsedAreas.has(areaId)) {
|
||||
state.collapsedAreas.delete(areaId);
|
||||
} else {
|
||||
state.collapsedAreas.add(areaId);
|
||||
}
|
||||
save();
|
||||
notify();
|
||||
},
|
||||
toggleGroupCollapsed(groupKey) {
|
||||
if (state.collapsedGroups.has(groupKey)) {
|
||||
state.collapsedGroups.delete(groupKey);
|
||||
} else {
|
||||
state.collapsedGroups.add(groupKey);
|
||||
}
|
||||
save();
|
||||
notify();
|
||||
},
|
||||
setAllCollapsed(collapsed) {
|
||||
const currentGame = this.getGame();
|
||||
if (!collapsed) {
|
||||
state.collapsedAreas.clear();
|
||||
state.collapsedGroups.clear();
|
||||
} else {
|
||||
state.expandedTrainerAreas.clear();
|
||||
for (const section of currentGame.sections) {
|
||||
for (const area of section.areas) {
|
||||
state.collapsedAreas.add(area.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
save();
|
||||
notify();
|
||||
},
|
||||
setPokedexFilter(filter) {
|
||||
state.pokedexFilter = filter;
|
||||
notify();
|
||||
},
|
||||
setPokedexSort(column) {
|
||||
if (state.pokedexSort.column === column) {
|
||||
state.pokedexSort = {
|
||||
column,
|
||||
direction: state.pokedexSort.direction === 'asc' ? 'desc' : 'asc',
|
||||
};
|
||||
} else {
|
||||
state.pokedexSort = { column, direction: 'asc' };
|
||||
}
|
||||
notify();
|
||||
},
|
||||
setSelectedSpeciesId(speciesId) {
|
||||
const wasClosed = !state.selectedSpeciesId;
|
||||
state.selectedSpeciesId = speciesId || null;
|
||||
state.openExternalMenu = null;
|
||||
state.movedexSearch = '';
|
||||
if (!speciesId || wasClosed) {
|
||||
state.movedexTab = 'levelUp';
|
||||
}
|
||||
notify();
|
||||
},
|
||||
setMovedexTab(tab) {
|
||||
const allowed = new Set(['levelUp', 'machine', 'tutor', 'egg', 'all']);
|
||||
state.movedexTab = allowed.has(tab) ? tab : 'levelUp';
|
||||
notify();
|
||||
},
|
||||
setMovedexSearch(query) {
|
||||
state.movedexSearch = query;
|
||||
notify();
|
||||
},
|
||||
toggleExternalMenu(speciesId, context = 'pokedex') {
|
||||
if (!SPECIES_BY_ID[speciesId]) return;
|
||||
const cur = state.openExternalMenu;
|
||||
if (cur && cur.speciesId === speciesId && cur.context === context) {
|
||||
state.openExternalMenu = null;
|
||||
} else {
|
||||
state.openExternalMenu = { speciesId, context };
|
||||
}
|
||||
notify();
|
||||
},
|
||||
closeExternalMenu() {
|
||||
if (!state.openExternalMenu) return false;
|
||||
state.openExternalMenu = null;
|
||||
notify();
|
||||
return true;
|
||||
},
|
||||
toggleTrainerDefeated(trainerId) {
|
||||
if (validTrainerIds.size && !validTrainerIds.has(trainerId)) return;
|
||||
if (state.defeatedTrainers.has(trainerId)) {
|
||||
state.defeatedTrainers.delete(trainerId);
|
||||
} else {
|
||||
state.defeatedTrainers.add(trainerId);
|
||||
}
|
||||
save();
|
||||
notify();
|
||||
},
|
||||
toggleAreaTrainersExpanded(areaId) {
|
||||
if (state.expandedTrainerAreas.has(areaId)) {
|
||||
state.expandedTrainerAreas.delete(areaId);
|
||||
} else {
|
||||
state.expandedTrainerAreas.add(areaId);
|
||||
}
|
||||
save();
|
||||
notify();
|
||||
},
|
||||
setProfileModal(modalState) {
|
||||
state.profileModal = modalState;
|
||||
state.openExternalMenu = null;
|
||||
notify();
|
||||
},
|
||||
switchGame(nextGameId) {
|
||||
if (!GAMES[nextGameId] || state.gameId === nextGameId) return;
|
||||
meta.activeGameId = nextGameId;
|
||||
state.gameId = nextGameId;
|
||||
state.profileModal = null;
|
||||
syncProfilesToState();
|
||||
saveMeta();
|
||||
loadActiveSave();
|
||||
notify();
|
||||
},
|
||||
switchProfile(nextProfileId) {
|
||||
const entry = ensureGameProfiles(state.gameId);
|
||||
if (state.profileId === nextProfileId || !entry.profiles.some((p) => p.id === nextProfileId)) {
|
||||
return;
|
||||
}
|
||||
entry.activeProfileId = nextProfileId;
|
||||
state.profileModal = null;
|
||||
syncProfilesToState();
|
||||
saveMeta();
|
||||
loadActiveSave();
|
||||
notify();
|
||||
},
|
||||
createProfile(name) {
|
||||
const entry = ensureGameProfiles(state.gameId);
|
||||
const cleanName = String(name || '').trim() || `Save ${entry.profiles.length + 1}`;
|
||||
let seq = entry.profiles.length + 1;
|
||||
let newId = `save-${seq}`;
|
||||
while (entry.profiles.some((p) => p.id === newId)) {
|
||||
seq++;
|
||||
newId = `save-${seq}`;
|
||||
}
|
||||
const profile = {
|
||||
id: newId,
|
||||
name: cleanName,
|
||||
createdAt: new Date().toISOString(),
|
||||
};
|
||||
entry.profiles.push(profile);
|
||||
entry.activeProfileId = newId;
|
||||
state.profileModal = null;
|
||||
syncProfilesToState();
|
||||
saveMeta();
|
||||
loadActiveSave();
|
||||
save();
|
||||
notify();
|
||||
return profile;
|
||||
},
|
||||
renameProfile(targetProfileId, nextName) {
|
||||
const entry = ensureGameProfiles(state.gameId);
|
||||
const profile = entry.profiles.find((p) => p.id === (targetProfileId || state.profileId));
|
||||
const cleanName = String(nextName || '').trim();
|
||||
if (!profile || !cleanName) return false;
|
||||
profile.name = cleanName;
|
||||
state.profileModal = null;
|
||||
syncProfilesToState();
|
||||
saveMeta();
|
||||
notify();
|
||||
return true;
|
||||
},
|
||||
deleteProfile(targetProfileId) {
|
||||
const entry = ensureGameProfiles(state.gameId);
|
||||
if (entry.profiles.length <= 1) return false;
|
||||
const targetId = targetProfileId || state.profileId;
|
||||
const idx = entry.profiles.findIndex((p) => p.id === targetId);
|
||||
if (idx === -1) return false;
|
||||
|
||||
entry.profiles.splice(idx, 1);
|
||||
if (storage && typeof storage.removeItem === 'function') {
|
||||
storage.removeItem(getSaveKey(state.gameId, targetId));
|
||||
}
|
||||
|
||||
const switchedActive = entry.activeProfileId === targetId;
|
||||
if (switchedActive) {
|
||||
entry.activeProfileId = entry.profiles[Math.max(0, idx - 1)].id;
|
||||
}
|
||||
state.profileModal = null;
|
||||
syncProfilesToState();
|
||||
saveMeta();
|
||||
if (switchedActive) {
|
||||
loadActiveSave();
|
||||
}
|
||||
notify();
|
||||
return true;
|
||||
},
|
||||
resetProgress() {
|
||||
state.caught.clear();
|
||||
state.defeatedTrainers.clear();
|
||||
save();
|
||||
notify();
|
||||
},
|
||||
exportJson() {
|
||||
const activeProfile = this.getActiveProfile();
|
||||
return JSON.stringify(
|
||||
{
|
||||
app: 'professor-oak-tracker-oras',
|
||||
version: 1,
|
||||
gameId: state.gameId,
|
||||
profileId: state.profileId,
|
||||
profileName: activeProfile?.name || 'Save 1',
|
||||
ruleset: state.ruleset,
|
||||
includeSuperTraining: state.includeSuperTraining,
|
||||
caught: [...state.caught],
|
||||
defeatedTrainers: [...state.defeatedTrainers],
|
||||
exportedAt: new Date().toISOString(),
|
||||
},
|
||||
null,
|
||||
2,
|
||||
);
|
||||
},
|
||||
importJson(rawJson) {
|
||||
const parsed = JSON.parse(rawJson);
|
||||
if (!parsed || !Array.isArray(parsed.caught)) {
|
||||
throw new Error('Invalid backup format: missing "caught" array.');
|
||||
}
|
||||
if (parsed.gameId && GAMES[parsed.gameId] && parsed.gameId !== state.gameId) {
|
||||
throw new Error(
|
||||
`Backup is for ${GAMES[parsed.gameId].title}. Switch versions before importing.`,
|
||||
);
|
||||
}
|
||||
const validIds = parsed.caught.filter((id) => Boolean(SPECIES_BY_ID[id]));
|
||||
state.caught = new Set(validIds);
|
||||
state.defeatedTrainers = new Set(
|
||||
Array.isArray(parsed.defeatedTrainers)
|
||||
? parsed.defeatedTrainers.filter(
|
||||
(id) => typeof id === 'string' && (!validTrainerIds.size || validTrainerIds.has(id)),
|
||||
)
|
||||
: [],
|
||||
);
|
||||
if (parsed.ruleset === 'solo' || parsed.ruleset === 'all') {
|
||||
state.ruleset = parsed.ruleset;
|
||||
}
|
||||
state.includeSuperTraining =
|
||||
typeof parsed.includeSuperTraining === 'boolean' ? parsed.includeSuperTraining : false;
|
||||
save();
|
||||
notify();
|
||||
return validIds.length;
|
||||
},
|
||||
getPokedexRows() {
|
||||
const currentGame = this.getGame();
|
||||
const { earliestBySpecies, locationsBySpecies } = indexGameSpecies(currentGame);
|
||||
const { choiceBySpecies, lockedBySpecies } = getExclusiveChoiceState(
|
||||
currentGame,
|
||||
state.caught,
|
||||
state.ruleset,
|
||||
);
|
||||
const q = state.searchQuery.trim().toLowerCase();
|
||||
|
||||
const rows = SPECIES_LIST.map((sp) => {
|
||||
const earliest = earliestBySpecies.get(sp.id) || null;
|
||||
const locations = locationsBySpecies.get(sp.id) || [];
|
||||
const soloValid = isSpeciesSoloAvailableForGame(sp, currentGame.id) && earliest !== null;
|
||||
const lockedBy = lockedBySpecies.get(sp.id) || null;
|
||||
const choiceInfo = choiceBySpecies.get(sp.id) || null;
|
||||
return {
|
||||
...sp,
|
||||
caught: state.caught.has(sp.id),
|
||||
earliest,
|
||||
locations,
|
||||
soloValid,
|
||||
lockedBy,
|
||||
choiceInfo,
|
||||
};
|
||||
}).filter((row) => {
|
||||
if (state.ruleset === 'solo' && !row.soloValid) return false;
|
||||
if (state.pokedexFilter === 'hoenn' && row.hoennId === null) return false;
|
||||
if (state.pokedexFilter === 'national' && row.hoennId !== null) return false;
|
||||
if (state.uncaughtOnly && (row.caught || row.lockedBy)) return false;
|
||||
if (state.activeSectionId !== 'all') {
|
||||
if (!row.earliest || row.earliest.sectionId !== state.activeSectionId) return false;
|
||||
}
|
||||
if (q) {
|
||||
const hay = [
|
||||
row.name,
|
||||
String(row.natId),
|
||||
row.hoennId ? String(row.hoennId) : '',
|
||||
row.evolutionMethod,
|
||||
row.soloNotes,
|
||||
row.earliest?.shortName || '',
|
||||
...row.locations.map((l) => `${l.areaName} ${l.method}`),
|
||||
]
|
||||
.join(' ')
|
||||
.toLowerCase();
|
||||
if (!hay.includes(q)) return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
const { column, direction } = state.pokedexSort;
|
||||
const dir = direction === 'desc' ? -1 : 1;
|
||||
|
||||
rows.sort((a, b) => {
|
||||
let cmp = 0;
|
||||
if (column === 'hoennId') {
|
||||
const ah = a.hoennId ?? 9000 + a.natId;
|
||||
const bh = b.hoennId ?? 9000 + b.natId;
|
||||
cmp = ah - bh;
|
||||
} else if (column === 'natId') {
|
||||
cmp = a.natId - b.natId;
|
||||
} else if (column === 'name') {
|
||||
cmp = a.name.localeCompare(b.name);
|
||||
} else if (column === 'milestone') {
|
||||
const am = a.earliest?.badgeNumber ?? 99;
|
||||
const bm = b.earliest?.badgeNumber ?? 99;
|
||||
cmp = am - bm || a.natId - b.natId;
|
||||
} else if (column === 'caught') {
|
||||
cmp = Number(b.caught) - Number(a.caught) || a.natId - b.natId;
|
||||
} else if (column === 'bst') {
|
||||
cmp = (a.baseStats?.total ?? 0) - (b.baseStats?.total ?? 0) || a.natId - b.natId;
|
||||
} else if (column === 'evolutionMethod') {
|
||||
cmp = (a.evolutionMethod || 'Base / Wild').localeCompare(b.evolutionMethod || 'Base / Wild');
|
||||
}
|
||||
return cmp * dir;
|
||||
});
|
||||
|
||||
return rows;
|
||||
},
|
||||
};
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,127 @@
|
||||
import { escapeHtml, padDex } from './formatters.js';
|
||||
|
||||
function toWikiSlug(name) {
|
||||
return String(name || '')
|
||||
.trim()
|
||||
.replace(/ /g, '_');
|
||||
}
|
||||
|
||||
function toDbSlug(species) {
|
||||
return String(species?.id || '')
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9-]/g, '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns external Pokédex and strategy links for a species in Omega Ruby & Alpha Sapphire.
|
||||
*/
|
||||
export function getExternalLinksForSpecies(species) {
|
||||
if (!species) return [];
|
||||
const dex3 = padDex(species.natId, 3);
|
||||
const wikiTitle = `${encodeURIComponent(toWikiSlug(species.name))}_(Pok%C3%A9mon)`;
|
||||
const slug = toDbSlug(species);
|
||||
|
||||
return [
|
||||
{
|
||||
id: 'serebii',
|
||||
label: 'Serebii (Gen 6 ORAS)',
|
||||
description: 'XY / ORAS Pokédex & locations',
|
||||
url: `https://www.serebii.net/pokedex-xy/${dex3}.shtml`,
|
||||
},
|
||||
{
|
||||
id: 'bulbapedia',
|
||||
label: 'Bulbapedia',
|
||||
description: 'Full encyclopedia & learnsets',
|
||||
url: `https://bulbapedia.bulbagarden.net/wiki/${wikiTitle}`,
|
||||
},
|
||||
{
|
||||
id: 'pokemondb',
|
||||
label: 'Pokémon Database',
|
||||
description: 'Stats, type chart & ORAS moves',
|
||||
url: `https://pokemondb.net/pokedex/${slug}`,
|
||||
},
|
||||
{
|
||||
id: 'smogon',
|
||||
label: 'Smogon Strategy',
|
||||
description: 'XY / ORAS competitive sets',
|
||||
url: `https://www.smogon.com/dex/xy/pokemon/${slug}/`,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
const EXTERNAL_ARROW_SVG = `
|
||||
<svg class="ext-arrow-icon" width="12" height="12" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
||||
<path d="M9.5 2.5H13.5V6.5" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M13.2 2.8L7.2 8.8" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M7 3.5H4C3.17 3.5 2.5 4.17 2.5 5V12C2.5 12.83 3.17 13.5 4 13.5H11C11.83 13.5 12.5 12.83 12.5 12V9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
||||
</svg>
|
||||
`;
|
||||
|
||||
/**
|
||||
* Renders an arrow button and, when active, its external links popup menu.
|
||||
*/
|
||||
export function renderExternalLinksControl(species, state, context = 'pokedex') {
|
||||
if (!species) return '';
|
||||
const activeMenu = state?.openExternalMenu;
|
||||
const isOpen = Boolean(
|
||||
activeMenu && activeMenu.speciesId === species.id && activeMenu.context === context,
|
||||
);
|
||||
const links = isOpen ? getExternalLinksForSpecies(species) : [];
|
||||
|
||||
const menuHtml = isOpen
|
||||
? `
|
||||
<div
|
||||
class="ext-links-menu"
|
||||
role="menu"
|
||||
aria-label="External links for ${escapeHtml(species.name)}"
|
||||
data-ext-menu-panel="${escapeHtml(species.id)}"
|
||||
data-ext-context="${escapeHtml(context)}"
|
||||
>
|
||||
<div class="ext-links-header">
|
||||
<span>${escapeHtml(species.name)} Guides</span>
|
||||
<span class="mono">#${padDex(species.natId)}</span>
|
||||
</div>
|
||||
${links
|
||||
.map(
|
||||
(link) => `
|
||||
<a
|
||||
class="ext-links-item"
|
||||
role="menuitem"
|
||||
href="${escapeHtml(link.url)}"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
data-ext-site="${escapeHtml(link.id)}"
|
||||
>
|
||||
<span class="ext-links-item-main">
|
||||
<span class="ext-links-item-label">${escapeHtml(link.label)}</span>
|
||||
<span class="ext-links-item-desc">${escapeHtml(link.description)}</span>
|
||||
</span>
|
||||
<span class="ext-links-item-arrow" aria-hidden="true">↗</span>
|
||||
</a>
|
||||
`,
|
||||
)
|
||||
.join('')}
|
||||
</div>
|
||||
`
|
||||
: '';
|
||||
|
||||
return `
|
||||
<span class="ext-menu-wrap ${isOpen ? 'is-open' : ''}">
|
||||
<button
|
||||
type="button"
|
||||
class="ext-menu-trigger ${isOpen ? 'active' : ''}"
|
||||
data-open-ext-menu="${escapeHtml(species.id)}"
|
||||
data-ext-context="${escapeHtml(context)}"
|
||||
aria-haspopup="menu"
|
||||
aria-expanded="${isOpen}"
|
||||
aria-label="External links for ${escapeHtml(species.name)}"
|
||||
title="External links (Serebii, Bulbapedia, PokémonDB, Smogon)"
|
||||
>
|
||||
${EXTERNAL_ARROW_SVG}
|
||||
<span class="ext-menu-caret" aria-hidden="true">▾</span>
|
||||
</button>
|
||||
${menuHtml}
|
||||
</span>
|
||||
`;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
import { SPECIES_LIST, SPECIES_BY_ID } from '../data/species.js';
|
||||
|
||||
export function escapeHtml(value) {
|
||||
return String(value ?? '')
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
|
||||
export function padDex(num, width = 3) {
|
||||
return String(num).padStart(width, '0');
|
||||
}
|
||||
|
||||
export function getMethodClass(method) {
|
||||
switch (method) {
|
||||
case 'Walking':
|
||||
return 'method-walking';
|
||||
case 'Horde':
|
||||
return 'method-horde';
|
||||
case 'Old Rod':
|
||||
case 'Good Rod':
|
||||
case 'Super Rod':
|
||||
case 'Surf':
|
||||
case 'Dive':
|
||||
return 'method-water';
|
||||
case 'DexNav Hidden':
|
||||
case 'Soaring':
|
||||
case 'Mirage Spot':
|
||||
return 'method-special';
|
||||
case 'Gift':
|
||||
case 'Gift Egg':
|
||||
case 'Trade':
|
||||
case 'Static':
|
||||
case 'Fossil':
|
||||
return 'method-event';
|
||||
case 'Breeding':
|
||||
case 'Evolution':
|
||||
return 'method-evo';
|
||||
default:
|
||||
return 'method-special';
|
||||
}
|
||||
}
|
||||
|
||||
export function getTypeBadgeHtml(type) {
|
||||
const slug = String(type || 'normal').toLowerCase();
|
||||
return `<span class="type-pill type-${escapeHtml(slug)}">${escapeHtml(type)}</span>`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the root ancestor and ordered evolution tree for a species id.
|
||||
*/
|
||||
export function getEvolutionFamily(speciesId) {
|
||||
const target = SPECIES_BY_ID[speciesId];
|
||||
if (!target) return [];
|
||||
|
||||
let root = target;
|
||||
const visited = new Set([root.id]);
|
||||
while (root.evolvesFrom && SPECIES_BY_ID[root.evolvesFrom] && !visited.has(root.evolvesFrom)) {
|
||||
root = SPECIES_BY_ID[root.evolvesFrom];
|
||||
visited.add(root.id);
|
||||
}
|
||||
|
||||
const childrenMap = new Map();
|
||||
for (const sp of SPECIES_LIST) {
|
||||
if (sp.evolvesFrom) {
|
||||
if (!childrenMap.has(sp.evolvesFrom)) childrenMap.set(sp.evolvesFrom, []);
|
||||
childrenMap.get(sp.evolvesFrom).push(sp);
|
||||
}
|
||||
}
|
||||
|
||||
const family = [];
|
||||
const queue = [{ species: root, depth: 0 }];
|
||||
const seen = new Set();
|
||||
while (queue.length > 0) {
|
||||
const { species, depth } = queue.shift();
|
||||
if (seen.has(species.id)) continue;
|
||||
seen.add(species.id);
|
||||
family.push({ species, depth });
|
||||
const kids = childrenMap.get(species.id) || [];
|
||||
for (const kid of kids) {
|
||||
queue.push({ species: kid, depth: depth + 1 });
|
||||
}
|
||||
}
|
||||
return family;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
import { escapeHtml } from './formatters.js';
|
||||
import { renderItemIconsHtml } from './sprites.js';
|
||||
|
||||
export function renderGuideView(game) {
|
||||
const { guide } = game;
|
||||
|
||||
const sstEnabled = Boolean(game.includeSuperTraining);
|
||||
|
||||
const stonesRows = (guide?.superTrainingStones || [])
|
||||
.map(
|
||||
(row) => `
|
||||
<tr>
|
||||
<td>
|
||||
<span class="evo-cell-wrap">
|
||||
${renderItemIconsHtml(row.stone, { size: 22 })}
|
||||
<strong class="amber-inline">${escapeHtml(row.stone)}</strong>
|
||||
</span>
|
||||
</td>
|
||||
<td>${escapeHtml(row.overworldSource || '')}</td>
|
||||
<td>${escapeHtml(row.stage)} (${escapeHtml(row.opponent)})</td>
|
||||
<td>${escapeHtml(row.usedFor)}</td>
|
||||
</tr>
|
||||
`,
|
||||
)
|
||||
.join('');
|
||||
|
||||
const tipsCards = (guide?.grindingTips || [])
|
||||
.map(
|
||||
(tip) => `
|
||||
<article class="guide-card">
|
||||
<h3 class="guide-card-title">${escapeHtml(tip.title)}</h3>
|
||||
<p class="guide-card-body">${escapeHtml(tip.detail)}</p>
|
||||
</article>
|
||||
`,
|
||||
)
|
||||
.join('');
|
||||
|
||||
const exclusionItems = (guide?.soloExclusions || [])
|
||||
.map(
|
||||
(ex) => `
|
||||
<div class="exclusion-item">
|
||||
<div class="exclusion-cat">${escapeHtml(ex.category)}</div>
|
||||
<div class="exclusion-list">${escapeHtml(ex.list)}</div>
|
||||
</div>
|
||||
`,
|
||||
)
|
||||
.join('');
|
||||
|
||||
return `
|
||||
<div class="guide-view">
|
||||
<section class="guide-section">
|
||||
<h2 class="guide-heading">
|
||||
${
|
||||
sstEnabled
|
||||
? 'Secret Super Training — Evolution Stones (Enabled: Available Pre-Badge 1!)'
|
||||
: 'Evolution Stones — Overworld Locations & Optional Secret Super Training'
|
||||
}
|
||||
</h2>
|
||||
<p class="guide-lead">
|
||||
${
|
||||
sstEnabled
|
||||
? '<strong>Secret Super Training is ON.</strong> Max out any Pokémon’s EVs (510 total) to unlock Secret Super Training immediately on the bottom screen and farm stones early in Pre-Badge 1 / 3 / 7.'
|
||||
: '<strong>Secret Super Training is currently OFF</strong> (default). Early stone evolutions follow their deterministic Overworld, NPC gift, or Dive Shard locations below. Check <strong>Secret Super Training</strong> in the header anytime to switch to 510-EV minigame timing.'
|
||||
}
|
||||
</p>
|
||||
<div class="dex-table-wrap">
|
||||
<table class="dex-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Stone</th>
|
||||
<th>Overworld / Non-Super Training Source</th>
|
||||
<th>Secret Super Training (Optional)</th>
|
||||
<th>${escapeHtml(game.shortTitle)} Evolutions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>${stonesRows}</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="guide-section">
|
||||
<h2 class="guide-heading">${escapeHtml(game.shortTitle)} POC Strategy Notes</h2>
|
||||
<div class="guide-grid">${tipsCards}</div>
|
||||
</section>
|
||||
|
||||
<section class="guide-section">
|
||||
<h2 class="guide-heading">Excluded in Strict Single-Cartridge ${escapeHtml(game.shortTitle)} POC</h2>
|
||||
<p class="guide-lead">
|
||||
Switch the <strong>Pokédex Ruleset</strong> dropdown in the header to <strong>Show All</strong> if you plan to trade or transfer.
|
||||
</p>
|
||||
<div class="exclusion-grid">${exclusionItems}</div>
|
||||
</section>
|
||||
|
||||
<section class="guide-section">
|
||||
<h2 class="guide-heading">Sprites & Item Icons (External Assets / Offline Download)</h2>
|
||||
<article class="guide-card">
|
||||
<p class="guide-card-body">
|
||||
Regular & Shiny ORAS Pokémon sprites and Evolution Item icons load automatically from the open-source
|
||||
<a class="ext-link" href="https://github.com/PokeAPI/sprites" target="_blank" rel="noopener noreferrer">PokeAPI/sprites</a>
|
||||
repository. If you want 100% offline local sprites, download or clone the <code>sprites/</code> folder from
|
||||
<a class="ext-link" href="https://github.com/PokeAPI/sprites" target="_blank" rel="noopener noreferrer">github.com/PokeAPI/sprites</a>
|
||||
into <code>assets/sprites/</code> (so <code>assets/sprites/pokemon/</code> and <code>assets/sprites/items/</code> exist) and restart <code>node server.mjs</code>—the app detects local sprites automatically.
|
||||
</p>
|
||||
</article>
|
||||
</section>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
import { listGames } from '../data/games/index.js';
|
||||
import { escapeHtml } from './formatters.js';
|
||||
|
||||
const ALL_METHODS = [
|
||||
'all',
|
||||
'Walking',
|
||||
'Horde',
|
||||
'Old Rod',
|
||||
'Good Rod',
|
||||
'Super Rod',
|
||||
'Surf',
|
||||
'Rock Smash',
|
||||
'Dive',
|
||||
'DexNav Hidden',
|
||||
'Mirage Spot',
|
||||
'Soaring',
|
||||
'Gift',
|
||||
'Gift Egg',
|
||||
'Trade',
|
||||
'Static',
|
||||
'Fossil',
|
||||
'Breeding',
|
||||
'Evolution',
|
||||
];
|
||||
|
||||
export function renderHeader(game, state, progress, profilesWithCounts = null) {
|
||||
const methodOptions = ALL_METHODS.map((m) => {
|
||||
const label = m === 'all' ? 'All Methods' : m;
|
||||
return `<option value="${escapeHtml(m)}" ${state.methodFilter === m ? 'selected' : ''}>${escapeHtml(label)}</option>`;
|
||||
}).join('');
|
||||
|
||||
const versionPills = listGames()
|
||||
.map((g) => {
|
||||
const isActive = g.id === game.id;
|
||||
const cls = g.themeClass || (g.id === 'omega-ruby' ? 'version-or' : 'version-as');
|
||||
return `
|
||||
<button
|
||||
type="button"
|
||||
class="version-switch-btn ${cls} ${isActive ? 'active' : ''}"
|
||||
data-switch-game="${escapeHtml(g.id)}"
|
||||
aria-pressed="${isActive}"
|
||||
>${escapeHtml(g.title)}</button>
|
||||
`;
|
||||
})
|
||||
.join('');
|
||||
|
||||
const profileList =
|
||||
profilesWithCounts ||
|
||||
(state.profiles || [{ id: 'default', name: 'Save 1', caughtCount: state.caught?.size || 0 }]);
|
||||
|
||||
const profileOptions = profileList
|
||||
.map((p) => {
|
||||
const countText = Number.isInteger(p.caughtCount) ? ` (${p.caughtCount})` : '';
|
||||
return `<option value="${escapeHtml(p.id)}" ${p.id === state.profileId ? 'selected' : ''}>${escapeHtml(p.name)}${escapeHtml(countText)}</option>`;
|
||||
})
|
||||
.join('');
|
||||
|
||||
const rulesetSoloLabel =
|
||||
game.id === 'omega-ruby' ? 'Strict Solo OR Cartridge' : 'Strict Solo AS Cartridge';
|
||||
const rulesetAllLabel =
|
||||
game.id === 'omega-ruby'
|
||||
? 'Show All (incl. Trade / AS / Events)'
|
||||
: 'Show All (incl. Trade / OR / Events)';
|
||||
|
||||
return `
|
||||
<header class="app-header ${escapeHtml(game.themeClass || 'version-as')}">
|
||||
<div class="header-top">
|
||||
<div class="brand-block">
|
||||
<div class="brand-badges">
|
||||
<a class="hub-home-link" href="../" title="Back to Professor Oak Tracker Hub">← Hub</a>
|
||||
<div class="version-switcher" role="group" aria-label="Game Version">
|
||||
${versionPills}
|
||||
</div>
|
||||
<span class="platform-pill">${escapeHtml(game.platform)}</span>
|
||||
</div>
|
||||
<h1 class="app-title">Professor Oak Challenge Tracker</h1>
|
||||
<p class="app-subtitle">
|
||||
Inspired by the Luminescent 2.1 Tracker — check any Pokémon <span class="mint-inline">Caught</span> to highlight every occurrence across Areas & Pokédex. Evolutions unlock at each upcoming Gym Leader / Champion level cap, and exclusive picks lock out alternatives automatically.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="progress-panel">
|
||||
<div class="profile-bar">
|
||||
<label class="profile-label" for="profile-select">Save</label>
|
||||
<select class="select-input select-sm profile-select" id="profile-select" aria-label="Active save profile">
|
||||
${profileOptions}
|
||||
</select>
|
||||
<button type="button" class="btn-ghost btn-xs" data-action="new-profile" title="Create a new save profile">+ New</button>
|
||||
<button type="button" class="btn-ghost btn-xs" data-action="rename-profile" title="Rename active save profile">Rename</button>
|
||||
${
|
||||
profileList.length > 1
|
||||
? '<button type="button" class="btn-ghost btn-xs btn-danger" data-action="delete-profile" title="Delete active save profile">Del</button>'
|
||||
: ''
|
||||
}
|
||||
</div>
|
||||
<div class="progress-stats-row">
|
||||
<div>
|
||||
<span class="progress-count">${progress.totalCaught}</span>
|
||||
<span class="progress-sep">/</span>
|
||||
<span class="progress-total">${progress.totalObtainable}</span>
|
||||
<span class="progress-caption">${state.ruleset === 'solo' ? 'Solo POC Caught' : 'All Dex Caught'}</span>
|
||||
</div>
|
||||
<span class="progress-pct">${progress.percent}%</span>
|
||||
</div>
|
||||
<div class="progress-track" role="progressbar" aria-valuenow="${progress.percent}" aria-valuemin="0" aria-valuemax="100">
|
||||
<div class="progress-fill" style="width: ${progress.percent}%"></div>
|
||||
</div>
|
||||
<div class="progress-meta-row">
|
||||
<span>Remaining: <strong>${progress.totalRemaining}</strong></span>
|
||||
<div class="header-actions">
|
||||
<button type="button" class="btn-ghost btn-sm" data-action="export-json">Export Save</button>
|
||||
<button type="button" class="btn-ghost btn-sm" data-action="import-json">Import</button>
|
||||
<button type="button" class="btn-ghost btn-sm btn-danger" data-action="reset-progress">Reset</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header-toolbar">
|
||||
<nav class="tab-nav" aria-label="Tracker views">
|
||||
<button type="button" class="tab-btn ${state.activeTab === 'routes' ? 'active' : ''}" data-tab="routes">
|
||||
Areas & Routes
|
||||
</button>
|
||||
<button type="button" class="tab-btn ${state.activeTab === 'pokedex' ? 'active' : ''}" data-tab="pokedex">
|
||||
Pokédex & Evolution Methods
|
||||
</button>
|
||||
<button type="button" class="tab-btn ${state.activeTab === 'guide' ? 'active' : ''}" data-tab="guide">
|
||||
POC Stones & Tips
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
<div class="filter-controls">
|
||||
<div class="search-wrap">
|
||||
<input
|
||||
type="search"
|
||||
id="global-search"
|
||||
class="search-input"
|
||||
placeholder="Search Pokémon, trainer, stone..."
|
||||
value="${escapeHtml(state.searchQuery)}"
|
||||
autocomplete="off"
|
||||
/>
|
||||
${state.searchQuery ? '<button type="button" class="search-clear" data-action="clear-search" title="Clear search">×</button>' : ''}
|
||||
</div>
|
||||
|
||||
${
|
||||
state.activeTab === 'routes'
|
||||
? `<select class="select-input" id="method-filter" aria-label="Filter encounter method">${methodOptions}</select>`
|
||||
: ''
|
||||
}
|
||||
|
||||
<select class="select-input" id="ruleset-select" aria-label="Pokédex ruleset">
|
||||
<option value="solo" ${state.ruleset === 'solo' ? 'selected' : ''}>${escapeHtml(rulesetSoloLabel)}</option>
|
||||
<option value="all" ${state.ruleset === 'all' ? 'selected' : ''}>${escapeHtml(rulesetAllLabel)}</option>
|
||||
</select>
|
||||
|
||||
<label class="toggle-chip ${state.uncaughtOnly ? 'active' : ''}">
|
||||
<input type="checkbox" id="uncaught-only-toggle" ${state.uncaughtOnly ? 'checked' : ''} />
|
||||
<span>Uncaught Only</span>
|
||||
</label>
|
||||
|
||||
<label
|
||||
class="toggle-chip ${state.includeSuperTraining ? 'active' : ''}"
|
||||
title="Optional: unlock early stone evolutions via Secret Super Training (510 EV minigames) as soon as their base forms are caught"
|
||||
>
|
||||
<input type="checkbox" id="super-training-toggle" ${state.includeSuperTraining ? 'checked' : ''} />
|
||||
<span>Secret Super Training</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
`;
|
||||
}
|
||||
@@ -0,0 +1,387 @@
|
||||
import { SPECIES_BY_ID } from '../data/species.js';
|
||||
import { getPokemonMoveset } from '../data/movesets.js';
|
||||
import { getExclusiveChoiceState, indexGameSpecies } from '../state/tracker-store.js';
|
||||
import { renderExternalLinksControl } from './external-links.js';
|
||||
import { escapeHtml, getEvolutionFamily, getTypeBadgeHtml, padDex } from './formatters.js';
|
||||
import { renderItemIconsHtml, renderPokemonSpriteImg } from './sprites.js';
|
||||
|
||||
function getCategoryBadgeHtml(category) {
|
||||
const slug = String(category || 'Status').toLowerCase();
|
||||
return `<span class="move-cat-pill cat-${escapeHtml(slug)}">${escapeHtml(category)}</span>`;
|
||||
}
|
||||
|
||||
function renderBaseStatsHtml(species) {
|
||||
const st = species.baseStats;
|
||||
if (!st) return '';
|
||||
const bars = [
|
||||
['HP', st.hp, '#ef4444'],
|
||||
['Atk', st.atk, '#f97316'],
|
||||
['Def', st.def, '#eab308'],
|
||||
['SpA', st.spa, '#3b82f6'],
|
||||
['SpD', st.spd, '#22c55e'],
|
||||
['Spe', st.spe, '#ec4899'],
|
||||
];
|
||||
|
||||
return `
|
||||
<div class="modal-section">
|
||||
<div class="stats-header-row">
|
||||
<h3 class="modal-subtitle">Base Stats (BST ${st.total})</h3>
|
||||
${
|
||||
species.abilities?.length
|
||||
? `<div class="abilities-inline">Abilities: ${species.abilities
|
||||
.map((ab) => `<span class="ability-pill">${escapeHtml(ab)}</span>`)
|
||||
.join('')}</div>`
|
||||
: ''
|
||||
}
|
||||
</div>
|
||||
<div class="stat-bars-grid">
|
||||
${bars
|
||||
.map(([label, val, color]) => {
|
||||
const pct = Math.min(100, Math.round((val / 180) * 100));
|
||||
return `
|
||||
<div class="stat-bar-row">
|
||||
<span class="stat-bar-label">${label}</span>
|
||||
<span class="stat-bar-val mono">${val}</span>
|
||||
<div class="stat-bar-track">
|
||||
<div class="stat-bar-fill" style="width: ${pct}%; background: ${color}"></div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
})
|
||||
.join('')}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
function buildMovedexRows(moveset) {
|
||||
const levelRows = moveset.levelUp.map((m) => ({
|
||||
...m,
|
||||
unlockLabel: `Lv. ${m.level}`,
|
||||
badgeClass: 'unlock-level',
|
||||
searchMethod: 'level up',
|
||||
}));
|
||||
const machineRows = moveset.machine.map((m) => ({
|
||||
...m,
|
||||
unlockLabel: m.machine || 'TM',
|
||||
badgeClass: String(m.machine || '').startsWith('HM') ? 'unlock-hm' : 'unlock-tm',
|
||||
searchMethod: 'tm hm machine',
|
||||
}));
|
||||
const tutorRows = moveset.tutor.map((m) => ({
|
||||
...m,
|
||||
unlockLabel: 'Tutor',
|
||||
badgeClass: 'unlock-tutor',
|
||||
searchMethod: 'move tutor',
|
||||
}));
|
||||
const eggRows = moveset.egg.map((m) => ({
|
||||
...m,
|
||||
unlockLabel: m.note ? 'Light Ball' : 'Egg',
|
||||
badgeClass: 'unlock-egg',
|
||||
searchMethod: 'egg breed',
|
||||
}));
|
||||
|
||||
return {
|
||||
levelUp: levelRows,
|
||||
machine: machineRows,
|
||||
tutor: tutorRows,
|
||||
egg: eggRows,
|
||||
all: [...levelRows, ...machineRows, ...tutorRows, ...eggRows],
|
||||
};
|
||||
}
|
||||
|
||||
function matchesMoveQuery(row, q) {
|
||||
if (!q) return true;
|
||||
return `${row.name} ${row.type} ${row.category} ${row.unlockLabel} ${row.searchMethod} ${row.note || ''}`
|
||||
.toLowerCase()
|
||||
.includes(q);
|
||||
}
|
||||
|
||||
function renderMovedexSection(species, state) {
|
||||
const moveset = getPokemonMoveset(species.natId);
|
||||
const rowsByTab = buildMovedexRows(moveset);
|
||||
const activeTab = rowsByTab[state.movedexTab] ? state.movedexTab : 'levelUp';
|
||||
const query = (state.movedexSearch || '').trim().toLowerCase();
|
||||
|
||||
const tabs = [
|
||||
{ id: 'levelUp', label: 'Level-Up', count: rowsByTab.levelUp.length },
|
||||
{ id: 'machine', label: 'TM / HM', count: rowsByTab.machine.length },
|
||||
{ id: 'tutor', label: 'Tutor', count: rowsByTab.tutor.length },
|
||||
{ id: 'egg', label: 'Egg', count: rowsByTab.egg.length },
|
||||
{ id: 'all', label: 'All', count: rowsByTab.all.length },
|
||||
];
|
||||
|
||||
const filteredRows = rowsByTab[activeTab].filter((row) => matchesMoveQuery(row, query));
|
||||
const allMatchCount =
|
||||
query && filteredRows.length === 0 && activeTab !== 'all'
|
||||
? rowsByTab.all.filter((row) => matchesMoveQuery(row, query)).length
|
||||
: 0;
|
||||
|
||||
const tabsHtml = tabs
|
||||
.map(
|
||||
(t) => `
|
||||
<button
|
||||
type="button"
|
||||
class="movedex-tab-btn ${activeTab === t.id ? 'active' : ''}"
|
||||
data-movedex-tab="${t.id}"
|
||||
>${escapeHtml(t.label)} <span class="movedex-tab-count">(${t.count})</span></button>
|
||||
`,
|
||||
)
|
||||
.join('');
|
||||
|
||||
const rowsHtml =
|
||||
filteredRows.length > 0
|
||||
? filteredRows
|
||||
.map(
|
||||
(m) => `
|
||||
<tr class="movedex-row">
|
||||
<td class="mono move-unlock-col">
|
||||
<span class="move-method-pill ${escapeHtml(m.badgeClass)}">${escapeHtml(m.unlockLabel)}</span>
|
||||
</td>
|
||||
<td class="move-name-col">
|
||||
<strong>${escapeHtml(m.name)}</strong>
|
||||
</td>
|
||||
<td>${getTypeBadgeHtml(m.type)}</td>
|
||||
<td>${getCategoryBadgeHtml(m.category)}</td>
|
||||
<td class="mono move-stat-col">${m.power ?? '—'}</td>
|
||||
<td class="mono move-stat-col">${m.accuracy !== null && m.accuracy !== undefined ? `${m.accuracy}%` : '—'}</td>
|
||||
<td class="mono move-stat-col">${m.pp ?? '—'}</td>
|
||||
</tr>
|
||||
`,
|
||||
)
|
||||
.join('')
|
||||
: `
|
||||
<tr>
|
||||
<td colspan="7" class="empty-cell">
|
||||
${
|
||||
query
|
||||
? allMatchCount > 0
|
||||
? `No matches in this tab. <button type="button" class="inline-jump-link" data-movedex-tab="all">View ${allMatchCount} match${allMatchCount === 1 ? '' : 'es'} in All Moves</button>`
|
||||
: `No ORAS moves match "${escapeHtml(state.movedexSearch.trim())}".`
|
||||
: `No ORAS ${escapeHtml(tabs.find((t) => t.id === activeTab)?.label || '')} moves recorded for ${escapeHtml(species.name)}.`
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
|
||||
return `
|
||||
<div class="modal-section movedex-section">
|
||||
<div class="movedex-head-row">
|
||||
<h3 class="modal-subtitle">ORAS Movedex (${moveset.totalUniqueMoves} moves)</h3>
|
||||
<div class="movedex-search-wrap">
|
||||
<input
|
||||
type="search"
|
||||
id="movedex-search"
|
||||
class="movedex-search-input"
|
||||
placeholder="Filter moves, type, TM..."
|
||||
value="${escapeHtml(state.movedexSearch || '')}"
|
||||
autocomplete="off"
|
||||
/>
|
||||
${state.movedexSearch ? '<button type="button" class="search-clear" data-action="clear-movedex-search" title="Clear move filter">×</button>' : ''}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="movedex-tabs" role="tablist" aria-label="Move learn methods">
|
||||
${tabsHtml}
|
||||
</div>
|
||||
|
||||
<div class="movedex-table-wrap">
|
||||
<table class="movedex-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Learn</th>
|
||||
<th>Move</th>
|
||||
<th>Type</th>
|
||||
<th>Cat.</th>
|
||||
<th class="move-stat-head">Pwr</th>
|
||||
<th class="move-stat-head">Acc</th>
|
||||
<th class="move-stat-head">PP</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>${rowsHtml}</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
export function renderSpeciesModal(game, state) {
|
||||
if (!state.selectedSpeciesId) return '';
|
||||
const species = SPECIES_BY_ID[state.selectedSpeciesId];
|
||||
if (!species) return '';
|
||||
|
||||
const { locationsBySpecies } = indexGameSpecies(game);
|
||||
const { lockedBySpecies } = getExclusiveChoiceState(game, state.caught, state.ruleset);
|
||||
const locations = locationsBySpecies.get(species.id) || [];
|
||||
const family = getEvolutionFamily(species.id);
|
||||
const isCaught = state.caught.has(species.id);
|
||||
const lockedInfo = lockedBySpecies.get(species.id);
|
||||
|
||||
const familyHtml = family
|
||||
.map(({ species: member, depth }) => {
|
||||
const memberCaught = state.caught.has(member.id);
|
||||
const memberLocked = lockedBySpecies.get(member.id);
|
||||
const isCurrent = member.id === species.id;
|
||||
const memberItemIcons = renderItemIconsHtml(member.evolutionMethod, { size: 18 });
|
||||
return `
|
||||
<div class="family-node ${isCurrent ? 'current' : ''} ${memberCaught ? 'is-caught' : ''} ${memberLocked ? 'is-locked' : ''}" style="--depth: ${depth}">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="caught-checkbox"
|
||||
data-toggle-species="${escapeHtml(member.id)}"
|
||||
${memberCaught ? 'checked' : ''}
|
||||
${memberLocked ? 'disabled' : ''}
|
||||
aria-label="Mark ${escapeHtml(member.name)} caught"
|
||||
/>
|
||||
${renderPokemonSpriteImg(member, {
|
||||
shiny: false,
|
||||
className: 'pkmn-mini-sprite',
|
||||
size: 36,
|
||||
})}
|
||||
<button type="button" class="species-link" data-inspect-species="${escapeHtml(member.id)}">
|
||||
<strong>${escapeHtml(member.name)}</strong>
|
||||
</button>
|
||||
${memberLocked ? `<span class="lock-pill">Locked · ${escapeHtml(memberLocked.chosenLabel)}</span>` : ''}
|
||||
<span class="family-evo">
|
||||
${memberItemIcons}
|
||||
<span>${escapeHtml(member.evolutionMethod || 'Base')}</span>
|
||||
</span>
|
||||
</div>
|
||||
`;
|
||||
})
|
||||
.join('');
|
||||
|
||||
const locHtml = locations.length
|
||||
? locations
|
||||
.map(
|
||||
(loc) => `
|
||||
<div class="modal-loc-row">
|
||||
<div>
|
||||
<span class="milestone-tag tag-earlier">${escapeHtml(loc.sectionShortName)}</span>
|
||||
<strong>${escapeHtml(loc.areaName)}</strong>
|
||||
<span class="amber-inline">[${escapeHtml(loc.method)}]</span>
|
||||
${loc.notes ? `<span class="encounter-note">${escapeHtml(loc.notes)}</span>` : ''}
|
||||
</div>
|
||||
<div class="encounter-meta">
|
||||
<span class="rate-pill">${escapeHtml(loc.rate)}</span>
|
||||
<span class="level-pill">${escapeHtml(loc.levels)}</span>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
)
|
||||
.join('')
|
||||
: `<p class="muted-text">No native ${escapeHtml(game.shortTitle)} encounter (${escapeHtml(species.soloNotes || 'not available solo')}).</p>`;
|
||||
|
||||
return `
|
||||
<div class="modal-backdrop" data-action="close-modal" role="dialog" aria-modal="true" aria-label="${escapeHtml(species.name)} details">
|
||||
<div class="modal-card">
|
||||
<div class="modal-header">
|
||||
<div>
|
||||
<div class="modal-dex-nums">
|
||||
${species.hoennId ? `Hoenn #${padDex(species.hoennId)} · ` : ''}National #${padDex(species.natId)}
|
||||
</div>
|
||||
<h2 class="modal-title">${escapeHtml(species.name)}</h2>
|
||||
<div class="modal-types">${species.types.map(getTypeBadgeHtml).join('')}</div>
|
||||
</div>
|
||||
<div class="modal-header-actions">
|
||||
${renderExternalLinksControl(species, state, 'modal')}
|
||||
<button
|
||||
type="button"
|
||||
class="btn-caught-lg ${isCaught ? 'checked' : ''}"
|
||||
data-toggle-species-btn="${escapeHtml(species.id)}"
|
||||
${lockedInfo ? 'disabled' : ''}
|
||||
>
|
||||
${lockedInfo ? `Locked (${escapeHtml(lockedInfo.chosenLabel)})` : isCaught ? '✓ Caught' : 'Mark Caught'}
|
||||
</button>
|
||||
<button type="button" class="btn-ghost" data-action="close-modal" aria-label="Close">×</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="sprite-showcase">
|
||||
<div class="sprite-card">
|
||||
<div class="sprite-frame">
|
||||
${renderPokemonSpriteImg(species, { shiny: false, className: 'pkmn-sprite', size: 96 })}
|
||||
</div>
|
||||
<span class="sprite-label">Regular</span>
|
||||
</div>
|
||||
<div class="sprite-card sprite-card-shiny">
|
||||
<div class="sprite-frame">
|
||||
${renderPokemonSpriteImg(species, { shiny: true, className: 'pkmn-sprite', size: 96 })}
|
||||
</div>
|
||||
<span class="sprite-label shiny-label">★ Shiny</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
${
|
||||
lockedInfo
|
||||
? `<div class="modal-alert">Locked out in Solo POC because <strong>${escapeHtml(lockedInfo.chosenLabel)}</strong> was selected for <strong>${escapeHtml(lockedInfo.groupLabel)}</strong>. Uncheck that line to unlock.</div>`
|
||||
: species.soloNotes
|
||||
? `<div class="modal-alert">${escapeHtml(species.soloNotes)}</div>`
|
||||
: ''
|
||||
}
|
||||
|
||||
${renderBaseStatsHtml(species)}
|
||||
|
||||
<div class="modal-section">
|
||||
<h3 class="modal-subtitle">Evolution Family</h3>
|
||||
<div class="family-list">${familyHtml}</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-section">
|
||||
<h3 class="modal-subtitle">${escapeHtml(game.shortTitle)} Locations & Methods (${locations.length})</h3>
|
||||
<div class="modal-locs">${locHtml}</div>
|
||||
</div>
|
||||
|
||||
${renderMovedexSection(species, state)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
export function renderProfileModal(game, state) {
|
||||
const modal = state.profileModal;
|
||||
if (!modal) return '';
|
||||
const isRename = modal.mode === 'rename';
|
||||
const target = isRename
|
||||
? (state.profiles || []).find((p) => p.id === (modal.profileId || state.profileId))
|
||||
: null;
|
||||
const defaultVal = isRename
|
||||
? target?.name || 'Save 1'
|
||||
: `Save ${(state.profiles?.length || 1) + 1}`;
|
||||
const heading = isRename
|
||||
? `Rename ${game.shortTitle} Save Profile`
|
||||
: `New ${game.shortTitle} Save Profile`;
|
||||
|
||||
return `
|
||||
<div class="modal-backdrop" data-action="close-profile-modal" role="dialog" aria-modal="true" aria-label="${escapeHtml(heading)}">
|
||||
<div class="modal-card modal-card-sm">
|
||||
<div class="modal-header">
|
||||
<div>
|
||||
<div class="modal-dex-nums">${escapeHtml(game.title)}</div>
|
||||
<h2 class="modal-title">${escapeHtml(heading)}</h2>
|
||||
</div>
|
||||
<button type="button" class="btn-ghost" data-action="close-profile-modal" aria-label="Close">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="profile-modal-form" class="profile-form" data-profile-mode="${escapeHtml(modal.mode)}" data-profile-id="${escapeHtml(target?.id || '')}">
|
||||
<label class="profile-form-label" for="profile-name-input">Profile Name</label>
|
||||
<input
|
||||
type="text"
|
||||
id="profile-name-input"
|
||||
class="text-input"
|
||||
value="${escapeHtml(defaultVal)}"
|
||||
maxlength="36"
|
||||
required
|
||||
autocomplete="off"
|
||||
/>
|
||||
<div class="profile-form-actions">
|
||||
<button type="button" class="btn-ghost" data-action="close-profile-modal">Cancel</button>
|
||||
<button type="submit" class="btn-primary">${isRename ? 'Save Name' : 'Create Save'}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
import { escapeHtml, padDex, getTypeBadgeHtml } from './formatters.js';
|
||||
import { renderExternalLinksControl } from './external-links.js';
|
||||
import { renderItemIconsHtml, renderPokemonSpriteImg } from './sprites.js';
|
||||
|
||||
function sortIndicator(sortState, column) {
|
||||
if (sortState.column !== column) return '<span class="sort-arrow muted">⇅</span>';
|
||||
return `<span class="sort-arrow active">${sortState.direction === 'asc' ? '▲' : '▼'}</span>`;
|
||||
}
|
||||
|
||||
function getAvailabilityBadge(row) {
|
||||
if (row.lockedBy) {
|
||||
return `<span class="lock-pill">Locked · ${escapeHtml(row.lockedBy.chosenLabel)} chosen</span>`;
|
||||
}
|
||||
if (row.soloValid) return '';
|
||||
const labels = {
|
||||
'or-only': 'OR Only',
|
||||
'trade-evo': 'Trade Evo',
|
||||
'eon-ticket': 'Eon Ticket',
|
||||
'event-only': 'Event Only',
|
||||
'dual-game-legendary': 'Needs Trade',
|
||||
};
|
||||
const label = labels[row.availability] || 'Unavailable Solo';
|
||||
return `<span class="avail-pill avail-${escapeHtml(row.availability)}">${escapeHtml(label)}</span>`;
|
||||
}
|
||||
|
||||
export function renderPokedexView(store, state) {
|
||||
const rows = store.getPokedexRows();
|
||||
const caughtInView = rows.filter((r) => r.caught).length;
|
||||
|
||||
const tableRowsHtml = rows
|
||||
.map((row) => {
|
||||
const hoennLabel = row.hoennId ? `#${padDex(row.hoennId)}` : '—';
|
||||
const natLabel = `#${padDex(row.natId)}`;
|
||||
const milestoneLabel = row.earliest ? row.earliest.shortName : 'Not in AS Solo';
|
||||
const evoText = row.evolutionMethod || 'Base / Wild Encounter';
|
||||
const typesHtml = row.types.map(getTypeBadgeHtml).join('');
|
||||
const itemIconsHtml = renderItemIconsHtml(evoText, { size: 18 });
|
||||
const isLocked = Boolean(row.lockedBy);
|
||||
|
||||
return `
|
||||
<tr class="dex-row ${row.caught ? 'is-caught' : ''} ${isLocked ? 'is-locked' : ''} ${!row.soloValid ? 'is-excluded' : ''}">
|
||||
<td class="col-num mono">${escapeHtml(hoennLabel)}</td>
|
||||
<td class="col-num mono">${escapeHtml(natLabel)}</td>
|
||||
<td class="col-name">
|
||||
<div class="dex-name-cell">
|
||||
${renderPokemonSpriteImg(row, { shiny: false, className: 'pkmn-table-sprite', size: 28 })}
|
||||
<button type="button" class="species-link" data-inspect-species="${escapeHtml(row.id)}">
|
||||
${escapeHtml(row.name)}
|
||||
</button>
|
||||
<span class="inline-types">${typesHtml}</span>
|
||||
${getAvailabilityBadge(row)}
|
||||
${renderExternalLinksControl(row, state, 'pokedex')}
|
||||
</div>
|
||||
</td>
|
||||
<td class="col-caught">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="caught-checkbox"
|
||||
data-toggle-species="${escapeHtml(row.id)}"
|
||||
${row.caught ? 'checked' : ''}
|
||||
${isLocked ? 'disabled' : ''}
|
||||
aria-label="Mark ${escapeHtml(row.name)} caught"
|
||||
title="${
|
||||
isLocked
|
||||
? `Locked (${row.lockedBy.chosenLabel} chosen)`
|
||||
: row.caught
|
||||
? 'Caught everywhere'
|
||||
: 'Mark caught everywhere'
|
||||
}"
|
||||
/>
|
||||
</td>
|
||||
<td class="col-milestone">
|
||||
${
|
||||
row.earliest
|
||||
? `<button type="button" class="milestone-jump-pill" data-jump-section="${escapeHtml(row.earliest.sectionId)}">${escapeHtml(milestoneLabel)}</button>`
|
||||
: `<span class="muted-text">${escapeHtml(milestoneLabel)}</span>`
|
||||
}
|
||||
</td>
|
||||
<td class="col-stats mono">
|
||||
${
|
||||
row.baseStats
|
||||
? `<div class="dex-stats-cell" title="HP ${row.baseStats.hp} / Atk ${row.baseStats.atk} / Def ${row.baseStats.def} / SpA ${row.baseStats.spa} / SpD ${row.baseStats.spd} / Spe ${row.baseStats.spe}">
|
||||
<span class="dex-bst-pill">${row.baseStats.total}</span>
|
||||
<span class="dex-stat-split">${row.baseStats.hp}/${row.baseStats.atk}/${row.baseStats.def}/${row.baseStats.spa}/${row.baseStats.spd}/${row.baseStats.spe}</span>
|
||||
</div>`
|
||||
: '<span class="muted-text">—</span>'
|
||||
}
|
||||
</td>
|
||||
<td class="col-evo">
|
||||
<span class="evo-cell-wrap">
|
||||
${itemIconsHtml}
|
||||
<span>${escapeHtml(evoText)}</span>
|
||||
</span>
|
||||
${row.soloNotes && !row.soloValid ? `<span class="evo-subnote">${escapeHtml(row.soloNotes)}</span>` : ''}
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
})
|
||||
.join('');
|
||||
|
||||
return `
|
||||
<div class="pokedex-view">
|
||||
<div class="view-utility-bar">
|
||||
<div class="dex-filter-pills">
|
||||
<button type="button" class="pill-btn ${state.pokedexFilter === 'all' ? 'active' : ''}" data-dex-filter="all">
|
||||
All (${rows.length})
|
||||
</button>
|
||||
<button type="button" class="pill-btn ${state.pokedexFilter === 'hoenn' ? 'active' : ''}" data-dex-filter="hoenn">
|
||||
Hoenn Dex
|
||||
</button>
|
||||
<button type="button" class="pill-btn ${state.pokedexFilter === 'national' ? 'active' : ''}" data-dex-filter="national">
|
||||
National Dex Additions
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="utility-right">
|
||||
<span class="dex-count-summary">Showing <strong>${rows.length}</strong> · Caught: <strong class="mint-inline">${caughtInView}</strong></span>
|
||||
<button type="button" class="btn-ghost btn-sm" data-jump-tab="routes">↑ Back to Routes</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dex-table-wrap">
|
||||
<table class="dex-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<button type="button" class="sort-btn" data-sort-col="hoennId">
|
||||
Hoenn # ${sortIndicator(state.pokedexSort, 'hoennId')}
|
||||
</button>
|
||||
</th>
|
||||
<th>
|
||||
<button type="button" class="sort-btn" data-sort-col="natId">
|
||||
Nat # ${sortIndicator(state.pokedexSort, 'natId')}
|
||||
</button>
|
||||
</th>
|
||||
<th>
|
||||
<button type="button" class="sort-btn" data-sort-col="name">
|
||||
Pokemon Name ${sortIndicator(state.pokedexSort, 'name')}
|
||||
</button>
|
||||
</th>
|
||||
<th class="col-caught-head">
|
||||
<button type="button" class="sort-btn" data-sort-col="caught">
|
||||
Caught ${sortIndicator(state.pokedexSort, 'caught')}
|
||||
</button>
|
||||
</th>
|
||||
<th>
|
||||
<button type="button" class="sort-btn" data-sort-col="milestone">
|
||||
Earliest Milestone ${sortIndicator(state.pokedexSort, 'milestone')}
|
||||
</button>
|
||||
</th>
|
||||
<th>
|
||||
<button type="button" class="sort-btn" data-sort-col="bst">
|
||||
Base Stats ${sortIndicator(state.pokedexSort, 'bst')}
|
||||
</button>
|
||||
</th>
|
||||
<th>
|
||||
<button type="button" class="sort-btn" data-sort-col="evolutionMethod">
|
||||
Evolution / Obtain Method ${sortIndicator(state.pokedexSort, 'evolutionMethod')}
|
||||
</button>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
${
|
||||
rows.length > 0
|
||||
? tableRowsHtml
|
||||
: `<tr><td colspan="7" class="empty-cell">No Pokédex entries match your current filter.</td></tr>`
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
@@ -0,0 +1,545 @@
|
||||
import { SPECIES_BY_ID } from '../data/species.js';
|
||||
import { getExclusiveChoiceState, indexGameSpecies } from '../state/tracker-store.js';
|
||||
import { escapeHtml, getMethodClass, getTypeBadgeHtml, padDex } from './formatters.js';
|
||||
import { renderItemIconsHtml, renderPokemonSpriteImg } from './sprites.js';
|
||||
|
||||
const STARTER_LABELS = {
|
||||
treecko: 'Treecko',
|
||||
torchic: 'Torchic',
|
||||
mudkip: 'Mudkip',
|
||||
};
|
||||
|
||||
function getTrainerRoleClass(role) {
|
||||
switch (role) {
|
||||
case 'Gym Leader':
|
||||
return 'role-gym';
|
||||
case 'Rival':
|
||||
return 'role-rival';
|
||||
case 'Team Aqua':
|
||||
return 'role-aqua';
|
||||
case 'Team Magma':
|
||||
return 'role-magma';
|
||||
case 'Elite Four':
|
||||
return 'role-e4';
|
||||
case 'Champion':
|
||||
return 'role-champion';
|
||||
case 'Delta Episode':
|
||||
return 'role-delta';
|
||||
case 'Trainer':
|
||||
return 'role-trainer';
|
||||
default:
|
||||
return 'role-other';
|
||||
}
|
||||
}
|
||||
|
||||
function getTrainerAllMons(trainer) {
|
||||
if (Array.isArray(trainer.team)) return trainer.team;
|
||||
if (trainer.starterTeams) return Object.values(trainer.starterTeams).flat();
|
||||
return [];
|
||||
}
|
||||
|
||||
function trainerDirectMatch(trainer, area, section, q) {
|
||||
if (!q) return false;
|
||||
const hay = [
|
||||
trainer.name,
|
||||
trainer.role,
|
||||
trainer.location,
|
||||
trainer.reward || '',
|
||||
trainer.note || '',
|
||||
area.name,
|
||||
section.title,
|
||||
]
|
||||
.join(' ')
|
||||
.toLowerCase();
|
||||
return hay.includes(q);
|
||||
}
|
||||
|
||||
function trainerMatchesSearch(trainer, area, section, q) {
|
||||
if (!q) return true;
|
||||
if (trainerDirectMatch(trainer, area, section, q)) return true;
|
||||
const monsText = getTrainerAllMons(trainer)
|
||||
.map((mon) => `${mon.name} ${mon.note || ''} ${(mon.types || []).join(' ')}`)
|
||||
.join(' ')
|
||||
.toLowerCase();
|
||||
return monsText.includes(q);
|
||||
}
|
||||
|
||||
function renderTeamMonChipsHtml(team) {
|
||||
return team
|
||||
.map(
|
||||
(mon) => `
|
||||
<div class="team-mon-chip">
|
||||
${renderPokemonSpriteImg(
|
||||
{ natId: mon.natId, name: mon.name },
|
||||
{ className: 'pkmn-mini-sprite', size: 28 },
|
||||
)}
|
||||
<div class="team-mon-info">
|
||||
<div class="team-mon-top">
|
||||
<span class="team-mon-name">${escapeHtml(mon.name)}</span>
|
||||
<span class="team-mon-level mono">Lv.${escapeHtml(mon.level)}</span>
|
||||
${mon.note ? `<span class="team-mon-note">${escapeHtml(mon.note)}</span>` : ''}
|
||||
</div>
|
||||
<div class="team-mon-types">${(mon.types || []).map(getTypeBadgeHtml).join('')}</div>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
)
|
||||
.join('');
|
||||
}
|
||||
|
||||
function renderTrainerTeamHtml(trainer, chosenStarter) {
|
||||
if (trainer.starterTeams) {
|
||||
if (chosenStarter && trainer.starterTeams[chosenStarter]) {
|
||||
const label = STARTER_LABELS[chosenStarter] || chosenStarter;
|
||||
return `
|
||||
<div class="trainer-team-context">Opponent team for your <strong>${escapeHtml(label)}</strong> starter pick:</div>
|
||||
<div class="trainer-team-row">${renderTeamMonChipsHtml(trainer.starterTeams[chosenStarter])}</div>
|
||||
`;
|
||||
}
|
||||
const variantsHtml = Object.entries(trainer.starterTeams)
|
||||
.map(([starterKey, team]) => {
|
||||
const label = STARTER_LABELS[starterKey] || starterKey;
|
||||
return `
|
||||
<div class="trainer-variant-group">
|
||||
<span class="trainer-variant-label">If ${escapeHtml(label)}:</span>
|
||||
<div class="trainer-team-row">${renderTeamMonChipsHtml(team)}</div>
|
||||
</div>
|
||||
`;
|
||||
})
|
||||
.join('');
|
||||
return `<div class="trainer-team-variants">${variantsHtml}</div>`;
|
||||
}
|
||||
|
||||
return `<div class="trainer-team-row">${renderTeamMonChipsHtml(trainer.team || [])}</div>`;
|
||||
}
|
||||
|
||||
function renderTrainerCardsGrid(trainers, state, chosenStarter) {
|
||||
return `<div class="trainers-grid">
|
||||
${trainers
|
||||
.map((trainer) => {
|
||||
const isDefeated = state.defeatedTrainers.has(trainer.id);
|
||||
const checkboxId = `trainer-check-${trainer.id}`;
|
||||
return `
|
||||
<article class="trainer-battle-card ${isDefeated ? 'is-defeated' : ''}">
|
||||
<div class="trainer-card-header">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="caught-checkbox trainer-defeat-checkbox"
|
||||
id="${escapeHtml(checkboxId)}"
|
||||
data-toggle-trainer="${escapeHtml(trainer.id)}"
|
||||
aria-label="Mark ${escapeHtml(trainer.name)} defeated"
|
||||
${isDefeated ? 'checked' : ''}
|
||||
/>
|
||||
<label class="trainer-card-title-group" for="${escapeHtml(checkboxId)}">
|
||||
<span class="role-pill ${getTrainerRoleClass(trainer.role)}">${escapeHtml(trainer.role)}</span>
|
||||
<span class="trainer-name">${escapeHtml(trainer.name)}</span>
|
||||
${trainer.note ? `<span class="trainer-note-pill">${escapeHtml(trainer.note)}</span>` : ''}
|
||||
${isDefeated ? '<span class="defeated-pill">Defeated</span>' : ''}
|
||||
</label>
|
||||
<span class="trainer-location">${escapeHtml(trainer.location)}</span>
|
||||
</div>
|
||||
${renderTrainerTeamHtml(trainer, chosenStarter)}
|
||||
${
|
||||
trainer.reward
|
||||
? `<div class="trainer-reward"><span class="reward-label">Reward / Notes:</span> ${escapeHtml(trainer.reward)}</div>`
|
||||
: ''
|
||||
}
|
||||
</article>
|
||||
`;
|
||||
})
|
||||
.join('')}
|
||||
</div>`;
|
||||
}
|
||||
|
||||
function renderAreaTrainersDrawer(area, visibleTrainers, totalTrainersCount, state, chosenStarter, isExpanded) {
|
||||
const allTrainers = area.trainers || [];
|
||||
const defeatedCount = allTrainers.filter((t) => state.defeatedTrainers.has(t.id)).length;
|
||||
const allDefeated = totalTrainersCount > 0 && defeatedCount === totalTrainersCount;
|
||||
const countLabel =
|
||||
visibleTrainers.length < totalTrainersCount
|
||||
? `${visibleTrainers.length} of ${totalTrainersCount} battles`
|
||||
: visibleTrainers.length === 1
|
||||
? '1 battle'
|
||||
: `${visibleTrainers.length} battles`;
|
||||
|
||||
return `
|
||||
<div class="trainers-panel area-trainers-drawer ${allDefeated ? 'all-defeated' : ''} ${isExpanded ? 'is-expanded' : ''}">
|
||||
<button
|
||||
type="button"
|
||||
class="trainers-toggle-btn"
|
||||
data-toggle-area-trainers="${escapeHtml(area.id)}"
|
||||
aria-expanded="${isExpanded}"
|
||||
>
|
||||
<span class="trainers-toggle-left">
|
||||
<span class="area-chevron">${isExpanded ? '▾' : '▸'}</span>
|
||||
<span class="trainers-toggle-title">Trainer Battles</span>
|
||||
<span class="trainers-toggle-sub">${countLabel}${!isExpanded ? ' · Click to view trainers' : ''}</span>
|
||||
</span>
|
||||
<span class="area-status ${allDefeated ? 'done' : ''}">
|
||||
${allDefeated ? `✓ All ${totalTrainersCount} defeated` : `${defeatedCount} / ${totalTrainersCount} defeated`}
|
||||
</span>
|
||||
</button>
|
||||
${isExpanded ? renderTrainerCardsGrid(visibleTrainers, state, chosenStarter) : ''}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
function entryMatchesSearch(entry, species, area, section, method, q) {
|
||||
if (!q) return true;
|
||||
const hay = [
|
||||
species?.name || '',
|
||||
species?.evolutionMethod || '',
|
||||
String(species?.natId || ''),
|
||||
species?.hoennId ? String(species.hoennId) : '',
|
||||
entry.notes || '',
|
||||
entry.rate || '',
|
||||
entry.levels || '',
|
||||
method,
|
||||
area.name,
|
||||
area.subtitle,
|
||||
section.title,
|
||||
]
|
||||
.join(' ')
|
||||
.toLowerCase();
|
||||
return hay.includes(q);
|
||||
}
|
||||
|
||||
export function renderRoutesView(game, state, progress) {
|
||||
const q = state.searchQuery.trim().toLowerCase();
|
||||
const { earliestBySpecies } = indexGameSpecies(game);
|
||||
const { selectedByGroup, lockedBySpecies } = getExclusiveChoiceState(
|
||||
game,
|
||||
state.caught,
|
||||
state.ruleset,
|
||||
);
|
||||
const progressBySection = new Map(progress.sections.map((s) => [s.id, s]));
|
||||
|
||||
const visibleSections = game.sections.filter(
|
||||
(s) => state.activeSectionId === 'all' || s.id === state.activeSectionId,
|
||||
);
|
||||
|
||||
let renderedSectionsCount = 0;
|
||||
|
||||
const sectionsHtml = visibleSections
|
||||
.map((section) => {
|
||||
const secProg = progressBySection.get(section.id);
|
||||
const chosenStarter = selectedByGroup.get('starter')?.chosenOption || null;
|
||||
|
||||
const areasHtml = section.areas
|
||||
.map((area) => {
|
||||
const areaSpeciesIds = new Set();
|
||||
const areaExclusiveGroupsSeen = new Set();
|
||||
let areaTargetCount = 0;
|
||||
let areaCaughtCount = 0;
|
||||
|
||||
const groupsHtml = area.groups
|
||||
.map((group) => {
|
||||
for (const entry of group.entries) {
|
||||
if (entry.choiceGroup && state.ruleset === 'solo') {
|
||||
if (!areaExclusiveGroupsSeen.has(entry.choiceGroup)) {
|
||||
areaExclusiveGroupsSeen.add(entry.choiceGroup);
|
||||
const sel = selectedByGroup.get(entry.choiceGroup);
|
||||
const repOpt = sel?.chosenOption || entry.choiceOption;
|
||||
const repEntries = group.entries.filter(
|
||||
(e) => e.choiceGroup === entry.choiceGroup && e.choiceOption === repOpt,
|
||||
);
|
||||
for (const re of repEntries) {
|
||||
if (!areaSpeciesIds.has(re.speciesId)) {
|
||||
areaSpeciesIds.add(re.speciesId);
|
||||
areaTargetCount++;
|
||||
if (state.caught.has(re.speciesId)) areaCaughtCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (!areaSpeciesIds.has(entry.speciesId)) {
|
||||
areaSpeciesIds.add(entry.speciesId);
|
||||
areaTargetCount++;
|
||||
if (state.caught.has(entry.speciesId)) areaCaughtCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (state.methodFilter !== 'all' && group.method !== state.methodFilter) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const filteredEntries = group.entries.filter((entry) => {
|
||||
const sp = SPECIES_BY_ID[entry.speciesId];
|
||||
const isCaught = state.caught.has(entry.speciesId);
|
||||
const isLocked = lockedBySpecies.has(entry.speciesId);
|
||||
if (state.uncaughtOnly && (isCaught || isLocked)) return false;
|
||||
return entryMatchesSearch(entry, sp, area, section, group.method, q);
|
||||
});
|
||||
|
||||
if (filteredEntries.length === 0) return '';
|
||||
|
||||
const groupKey = `${area.id}::${group.method}`;
|
||||
const isGroupCollapsed = state.collapsedGroups.has(groupKey);
|
||||
const groupCaught = filteredEntries.filter((e) => state.caught.has(e.speciesId)).length;
|
||||
const groupAvailable = filteredEntries.filter(
|
||||
(e) => !lockedBySpecies.has(e.speciesId),
|
||||
).length;
|
||||
|
||||
const rowsHtml = filteredEntries
|
||||
.map((entry) => {
|
||||
const sp = SPECIES_BY_ID[entry.speciesId];
|
||||
const isCaught = state.caught.has(entry.speciesId);
|
||||
const lockedInfo = lockedBySpecies.get(entry.speciesId);
|
||||
const isLocked = Boolean(lockedInfo);
|
||||
const earliest = earliestBySpecies.get(entry.speciesId);
|
||||
const isEarliestHere = earliest && earliest.sectionId === section.id;
|
||||
const dexLabel = sp?.hoennId ? `H#${padDex(sp.hoennId)}` : `N#${padDex(sp?.natId ?? 0)}`;
|
||||
const evoHint = sp?.evolutionMethod ? sp.evolutionMethod : '';
|
||||
const combinedNote = [entry.notes, !entry.notes && evoHint ? evoHint : '']
|
||||
.filter(Boolean)
|
||||
.join(' · ');
|
||||
const itemIconsHtml = renderItemIconsHtml(`${entry.levels} ${combinedNote}`, { size: 16 });
|
||||
|
||||
let exclusiveBadge = '';
|
||||
if (isLocked) {
|
||||
exclusiveBadge = `<span class="lock-pill" title="Locked in Solo POC because ${escapeHtml(lockedInfo.chosenLabel)} was chosen">Locked · ${escapeHtml(lockedInfo.chosenLabel)} chosen</span>`;
|
||||
} else if (entry.choiceGroup && state.ruleset === 'solo') {
|
||||
const sel = selectedByGroup.get(entry.choiceGroup);
|
||||
if (!sel?.chosenOption) {
|
||||
exclusiveBadge = `<span class="pick-pill" title="Exclusive choice — checking one locks the others">Pick 1</span>`;
|
||||
} else {
|
||||
exclusiveBadge = `<span class="chosen-pill">Chosen</span>`;
|
||||
}
|
||||
}
|
||||
|
||||
return `
|
||||
<div class="encounter-row ${isCaught ? 'is-caught' : ''} ${isLocked ? 'is-locked' : ''}">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="caught-checkbox"
|
||||
data-toggle-species="${escapeHtml(entry.speciesId)}"
|
||||
${isCaught ? 'checked' : ''}
|
||||
${isLocked ? 'disabled' : ''}
|
||||
aria-label="Mark ${escapeHtml(sp?.name || entry.speciesId)} caught"
|
||||
title="${
|
||||
isLocked
|
||||
? `Locked (${lockedInfo.chosenLabel} chosen)`
|
||||
: isCaught
|
||||
? 'Caught — synced across all routes & Pokédex'
|
||||
: 'Mark caught across all routes & Pokédex'
|
||||
}"
|
||||
/>
|
||||
|
||||
<div class="encounter-main">
|
||||
${
|
||||
sp
|
||||
? renderPokemonSpriteImg(sp, {
|
||||
shiny: false,
|
||||
className: 'pkmn-mini-sprite',
|
||||
size: 28,
|
||||
})
|
||||
: ''
|
||||
}
|
||||
<button
|
||||
type="button"
|
||||
class="species-link"
|
||||
data-inspect-species="${escapeHtml(entry.speciesId)}"
|
||||
>
|
||||
<span class="species-name">${escapeHtml(sp?.name || entry.speciesId)}</span>
|
||||
</button>
|
||||
<span class="inline-types">${(sp?.types || []).map(getTypeBadgeHtml).join('')}</span>
|
||||
<span class="dex-chip">${escapeHtml(dexLabel)}</span>
|
||||
${
|
||||
isEarliestHere
|
||||
? '<span class="milestone-tag tag-new" title="First obtainable in this Badge Checkpoint">NEW</span>'
|
||||
: `<span class="milestone-tag tag-earlier" title="Earliest available in ${escapeHtml(earliest?.shortName || '')}">${escapeHtml(earliest?.shortName || '')}</span>`
|
||||
}
|
||||
${exclusiveBadge}
|
||||
${itemIconsHtml}
|
||||
${combinedNote ? `<span class="encounter-note">${escapeHtml(combinedNote)}</span>` : ''}
|
||||
</div>
|
||||
|
||||
<div class="encounter-meta">
|
||||
<span class="rate-pill">${escapeHtml(entry.rate)}</span>
|
||||
<span class="level-pill">${escapeHtml(entry.levels)}</span>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
})
|
||||
.join('');
|
||||
|
||||
return `
|
||||
<div class="method-group ${getMethodClass(group.method)} ${isGroupCollapsed ? 'collapsed' : ''}">
|
||||
<button
|
||||
type="button"
|
||||
class="method-header"
|
||||
data-toggle-group="${escapeHtml(groupKey)}"
|
||||
aria-expanded="${!isGroupCollapsed}"
|
||||
>
|
||||
<span class="method-chevron">${isGroupCollapsed ? '▸' : '▾'}</span>
|
||||
<span class="method-title">${escapeHtml(group.method)}</span>
|
||||
<span class="method-count">${groupCaught}/${groupAvailable}</span>
|
||||
</button>
|
||||
${isGroupCollapsed ? '' : `<div class="encounter-list">${rowsHtml}</div>`}
|
||||
</div>
|
||||
`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join('');
|
||||
|
||||
const isTrainerOnlyArea = area.groups.length === 0;
|
||||
const allAreaTrainers = area.trainers || [];
|
||||
const visibleAreaTrainers = q
|
||||
? allAreaTrainers.filter((t) => trainerMatchesSearch(t, area, section, q))
|
||||
: allAreaTrainers;
|
||||
const directTrainerMatch = Boolean(
|
||||
q && allAreaTrainers.some((t) => trainerDirectMatch(t, area, section, q)),
|
||||
);
|
||||
const trainerOnlySearchMatch = Boolean(
|
||||
q && !groupsHtml && visibleAreaTrainers.length > 0,
|
||||
);
|
||||
const autoExpandTrainers = directTrainerMatch || trainerOnlySearchMatch;
|
||||
|
||||
if (isTrainerOnlyArea) {
|
||||
if (allAreaTrainers.length === 0) return '';
|
||||
if (q) {
|
||||
if (visibleAreaTrainers.length === 0) return '';
|
||||
} else if (state.uncaughtOnly || state.methodFilter !== 'all') {
|
||||
return '';
|
||||
}
|
||||
|
||||
const totalTrainers = allAreaTrainers.length;
|
||||
const defeatedTrainersCount = allAreaTrainers.filter((t) =>
|
||||
state.defeatedTrainers.has(t.id),
|
||||
).length;
|
||||
const trainersComplete =
|
||||
totalTrainers > 0 && defeatedTrainersCount === totalTrainers;
|
||||
const isExpanded =
|
||||
state.expandedTrainerAreas.has(area.id) || autoExpandTrainers;
|
||||
|
||||
return `
|
||||
<article class="area-card trainer-only-card ${trainersComplete ? 'area-complete' : ''}" id="area-${escapeHtml(area.id)}">
|
||||
<div class="area-header">
|
||||
<button
|
||||
type="button"
|
||||
class="area-collapse-btn"
|
||||
data-toggle-area-trainers="${escapeHtml(area.id)}"
|
||||
aria-expanded="${isExpanded}"
|
||||
>
|
||||
<span class="area-chevron">${isExpanded ? '▾' : '▸'}</span>
|
||||
<div class="area-titles">
|
||||
<h3 class="area-name">${escapeHtml(area.name)}</h3>
|
||||
<p class="area-subtitle">${escapeHtml(area.subtitle)} · ${visibleAreaTrainers.length} ${visibleAreaTrainers.length === 1 ? 'battle' : 'battles'}</p>
|
||||
</div>
|
||||
</button>
|
||||
<div class="area-status ${trainersComplete ? 'done' : ''}">
|
||||
${trainersComplete ? `✓ ${totalTrainers} defeated` : `${defeatedTrainersCount} / ${totalTrainers} defeated`}
|
||||
</div>
|
||||
</div>
|
||||
${isExpanded ? `<div class="area-body area-body-trainers">${renderTrainerCardsGrid(visibleAreaTrainers, state, chosenStarter)}</div>` : ''}
|
||||
</article>
|
||||
`;
|
||||
}
|
||||
|
||||
if (!groupsHtml && !autoExpandTrainers) return '';
|
||||
|
||||
const areaComplete = areaTargetCount > 0 && areaCaughtCount === areaTargetCount;
|
||||
const isAreaCollapsed = autoExpandTrainers
|
||||
? false
|
||||
: state.collapsedAreas.has(area.id);
|
||||
const isAreaTrainersExpanded =
|
||||
state.expandedTrainerAreas.has(area.id) || autoExpandTrainers;
|
||||
const trainersDrawerHtml =
|
||||
visibleAreaTrainers.length > 0 && (!q || autoExpandTrainers || Boolean(groupsHtml))
|
||||
? renderAreaTrainersDrawer(
|
||||
area,
|
||||
visibleAreaTrainers,
|
||||
allAreaTrainers.length,
|
||||
state,
|
||||
chosenStarter,
|
||||
isAreaTrainersExpanded,
|
||||
)
|
||||
: '';
|
||||
|
||||
return `
|
||||
<article class="area-card ${areaComplete ? 'area-complete' : ''}" id="area-${escapeHtml(area.id)}">
|
||||
<div class="area-header">
|
||||
<button
|
||||
type="button"
|
||||
class="area-collapse-btn"
|
||||
data-toggle-area="${escapeHtml(area.id)}"
|
||||
aria-expanded="${!isAreaCollapsed}"
|
||||
>
|
||||
<span class="area-chevron">${isAreaCollapsed ? '▸' : '▾'}</span>
|
||||
<div class="area-titles">
|
||||
<h3 class="area-name">${escapeHtml(area.name)}</h3>
|
||||
<p class="area-subtitle">${escapeHtml(area.subtitle)}</p>
|
||||
</div>
|
||||
</button>
|
||||
<div class="area-status ${areaComplete ? 'done' : ''}">
|
||||
${areaComplete ? '✓ Complete' : `${areaCaughtCount} / ${areaTargetCount} caught`}
|
||||
</div>
|
||||
</div>
|
||||
${isAreaCollapsed ? '' : `<div class="area-body">${groupsHtml}${trainersDrawerHtml}</div>`}
|
||||
</article>
|
||||
`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join('');
|
||||
|
||||
if (!areasHtml) return '';
|
||||
renderedSectionsCount++;
|
||||
|
||||
return `
|
||||
<section class="badge-section" id="section-${escapeHtml(section.id)}">
|
||||
<div class="section-banner">
|
||||
<div class="section-banner-main">
|
||||
<div class="section-kicker">Checkpoint ${section.badgeNumber} · ${escapeHtml(section.gymLeader)}${section.levelCap ? ` · Level Cap: Lv. ${escapeHtml(section.levelCap)}` : ''}</div>
|
||||
<h2 class="section-title">${escapeHtml(section.title)}</h2>
|
||||
<p class="section-summary">${escapeHtml(section.summary)}</p>
|
||||
</div>
|
||||
<div class="section-banner-stats">
|
||||
<div class="section-stat-box">
|
||||
<span class="stat-label">New Unlocks</span>
|
||||
<span class="stat-value">${secProg.newCaught} / ${secProg.newTotal}</span>
|
||||
</div>
|
||||
<div class="section-stat-box">
|
||||
<span class="stat-label">Cumul. POC</span>
|
||||
<span class="stat-value">${secProg.cumulativeCaught} / ${secProg.cumulativeTotal}</span>
|
||||
</div>
|
||||
<div class="section-actions">
|
||||
<button type="button" class="btn-ghost btn-sm" data-mark-section="${escapeHtml(section.id)}" data-mark-value="1">Check All New</button>
|
||||
<button type="button" class="btn-ghost btn-sm" data-mark-section="${escapeHtml(section.id)}" data-mark-value="0">Uncheck</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="areas-stack">${areasHtml}</div>
|
||||
</section>
|
||||
`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join('');
|
||||
|
||||
return `
|
||||
<div class="routes-view">
|
||||
<div class="view-utility-bar">
|
||||
<div class="utility-left">
|
||||
<span class="legend-item"><span class="legend-dot dot-amber"></span>Special Method (Rod / Horde / DexNav / Mirage / Gift)</span>
|
||||
<span class="legend-item"><span class="legend-dot dot-mint"></span>Caught (synced everywhere)</span>
|
||||
</div>
|
||||
<div class="utility-right">
|
||||
<button type="button" class="btn-ghost btn-sm" data-action="expand-all">Expand All</button>
|
||||
<button type="button" class="btn-ghost btn-sm" data-action="collapse-all">Collapse All</button>
|
||||
<button type="button" class="btn-ghost btn-sm" data-jump-tab="pokedex">Jump to Pokédex ↓</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
${
|
||||
renderedSectionsCount === 0
|
||||
? `<div class="empty-state">
|
||||
<p>No areas, Pokémon, or trainers match your current filters.</p>
|
||||
<button type="button" class="btn-primary" data-action="reset-filters">Clear Filters</button>
|
||||
</div>`
|
||||
: sectionsHtml
|
||||
}
|
||||
|
||||
<div class="bottom-jump">
|
||||
<button type="button" class="btn-ghost btn-sm" data-action="scroll-top">↑ Top of List</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import { escapeHtml } from './formatters.js';
|
||||
|
||||
export function renderSidebar(game, state, progress) {
|
||||
const sectionButtons = progress.sections
|
||||
.map((sec) => {
|
||||
const active = state.activeSectionId === sec.id;
|
||||
const done = sec.newTotal > 0 && sec.newRemaining === 0;
|
||||
return `
|
||||
<button
|
||||
type="button"
|
||||
class="milestone-btn ${active ? 'active' : ''} ${done ? 'done' : ''}"
|
||||
data-section-id="${escapeHtml(sec.id)}"
|
||||
>
|
||||
<div class="milestone-top">
|
||||
<span class="milestone-name">${done ? '✓ ' : ''}${escapeHtml(sec.shortName)}</span>
|
||||
<span class="milestone-count">${sec.newCaught}/${sec.newTotal}</span>
|
||||
</div>
|
||||
<div class="milestone-sub">
|
||||
<span>${sec.levelCap ? `Cap Lv.${sec.levelCap} · ` : ''}New: ${sec.newTotal}</span>
|
||||
<span>Cumul: ${sec.cumulativeCaught}/${sec.cumulativeTotal}</span>
|
||||
</div>
|
||||
<div class="mini-bar">
|
||||
<div class="mini-bar-fill" style="width: ${sec.newTotal ? Math.round((sec.newCaught / sec.newTotal) * 100) : 0}%"></div>
|
||||
</div>
|
||||
</button>
|
||||
`;
|
||||
})
|
||||
.join('');
|
||||
|
||||
return `
|
||||
<aside class="milestone-rail" aria-label="Badge Checkpoints">
|
||||
<div class="rail-header">
|
||||
<span class="rail-title">Badge Checkpoints</span>
|
||||
<button
|
||||
type="button"
|
||||
class="btn-link"
|
||||
data-section-id="all"
|
||||
>Show All</button>
|
||||
</div>
|
||||
<div class="milestone-list">
|
||||
<button
|
||||
type="button"
|
||||
class="milestone-btn ${state.activeSectionId === 'all' ? 'active' : ''}"
|
||||
data-section-id="all"
|
||||
>
|
||||
<div class="milestone-top">
|
||||
<span class="milestone-name">All Sections</span>
|
||||
<span class="milestone-count">${progress.totalCaught}/${progress.totalObtainable}</span>
|
||||
</div>
|
||||
<div class="milestone-sub">
|
||||
<span>Complete ${escapeHtml(game.shortTitle)} POC</span>
|
||||
</div>
|
||||
</button>
|
||||
${sectionButtons}
|
||||
</div>
|
||||
</aside>
|
||||
`;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
import { escapeHtml } from './formatters.js';
|
||||
|
||||
export const POKEAPI_SPRITES_CDN =
|
||||
'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites';
|
||||
|
||||
let spriteBaseUrl = POKEAPI_SPRITES_CDN;
|
||||
|
||||
export function setSpriteBaseUrl(baseUrl) {
|
||||
spriteBaseUrl = String(baseUrl || POKEAPI_SPRITES_CDN).replace(/\/+$/, '');
|
||||
}
|
||||
|
||||
export function getSpriteBaseUrl() {
|
||||
return spriteBaseUrl;
|
||||
}
|
||||
|
||||
const ITEM_PATTERNS = [
|
||||
{ regex: /water stone/i, slug: 'water-stone', label: 'Water Stone' },
|
||||
{ regex: /fire stone/i, slug: 'fire-stone', label: 'Fire Stone' },
|
||||
{ regex: /thunder stone/i, slug: 'thunder-stone', label: 'Thunder Stone' },
|
||||
{ regex: /leaf stone/i, slug: 'leaf-stone', label: 'Leaf Stone' },
|
||||
{ regex: /moon stone/i, slug: 'moon-stone', label: 'Moon Stone' },
|
||||
{ regex: /sun stone/i, slug: 'sun-stone', label: 'Sun Stone' },
|
||||
{ regex: /shiny stone/i, slug: 'shiny-stone', label: 'Shiny Stone' },
|
||||
{ regex: /dusk stone/i, slug: 'dusk-stone', label: 'Dusk Stone' },
|
||||
{ regex: /dawn stone/i, slug: 'dawn-stone', label: 'Dawn Stone' },
|
||||
{ regex: /oval stone/i, slug: 'oval-stone', label: 'Oval Stone' },
|
||||
{ regex: /king's rock/i, slug: 'kings-rock', label: "King's Rock" },
|
||||
{ regex: /metal coat/i, slug: 'metal-coat', label: 'Metal Coat' },
|
||||
{ regex: /dragon scale/i, slug: 'dragon-scale', label: 'Dragon Scale' },
|
||||
{ regex: /deep sea tooth/i, slug: 'deep-sea-tooth', label: 'Deep Sea Tooth' },
|
||||
{ regex: /deep sea scale/i, slug: 'deep-sea-scale', label: 'Deep Sea Scale' },
|
||||
{ regex: /protector/i, slug: 'protector', label: 'Protector' },
|
||||
{ regex: /reaper cloth/i, slug: 'reaper-cloth', label: 'Reaper Cloth' },
|
||||
{ regex: /electirizer/i, slug: 'electirizer', label: 'Electirizer' },
|
||||
{ regex: /magmarizer/i, slug: 'magmarizer', label: 'Magmarizer' },
|
||||
{ regex: /up-grade/i, slug: 'up-grade', label: 'Up-Grade' },
|
||||
{ regex: /dubious disc/i, slug: 'dubious-disc', label: 'Dubious Disc' },
|
||||
{ regex: /prism scale/i, slug: 'prism-scale', label: 'Prism Scale' },
|
||||
{ regex: /sea incense/i, slug: 'sea-incense', label: 'Sea Incense' },
|
||||
{ regex: /rose incense/i, slug: 'rose-incense', label: 'Rose Incense' },
|
||||
{ regex: /pure incense/i, slug: 'pure-incense', label: 'Pure Incense' },
|
||||
{ regex: /luck incense/i, slug: 'luck-incense', label: 'Luck Incense' },
|
||||
{ regex: /lax incense/i, slug: 'lax-incense', label: 'Lax Incense' },
|
||||
{ regex: /wave incense/i, slug: 'wave-incense', label: 'Wave Incense' },
|
||||
{ regex: /helix fossil/i, slug: 'helix-fossil', label: 'Helix Fossil' },
|
||||
{ regex: /dome fossil/i, slug: 'dome-fossil', label: 'Dome Fossil' },
|
||||
{ regex: /old amber/i, slug: 'old-amber', label: 'Old Amber' },
|
||||
{ regex: /root fossil/i, slug: 'root-fossil', label: 'Root Fossil' },
|
||||
{ regex: /claw fossil/i, slug: 'claw-fossil', label: 'Claw Fossil' },
|
||||
{ regex: /skull fossil/i, slug: 'skull-fossil', label: 'Skull Fossil' },
|
||||
{ regex: /armor fossil/i, slug: 'armor-fossil', label: 'Armor Fossil' },
|
||||
{ regex: /cover fossil/i, slug: 'cover-fossil', label: 'Cover Fossil' },
|
||||
{ regex: /plume fossil/i, slug: 'plume-fossil', label: 'Plume Fossil' },
|
||||
{ regex: /poké ball|poke ball/i, slug: 'poke-ball', label: 'Poké Ball' },
|
||||
];
|
||||
|
||||
export function getPokemonSpriteUrls(natId, { shiny = false } = {}) {
|
||||
const base = getSpriteBaseUrl();
|
||||
const shinySeg = shiny ? 'shiny/' : '';
|
||||
return {
|
||||
primary: `${base}/pokemon/versions/generation-vi/omega-ruby-alpha-sapphire/${shinySeg}${natId}.png`,
|
||||
fallback: `${base}/pokemon/${shinySeg}${natId}.png`,
|
||||
};
|
||||
}
|
||||
|
||||
export function getItemSpriteUrl(slug) {
|
||||
return `${getSpriteBaseUrl()}/items/${slug}.png`;
|
||||
}
|
||||
|
||||
export function extractItemsFromText(text) {
|
||||
if (!text) return [];
|
||||
const matches = [];
|
||||
for (const item of ITEM_PATTERNS) {
|
||||
if (item.regex.test(text)) {
|
||||
matches.push({
|
||||
slug: item.slug,
|
||||
label: item.label,
|
||||
url: getItemSpriteUrl(item.slug),
|
||||
});
|
||||
}
|
||||
}
|
||||
return matches;
|
||||
}
|
||||
|
||||
export function renderPokemonSpriteImg(species, { shiny = false, className = 'pkmn-sprite', size = 96 } = {}) {
|
||||
const { primary, fallback } = getPokemonSpriteUrls(species.natId, { shiny });
|
||||
const alt = `${species.name}${shiny ? ' (Shiny)' : ''} sprite`;
|
||||
return `<img
|
||||
class="${escapeHtml(className)}"
|
||||
src="${escapeHtml(primary)}"
|
||||
data-fallback-src="${escapeHtml(fallback)}"
|
||||
alt="${escapeHtml(alt)}"
|
||||
width="${size}"
|
||||
height="${size}"
|
||||
loading="lazy"
|
||||
/>`;
|
||||
}
|
||||
|
||||
export function renderItemIconsHtml(text, { size = 20 } = {}) {
|
||||
const items = extractItemsFromText(text);
|
||||
if (items.length === 0) return '';
|
||||
return items
|
||||
.map(
|
||||
(item) => `<img
|
||||
class="item-icon"
|
||||
src="${escapeHtml(item.url)}"
|
||||
alt="${escapeHtml(item.label)}"
|
||||
title="${escapeHtml(item.label)}"
|
||||
width="${size}"
|
||||
height="${size}"
|
||||
loading="lazy"
|
||||
/>`,
|
||||
)
|
||||
.join('');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,960 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import http from 'node:http';
|
||||
import { SPECIES_LIST, SPECIES_BY_ID } from '../src/data/species.js';
|
||||
import { getPokemonMoveset, ORAS_MOVES } from '../src/data/movesets.js';
|
||||
import { getExternalLinksForSpecies } from '../src/ui/external-links.js';
|
||||
import { ALPHA_SAPPHIRE_DATA } from '../src/data/games/alpha-sapphire.js';
|
||||
import { ALPHA_SAPPHIRE_TRAINERS_BY_AREA } from '../src/data/games/alpha-sapphire-trainers.js';
|
||||
import { getGame, listGames } from '../src/data/games/index.js';
|
||||
import {
|
||||
createTrackerStore,
|
||||
computeGameProgress,
|
||||
getExclusiveChoiceState,
|
||||
indexGameSpecies,
|
||||
isSpeciesSoloAvailableForGame,
|
||||
} from '../src/state/tracker-store.js';
|
||||
import { renderHeader } from '../src/ui/header.js';
|
||||
import { renderSidebar } from '../src/ui/sidebar.js';
|
||||
import { renderRoutesView } from '../src/ui/routes-view.js';
|
||||
import { renderPokedexView } from '../src/ui/pokedex-view.js';
|
||||
import { renderGuideView } from '../src/ui/guide-view.js';
|
||||
import { renderProfileModal, renderSpeciesModal } from '../src/ui/modal.js';
|
||||
import {
|
||||
extractItemsFromText,
|
||||
getPokemonSpriteUrls,
|
||||
POKEAPI_SPRITES_CDN,
|
||||
setSpriteBaseUrl,
|
||||
} from '../src/ui/sprites.js';
|
||||
import { createStaticServer } from '../server.mjs';
|
||||
|
||||
function createMemoryStorage() {
|
||||
const map = new Map();
|
||||
return {
|
||||
getItem: (k) => (map.has(k) ? map.get(k) : null),
|
||||
setItem: (k, v) => map.set(k, String(v)),
|
||||
removeItem: (k) => map.delete(k),
|
||||
};
|
||||
}
|
||||
|
||||
test('species catalog has unique ids, valid evolvesFrom, and complete Hoenn Dex 1..211', () => {
|
||||
const seenIds = new Set();
|
||||
const seenNatIds = new Set();
|
||||
const hoennNums = new Set();
|
||||
|
||||
for (const sp of SPECIES_LIST) {
|
||||
assert.ok(sp.id && !seenIds.has(sp.id), `Duplicate or empty species id: ${sp.id}`);
|
||||
seenIds.add(sp.id);
|
||||
|
||||
assert.ok(Number.isInteger(sp.natId) && sp.natId > 0 && sp.natId <= 721, `Invalid natId for ${sp.id}: ${sp.natId}`);
|
||||
assert.ok(!seenNatIds.has(sp.natId), `Duplicate natId ${sp.natId} (${sp.id})`);
|
||||
seenNatIds.add(sp.natId);
|
||||
|
||||
if (sp.hoennId !== null) {
|
||||
assert.ok(sp.hoennId >= 1 && sp.hoennId <= 211, `Out of range hoennId ${sp.hoennId} for ${sp.id}`);
|
||||
assert.ok(!hoennNums.has(sp.hoennId), `Duplicate hoennId ${sp.hoennId} (${sp.id})`);
|
||||
hoennNums.add(sp.hoennId);
|
||||
}
|
||||
|
||||
if (sp.evolvesFrom) {
|
||||
assert.ok(SPECIES_BY_ID[sp.evolvesFrom], `Missing evolvesFrom "${sp.evolvesFrom}" on ${sp.id}`);
|
||||
}
|
||||
assert.ok(Array.isArray(sp.types) && sp.types.length > 0, `Missing types on ${sp.id}`);
|
||||
}
|
||||
|
||||
assert.equal(hoennNums.size, 211, 'Hoenn Dex must contain all 211 entries');
|
||||
for (let i = 1; i <= 211; i++) {
|
||||
assert.ok(hoennNums.has(i), `Missing Hoenn Dex #${i}`);
|
||||
}
|
||||
});
|
||||
|
||||
test('Alpha Sapphire and Omega Ruby datasets reference valid species, enforce version exclusives, and cover all solo species', () => {
|
||||
const games = listGames();
|
||||
assert.equal(games.length, 2);
|
||||
|
||||
for (const game of games) {
|
||||
assert.equal(game.sections.length, 10);
|
||||
const forbiddenAvailability = game.id === 'omega-ruby' ? 'as-only' : 'or-only';
|
||||
|
||||
const referenced = new Set();
|
||||
for (const section of game.sections) {
|
||||
assert.ok(section.areas.length > 0, `Section ${section.id} has no areas in ${game.id}`);
|
||||
for (const area of section.areas) {
|
||||
assert.ok(
|
||||
area.groups.length > 0 || (Array.isArray(area.trainers) && area.trainers.length > 0),
|
||||
`Area ${area.id} has neither encounter groups nor trainers in ${game.id}`,
|
||||
);
|
||||
for (const group of area.groups) {
|
||||
assert.ok(group.entries.length > 0, `Group ${area.id}::${group.method} has no entries`);
|
||||
for (const entry of group.entries) {
|
||||
const sp = SPECIES_BY_ID[entry.speciesId];
|
||||
assert.ok(sp, `Unknown speciesId "${entry.speciesId}" in ${area.id}`);
|
||||
assert.notEqual(
|
||||
sp.availability,
|
||||
forbiddenAvailability,
|
||||
`Opposite-version exclusive "${entry.speciesId}" must not appear in ${game.id} (${area.id})`,
|
||||
);
|
||||
assert.ok(entry.rate, `Missing rate for ${entry.speciesId} in ${area.id}`);
|
||||
assert.ok(entry.levels, `Missing levels for ${entry.speciesId} in ${area.id}`);
|
||||
referenced.add(entry.speciesId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const sp of SPECIES_LIST) {
|
||||
if (isSpeciesSoloAvailableForGame(sp, game.id)) {
|
||||
assert.ok(
|
||||
referenced.has(sp.id),
|
||||
`Solo-available ${game.id} species "${sp.id}" (#${sp.natId}) is missing from all sections`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('all section evolutions in both games obey upcoming Gym Leader / Champion level caps and pre-evolution ordering', () => {
|
||||
const expectedCaps = [14, 16, 21, 28, 30, 35, 45, 46, 59, 79];
|
||||
|
||||
for (const game of listGames()) {
|
||||
const { earliestBySpecies } = indexGameSpecies(game);
|
||||
assert.deepEqual(
|
||||
game.sections.map((s) => s.levelCap),
|
||||
expectedCaps,
|
||||
);
|
||||
|
||||
for (const section of game.sections) {
|
||||
for (const area of section.areas) {
|
||||
for (const group of area.groups) {
|
||||
if (group.method !== 'Evolution') continue;
|
||||
for (const entry of group.entries) {
|
||||
const lvlMatch = /^Lv\.\s*(\d+)$/.exec(entry.rate);
|
||||
if (lvlMatch) {
|
||||
assert.ok(
|
||||
Number(lvlMatch[1]) <= section.levelCap,
|
||||
`${game.id}: ${entry.speciesId} (${entry.rate}) exceeds ${section.id} level cap (${section.levelCap})`,
|
||||
);
|
||||
}
|
||||
const sp = SPECIES_BY_ID[entry.speciesId];
|
||||
if (sp?.evolvesFrom) {
|
||||
const pre = earliestBySpecies.get(sp.evolvesFrom);
|
||||
assert.ok(
|
||||
pre && pre.badgeNumber <= section.badgeNumber,
|
||||
`${game.id}: ${entry.speciesId} cannot evolve before ${sp.evolvesFrom} (${pre?.sectionId || 'missing'})`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('exclusive choice locking locks alternative branches once one option is checked and releases when unchecked', () => {
|
||||
const storage = createMemoryStorage();
|
||||
const store = createTrackerStore({ storage });
|
||||
|
||||
// By default (Secret Super Training OFF), Pre-Badge 1 cap Lv. 14 has 20 unlocks while total Solo POC is 410
|
||||
let prog = computeGameProgress(ALPHA_SAPPHIRE_DATA, store.getState().caught, 'solo');
|
||||
assert.equal(prog.sections[0].levelCap, 14);
|
||||
assert.equal(prog.sections[0].newTotal, 20);
|
||||
assert.equal(prog.totalObtainable, 410);
|
||||
assert.equal(store.isSpeciesLocked('treecko'), null);
|
||||
assert.equal(store.isSpeciesLocked('torchic'), null);
|
||||
assert.equal(store.isSpeciesLocked('mudkip'), null);
|
||||
|
||||
// Check Torchic -> locks Treecko & Mudkip lines across sections, keeps Torchic/Combusken/Blaziken unlocked
|
||||
assert.equal(store.toggleCaught('torchic'), true);
|
||||
assert.equal(store.isSpeciesLocked('combusken'), null);
|
||||
assert.equal(store.isSpeciesLocked('blaziken'), null);
|
||||
assert.equal(store.isSpeciesLocked('treecko')?.chosenOption, 'torchic');
|
||||
assert.equal(store.isSpeciesLocked('sceptile')?.chosenOption, 'torchic');
|
||||
assert.equal(store.isSpeciesLocked('mudkip')?.chosenOption, 'torchic');
|
||||
assert.equal(store.isSpeciesLocked('swampert')?.chosenOption, 'torchic');
|
||||
|
||||
// Cannot check locked-out starter
|
||||
assert.equal(store.toggleCaught('mudkip'), false);
|
||||
assert.equal(store.getState().caught.has('mudkip'), false);
|
||||
|
||||
// Fossil exclusive lock works identically
|
||||
assert.equal(store.toggleCaught('anorith'), true);
|
||||
assert.equal(store.isSpeciesLocked('lileep')?.chosenOption, 'claw');
|
||||
assert.equal(store.isSpeciesLocked('cradily')?.chosenOption, 'claw');
|
||||
assert.equal(store.isSpeciesLocked('armaldo'), null);
|
||||
|
||||
// Unchecking Torchic releases the starter lock
|
||||
assert.equal(store.toggleCaught('torchic'), true);
|
||||
assert.equal(store.isSpeciesLocked('mudkip'), null);
|
||||
assert.equal(store.isSpeciesLocked('treecko'), null);
|
||||
|
||||
// Batch check section skips unchosen exclusive group and later-stone evolutions when Super Training is OFF
|
||||
store.setSectionCaught('pre-badge-1', true);
|
||||
assert.equal(store.getState().caught.has('mudkip'), false);
|
||||
assert.equal(store.getState().caught.has('treecko'), false);
|
||||
assert.equal(store.getState().caught.has('torchic'), false);
|
||||
assert.equal(store.getState().caught.has('zigzagoon'), true);
|
||||
assert.equal(store.getState().caught.has('lombre'), true);
|
||||
assert.equal(store.getState().caught.has('ludicolo'), false, 'Water Stone waits for Dive Shards unless Secret Super Training is checked');
|
||||
assert.equal(store.getState().caught.has('exploud'), false, 'Lv. 40 Exploud waits for Pre-Badge 7');
|
||||
|
||||
// Checking Mudkip & batch-checking Pre-Badge 2 (cap Lv. 16) checks Marshtomp, leaving Swampert for Pre-Badge 7
|
||||
store.toggleCaught('mudkip');
|
||||
store.setSectionCaught('pre-badge-2', true);
|
||||
assert.equal(store.getState().caught.has('marshtomp'), true);
|
||||
assert.equal(store.getState().caught.has('swampert'), false);
|
||||
assert.equal(store.getState().caught.has('grovyle'), false);
|
||||
|
||||
// Switching to 'all' ruleset lifts exclusive locks
|
||||
const { lockedBySpecies } = getExclusiveChoiceState(ALPHA_SAPPHIRE_DATA, store.getState().caught, 'all');
|
||||
assert.equal(lockedBySpecies.size, 0);
|
||||
});
|
||||
|
||||
test('store syncs caught species globally, persists to storage, filters, sorts, and imports/exports JSON', () => {
|
||||
const storage = createMemoryStorage();
|
||||
const store = createTrackerStore({ storage });
|
||||
|
||||
store.toggleCaught('zigzagoon');
|
||||
store.toggleCaught('lotad');
|
||||
|
||||
const state = store.getState();
|
||||
assert.equal(state.caught.has('zigzagoon'), true);
|
||||
assert.equal(state.caught.has('lotad'), true);
|
||||
|
||||
// Recreate store from same storage to confirm persistence
|
||||
const restored = createTrackerStore({ storage });
|
||||
assert.equal(restored.getState().caught.has('zigzagoon'), true);
|
||||
assert.equal(restored.getState().caught.has('lotad'), true);
|
||||
|
||||
// Confirm Pokédex rows reflect caught state and solo filtering
|
||||
const soloRows = restored.getPokedexRows();
|
||||
const zigRow = soloRows.find((r) => r.id === 'zigzagoon');
|
||||
assert.equal(zigRow.caught, true);
|
||||
assert.equal(soloRows.some((r) => r.id === 'seedot'), false, 'OR exclusive hidden in solo mode');
|
||||
|
||||
restored.setRuleset('all');
|
||||
const allRows = restored.getPokedexRows();
|
||||
assert.equal(allRows.some((r) => r.id === 'seedot'), true, 'OR exclusive visible in all mode');
|
||||
assert.equal(allRows.some((r) => r.id === 'alakazam'), true, 'Trade evo visible in all mode');
|
||||
|
||||
// Search & uncaughtOnly filter
|
||||
restored.setRuleset('solo');
|
||||
restored.setSearchQuery('Lotad');
|
||||
assert.equal(restored.getPokedexRows().length, 1);
|
||||
restored.setUncaughtOnly(true);
|
||||
assert.equal(restored.getPokedexRows().length, 0);
|
||||
|
||||
// Sorting
|
||||
restored.setUncaughtOnly(false);
|
||||
restored.setSearchQuery('');
|
||||
restored.setPokedexSort('name');
|
||||
const byNameAsc = restored.getPokedexRows();
|
||||
assert.ok(byNameAsc[0].name.localeCompare(byNameAsc[1].name) <= 0);
|
||||
restored.setPokedexSort('name');
|
||||
const byNameDesc = restored.getPokedexRows();
|
||||
assert.ok(byNameDesc[0].name.localeCompare(byNameDesc[1].name) >= 0);
|
||||
|
||||
// Export & Import round-trip
|
||||
const backup = restored.exportJson();
|
||||
restored.resetProgress();
|
||||
assert.equal(restored.getState().caught.size, 0);
|
||||
const importedCount = restored.importJson(backup);
|
||||
assert.equal(importedCount, 2);
|
||||
assert.equal(restored.getState().caught.has('lotad'), true);
|
||||
assert.throws(() => restored.importJson('{"bad": true}'));
|
||||
});
|
||||
|
||||
test('UI views list all starter/fossil choices, show Caught checkboxes, and render locked states cleanly', () => {
|
||||
const store = createTrackerStore({ storage: createMemoryStorage() });
|
||||
store.toggleCaught('mudkip');
|
||||
store.setSelectedSpeciesId('ralts');
|
||||
|
||||
const state = store.getState();
|
||||
const game = store.getGame();
|
||||
const progress = computeGameProgress(game, state.caught, state.ruleset);
|
||||
|
||||
// Check section banner renders Level Cap and UI views render starter/fossil choices
|
||||
const headerHtml = renderHeader(game, state, progress);
|
||||
const sidebarHtml = renderSidebar(game, state, progress);
|
||||
const routesHtml = renderRoutesView(game, state, progress);
|
||||
const pokedexHtml = renderPokedexView(store, state);
|
||||
const guideHtml = renderGuideView(game);
|
||||
const modalHtml = renderSpeciesModal(game, state);
|
||||
|
||||
assert.match(headerHtml, /Pokémon Alpha Sapphire/);
|
||||
assert.match(headerHtml, /Gym Leader \/ Champion level cap/);
|
||||
assert.match(headerHtml, /id="super-training-toggle"/);
|
||||
assert.doesNotMatch(headerHtml, /id="super-training-toggle"\s+checked/);
|
||||
assert.doesNotMatch(headerHtml, /choices-drawer/);
|
||||
assert.match(sidebarHtml, /Pre-Badge 1/);
|
||||
assert.match(sidebarHtml, /Cap Lv\.14/);
|
||||
assert.match(routesHtml, /Level Cap: Lv\. 14/);
|
||||
|
||||
// All 3 starters appear in Route 101 checklist, with Treecko/Torchic locked after Mudkip is checked
|
||||
assert.match(routesHtml, /Treecko/);
|
||||
assert.match(routesHtml, /Torchic/);
|
||||
assert.match(routesHtml, /Mudkip/);
|
||||
assert.match(routesHtml, /encounter-row is-caught/);
|
||||
assert.match(routesHtml, /encounter-row\s+is-locked/);
|
||||
assert.match(routesHtml, /Locked · Mudkip chosen/);
|
||||
assert.match(routesHtml, /type="checkbox"/);
|
||||
|
||||
// Pokédex header reads "Caught" (not "X's") and renders checkboxes
|
||||
assert.match(pokedexHtml, /Caught\s*<span class="sort-arrow/);
|
||||
assert.doesNotMatch(pokedexHtml, />X's/);
|
||||
assert.match(pokedexHtml, /dex-row is-caught/);
|
||||
assert.match(pokedexHtml, /type="checkbox"/);
|
||||
assert.match(pokedexHtml, /items\/water-stone\.png/);
|
||||
|
||||
assert.match(guideHtml, /Secret Super Training/);
|
||||
assert.match(guideHtml, /items\/dawn-stone\.png/);
|
||||
assert.match(modalHtml, /Evolution Family/);
|
||||
assert.match(modalHtml, /Gallade/);
|
||||
assert.match(modalHtml, /Regular/);
|
||||
assert.match(modalHtml, /★ Shiny/);
|
||||
assert.match(modalHtml, /omega-ruby-alpha-sapphire\/280\.png/);
|
||||
assert.match(modalHtml, /omega-ruby-alpha-sapphire\/shiny\/280\.png/);
|
||||
assert.match(modalHtml, /items\/dawn-stone\.png/);
|
||||
});
|
||||
|
||||
test('sprite helpers resolve ORAS regular, shiny, and item URLs with configurable base', () => {
|
||||
setSpriteBaseUrl(POKEAPI_SPRITES_CDN);
|
||||
const reg = getPokemonSpriteUrls(258, { shiny: false });
|
||||
const shn = getPokemonSpriteUrls(258, { shiny: true });
|
||||
assert.equal(
|
||||
reg.primary,
|
||||
'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-vi/omega-ruby-alpha-sapphire/258.png',
|
||||
);
|
||||
assert.equal(
|
||||
reg.fallback,
|
||||
'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/258.png',
|
||||
);
|
||||
assert.equal(
|
||||
shn.primary,
|
||||
'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-vi/omega-ruby-alpha-sapphire/shiny/258.png',
|
||||
);
|
||||
|
||||
const items = extractItemsFromText('Dawn Stone (Male Kirlia) + Sea Incense + Helix Fossil');
|
||||
assert.deepEqual(
|
||||
items.map((i) => i.slug),
|
||||
['dawn-stone', 'sea-incense', 'helix-fossil'],
|
||||
);
|
||||
|
||||
setSpriteBaseUrl('./assets/sprites');
|
||||
assert.equal(getPokemonSpriteUrls(1).fallback, './assets/sprites/pokemon/1.png');
|
||||
setSpriteBaseUrl(POKEAPI_SPRITES_CDN);
|
||||
});
|
||||
|
||||
test('static server serves index.html and rejects traversal', async () => {
|
||||
const server = createStaticServer();
|
||||
await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve));
|
||||
const { port } = server.address();
|
||||
|
||||
try {
|
||||
const res = await fetch(`http://127.0.0.1:${port}/`);
|
||||
assert.equal(res.status, 200);
|
||||
const body = await res.text();
|
||||
assert.match(body, /Alpha Sapphire — Professor Oak Challenge Tracker/);
|
||||
|
||||
const cssRes = await fetch(`http://127.0.0.1:${port}/src/styles/main.css`);
|
||||
assert.equal(cssRes.status, 200);
|
||||
|
||||
const statusRes = await fetch(`http://127.0.0.1:${port}/api/assets-status`);
|
||||
assert.equal(statusRes.status, 200);
|
||||
const statusJson = await statusRes.json();
|
||||
assert.equal(typeof statusJson.hasLocalSprites, 'boolean');
|
||||
|
||||
const rawStatus = await new Promise((resolve, reject) => {
|
||||
const req = http.request(
|
||||
{ host: '127.0.0.1', port, path: '/../package.json', method: 'GET' },
|
||||
(r) => resolve(r.statusCode),
|
||||
);
|
||||
req.on('error', reject);
|
||||
req.end();
|
||||
});
|
||||
assert.equal(rawStatus, 403);
|
||||
} finally {
|
||||
await new Promise((resolve) => server.close(resolve));
|
||||
}
|
||||
});
|
||||
|
||||
test('all Alpha Sapphire sections & routes define valid regular and key trainer battles under route headers', () => {
|
||||
const game = getGame('alpha-sapphire');
|
||||
const seenAreaIds = new Set();
|
||||
const seenTrainerIds = new Set();
|
||||
let regularCount = 0;
|
||||
let keyCount = 0;
|
||||
|
||||
for (const section of game.sections) {
|
||||
let sectionTrainerCount = 0;
|
||||
for (const area of section.areas) {
|
||||
assert.ok(area.id && !seenAreaIds.has(area.id), `Duplicate/empty area id: ${area.id}`);
|
||||
seenAreaIds.add(area.id);
|
||||
assert.ok(Array.isArray(area.trainers), `Area ${area.id} missing trainers array`);
|
||||
|
||||
for (const trainer of area.trainers) {
|
||||
assert.ok(trainer.id && !seenTrainerIds.has(trainer.id), `Duplicate/empty trainer id: ${trainer.id}`);
|
||||
seenTrainerIds.add(trainer.id);
|
||||
assert.ok(trainer.name && trainer.role && trainer.location, `Incomplete metadata on ${trainer.id}`);
|
||||
sectionTrainerCount++;
|
||||
if (trainer.role === 'Trainer') regularCount++;
|
||||
else keyCount++;
|
||||
|
||||
const teams = trainer.starterTeams
|
||||
? [
|
||||
trainer.starterTeams.treecko,
|
||||
trainer.starterTeams.torchic,
|
||||
trainer.starterTeams.mudkip,
|
||||
]
|
||||
: [trainer.team];
|
||||
|
||||
for (const team of teams) {
|
||||
assert.ok(Array.isArray(team) && team.length > 0, `Empty team on trainer ${trainer.id}`);
|
||||
for (const mon of team) {
|
||||
assert.ok(
|
||||
Number.isInteger(mon.natId) && mon.natId > 0 && mon.natId <= 721,
|
||||
`Invalid natId ${mon.natId} on ${trainer.id}`,
|
||||
);
|
||||
assert.ok(
|
||||
Number.isInteger(mon.level) && mon.level > 0 && mon.level <= 100,
|
||||
`Invalid level ${mon.level} on ${trainer.id}`,
|
||||
);
|
||||
assert.ok(mon.name, `Missing Pokémon name on ${trainer.id}`);
|
||||
assert.ok(Array.isArray(mon.types) && mon.types.length > 0, `Missing types for ${mon.name} on ${trainer.id}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
assert.ok(sectionTrainerCount > 0, `Section ${section.id} must have trainers under its areas`);
|
||||
}
|
||||
|
||||
for (const areaId of Object.keys(ALPHA_SAPPHIRE_TRAINERS_BY_AREA)) {
|
||||
assert.ok(seenAreaIds.has(areaId), `Orphaned trainer area key "${areaId}" not found in ALPHA_SAPPHIRE_DATA`);
|
||||
}
|
||||
|
||||
assert.ok(regularCount > 250, `Expected full ORAS regular trainer roster (>250), got ${regularCount}`);
|
||||
assert.ok(keyCount >= 40, `Expected key story/gym/boss battles (>=40), got ${keyCount}`);
|
||||
});
|
||||
|
||||
test('route-level trainer cards start collapsed, expand per route/gym, track defeated state, adapt Rival team, and search cleanly', () => {
|
||||
const storage = createMemoryStorage();
|
||||
const store = createTrackerStore({ storage });
|
||||
const game = store.getGame();
|
||||
|
||||
// Collapsed by default under route & gym headers
|
||||
let state = store.getState();
|
||||
let progress = computeGameProgress(game, state.caught, state.ruleset);
|
||||
assert.equal(progress.totalObtainable, 410);
|
||||
assert.equal(state.expandedTrainerAreas.size, 0);
|
||||
assert.equal(state.defeatedTrainers.size, 0);
|
||||
|
||||
let routesHtml = renderRoutesView(game, state, progress);
|
||||
assert.doesNotMatch(routesHtml, /Key Trainer & Gym Battles/);
|
||||
assert.match(routesHtml, /data-toggle-area-trainers="route-102"[^>]*aria-expanded="false"/);
|
||||
assert.match(routesHtml, /data-toggle-area-trainers="rustboro-gym"[^>]*aria-expanded="false"/);
|
||||
assert.doesNotMatch(routesHtml, /Youngster Calvin/);
|
||||
assert.doesNotMatch(routesHtml, /Gym Leader Roxanne/);
|
||||
|
||||
// Expand Route 102 (regular trainers) & Rustboro City Gym (gym trainers + Roxanne)
|
||||
store.toggleAreaTrainersExpanded('route-102');
|
||||
store.toggleAreaTrainersExpanded('rustboro-gym');
|
||||
store.toggleAreaTrainersExpanded('route-103-land');
|
||||
state = store.getState();
|
||||
progress = computeGameProgress(game, state.caught, state.ruleset);
|
||||
routesHtml = renderRoutesView(game, state, progress);
|
||||
assert.match(routesHtml, /data-toggle-area-trainers="route-102"[^>]*aria-expanded="true"/);
|
||||
assert.match(routesHtml, /Youngster Calvin/);
|
||||
assert.match(routesHtml, /Bug Catcher Rick/);
|
||||
assert.match(routesHtml, /Youngster Josh/);
|
||||
assert.match(routesHtml, /Schoolkid Georgia/);
|
||||
assert.match(routesHtml, /Gym Leader Roxanne/);
|
||||
assert.match(routesHtml, /Nosepass/);
|
||||
assert.match(routesHtml, /Lv\.14/);
|
||||
assert.match(routesHtml, /If Treecko:/);
|
||||
assert.match(routesHtml, /If Torchic:/);
|
||||
assert.match(routesHtml, /If Mudkip:/);
|
||||
|
||||
// Pick Mudkip starter & defeat Roxanne
|
||||
store.toggleCaught('mudkip');
|
||||
store.toggleTrainerDefeated('as-gym-roxanne');
|
||||
state = store.getState();
|
||||
progress = computeGameProgress(game, state.caught, state.ruleset);
|
||||
assert.equal(progress.totalObtainable, 410, 'Trainer defeats must not alter Pokémon POC total');
|
||||
routesHtml = renderRoutesView(game, state, progress);
|
||||
assert.match(routesHtml, /Opponent team for your <strong>Mudkip<\/strong> starter pick:/);
|
||||
assert.doesNotMatch(routesHtml, /If Torchic:/);
|
||||
assert.match(routesHtml, /trainer-battle-card is-defeated/);
|
||||
assert.match(routesHtml, /1 \/ 4 defeated/);
|
||||
assert.match(routesHtml, /<span class="defeated-pill">Defeated<\/span>/);
|
||||
|
||||
// Storage persistence + JSON export/import round-trip
|
||||
const restored = createTrackerStore({ storage });
|
||||
assert.equal(restored.getState().defeatedTrainers.has('as-gym-roxanne'), true);
|
||||
assert.equal(restored.getState().expandedTrainerAreas.has('route-102'), true);
|
||||
|
||||
const backup = restored.exportJson();
|
||||
restored.resetProgress();
|
||||
assert.equal(restored.getState().defeatedTrainers.size, 0);
|
||||
restored.importJson(backup);
|
||||
assert.equal(restored.getState().defeatedTrainers.has('as-gym-roxanne'), true);
|
||||
|
||||
// Searching a wild species keeps trainer drawers collapsed; searching a trainer name auto-expands that route
|
||||
restored.toggleAreaTrainersExpanded('route-102');
|
||||
restored.toggleAreaTrainersExpanded('rustboro-gym');
|
||||
restored.setSearchQuery('Zigzagoon');
|
||||
let searchState = restored.getState();
|
||||
let searchHtml = renderRoutesView(game, searchState, computeGameProgress(game, searchState.caught, searchState.ruleset));
|
||||
assert.match(searchHtml, /data-toggle-area-trainers="route-102"[^>]*aria-expanded="false"/);
|
||||
|
||||
restored.setSearchQuery('Youngster Calvin');
|
||||
searchState = restored.getState();
|
||||
searchHtml = renderRoutesView(game, searchState, computeGameProgress(game, searchState.caught, searchState.ruleset));
|
||||
assert.match(searchHtml, /Youngster Calvin/);
|
||||
assert.match(searchHtml, /data-toggle-area-trainers="route-102"[^>]*aria-expanded="true"/);
|
||||
|
||||
restored.setSearchQuery('Roxanne');
|
||||
searchState = restored.getState();
|
||||
searchHtml = renderRoutesView(game, searchState, computeGameProgress(game, searchState.caught, searchState.ruleset));
|
||||
assert.match(searchHtml, /Gym Leader Roxanne/);
|
||||
assert.match(searchHtml, /data-toggle-area-trainers="rustboro-gym"[^>]*aria-expanded="true"/);
|
||||
});
|
||||
|
||||
test('Omega Ruby dataset defines Team Magma & OR-specific trainers accurately', () => {
|
||||
const game = getGame('omega-ruby');
|
||||
const seenAreaIds = new Set();
|
||||
const seenTrainerIds = new Set();
|
||||
const trainersByArea = new Map();
|
||||
|
||||
for (const section of game.sections) {
|
||||
for (const area of section.areas) {
|
||||
assert.ok(!seenAreaIds.has(area.id), `Duplicate OR area id: ${area.id}`);
|
||||
seenAreaIds.add(area.id);
|
||||
trainersByArea.set(area.id, area.trainers || []);
|
||||
for (const t of area.trainers || []) {
|
||||
assert.ok(!seenTrainerIds.has(t.id), `Duplicate OR trainer id: ${t.id}`);
|
||||
seenTrainerIds.add(t.id);
|
||||
assert.notEqual(t.role, 'Team Aqua', `Found Team Aqua trainer "${t.id}" inside Omega Ruby`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const r115Hector = trainersByArea.get('route-115-north')?.find((t) => t.name === 'Collector Hector');
|
||||
assert.equal(r115Hector?.team?.[0]?.name, 'Seviper');
|
||||
|
||||
const chimney = trainersByArea.get('mt-chimney') || [];
|
||||
assert.ok(chimney.some((t) => t.name === 'Team Magma Leader Maxie'));
|
||||
assert.ok(trainersByArea.has('lilycove-magma-hideout'));
|
||||
assert.ok(trainersByArea.has('delta-magma-hideout'));
|
||||
});
|
||||
|
||||
test('game switcher and multi-save profiles isolate saves per game/profile, migrate legacy saves, and render switcher/modal UI', () => {
|
||||
const storage = createMemoryStorage();
|
||||
// Seed legacy pre-profile Alpha Sapphire save
|
||||
storage.setItem(
|
||||
'poc-tracker:v1:alpha-sapphire',
|
||||
JSON.stringify({ version: 1, gameId: 'alpha-sapphire', caught: ['mudkip'], defeatedTrainers: ['as-gym-roxanne'] }),
|
||||
);
|
||||
|
||||
const store = createTrackerStore({ storage });
|
||||
assert.equal(store.getGame().id, 'alpha-sapphire');
|
||||
assert.equal(store.getActiveProfile().id, 'default');
|
||||
assert.equal(store.getState().caught.has('mudkip'), true);
|
||||
assert.equal(store.getState().defeatedTrainers.has('as-gym-roxanne'), true);
|
||||
|
||||
// Create second Alpha Sapphire profile -> clean save, Save 1 stays intact
|
||||
const second = store.createProfile('Treecko Challenge');
|
||||
assert.equal(store.getState().profileId, second.id);
|
||||
assert.equal(store.getState().caught.size, 0);
|
||||
store.toggleCaught('treecko');
|
||||
assert.equal(store.getState().caught.has('treecko'), true);
|
||||
|
||||
// Swap back to Save 1 -> Mudkip + Roxanne defeat preserved
|
||||
store.switchProfile('default');
|
||||
assert.equal(store.getState().caught.has('mudkip'), true);
|
||||
assert.equal(store.getState().caught.has('treecko'), false);
|
||||
|
||||
// Rename Save 2 and inspect profile counts
|
||||
store.renameProfile(second.id, 'Treecko Speedrun');
|
||||
const profilesWithCounts = store.getProfilesWithCounts();
|
||||
assert.equal(profilesWithCounts.length, 2);
|
||||
assert.equal(profilesWithCounts[1].name, 'Treecko Speedrun');
|
||||
assert.equal(profilesWithCounts[1].caughtCount, 1);
|
||||
|
||||
// Render header & profile modal
|
||||
const asHeader = renderHeader(
|
||||
store.getGame(),
|
||||
store.getState(),
|
||||
computeGameProgress(store.getGame(), store.getState().caught, store.getState().ruleset),
|
||||
profilesWithCounts,
|
||||
);
|
||||
assert.match(asHeader, /data-switch-game="alpha-sapphire"[^>]*aria-pressed="true"/);
|
||||
assert.match(asHeader, /data-switch-game="omega-ruby"/);
|
||||
assert.match(asHeader, /Treecko Speedrun \(1\)/);
|
||||
assert.match(asHeader, /Strict Solo AS Cartridge/);
|
||||
|
||||
store.setProfileModal({ mode: 'create' });
|
||||
const modalHtml = renderProfileModal(store.getGame(), store.getState());
|
||||
assert.match(modalHtml, /New Alpha Sapphire Save Profile/);
|
||||
assert.match(modalHtml, /id="profile-name-input"/);
|
||||
|
||||
// Export AS Save 1 backup
|
||||
const asBackup = store.exportJson();
|
||||
|
||||
// Switch to Omega Ruby mode -> clean independent OR profile + OR encounters + OR trainers
|
||||
store.switchGame('omega-ruby');
|
||||
assert.equal(store.getGame().id, 'omega-ruby');
|
||||
assert.equal(store.getState().caught.size, 0);
|
||||
store.toggleCaught('seedot');
|
||||
store.toggleCaught('latios');
|
||||
assert.equal(store.getState().caught.has('seedot'), true);
|
||||
|
||||
const orProgress = computeGameProgress(store.getGame(), store.getState().caught, store.getState().ruleset);
|
||||
assert.equal(orProgress.totalObtainable, 410);
|
||||
const orHeader = renderHeader(
|
||||
store.getGame(),
|
||||
store.getState(),
|
||||
orProgress,
|
||||
store.getProfilesWithCounts(),
|
||||
);
|
||||
assert.match(orHeader, /Strict Solo OR Cartridge/);
|
||||
assert.match(orHeader, /version-or/);
|
||||
|
||||
// Cross-version JSON import throws cleanly
|
||||
assert.throws(() => store.importJson(asBackup), /Switch versions before importing/);
|
||||
|
||||
// Re-create store from storage without gameId -> remembers active game (Omega Ruby) & saves
|
||||
const reloaded = createTrackerStore({ storage });
|
||||
assert.equal(reloaded.getGame().id, 'omega-ruby');
|
||||
assert.equal(reloaded.getState().caught.has('seedot'), true);
|
||||
|
||||
// Deleting last remaining profile is blocked; switching back to AS allows deleting extra profile
|
||||
assert.equal(reloaded.deleteProfile('default'), false);
|
||||
reloaded.switchGame('alpha-sapphire');
|
||||
assert.equal(reloaded.deleteProfile(second.id), true);
|
||||
assert.equal(reloaded.getState().profiles.length, 1);
|
||||
assert.equal(reloaded.getState().caught.has('mudkip'), true);
|
||||
});
|
||||
|
||||
test('ORAS wild encounters match Serebii Pokearth & Pokedex-XY across routes, caves, Safari Zone, Shoal Cave, Sky Pillar, and Mirage Spots', () => {
|
||||
const areaById = (game, id) => {
|
||||
for (const s of game.sections) {
|
||||
const found = s.areas.find((a) => a.id === id);
|
||||
if (found) return { section: s, area: found };
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const speciesInArea = (game, id) => {
|
||||
const found = areaById(game, id);
|
||||
assert.ok(found, `Missing area "${id}" in ${game.id}`);
|
||||
return new Set(found.area.groups.flatMap((g) => g.entries.map((e) => e.speciesId)));
|
||||
};
|
||||
|
||||
for (const game of listGames()) {
|
||||
// Route 116: Zigzagoon, Whismur, Nincada, Taillow, Skitty — no Abra or Poochyena
|
||||
const r116 = speciesInArea(game, 'route-116');
|
||||
assert.equal(r116.has('abra'), false);
|
||||
assert.equal(r116.has('poochyena'), false);
|
||||
assert.equal(r116.has('taillow'), true);
|
||||
assert.equal(r116.has('skitty'), true);
|
||||
|
||||
// Petalburg Woods: both Silcoon and Cascoon in both games, no Poochyena
|
||||
const woods = speciesInArea(game, 'petalburg-woods');
|
||||
assert.equal(woods.has('silcoon'), true);
|
||||
assert.equal(woods.has('cascoon'), true);
|
||||
assert.equal(woods.has('poochyena'), false);
|
||||
|
||||
// Route 104 South & North: no Poochyena
|
||||
assert.equal(speciesInArea(game, 'route-104-south').has('poochyena'), false);
|
||||
assert.equal(speciesInArea(game, 'route-104-north').has('poochyena'), false);
|
||||
|
||||
// Granite Cave 1F (Pre-Badge 2) has Abra; B1F/B2F (Mach Bike -> Pre-Badge 3) has Aron & Sableye/Mawile
|
||||
const gc1f = areaById(game, 'granite-cave');
|
||||
assert.equal(gc1f.section.id, 'pre-badge-2');
|
||||
assert.equal(speciesInArea(game, 'granite-cave').has('abra'), true);
|
||||
assert.equal(speciesInArea(game, 'granite-cave').has('aron'), false);
|
||||
|
||||
const gcBasement = areaById(game, 'granite-cave-basement');
|
||||
assert.equal(gcBasement.section.id, 'pre-badge-3');
|
||||
const gcBaseSpecies = speciesInArea(game, 'granite-cave-basement');
|
||||
assert.equal(gcBaseSpecies.has('aron'), true);
|
||||
assert.equal(gcBaseSpecies.has(game.id === 'omega-ruby' ? 'mawile' : 'sableye'), true);
|
||||
|
||||
// Jagged Pass has no Koffing; Route 111 Desert Horde is Sandshrew-only
|
||||
assert.equal(speciesInArea(game, 'jagged-pass').has('koffing'), false);
|
||||
const desertHorde = areaById(game, 'route-111-desert').area.groups.find((g) => g.method === 'Horde');
|
||||
assert.deepEqual(desertHorde.entries.map((e) => e.speciesId), ['sandshrew']);
|
||||
|
||||
// Safari Zone has Donphan, Wobbuffet, Xatu, Seaking; Natu & Phanpy are bred in Pre-Badge 7
|
||||
const safari = speciesInArea(game, 'safari-zone');
|
||||
assert.equal(safari.has('donphan'), true);
|
||||
assert.equal(safari.has('wobbuffet'), true);
|
||||
assert.equal(safari.has('xatu'), true);
|
||||
assert.equal(safari.has('seaking'), true);
|
||||
assert.equal(safari.has('natu'), false);
|
||||
assert.equal(safari.has('phanpy'), false);
|
||||
|
||||
const b7Evos = speciesInArea(game, 'pre-badge-7-evolutions');
|
||||
assert.equal(b7Evos.has('natu'), true);
|
||||
assert.equal(b7Evos.has('phanpy'), true);
|
||||
assert.equal(b7Evos.has('glalie'), true);
|
||||
|
||||
// Shoal Cave has no wild Glalie
|
||||
assert.equal(speciesInArea(game, 'shoal-cave').has('glalie'), false);
|
||||
|
||||
// Sky Pillar Walking has Claydol + version-exclusive Sableye/Mawile; Horde has Golbat, Ariados, Swablu
|
||||
const sky = areaById(game, 'sky-pillar-delta').area;
|
||||
const skyWalk = new Set(sky.groups.find((g) => g.method === 'Walking').entries.map((e) => e.speciesId));
|
||||
const skyHorde = new Set(sky.groups.find((g) => g.method === 'Horde').entries.map((e) => e.speciesId));
|
||||
assert.equal(skyWalk.has('claydol'), true);
|
||||
assert.equal(skyWalk.has(game.id === 'omega-ruby' ? 'mawile' : 'sableye'), true);
|
||||
assert.equal(skyHorde.has('swablu'), true);
|
||||
assert.equal(skyHorde.has('sableye'), false);
|
||||
assert.equal(skyHorde.has('mawile'), false);
|
||||
|
||||
// Mirage Island Rock Smash Binacle + Barbaracle Lv. 39 are included
|
||||
assert.equal(speciesInArea(game, 'mirage-spots').has('binacle'), true);
|
||||
assert.equal(speciesInArea(game, 'pre-badge-8-breeding-evos').has('barbaracle'), true);
|
||||
}
|
||||
|
||||
// Omega Ruby swaps Route 110 Minun, Route 117 Illumise (20%), and Fiery Path Koffing Horde
|
||||
const orGame = getGame('omega-ruby');
|
||||
const or110Walk = orGame.sections[2].areas.find((a) => a.id === 'route-110').groups[0].entries;
|
||||
assert.equal(or110Walk.some((e) => e.speciesId === 'minun' && e.rate === '16%'), true);
|
||||
const or117Walk = orGame.sections[2].areas.find((a) => a.id === 'route-117').groups[0].entries;
|
||||
assert.equal(or117Walk.some((e) => e.speciesId === 'illumise' && e.rate === '20%'), true);
|
||||
const orFieryHorde = orGame.sections[3].areas.find((a) => a.id === 'fiery-path').groups[1].entries;
|
||||
assert.equal(orFieryHorde.some((e) => e.speciesId === 'koffing'), true);
|
||||
|
||||
// X&Y-only species (Caterpie, Mareep, Hoppip, Wooper lines) are excluded from ORAS catalog
|
||||
for (const xyOnly of ['caterpie', 'butterfree', 'mareep', 'ampharos', 'hoppip', 'jumpluff', 'wooper', 'quagsire']) {
|
||||
assert.equal(SPECIES_BY_ID[xyOnly], undefined, `${xyOnly} is X&Y-only and must not be in ORAS catalog`);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
test('optional Secret Super Training flag shifts stone evolutions between overworld pickups and minigame unlocks per save profile', () => {
|
||||
const storage = createMemoryStorage();
|
||||
const store = createTrackerStore({ storage });
|
||||
|
||||
// Default: Secret Super Training is OFF
|
||||
assert.equal(store.getState().includeSuperTraining, false);
|
||||
const asOff = store.getGame();
|
||||
assert.equal(asOff.includeSuperTraining, false);
|
||||
assert.equal(computeGameProgress(asOff, new Set(), 'solo').totalObtainable, 410);
|
||||
|
||||
const asOffEarliest = indexGameSpecies(asOff).earliestBySpecies;
|
||||
assert.equal(asOffEarliest.get('delcatty')?.sectionId, 'pre-badge-4');
|
||||
assert.equal(asOffEarliest.get('vileplume')?.sectionId, 'pre-badge-6');
|
||||
assert.equal(asOffEarliest.get('bellossom')?.sectionId, 'pre-badge-7');
|
||||
assert.equal(asOffEarliest.get('roserade')?.sectionId, 'pre-badge-7');
|
||||
assert.equal(asOffEarliest.get('ludicolo')?.sectionId, 'pre-badge-8');
|
||||
assert.equal(asOffEarliest.get('raichu')?.sectionId, 'pre-badge-8');
|
||||
assert.equal(asOffEarliest.get('starmie')?.sectionId, 'pre-badge-8');
|
||||
assert.equal(asOffEarliest.get('gallade')?.sectionId, 'pre-elite-4');
|
||||
assert.equal(asOffEarliest.get('froslass')?.sectionId, 'pre-elite-4');
|
||||
|
||||
// Omega Ruby uses Route 119 Leaf Stone for Shiftry in Pre-Badge 6 and Route 124 Green Shard for Vileplume in Pre-Badge 8
|
||||
const orOff = getGame('omega-ruby', { includeSuperTraining: false });
|
||||
assert.equal(computeGameProgress(orOff, new Set(), 'solo').totalObtainable, 410);
|
||||
const orOffEarliest = indexGameSpecies(orOff).earliestBySpecies;
|
||||
assert.equal(orOffEarliest.get('delcatty')?.sectionId, 'pre-badge-4');
|
||||
assert.equal(orOffEarliest.get('shiftry')?.sectionId, 'pre-badge-6');
|
||||
assert.equal(orOffEarliest.get('vileplume')?.sectionId, 'pre-badge-8');
|
||||
assert.equal(orOffEarliest.get('gallade')?.sectionId, 'pre-elite-4');
|
||||
|
||||
// Guide view states Secret Super Training is OFF
|
||||
const guideOffHtml = renderGuideView(asOff);
|
||||
assert.match(guideOffHtml, /Secret Super Training is currently OFF/);
|
||||
|
||||
// Create a second save profile and enable Secret Super Training only on that save
|
||||
const sstProfile = store.createProfile('Super Training Run');
|
||||
assert.equal(store.getState().includeSuperTraining, false);
|
||||
store.setIncludeSuperTraining(true);
|
||||
assert.equal(store.getState().includeSuperTraining, true);
|
||||
|
||||
const asOn = store.getGame();
|
||||
assert.equal(asOn.includeSuperTraining, true);
|
||||
assert.equal(computeGameProgress(asOn, new Set(), 'solo').totalObtainable, 410);
|
||||
const asOnProg = computeGameProgress(asOn, new Set(), 'solo');
|
||||
assert.equal(asOnProg.sections[0].newTotal, 22);
|
||||
|
||||
const asOnEarliest = indexGameSpecies(asOn).earliestBySpecies;
|
||||
assert.equal(asOnEarliest.get('ludicolo')?.sectionId, 'pre-badge-1');
|
||||
assert.equal(asOnEarliest.get('delcatty')?.sectionId, 'pre-badge-1');
|
||||
assert.equal(asOnEarliest.get('gallade')?.sectionId, 'pre-badge-3');
|
||||
assert.equal(asOnEarliest.get('vileplume')?.sectionId, 'pre-badge-3');
|
||||
assert.equal(asOnEarliest.get('bellossom')?.sectionId, 'pre-badge-3');
|
||||
assert.equal(asOnEarliest.get('roserade')?.sectionId, 'pre-badge-3');
|
||||
assert.equal(asOnEarliest.get('raichu')?.sectionId, 'pre-badge-7');
|
||||
assert.equal(asOnEarliest.get('starmie')?.sectionId, 'pre-badge-7');
|
||||
assert.equal(asOnEarliest.get('froslass')?.sectionId, 'pre-badge-7');
|
||||
|
||||
const orOn = getGame('omega-ruby', { includeSuperTraining: true });
|
||||
assert.equal(computeGameProgress(orOn, new Set(), 'solo').totalObtainable, 410);
|
||||
assert.equal(indexGameSpecies(orOn).earliestBySpecies.get('shiftry')?.sectionId, 'pre-badge-1');
|
||||
|
||||
// Batch check Pre-Badge 1 when Secret Super Training is ON includes Ludicolo & Delcatty
|
||||
store.setSectionCaught('pre-badge-1', true);
|
||||
assert.equal(store.getState().caught.has('ludicolo'), true);
|
||||
assert.equal(store.getState().caught.has('delcatty'), true);
|
||||
|
||||
// Header checkbox renders checked & Guide reflects ON state
|
||||
const headerOnHtml = renderHeader(asOn, store.getState(), computeGameProgress(asOn, store.getState().caught, 'solo'));
|
||||
const guideOnHtml = renderGuideView(asOn);
|
||||
assert.match(headerOnHtml, /id="super-training-toggle" checked/);
|
||||
assert.match(guideOnHtml, /Secret Super Training is ON\./);
|
||||
|
||||
// Switching back to Save 1 restores Secret Super Training = false independently
|
||||
store.switchProfile('default');
|
||||
assert.equal(store.getState().includeSuperTraining, false);
|
||||
|
||||
// Reloading store and JSON export/import both persist includeSuperTraining
|
||||
store.switchProfile(sstProfile.id);
|
||||
const backup = store.exportJson();
|
||||
assert.equal(JSON.parse(backup).includeSuperTraining, true);
|
||||
|
||||
const reloaded = createTrackerStore({ storage });
|
||||
assert.equal(reloaded.getState().includeSuperTraining, true);
|
||||
reloaded.switchProfile('default');
|
||||
assert.equal(reloaded.getState().includeSuperTraining, false);
|
||||
reloaded.importJson(backup);
|
||||
assert.equal(reloaded.getState().includeSuperTraining, true);
|
||||
});
|
||||
|
||||
|
||||
test('ORAS Movedex covers all 478 species with Gen 6 stats, sorted TM/HMs, and renders tabs & filter in modal', () => {
|
||||
const validCategories = new Set(['Physical', 'Special', 'Status']);
|
||||
for (const sp of SPECIES_LIST) {
|
||||
const ms = getPokemonMoveset(sp.natId);
|
||||
assert.ok(ms.totalUniqueMoves > 0, `Expected moveset for ${sp.name} (#${sp.natId})`);
|
||||
for (const m of [...ms.levelUp, ...ms.machine, ...ms.tutor, ...ms.egg]) {
|
||||
assert.ok(m.name && m.type, `Move missing name/type on ${sp.name}`);
|
||||
assert.ok(validCategories.has(m.category), `Invalid move category "${m.category}" on ${m.name}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Verify Gen 6 ORAS stats via move_changelog restoration (Tackle 50 power, Leech Life 20 power)
|
||||
assert.equal(ORAS_MOVES[33][3], 50);
|
||||
assert.equal(ORAS_MOVES[141][3], 20);
|
||||
|
||||
// Verify Mudkip TMs sort numerically (TM06..TM100 then HM01..HM07) & Pichu preserves Volt Tackle (Light Ball)
|
||||
const mudkipMoves = getPokemonMoveset(258);
|
||||
const tmNums = mudkipMoves.machine.filter((m) => m.machine.startsWith('TM')).map((m) => Number(m.machine.slice(2)));
|
||||
assert.deepEqual(
|
||||
tmNums,
|
||||
[...tmNums].sort((a, b) => a - b),
|
||||
);
|
||||
const firstHmIdx = mudkipMoves.machine.findIndex((m) => m.machine.startsWith('HM'));
|
||||
assert.ok(firstHmIdx > 0 && mudkipMoves.machine.slice(firstHmIdx).every((m) => m.machine.startsWith('HM')));
|
||||
assert.equal(
|
||||
getPokemonMoveset(172).egg.some((m) => m.name === 'Volt Tackle' && m.note === 'Volt Tackle (Light Ball)'),
|
||||
true,
|
||||
);
|
||||
|
||||
// Modal renders ORAS Movedex section, switches tabs cleanly, and filters moves
|
||||
const store = createTrackerStore({ storage: createMemoryStorage() });
|
||||
store.setSelectedSpeciesId('mudkip');
|
||||
let modalHtml = renderSpeciesModal(store.getGame(), store.getState());
|
||||
assert.match(modalHtml, new RegExp(`ORAS Movedex \\(${mudkipMoves.totalUniqueMoves} moves\\)`));
|
||||
assert.match(modalHtml, /Level-Up <span class="movedex-tab-count">\(13\)<\/span>/);
|
||||
assert.match(modalHtml, /TM \/ HM <span class="movedex-tab-count">\(30\)<\/span>/);
|
||||
assert.match(modalHtml, /Water Gun/);
|
||||
assert.doesNotMatch(modalHtml, /TM06/);
|
||||
|
||||
store.setMovedexTab('machine');
|
||||
modalHtml = renderSpeciesModal(store.getGame(), store.getState());
|
||||
assert.match(modalHtml, /TM06/);
|
||||
assert.match(modalHtml, /HM03/);
|
||||
assert.match(modalHtml, /Surf/);
|
||||
|
||||
store.setMovedexSearch('waterfall');
|
||||
modalHtml = renderSpeciesModal(store.getGame(), store.getState());
|
||||
assert.match(modalHtml, /HM05/);
|
||||
assert.match(modalHtml, /Waterfall/);
|
||||
assert.doesNotMatch(modalHtml, /TM06/);
|
||||
|
||||
// Non-matching search in current tab offers jump link to All Moves when another tab matches
|
||||
store.setMovedexSearch('hydro pump');
|
||||
modalHtml = renderSpeciesModal(store.getGame(), store.getState());
|
||||
assert.match(modalHtml, /View 1 match in All Moves/);
|
||||
});
|
||||
|
||||
test('external guide arrow trigger and popup menu generate Serebii, Bulbapedia, PokemonDB, and Smogon links in Pokedex and Modal', () => {
|
||||
const hoOhLinks = getExternalLinksForSpecies(SPECIES_BY_ID['ho-oh']);
|
||||
assert.deepEqual(
|
||||
hoOhLinks.map((l) => l.id),
|
||||
['serebii', 'bulbapedia', 'pokemondb', 'smogon'],
|
||||
);
|
||||
assert.equal(hoOhLinks[0].url, 'https://www.serebii.net/pokedex-xy/250.shtml');
|
||||
assert.equal(hoOhLinks[1].url, 'https://bulbapedia.bulbagarden.net/wiki/Ho-Oh_(Pok%C3%A9mon)');
|
||||
assert.equal(hoOhLinks[2].url, 'https://pokemondb.net/pokedex/ho-oh');
|
||||
assert.equal(hoOhLinks[3].url, 'https://www.smogon.com/dex/xy/pokemon/ho-oh/');
|
||||
|
||||
const store = createTrackerStore({ storage: createMemoryStorage() });
|
||||
|
||||
// Pokédex table renders closed arrow trigger by default, then opens popup menu when toggled
|
||||
let dexHtml = renderPokedexView(store, store.getState());
|
||||
assert.match(dexHtml, /data-open-ext-menu="mudkip"/);
|
||||
assert.doesNotMatch(dexHtml, /data-ext-menu-panel="mudkip"/);
|
||||
|
||||
store.toggleExternalMenu('mudkip', 'pokedex');
|
||||
dexHtml = renderPokedexView(store, store.getState());
|
||||
assert.match(dexHtml, /data-ext-menu-panel="mudkip"/);
|
||||
assert.match(dexHtml, /https:\/\/www\.serebii\.net\/pokedex-xy\/258\.shtml/);
|
||||
assert.match(dexHtml, /https:\/\/bulbapedia\.bulbagarden\.net\/wiki\/Mudkip_\(Pok%C3%A9mon\)/);
|
||||
assert.match(dexHtml, /https:\/\/pokemondb\.net\/pokedex\/mudkip/);
|
||||
assert.match(dexHtml, /https:\/\/www\.smogon\.com\/dex\/xy\/pokemon\/mudkip\//);
|
||||
|
||||
// Clicking same trigger closes menu cleanly
|
||||
store.toggleExternalMenu('mudkip', 'pokedex');
|
||||
assert.equal(store.getState().openExternalMenu, null);
|
||||
|
||||
// Species modal header also exposes the external links popup
|
||||
store.setSelectedSpeciesId('porygon-z');
|
||||
store.toggleExternalMenu('porygon-z', 'modal');
|
||||
const modalHtml = renderSpeciesModal(store.getGame(), store.getState());
|
||||
assert.match(modalHtml, /data-ext-menu-panel="porygon-z"[\s\S]*?data-ext-context="modal"/);
|
||||
assert.match(modalHtml, /https:\/\/www\.serebii\.net\/pokedex-xy\/474\.shtml/);
|
||||
assert.match(modalHtml, /https:\/\/bulbapedia\.bulbagarden\.net\/wiki\/Porygon-Z_\(Pok%C3%A9mon\)/);
|
||||
});
|
||||
|
||||
test('ORAS checklist renders sprites and type pills, and Pokedex tab & modal show authentic Gen 6 stats', () => {
|
||||
// All 478 ORAS species have valid Gen 6 baseStats & abilities
|
||||
for (const sp of SPECIES_LIST) {
|
||||
assert.ok(sp.baseStats, `Missing baseStats on ${sp.id}`);
|
||||
const { hp, atk, def, spa, spd, spe, total } = sp.baseStats;
|
||||
assert.equal(hp + atk + def + spa + spd + spe, total, `BST mismatch on ${sp.id}`);
|
||||
assert.ok(Array.isArray(sp.abilities) && sp.abilities.length > 0, `Missing abilities on ${sp.id}`);
|
||||
}
|
||||
assert.equal(SPECIES_BY_ID.swellow.baseStats.spa, 50);
|
||||
assert.equal(SPECIES_BY_ID.swellow.baseStats.total, 430);
|
||||
assert.equal(SPECIES_BY_ID.pelipper.baseStats.spa, 85);
|
||||
|
||||
const store = createTrackerStore({ storage: createMemoryStorage() });
|
||||
const game = store.getGame();
|
||||
const state = store.getState();
|
||||
const progress = computeGameProgress(game, state.caught, state.ruleset);
|
||||
|
||||
// Main checklist rows include mini sprite + inline type pill(s)
|
||||
const routesHtml = renderRoutesView(game, state, progress);
|
||||
assert.match(routesHtml, /class="pkmn-mini-sprite"[^>]*src="[^"]*\/261\.png"/);
|
||||
assert.match(routesHtml, /class="inline-types">[\s\S]*?<span class="type-pill type-dark">Dark<\/span>/);
|
||||
|
||||
// Pokédex tab displays Gen 6 Base Stats & BST and supports sorting by bst
|
||||
const dexHtml = renderPokedexView(store, store.getState());
|
||||
assert.match(dexHtml, /data-sort-col="bst"/);
|
||||
assert.match(dexHtml, /class="dex-bst-pill">430<\/span>/);
|
||||
|
||||
store.setPokedexSort('bst'); // asc -> lowest BST first (Sunkern 180)
|
||||
const sortedAsc = store.getPokedexRows();
|
||||
assert.ok(sortedAsc[0].baseStats.total <= sortedAsc[1].baseStats.total);
|
||||
store.setPokedexSort('bst'); // desc -> highest BST first (Slaking / Kyogre / Groudon / Rayquaza >= 670)
|
||||
const sortedDesc = store.getPokedexRows();
|
||||
assert.ok(sortedDesc[0].baseStats.total >= 670);
|
||||
|
||||
// Pokédex detail modal displays Base Stats (BST), Abilities, and 6 colored stat bars
|
||||
store.setSelectedSpeciesId('swellow');
|
||||
const modalHtml = renderSpeciesModal(store.getGame(), store.getState());
|
||||
assert.match(modalHtml, /Base Stats \(BST 430\)/);
|
||||
assert.match(modalHtml, /Scrappy \(HA\)/);
|
||||
assert.equal((modalHtml.match(/class="stat-bar-row"/g) || []).length, 6);
|
||||
});
|
||||
Reference in new issue
Block a user