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/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/classifier.ts b/stats/src/classifier.ts index 820adac..fbcfccb 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; } @@ -278,8 +278,9 @@ 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)) || + (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) @@ -426,7 +427,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', 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([]); + }); +});