Skip to content

Commit

Permalink
Fix Rockruff-Dusk's Pokédex entry (#10871)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrebastosdias authored Feb 10, 2025
1 parent 8994a46 commit 920a0e0
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 19 deletions.
3 changes: 0 additions & 3 deletions data/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,6 @@ export const Aliases: import('../sim/dex').AliasesTable = {
ogerpontealmask: "Ogerpon",
terapagosbaby: "Terapagos",

// event formes
rockruffdusk: "Rockruff",

// totem formes
raticatet: "Raticate-Alola-Totem",
totemalolanraticate: "Raticate-Alola-Totem",
Expand Down
21 changes: 18 additions & 3 deletions data/pokedex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13277,9 +13277,24 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = {
heightm: 0.5,
weightkg: 9.2,
color: "Brown",
evos: ["Lycanroc", "Lycanroc-Midnight", "Lycanroc-Dusk"],
evos: ["Lycanroc", "Lycanroc-Midnight"],
eggGroups: ["Field"],
otherFormes: ["Rockruff-Dusk"],
formeOrder: ["Rockruff", "Rockruff-Dusk"],
},
rockruffdusk: {
num: 744,
name: "Rockruff-Dusk",
baseSpecies: "Rockruff",
forme: "Dusk",
types: ["Rock"],
baseStats: {hp: 45, atk: 65, def: 40, spa: 30, spd: 40, spe: 60},
abilities: {0: "Own Tempo"},
heightm: 0.5,
weightkg: 9.2,
color: "Brown",
evos: ["Lycanroc-Dusk"],
eggGroups: ["Field"],
formeOrder: ["Rockruff", "Rockruff"], // TODO: Rockruff-Dusk
},
lycanroc: {
num: 745,
Expand Down Expand Up @@ -13325,7 +13340,7 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = {
heightm: 0.8,
weightkg: 25,
color: "Brown",
prevo: "Rockruff",
prevo: "Rockruff-Dusk",
evoLevel: 25,
evoCondition: "from a special Rockruff during the evening",
eggGroups: ["Field"],
Expand Down
4 changes: 1 addition & 3 deletions sim/dex-species.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export class DexSpecies {

if (this.dex.data.Aliases.hasOwnProperty(id)) {
if (this.dex.data.FormatsData.hasOwnProperty(id)) {
// special event ID, like Rockruff-Dusk
// special event ID
const baseId = toID(this.dex.data.Aliases[id]);
species = new Species({
...this.dex.data.Pokedex[baseId],
Expand Down Expand Up @@ -707,8 +707,6 @@ export class DexSpecies {
// Greninja-Ash
if (['Gastrodon', 'Pumpkaboo', 'Sinistea', 'Tatsugiri'].includes(species.baseSpecies) && species.forme) {
return this.get(species.baseSpecies);
} else if (species.name === 'Lycanroc-Dusk') {
return this.get('Rockruff-Dusk');
} else if (species.prevo) {
// there used to be a check for Hidden Ability here, but apparently it's unnecessary
// Shed Skin Pupitar can definitely evolve into Unnerve Tyranitar
Expand Down
2 changes: 1 addition & 1 deletion sim/pokemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ export class Pokemon {

getUpdatedDetails(level = this.level) {
let name = this.species.name;
if (name === 'Greninja-Bond') name = 'Greninja';
if (['Greninja-Bond', 'Rockruff-Dusk'].includes(name)) name = this.species.baseSpecies;
return name + (level === 100 ? '' : ', L' + level) +
(this.gender === '' ? '' : ', ' + this.gender) + (this.set.shiny ? ', shiny' : '');
}
Expand Down
13 changes: 11 additions & 2 deletions sim/team-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,11 @@ export class TeamValidator {
tierSpecies = outOfBattleSpecies;
}
}
if (ability.id === 'owntempo' && species.id === 'rockruff') {
tierSpecies = outOfBattleSpecies = dex.species.get('rockruffdusk');
if (ability.id === 'owntempo' && toID(species.baseSpecies) === 'rockruff') {
outOfBattleSpecies = dex.species.get('rockruffdusk');
if (ruleTable.has('obtainableformes')) {
tierSpecies = outOfBattleSpecies;
}
}

if (ruleTable.has('obtainableformes')) {
Expand Down Expand Up @@ -1666,6 +1669,9 @@ export class TeamValidator {
if (species.baseSpecies === "Greninja" && toID(set.ability) === 'battlebond') {
set.species = "Greninja-Bond";
}
if (species.baseSpecies === "Rockruff" && toID(set.ability) === 'owntempo') {
set.species = "Rockruff-Dusk";
}

if (species.baseSpecies === "Unown" && dex.gen === 2) {
let resultBinary = '';
Expand Down Expand Up @@ -1714,6 +1720,9 @@ export class TeamValidator {
if (tierSpecies.baseSpecies === 'Greninja' && toID(set.ability) === 'battlebond') {
setHas['pokemon:greninjabond'] = true;
}
if (tierSpecies.baseSpecies === 'Rockruff' && toID(set.ability) === 'owntempo') {
setHas['pokemon:rockruffdusk'] = true;
}

const tier = tierSpecies.tier === '(PU)' ? 'ZU' : tierSpecies.tier === '(NU)' ? 'PU' : tierSpecies.tier;
const tierTag = 'pokemontag:' + toID(tier);
Expand Down
3 changes: 2 additions & 1 deletion sim/tools/exhaustive-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ export class ExhaustiveRunner {
private createPools(dex: typeof Dex): Pools {
return {
pokemon: new Pool(ExhaustiveRunner.onlyValid(dex.gen, dex.data.Pokedex, p => dex.species.get(p), (_, p) =>
(p.name !== 'Pichu-Spiky-eared' && p.name.substr(0, 8) !== 'Pikachu-') && p.name !== 'Greninja-Bond'),
(p.name !== 'Pichu-Spiky-eared' && p.name.substr(0, 8) !== 'Pikachu-') &&
!['Greninja-Bond', 'Rockruff-Dusk'].includes(p.name)),
this.prng),
items: new Pool(ExhaustiveRunner.onlyValid(dex.gen, dex.data.Items, i => dex.items.get(i)), this.prng),
abilities: new Pool(ExhaustiveRunner.onlyValid(dex.gen, dex.data.Abilities, a => dex.abilities.get(a)), this.prng),
Expand Down
12 changes: 6 additions & 6 deletions test/sim/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ describe('Dex data', function () {
// Alola (18) + Totem (12) + Pikachu (7) - Pikachu (6) + Greninja (2) + Zygarde (2) +
// Oricorio (3) + Rockruff (1) + Lycanroc (2) + Wishiwashi (1) + Silvally (17) + Minior (1)
// Mimikyu (1) + Necrozma (3) [Magearna (1) + LGPE Starters/Meltan/Melmetal (4)]
formes[7] = formes[6] + 18 + 12 + 7 - 6 + 2 + 2 + 3 + 1 + 2 + 1 + 17 + 1 + 1 + 3 - 1;
formes[7] = formes[6] + 18 + 12 + 7 - 6 + 2 + 2 + 3 + 1 + 2 + 1 + 17 + 1 + 1 + 3;
// Silvally (17) + Rotom (5) + Basculin (1) + Meowstic (1) +
// Aegislash (1) + Pumpkaboo (3) + Gourgeist (3) + Pikachu (7) + Galar (14) +
// Alola (8) + Indeedee (1) + Morpeko (1) + Eiscue (1) + Zacian/Zamazenta (2) +
Expand All @@ -308,19 +308,19 @@ describe('Dex data', function () {
// {GMax} 26 + 7
formes[8] = 17 + 5 + 1 + 1 + 1 + 3 + 3 + 7 + 14 + 8 +
1 + 1 + 1 + 2 + 1 + 2 + 2 + 2 + 1 + 1 + 2 + 2 + 1 +
(4 + 1 + 1 + 1 + 1 + 2 + (1 + 1)) + (1 + 3 + 4 + 2 + 3 + 1 + 2) - 1; // FIXME Rockruff
(4 + 1 + 1 + 1 + 1 + 2 + (1 + 1)) + (1 + 3 + 4 + 2 + 3 + 1 + 2);
// Pikachu (8) + Origin (3) + Therian (4) + Alola (16) + Galar (7) + Paldea (4) + Hisui (16) +
// Deoxys (3) + Rotom (5) + Shaymin (1) + Arceus (17) + Basculin (2) + Kyurem (2) + Keldeo (1) +
// Meloetta (1) + Greninja (1) + Vivillon (2) + Meowstic (1) + Hoopa (1) + Oricorio (3) +
// Meloetta (1) + Greninja (1) + Vivillon (2) + Meowstic (1) + Hoopa (1) + Oricorio (3) + Rockruff (1) +
// Lycanroc (2) + Minior (1) + Mimikyu (1) + Necrozma (2) + Magearna (1) + Toxtricity (1) +
// Antique (2) + Eiscue (1) + Indeedee (1) + Cramorant (2) + Morpeko (1) + Crowned (2) +
// Urshifu (1) + Zarude (1) + Calyrex (2) + Oinkologne (1) + Ursaluna (1) + Dudunsparce (1) +
// Palafin (1) + Maushold (1) + Squawkabilly (3) + Gimmighoul (1) + Basculegion (1) +
// Masterpiece (2) + Ogerpon (7) + Terapagos (2)
formes[9] = 8 + 3 + 4 + 16 + 7 + 4 + 16 + 3 + 5 + 1 + 17 +
2 + 2 + 1 + 1 + 1 + 2 + 1 + 1 + 3 + 2 + 1 + 1 + 2 + 1 +
1 + 2 + 1 + 1 + 2 + 1 + 2 + 1 + 1 + 1 + 2 + 1 + 1 + 1 +
1 + 3 + 1 + 1 + 2 + 7 + 2;
2 + 2 + 1 + 1 + 1 + 2 + 1 + 1 + 3 + 1 + 2 + 1 + 1 + 2 +
1 + 1 + 2 + 1 + 1 + 2 + 1 + 2 + 1 + 1 + 1 + 2 + 1 + 1 +
1 + 1 + 3 + 1 + 1 + 2 + 7 + 2;

for (const gen of [1, 2, 3, 4, 5, 6, 7, 8, 9]) {
it(`Gen ${gen} should have ${species[gen]} species and ${formes[gen]} formes`, () => {
Expand Down

0 comments on commit 920a0e0

Please sign in to comment.