From d7b2325a20aa5c81fce3509927836e135a0d706c Mon Sep 17 00:00:00 2001 From: larry-the-table-guy <180724454+larry-the-table-guy@users.noreply.github.com> Date: Sun, 26 Jan 2025 22:45:19 -0500 Subject: [PATCH 1/4] Stats: Fix typos in IDs in `classifier` --- stats/src/classifier.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stats/src/classifier.ts b/stats/src/classifier.ts index 820adac..13a6753 100644 --- a/stats/src/classifier.ts +++ b/stats/src/classifier.ts @@ -229,7 +229,7 @@ function tag( weather.sun += 2; } else if (pokemon.ability === 'sandstream') { weather.sand += 2; - } else if (pokemon.ability === 'snowarning') { + } else if (pokemon.ability === 'snowwarning') { weather.hail += 2; } @@ -426,7 +426,7 @@ const LESSER_BOOSTING_ITEM = new Set([ ]); const GREATER_BOOSTING_ITEM = new Set([ - 'firegem', 'watergem', 'electricgem', 'grassgem', 'icegem', 'fightinggem', 'posiongem', + 'firegem', 'watergem', 'electricgem', 'grassgem', 'icegem', 'fightinggem', 'poisongem', 'groundgem', 'flyinggem', 'psychicgem', 'buggem', 'rockgem', 'ghostgem', 'darkgem', 'steelgem', 'normalgem', 'focussash', 'mentalherb', 'powerherb', 'whiteherb', 'absorbbulb', 'berserkgene', 'cellbattery', 'focussash', 'airballoon', 'ejectbutton', 'shedshell', 'aguavberry', From 562bbf4c7308641d42cbd6375c06c61f0e59e042 Mon Sep 17 00:00:00 2001 From: larry-the-table-guy <180724454+larry-the-table-guy@users.noreply.github.com> Date: Wed, 29 Jan 2025 00:28:40 -0500 Subject: [PATCH 2/4] Use constants for trapping abilities and moves Fixes typo in 'arentrap' and adds missing 'pursuit' element. --- stats/src/classifier.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stats/src/classifier.ts b/stats/src/classifier.ts index 13a6753..9ee797e 100644 --- a/stats/src/classifier.ts +++ b/stats/src/classifier.ts @@ -278,8 +278,8 @@ function tag( ) { style.voltturn++; } - if ((style.trappers < 3 && ['magnetpull', 'arentrap', 'shadowtag'].includes(pokemon.ability)) || - pokemon.moves.some((m: ID) => ['block', 'meanlook', 'spiderweb'].includes(m))) { + if ((style.trappers < 3 && TRAPPING_ABILITIES.has(pokemon.ability)) || + pokemon.moves.some((m: ID) => TRAPPING_MOVES.has(m))) { style.trappers++; } if (style.dragons < 2 && legacy ? DRAGONS.has(pokemon.species) From cab32893a707b29eb1e27107c7b95b3349165421 Mon Sep 17 00:00:00 2001 From: larry-the-table-guy <180724454+larry-the-table-guy@users.noreply.github.com> Date: Thu, 30 Jan 2025 00:13:15 -0500 Subject: [PATCH 3/4] Fix invalid IDs in `aliases.json` and add test --- stats/src/aliases.json | 6 +++--- stats/src/test/util.test.ts | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 stats/src/test/util.test.ts diff --git a/stats/src/aliases.json b/stats/src/aliases.json index 629ba8c..8aedccd 100644 --- a/stats/src/aliases.json +++ b/stats/src/aliases.json @@ -1,6 +1,6 @@ { "aegislashblade":"aegislash", - "agirudaa":"acceldor", + "agirudaa":"accelgor", "alcremiecaramel":"alcremie", "alcremiecaramelswirl":"alcremie", "alcremielemon":"alcremie", @@ -78,7 +78,7 @@ "genesectshock":"genesect", "giratinao":"giratinaorigin", "gourgeistaverage":"gourgeist", - "jarooda":"sperperior", + "jarooda":"serperior", "keldeor":"keldeo", "keldeoresolute":"keldeo", "keldeoresolution":"keldeo", @@ -141,7 +141,7 @@ "polteageistantique":"polteageist", "pory2":"porygon2", "poryz":"porygonz", - "pumpkabooaverage":"pumkaboo", + "pumpkabooaverage":"pumpkaboo", "pz":"porygonz", "randorosu":"landorus", "rank":"reuniclus", diff --git a/stats/src/test/util.test.ts b/stats/src/test/util.test.ts new file mode 100644 index 0000000..33d0ee4 --- /dev/null +++ b/stats/src/test/util.test.ts @@ -0,0 +1,13 @@ +import {Dex} from '@pkmn/dex'; + +import aliases from '../aliases.json'; + +describe('Utils', () => { + test('ALIASES', () => { + const gen = Dex.forGen(9); + + // Aliased IDs that don't correspond to an actual Pokemon (none) + expect(Object.values(aliases).filter(id => !gen.species.get(id).exists)) + .toEqual([]); + }); +}); From 23788aea41b0f01de4fb288c89a331aa6a8cbb50 Mon Sep 17 00:00:00 2001 From: larry-the-table-guy <180724454+larry-the-table-guy@users.noreply.github.com> Date: Fri, 31 Jan 2025 00:02:28 -0500 Subject: [PATCH 4/4] Gate and document `pursuit` as a trapping move in `tag` --- stats/CHANGES.md | 4 +++- stats/src/classifier.ts | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/stats/CHANGES.md b/stats/CHANGES.md index b5eca7b..e43dbe4 100644 --- a/stats/CHANGES.md +++ b/stats/CHANGES.md @@ -51,7 +51,9 @@ quirks that have been corrected by `@pkmn/stats` unless "legacy" mode is opted i 'setup' moves, 'dragon' Pokémon, battle formes etc which include several notable absences (Darmanitan-Zen and Meloetta-Piroutte are not considered formes, Kommo-o is not considered a 'dragon') and have not been updated for Generation 8. `@pkmn/stats` instead computes these lists - programmatically from the data files to ensure they are comphrensive and up to date. + programmatically from the data files to ensure they are comprehensive and up to date. +- Smogon-Usage-Stats groups `pursuit` with other trapping moves when computing `stalliness`, but + excludes it when tagging Pokémon as trappers. `@pkmn/stats` includes it. - `Nidoran-M` is displayed in reports as `NidoranM`, `Nidroran-F` as `NidoranF` and `Flabébé` as `Flabebe` in Smogon-Usage-Stats whereas these **names display** correctly in `@pkmn/stats`. - The **'`empty'`** internal placeholder value is filtered out of reports and stats update logic by diff --git a/stats/src/classifier.ts b/stats/src/classifier.ts index 9ee797e..fbcfccb 100644 --- a/stats/src/classifier.ts +++ b/stats/src/classifier.ts @@ -279,7 +279,8 @@ function tag( style.voltturn++; } if ((style.trappers < 3 && TRAPPING_ABILITIES.has(pokemon.ability)) || - pokemon.moves.some((m: ID) => TRAPPING_MOVES.has(m))) { + (legacy ? pokemon.moves.some((m: ID) => ['block', 'meanlook', 'spiderweb'].includes(m)) + : pokemon.moves.some((m: ID) => TRAPPING_MOVES.has(m)))) { style.trappers++; } if (style.dragons < 2 && legacy ? DRAGONS.has(pokemon.species)