Skip to content

Commit

Permalink
feat: add m00 glitch Pokémon
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Feb 27, 2023
1 parent b814261 commit 43c9f09
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 13 deletions.
1 change: 1 addition & 0 deletions graphql/enums.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ enum PokemonEnum {
saharascal
saharaja
missingno
m00
bulbasaur
ivysaur
venusaur
Expand Down
4 changes: 2 additions & 2 deletions graphql/resolvers.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ type Query {
For every Pokémon all the data on each requested field is returned.
**_NOTE:_ To skip all CAP Pokémon, PokéStar Pokémon, and Missingno provide an `offset` of 88**
**_NOTE:_ To skip all CAP Pokémon, PokéStar Pokémon, Missingno, and 'M (00) provide an `offset` of 89**
You can provide `take` to limit the amount of Pokémon to return (default: 1), set the offset of where to start with `offset`, and reverse the entire array with `reverse`.
Expand All @@ -117,7 +117,7 @@ type Query {
offset: Int = 0

"Return only this many results, starting from the offset"
take: Int = 1389
take: Int = 1390

"Reverses the dataset before paginating"
reverse: Boolean = false
Expand Down
26 changes: 24 additions & 2 deletions src/lib/assets/pokedex-data/gen1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const entries: [string, PokemonTypes.DexEntry][] = [
color: 'Gray',
eggGroups: ['Undiscovered'],
evYields: { atk: 0, def: 0, hp: 0, spa: 0, spd: 0, spe: 0 },
heightm: 3,
heightm: 3.3,
isEggObtainable: false,
num: 0,
specialBackSprite: 'https://play.pokemonshowdown.com/sprites/afd-back/missingno.png',
Expand All @@ -21,7 +21,29 @@ const entries: [string, PokemonTypes.DexEntry][] = [
species: 'missingno.',
types: [TypesEnum.Normal],
weightkg: 1590.8,
aliases: ['m00']
otherFormes: ['m00']
}
],
[
'm00',
{
abilities: { first: 'pressure' },
baseSpecies: 'MissingNo.',
baseStats: { hp: 33, atk: 137, def: 0, spa: 29, spd: 29, spe: 6 },
color: 'Gray',
eggGroups: ['Undiscovered'],
evYields: { atk: 0, def: 0, hp: 0, spa: 0, spd: 0, spe: 0 },
heightm: 7,
isEggObtainable: false,
num: 0,
specialBackSprite: 'https://play.pokemonshowdown.com/sprites/gen1/missingno.png',
specialShinyBackSprite: 'https://play.pokemonshowdown.com/sprites/gen1/missingno.png',
specialShinySprite: 'https://play.pokemonshowdown.com/sprites/gen1/missingno.png',
specialSprite: 'https://play.pokemonshowdown.com/sprites/gen1/missingno.png',
species: "'m (00)",
types: [TypesEnum.Normal],
weightkg: 399.4,
otherFormes: ['missingno']
}
],
[
Expand Down
2 changes: 1 addition & 1 deletion src/lib/resolvers/pokemonResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function getPokemon(args: NonNullish<GetPokemonArgs>, requestedFields: Gr
*
* For every Pokémon all the data on each requested field is returned.
*
* **_NOTE:_ To skip all CAP Pokémon, PokéStar Pokémon, and Missingno provide an `offset` of 86**
* **_NOTE:_ To skip all CAP Pokémon, PokéStar Pokémon, and Missingno provide an `offset` of 89**
*
* You can provide `take` to limit the amount of Pokémon to return (default: 1), set the offset of where to start with `offset`, and reverse the entire array with `reverse`.
*
Expand Down
10 changes: 5 additions & 5 deletions src/lib/validations/pokemonArgs/getAllPokemonArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ export interface GetAllPokemonArgs extends BaseFuzzyArgs, BasePokemonArgs {
* Sets the offset where to start
* @default 0
* @minimum 0
* @maximum 1388
* @maximum 1389
*/
offset: number | Nullish;
/**
* Return only this many results, starting from the offset
* @default 1389
* @default 1390
* @minimum 1
* @maximum 1389
* @maximum 1390
*/
take: number | Nullish;
}
Expand All @@ -26,11 +26,11 @@ const getAllPokemonSchema: SchemaOf<GetAllPokemonArgs> = baseFuzzySchema //
.extend({
offset: s.number
.greaterThanOrEqual(0)
.lessThanOrEqual(1388)
.lessThanOrEqual(1389)
.nullish.transform((v) => v ?? 0),
take: s.number
.greaterThanOrEqual(1)
.lessThanOrEqual(1389)
.lessThanOrEqual(1390)
.nullish.transform((v) => v ?? 1)
});

Expand Down
4 changes: 4 additions & 0 deletions tests/scenarios/pokemon/getAllPokemonSpecies.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ describe('getAllPokemon', () => {
key: 'missingno',
species: 'missingno.'
},
{
key: 'm00',
species: "'m (00)"
},
{ key: 'bulbasaur', species: 'bulbasaur' },
{ key: 'ivysaur', species: 'ivysaur' },
{ key: 'venusaur', species: 'venusaur' },
Expand Down
4 changes: 2 additions & 2 deletions tests/scenarios/pokemon/getPokemon.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,14 @@ describe('getPokemon', () => {
forme: null,
formeLetter: null,
gender: { female: '50%', male: '50%' },
height: 3,
height: 3.3,
isEggObtainable: false,
backSprite: 'https://play.pokemonshowdown.com/sprites/afd-back/missingno.png',
levellingRate: null,
maximumHatchTime: null,
minimumHatchTime: null,
num: 0,
otherFormes: null,
otherFormes: ['m00'],
serebiiPage: '',
shinyBackSprite: 'https://play.pokemonshowdown.com/sprites/afd-back-shiny/missingno.png',
shinySprite: 'https://play.pokemonshowdown.com/sprites/afd-shiny/missingno.png',
Expand Down
2 changes: 1 addition & 1 deletion tests/testUtils/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface Query {
*
* For every Pokémon all the data on each requested field is returned.
*
* **_NOTE:_ To skip all CAP Pokémon, PokéStar Pokémon, and Missingno provide an `offset` of 86**
* **_NOTE:_ To skip all CAP Pokémon, PokéStar Pokémon, and Missingno provide an `offset` of 89**
*
* You can provide `take` to limit the amount of Pokémon to return (default: 1), set the offset of where to start with `offset`, and reverse the entire array with `reverse`.
*
Expand Down

0 comments on commit 43c9f09

Please sign in to comment.