Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion stats/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stats/src/aliases.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"aegislashblade":"aegislash",
"agirudaa":"acceldor",
"agirudaa":"accelgor",
"alcremiecaramel":"alcremie",
"alcremiecaramelswirl":"alcremie",
"alcremielemon":"alcremie",
Expand Down Expand Up @@ -78,7 +78,7 @@
"genesectshock":"genesect",
"giratinao":"giratinaorigin",
"gourgeistaverage":"gourgeist",
"jarooda":"sperperior",
"jarooda":"serperior",
"keldeor":"keldeo",
"keldeoresolute":"keldeo",
"keldeoresolution":"keldeo",
Expand Down Expand Up @@ -141,7 +141,7 @@
"polteageistantique":"polteageist",
"pory2":"porygon2",
"poryz":"porygonz",
"pumpkabooaverage":"pumkaboo",
"pumpkabooaverage":"pumpkaboo",
"pz":"porygonz",
"randorosu":"landorus",
"rank":"reuniclus",
Expand Down
9 changes: 5 additions & 4 deletions stats/src/classifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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',
Expand Down
13 changes: 13 additions & 0 deletions stats/src/test/util.test.ts
Original file line number Diff line number Diff line change
@@ -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([]);
});
});