Spaces:
Running
Running
{ | |
"version": 3, | |
"sources": ["../../sim/dex-species.ts"], | |
"sourcesContent": ["import { assignMissingFields, BasicEffect, toID } from './dex-data';\nimport { Utils } from '../lib/utils';\nimport { isDeepStrictEqual } from 'node:util';\n\ninterface SpeciesAbility {\n\t0: string;\n\t1?: string;\n\tH?: string;\n\tS?: string;\n}\n\ntype SpeciesTag = \"Mythical\" | \"Restricted Legendary\" | \"Sub-Legendary\" | \"Ultra Beast\" | \"Paradox\";\n\nexport interface SpeciesData extends Partial<Species> {\n\tname: string;\n\t/** National Dex number */\n\tnum: number;\n\n\ttypes: string[];\n\tabilities: SpeciesAbility;\n\tbaseStats: StatsTable;\n\teggGroups: string[];\n\tweightkg: number;\n}\n\nexport type ModdedSpeciesData = SpeciesData | Partial<Omit<SpeciesData, 'name'>> & { inherit: true };\n\nexport interface SpeciesFormatsData {\n\tdoublesTier?: TierTypes.Doubles | TierTypes.Other;\n\tgmaxUnreleased?: boolean;\n\tisNonstandard?: Nonstandard | null;\n\tnatDexTier?: TierTypes.Singles | TierTypes.Other;\n\ttier?: TierTypes.Singles | TierTypes.Other;\n}\n\nexport type ModdedSpeciesFormatsData = SpeciesFormatsData & { inherit?: true };\n\nexport interface LearnsetData {\n\tlearnset?: { [moveid: IDEntry]: MoveSource[] };\n\teventData?: EventInfo[];\n\teventOnly?: boolean;\n\tencounters?: EventInfo[];\n\texists?: boolean;\n}\n\nexport type ModdedLearnsetData = LearnsetData & { inherit?: true };\n\nexport interface PokemonGoData {\n\tencounters?: string[];\n\tLGPERestrictiveMoves?: { [moveid: string]: number | null };\n}\n\nexport interface SpeciesDataTable { [speciesid: IDEntry]: SpeciesData }\nexport interface ModdedSpeciesDataTable { [speciesid: IDEntry]: ModdedSpeciesData }\nexport interface SpeciesFormatsDataTable { [speciesid: IDEntry]: SpeciesFormatsData }\nexport interface ModdedSpeciesFormatsDataTable { [speciesid: IDEntry]: ModdedSpeciesFormatsData }\nexport interface LearnsetDataTable { [speciesid: IDEntry]: LearnsetData }\nexport interface ModdedLearnsetDataTable { [speciesid: IDEntry]: ModdedLearnsetData }\nexport interface PokemonGoDataTable { [speciesid: IDEntry]: PokemonGoData }\n\n/**\n * Describes a possible way to get a move onto a pokemon.\n *\n * First character is a generation number, 1-9.\n * Second character is a source ID, one of:\n *\n * - M = TM/HM\n * - T = tutor\n * - L = start or level-up, 3rd char+ is the level\n * - R = restricted (special moves like Rotom moves)\n * - E = egg\n * - D = Dream World, only 5D is valid\n * - S = event, 3rd char+ is the index in .eventData\n * - V = Virtual Console or Let's Go transfer, only 7V/8V is valid\n * - C = NOT A REAL SOURCE, see note, only 3C/4C is valid\n *\n * C marks certain moves learned by a pokemon's prevo. It's used to\n * work around the chainbreeding checker's shortcuts for performance;\n * it lets the pokemon be a valid father for teaching the move, but\n * is otherwise ignored by the learnset checker (which will actually\n * check prevos for compatibility).\n */\nexport type MoveSource = `${\n\t1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9\n}${\n\t'M' | 'T' | 'L' | 'R' | 'E' | 'D' | 'S' | 'V' | 'C'\n}${string}`;\n\nexport class Species extends BasicEffect implements Readonly<BasicEffect & SpeciesFormatsData> {\n\tdeclare readonly effectType: 'Pokemon';\n\t/**\n\t * Species ID. Identical to ID. Note that this is the full ID, e.g.\n\t * 'basculinbluestriped'. To get the base species ID, you need to\n\t * manually read toID(species.baseSpecies).\n\t */\n\tdeclare readonly id: ID;\n\t/**\n\t * Name. Note that this is the full name with forme,\n\t * e.g. 'Basculin-Blue-Striped'. To get the name without forme, see\n\t * `species.baseSpecies`.\n\t */\n\tdeclare readonly name: string;\n\t/**\n\t * Base species. Species, but without the forme name.\n\t *\n\t * DO NOT ASSUME A POKEMON CAN TRANSFORM FROM `baseSpecies` TO\n\t * `species`. USE `changesFrom` FOR THAT.\n\t */\n\treadonly baseSpecies: string;\n\t/**\n\t * Forme name. If the forme exists,\n\t * `species.name === species.baseSpecies + '-' + species.forme`\n\t *\n\t * The games make a distinction between Forme (foorumu) (legendary Pok\u00E9mon)\n\t * and Form (sugata) (non-legendary Pok\u00E9mon). PS does not use the same\n\t * distinction \u2013 they're all \"Forme\" to PS, reflecting current community\n\t * use of the term.\n\t *\n\t * This property only tracks non-cosmetic formes, and will be `''` for\n\t * cosmetic formes.\n\t */\n\treadonly forme: string;\n\t/**\n\t * Base forme name (e.g. 'Altered' for Giratina).\n\t */\n\treadonly baseForme: string;\n\t/**\n\t * Other forms. List of names of cosmetic forms. These should have\n\t * `aliases.js` aliases to this entry, but not have their own\n\t * entry in `pokedex.js`.\n\t */\n\treadonly cosmeticFormes?: string[];\n\t/**\n\t * Other formes. List of names of formes, appears only on the base\n\t * forme. Unlike forms, these have their own entry in `pokedex.js`.\n\t */\n\treadonly otherFormes?: string[];\n\t/**\n\t * List of forme speciesNames in the order they appear in the game data -\n\t * the union of baseSpecies, otherFormes and cosmeticFormes. Appears only on\n\t * the base species forme.\n\t *\n\t * A species's alternate formeindex may change from generation to generation -\n\t * the forme with index N in Gen A is not guaranteed to be the same forme as the\n\t * forme with index in Gen B.\n\t *\n\t * Gigantamaxes are not considered formes by the game (see data/FORMES.md - PS\n\t * labels them as such for convenience) - Gigantamax \"formes\" are instead included at\n\t * the end of the formeOrder list so as not to interfere with the correct index numbers.\n\t */\n\treadonly formeOrder?: string[];\n\t/**\n\t * Sprite ID. Basically the same as ID, but with a dash between\n\t * species and forme.\n\t */\n\treadonly spriteid: string;\n\t/** Abilities. */\n\treadonly abilities: SpeciesAbility;\n\t/** Types. */\n\treadonly types: string[];\n\t/** Added type (added by Trick-Or-Treat or Forest's Curse, but only listed in species by OMs). */\n\treadonly addedType?: string;\n\t/** Pre-evolution. '' if nothing evolves into this Pokemon. */\n\treadonly prevo: string;\n\t/** Evolutions. Array because many Pokemon have multiple evolutions. */\n\treadonly evos: string[];\n\treadonly evoType?: 'trade' | 'useItem' | 'levelMove' | 'levelExtra' | 'levelFriendship' | 'levelHold' | 'other';\n\t/** Evolution condition. falsy if doesn't evolve. */\n\tdeclare readonly evoCondition?: string;\n\t/** Evolution item. falsy if doesn't evolve. */\n\tdeclare readonly evoItem?: string;\n\t/** Evolution move. falsy if doesn't evolve. */\n\treadonly evoMove?: string;\n\t/** Region required to be in for evolution. falsy if doesn't evolve. */\n\treadonly evoRegion?: 'Alola' | 'Galar';\n\t/** Evolution level. falsy if doesn't evolve. */\n\treadonly evoLevel?: number;\n\t/** Is NFE? True if this Pokemon can evolve (Mega evolution doesn't count). */\n\treadonly nfe: boolean;\n\t/** Egg groups. */\n\treadonly eggGroups: string[];\n\t/** True if this species can hatch from an Egg. */\n\treadonly canHatch: boolean;\n\t/**\n\t * Gender. M = always male, F = always female, N = always\n\t * genderless, '' = sometimes male sometimes female.\n\t */\n\treadonly gender: GenderName;\n\t/** Gender ratio. Should add up to 1 unless genderless. */\n\treadonly genderRatio: { M: number, F: number };\n\t/** Base stats. */\n\treadonly baseStats: StatsTable;\n\t/** Max HP. Overrides usual HP calculations (for Shedinja). */\n\treadonly maxHP?: number;\n\t/** A Pokemon's Base Stat Total */\n\treadonly bst: number;\n\t/** Weight (in kg). Not valid for OMs; use weighthg / 10 instead. */\n\treadonly weightkg: number;\n\t/** Weight (in integer multiples of 0.1kg). */\n\treadonly weighthg: number;\n\t/** Height (in m). */\n\treadonly heightm: number;\n\t/** Color. */\n\treadonly color: string;\n\t/**\n\t * Tags, boolean data. Currently just legendary/mythical status.\n\t */\n\treadonly tags: SpeciesTag[];\n\t/** Does this Pokemon have an unreleased hidden ability? */\n\treadonly unreleasedHidden: boolean | 'Past';\n\t/**\n\t * Is it only possible to get the hidden ability on a male pokemon?\n\t * This is mainly relevant to Gen 5.\n\t */\n\treadonly maleOnlyHidden: boolean;\n\t/** Possible mother for a male-only Pokemon. */\n\treadonly mother?: string;\n\t/** True if a pokemon is mega. */\n\treadonly isMega?: boolean;\n\t/** True if a pokemon is primal. */\n\tdeclare readonly isPrimal?: boolean;\n\t/** Name of its Gigantamax move, if a pokemon is capable of gigantamaxing. */\n\treadonly canGigantamax?: string;\n\t/** If this Pokemon can gigantamax, is its gigantamax released? */\n\treadonly gmaxUnreleased?: boolean;\n\t/** True if a Pokemon species is incapable of dynamaxing */\n\treadonly cannotDynamax?: boolean;\n\t/** The Tera Type this Pokemon is forced to use */\n\treadonly forceTeraType?: string;\n\t/** What it transforms from, if a pokemon is a forme that is only accessible in battle. */\n\treadonly battleOnly?: string | string[];\n\t/** Required item. Do not use this directly; see requiredItems. */\n\treadonly requiredItem?: string;\n\t/** Required move. Move required to use this forme in-battle. */\n\tdeclare readonly requiredMove?: string;\n\t/** Required ability. Ability required to use this forme in-battle. */\n\tdeclare readonly requiredAbility?: string;\n\t/**\n\t * Required items. Items required to be in this forme, e.g. a mega\n\t * stone, or Griseous Orb. Array because Arceus formes can hold\n\t * either a Plate or a Z-Crystal.\n\t */\n\treadonly requiredItems?: string[];\n\n\t/**\n\t * Formes that can transform into this Pokemon, to inherit learnsets\n\t * from. (Like `prevo`, but for transformations that aren't\n\t * technically evolution. Includes in-battle transformations like\n\t * Zen Mode and out-of-battle transformations like Rotom.)\n\t *\n\t * Not filled out for megas/primals - fall back to baseSpecies\n\t * for in-battle formes.\n\t */\n\treadonly changesFrom?: string;\n\n\t/**\n\t * List of sources and other availability for a Pokemon transferred from\n\t * Pokemon GO.\n\t */\n\treadonly pokemonGoData?: string[];\n\n\t/**\n\t * Singles Tier. The Pokemon's location in the Smogon tier system.\n\t */\n\treadonly tier: TierTypes.Singles | TierTypes.Other;\n\t/**\n\t * Doubles Tier. The Pokemon's location in the Smogon doubles tier system.\n\t */\n\treadonly doublesTier: TierTypes.Doubles | TierTypes.Other;\n\t/**\n\t * National Dex Tier. The Pokemon's location in the Smogon National Dex tier system.\n\t */\n\treadonly natDexTier: TierTypes.Singles | TierTypes.Other;\n\n\tconstructor(data: AnyObject) {\n\t\tsuper(data);\n\n\t\tthis.fullname = `pokemon: ${data.name}`;\n\t\tthis.effectType = 'Pokemon';\n\t\tthis.baseSpecies = data.baseSpecies || this.name;\n\t\tthis.forme = data.forme || '';\n\t\tthis.baseForme = data.baseForme || '';\n\t\tthis.cosmeticFormes = data.cosmeticFormes || undefined;\n\t\tthis.otherFormes = data.otherFormes || undefined;\n\t\tthis.formeOrder = data.formeOrder || undefined;\n\t\tthis.spriteid = data.spriteid ||\n\t\t\t(toID(this.baseSpecies) + (this.baseSpecies !== this.name ? `-${toID(this.forme)}` : ''));\n\t\tthis.abilities = data.abilities || { 0: \"\" };\n\t\tthis.types = data.types || ['???'];\n\t\tthis.addedType = data.addedType || undefined;\n\t\tthis.prevo = data.prevo || '';\n\t\tthis.tier = data.tier || '';\n\t\tthis.doublesTier = data.doublesTier || '';\n\t\tthis.natDexTier = data.natDexTier || '';\n\t\tthis.evos = data.evos || [];\n\t\tthis.evoType = data.evoType || undefined;\n\t\tthis.evoMove = data.evoMove || undefined;\n\t\tthis.evoLevel = data.evoLevel || undefined;\n\t\tthis.nfe = data.nfe || false;\n\t\tthis.eggGroups = data.eggGroups || [];\n\t\tthis.canHatch = data.canHatch || false;\n\t\tthis.gender = data.gender || '';\n\t\tthis.genderRatio = data.genderRatio || (this.gender === 'M' ? { M: 1, F: 0 } :\n\t\t\tthis.gender === 'F' ? { M: 0, F: 1 } :\n\t\t\tthis.gender === 'N' ? { M: 0, F: 0 } :\n\t\t\t{ M: 0.5, F: 0.5 });\n\t\tthis.requiredItem = data.requiredItem || undefined;\n\t\tthis.requiredItems = data.requiredItems || (this.requiredItem ? [this.requiredItem] : undefined);\n\t\tthis.baseStats = data.baseStats || { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0 };\n\t\tthis.bst = this.baseStats.hp + this.baseStats.atk + this.baseStats.def +\n\t\t\tthis.baseStats.spa + this.baseStats.spd + this.baseStats.spe;\n\t\tthis.weightkg = data.weightkg || 0;\n\t\tthis.weighthg = this.weightkg * 10;\n\t\tthis.heightm = data.heightm || 0;\n\t\tthis.color = data.color || '';\n\t\tthis.tags = data.tags || [];\n\t\tthis.unreleasedHidden = data.unreleasedHidden || false;\n\t\tthis.maleOnlyHidden = !!data.maleOnlyHidden;\n\t\tthis.maxHP = data.maxHP || undefined;\n\t\tthis.isMega = !!(this.forme && ['Mega', 'Mega-X', 'Mega-Y'].includes(this.forme)) || undefined;\n\t\tthis.canGigantamax = data.canGigantamax || undefined;\n\t\tthis.gmaxUnreleased = !!data.gmaxUnreleased;\n\t\tthis.cannotDynamax = !!data.cannotDynamax;\n\t\tthis.battleOnly = data.battleOnly || (this.isMega ? this.baseSpecies : undefined);\n\t\tthis.changesFrom = data.changesFrom ||\n\t\t\t(this.battleOnly !== this.baseSpecies ? this.battleOnly : this.baseSpecies);\n\t\tif (Array.isArray(this.changesFrom)) this.changesFrom = this.changesFrom[0];\n\t\tthis.pokemonGoData = data.pokemonGoData || undefined;\n\n\t\tif (!this.gen && this.num >= 1) {\n\t\t\tif (this.num >= 906 || this.forme.includes('Paldea')) {\n\t\t\t\tthis.gen = 9;\n\t\t\t} else if (this.num >= 810 || ['Gmax', 'Galar', 'Galar-Zen', 'Hisui'].includes(this.forme)) {\n\t\t\t\tthis.gen = 8;\n\t\t\t} else if (this.num >= 722 || this.forme.startsWith('Alola') || this.forme === 'Starter') {\n\t\t\t\tthis.gen = 7;\n\t\t\t} else if (this.forme === 'Primal') {\n\t\t\t\tthis.gen = 6;\n\t\t\t\tthis.isPrimal = true;\n\t\t\t\tthis.battleOnly = this.baseSpecies;\n\t\t\t} else if (this.num >= 650 || this.isMega) {\n\t\t\t\tthis.gen = 6;\n\t\t\t} else if (this.num >= 494) {\n\t\t\t\tthis.gen = 5;\n\t\t\t} else if (this.num >= 387) {\n\t\t\t\tthis.gen = 4;\n\t\t\t} else if (this.num >= 252) {\n\t\t\t\tthis.gen = 3;\n\t\t\t} else if (this.num >= 152) {\n\t\t\t\tthis.gen = 2;\n\t\t\t} else {\n\t\t\t\tthis.gen = 1;\n\t\t\t}\n\t\t}\n\t\tassignMissingFields(this, data);\n\t}\n}\n\nconst EMPTY_SPECIES = Utils.deepFreeze(new Species({\n\tid: '', name: '', exists: false,\n\ttier: 'Illegal', doublesTier: 'Illegal',\n\tnatDexTier: 'Illegal', isNonstandard: 'Custom',\n}));\n\nexport class Learnset {\n\treadonly effectType: 'Learnset';\n\t/**\n\t * Keeps track of exactly how a pokemon might learn a move, in the\n\t * form moveid:sources[].\n\t */\n\treadonly learnset?: { [moveid: string]: MoveSource[] };\n\t/** True if the only way to get this Pokemon is from events. */\n\treadonly eventOnly: boolean;\n\t/** List of event data for each event. */\n\treadonly eventData?: EventInfo[];\n\treadonly encounters?: EventInfo[];\n\treadonly exists: boolean;\n\treadonly species: Species;\n\n\tconstructor(data: AnyObject, species: Species) {\n\t\tthis.exists = true;\n\t\tthis.effectType = 'Learnset';\n\t\tthis.learnset = data.learnset || undefined;\n\t\tthis.eventOnly = !!data.eventOnly;\n\t\tthis.eventData = data.eventData || undefined;\n\t\tthis.encounters = data.encounters || undefined;\n\t\tthis.species = species;\n\t}\n}\n\nexport class DexSpecies {\n\treadonly dex: ModdedDex;\n\treadonly speciesCache = new Map<ID, Species>();\n\treadonly learnsetCache = new Map<ID, Learnset>();\n\tallCache: readonly Species[] | null = null;\n\n\tconstructor(dex: ModdedDex) {\n\t\tthis.dex = dex;\n\t}\n\n\tget(name?: string | Species): Species {\n\t\tif (name && typeof name !== 'string') return name;\n\n\t\tlet id = '' as ID;\n\t\tif (name) {\n\t\t\tname = name.trim();\n\t\t\tid = toID(name);\n\t\t\tif (id === 'nidoran' && name.endsWith('\u2640')) {\n\t\t\t\tid = 'nidoranf' as ID;\n\t\t\t} else if (id === 'nidoran' && name.endsWith('\u2642')) {\n\t\t\t\tid = 'nidoranm' as ID;\n\t\t\t}\n\t\t}\n\t\treturn this.getByID(id);\n\t}\n\n\tgetByID(id: ID): Species {\n\t\tif (id === '') return EMPTY_SPECIES;\n\t\tlet species: Mutable<Species> | undefined = this.speciesCache.get(id);\n\t\tif (species) return species;\n\n\t\tif (this.dex.data.Aliases.hasOwnProperty(id)) {\n\t\t\tif (this.dex.data.FormatsData.hasOwnProperty(id)) {\n\t\t\t\t// special event ID\n\t\t\t\tconst baseId = toID(this.dex.data.Aliases[id]);\n\t\t\t\tspecies = new Species({\n\t\t\t\t\t...this.dex.data.Pokedex[baseId],\n\t\t\t\t\t...this.dex.data.FormatsData[id],\n\t\t\t\t\tname: id,\n\t\t\t\t});\n\t\t\t\tspecies.abilities = { 0: species.abilities['S']! };\n\t\t\t} else {\n\t\t\t\tspecies = this.get(this.dex.data.Aliases[id]);\n\t\t\t\tif (species.cosmeticFormes) {\n\t\t\t\t\tfor (const forme of species.cosmeticFormes) {\n\t\t\t\t\t\tif (toID(forme) === id) {\n\t\t\t\t\t\t\tspecies = new Species({\n\t\t\t\t\t\t\t\t...species,\n\t\t\t\t\t\t\t\tname: forme,\n\t\t\t\t\t\t\t\tforme: forme.slice(species.name.length + 1),\n\t\t\t\t\t\t\t\tbaseForme: \"\",\n\t\t\t\t\t\t\t\tbaseSpecies: species.name,\n\t\t\t\t\t\t\t\totherFormes: null,\n\t\t\t\t\t\t\t\tcosmeticFormes: null,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.speciesCache.set(id, this.dex.deepFreeze(species));\n\t\t\treturn species;\n\t\t}\n\n\t\tif (!this.dex.data.Pokedex.hasOwnProperty(id)) {\n\t\t\tlet aliasTo = '';\n\t\t\tconst formeNames: { [k: IDEntry]: IDEntry[] } = {\n\t\t\t\talola: ['a', 'alola', 'alolan'],\n\t\t\t\tgalar: ['g', 'galar', 'galarian'],\n\t\t\t\thisui: ['h', 'hisui', 'hisuian'],\n\t\t\t\tpaldea: ['p', 'paldea', 'paldean'],\n\t\t\t\tmega: ['m', 'mega'],\n\t\t\t\tprimal: ['p', 'primal'],\n\t\t\t};\n\t\t\tfor (const forme in formeNames) {\n\t\t\t\tlet pokeName = '';\n\t\t\t\tfor (const i of formeNames[forme as ID]) {\n\t\t\t\t\tif (id.startsWith(i)) {\n\t\t\t\t\t\tpokeName = id.slice(i.length);\n\t\t\t\t\t} else if (id.endsWith(i)) {\n\t\t\t\t\t\tpokeName = id.slice(0, -i.length);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.dex.data.Aliases.hasOwnProperty(pokeName)) pokeName = toID(this.dex.data.Aliases[pokeName]);\n\t\t\t\tif (this.dex.data.Pokedex[pokeName + forme]) {\n\t\t\t\t\taliasTo = pokeName + forme;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (aliasTo) {\n\t\t\t\tspecies = this.get(aliasTo);\n\t\t\t\tif (species.exists) {\n\t\t\t\t\tthis.speciesCache.set(id, species);\n\t\t\t\t\treturn species;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (id && this.dex.data.Pokedex.hasOwnProperty(id)) {\n\t\t\tconst pokedexData = this.dex.data.Pokedex[id];\n\t\t\tconst baseSpeciesTags = pokedexData.baseSpecies && this.dex.data.Pokedex[toID(pokedexData.baseSpecies)].tags;\n\t\t\tspecies = new Species({\n\t\t\t\ttags: baseSpeciesTags,\n\t\t\t\t...pokedexData,\n\t\t\t\t...this.dex.data.FormatsData[id],\n\t\t\t});\n\t\t\t// Inherit any statuses from the base species (Arceus, Silvally).\n\t\t\tconst baseSpeciesStatuses = this.dex.data.Conditions[toID(species.baseSpecies)];\n\t\t\tif (baseSpeciesStatuses !== undefined) {\n\t\t\t\tfor (const key in baseSpeciesStatuses) {\n\t\t\t\t\tif (!(key in species)) {\n\t\t\t\t\t\t(species as any)[key] = (baseSpeciesStatuses as any)[key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!species.tier && !species.doublesTier && !species.natDexTier && species.baseSpecies !== species.name) {\n\t\t\t\tif (species.baseSpecies === 'Mimikyu') {\n\t\t\t\t\tspecies.tier = this.dex.data.FormatsData[toID(species.baseSpecies)].tier || 'Illegal';\n\t\t\t\t\tspecies.doublesTier = this.dex.data.FormatsData[toID(species.baseSpecies)].doublesTier || 'Illegal';\n\t\t\t\t\tspecies.natDexTier = this.dex.data.FormatsData[toID(species.baseSpecies)].natDexTier || 'Illegal';\n\t\t\t\t} else if (species.id.endsWith('totem')) {\n\t\t\t\t\tspecies.tier = this.dex.data.FormatsData[species.id.slice(0, -5)].tier || 'Illegal';\n\t\t\t\t\tspecies.doublesTier = this.dex.data.FormatsData[species.id.slice(0, -5)].doublesTier || 'Illegal';\n\t\t\t\t\tspecies.natDexTier = this.dex.data.FormatsData[species.id.slice(0, -5)].natDexTier || 'Illegal';\n\t\t\t\t} else if (species.battleOnly) {\n\t\t\t\t\tspecies.tier = this.dex.data.FormatsData[toID(species.battleOnly)].tier || 'Illegal';\n\t\t\t\t\tspecies.doublesTier = this.dex.data.FormatsData[toID(species.battleOnly)].doublesTier || 'Illegal';\n\t\t\t\t\tspecies.natDexTier = this.dex.data.FormatsData[toID(species.battleOnly)].natDexTier || 'Illegal';\n\t\t\t\t} else {\n\t\t\t\t\tconst baseFormatsData = this.dex.data.FormatsData[toID(species.baseSpecies)];\n\t\t\t\t\tif (!baseFormatsData) {\n\t\t\t\t\t\tthrow new Error(`${species.baseSpecies} has no formats-data entry`);\n\t\t\t\t\t}\n\t\t\t\t\tspecies.tier = baseFormatsData.tier || 'Illegal';\n\t\t\t\t\tspecies.doublesTier = baseFormatsData.doublesTier || 'Illegal';\n\t\t\t\t\tspecies.natDexTier = baseFormatsData.natDexTier || 'Illegal';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!species.tier) species.tier = 'Illegal';\n\t\t\tif (!species.doublesTier) species.doublesTier = species.tier as any;\n\t\t\tif (!species.natDexTier) species.natDexTier = species.tier;\n\t\t\tif (species.gen > this.dex.gen) {\n\t\t\t\tspecies.tier = 'Illegal';\n\t\t\t\tspecies.doublesTier = 'Illegal';\n\t\t\t\tspecies.natDexTier = 'Illegal';\n\t\t\t\tspecies.isNonstandard = 'Future';\n\t\t\t}\n\t\t\tif (this.dex.currentMod === 'gen7letsgo' && !species.isNonstandard) {\n\t\t\t\tconst isLetsGo = (\n\t\t\t\t\t(species.num <= 151 || ['Meltan', 'Melmetal'].includes(species.name)) &&\n\t\t\t\t\t(!species.forme || (['Alola', 'Mega', 'Mega-X', 'Mega-Y', 'Starter'].includes(species.forme) &&\n\t\t\t\t\t\tspecies.name !== 'Pikachu-Alola'))\n\t\t\t\t);\n\t\t\t\tif (!isLetsGo) species.isNonstandard = 'Past';\n\t\t\t}\n\t\t\tif (this.dex.currentMod === 'gen8bdsp' &&\n\t\t\t\t(!species.isNonstandard || [\"Gigantamax\", \"CAP\"].includes(species.isNonstandard))) {\n\t\t\t\tif (species.gen > 4 || (species.num < 1 && species.isNonstandard !== 'CAP') ||\n\t\t\t\t\tspecies.id === 'pichuspikyeared') {\n\t\t\t\t\tspecies.isNonstandard = 'Future';\n\t\t\t\t\tspecies.tier = species.doublesTier = species.natDexTier = 'Illegal';\n\t\t\t\t}\n\t\t\t}\n\t\t\tspecies.nfe = species.evos.some(evo => {\n\t\t\t\tconst evoSpecies = this.get(evo);\n\t\t\t\treturn !evoSpecies.isNonstandard ||\n\t\t\t\t\tevoSpecies.isNonstandard === species?.isNonstandard ||\n\t\t\t\t\t// Pokemon with Hisui evolutions\n\t\t\t\t\tevoSpecies.isNonstandard === \"Unobtainable\";\n\t\t\t});\n\t\t\tspecies.canHatch = species.canHatch ||\n\t\t\t\t(!['Ditto', 'Undiscovered'].includes(species.eggGroups[0]) && !species.prevo && species.name !== 'Manaphy');\n\t\t\tif (this.dex.gen === 1) species.bst -= species.baseStats.spd;\n\t\t\tif (this.dex.gen < 5) {\n\t\t\t\tspecies.abilities = this.dex.deepClone(species.abilities);\n\t\t\t\tdelete species.abilities['H'];\n\t\t\t}\n\t\t\tif (this.dex.gen === 3 && this.dex.abilities.get(species.abilities['1']).gen === 4) delete species.abilities['1'];\n\n\t\t\tif (this.dex.parentMod) {\n\t\t\t\t// if this species is exactly identical to parentMod's species, reuse parentMod's copy\n\t\t\t\tconst parentMod = this.dex.mod(this.dex.parentMod);\n\t\t\t\tif (this.dex.data.Pokedex[id] === parentMod.data.Pokedex[id]) {\n\t\t\t\t\tconst parentSpecies = parentMod.species.getByID(id);\n\t\t\t\t\t// checking tier cheaply filters out some non-matches.\n\t\t\t\t\t// The construction logic is very complex so we ultimately need to do a deep equality check\n\t\t\t\t\tif (species.tier === parentSpecies.tier && isDeepStrictEqual(species, parentSpecies)) {\n\t\t\t\t\t\tspecies = parentSpecies;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecies = new Species({\n\t\t\t\tid, name: id,\n\t\t\t\texists: false, tier: 'Illegal', doublesTier: 'Illegal', natDexTier: 'Illegal', isNonstandard: 'Custom',\n\t\t\t});\n\t\t}\n\t\tif (species.exists) this.speciesCache.set(id, this.dex.deepFreeze(species));\n\t\treturn species;\n\t}\n\n\t/**\n\t * @param id the ID of the species the move pool belongs to\n\t * @param isNatDex\n\t * @returns a Set of IDs of the full valid movepool of the given species for the current generation/mod.\n\t * Note that inter-move incompatibilities, such as those from exclusive events, are not considered and all moves are\n\t * lumped together. However, Necturna and Necturine's Sketchable moves are omitted from this pool, as their fundamental\n\t * incompatibility with each other is essential to the nature of those species.\n\t */\n\tgetMovePool(id: ID, isNatDex = false): Set<ID> {\n\t\tlet eggMovesOnly = false;\n\t\tlet maxGen = this.dex.gen;\n\t\tconst gen3HMMoves = ['cut', 'fly', 'surf', 'strength', 'flash', 'rocksmash', 'waterfall', 'dive'];\n\t\tconst gen4HMMoves = ['cut', 'fly', 'surf', 'strength', 'rocksmash', 'waterfall', 'rockclimb'];\n\t\tconst movePool = new Set<ID>();\n\t\tfor (const { species, learnset } of this.getFullLearnset(id)) {\n\t\t\tif (!eggMovesOnly) eggMovesOnly = this.eggMovesOnly(species, this.get(id));\n\t\t\tfor (const moveid in learnset) {\n\t\t\t\tif (species.isNonstandard !== 'CAP') {\n\t\t\t\t\tif (gen4HMMoves.includes(moveid) && this.dex.gen >= 5) {\n\t\t\t\t\t\tif (!learnset[moveid].some(source => parseInt(source.charAt(0)) >= 5 &&\n\t\t\t\t\t\t\tparseInt(source.charAt(0)) <= this.dex.gen)) continue;\n\t\t\t\t\t} else if (\n\t\t\t\t\t\tgen3HMMoves.includes(moveid) && this.dex.gen >= 4 &&\n\t\t\t\t\t\t!learnset[moveid].some(\n\t\t\t\t\t\t\tsource => parseInt(source.charAt(0)) >= 4 && parseInt(source.charAt(0)) <= this.dex.gen\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (eggMovesOnly) {\n\t\t\t\t\tif (learnset[moveid].some(source => source.startsWith('9E'))) {\n\t\t\t\t\t\tmovePool.add(moveid as ID);\n\t\t\t\t\t}\n\t\t\t\t} else if (maxGen >= 9) {\n\t\t\t\t\t// Pokemon Home now strips learnsets on withdrawal\n\t\t\t\t\tif (isNatDex || learnset[moveid].some(source => source.startsWith('9'))) {\n\t\t\t\t\t\tmovePool.add(moveid as ID);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (learnset[moveid].some(source => parseInt(source.charAt(0)) <= maxGen)) {\n\t\t\t\t\t\tmovePool.add(moveid as ID);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (moveid === 'sketch' && movePool.has('sketch' as ID)) {\n\t\t\t\t\tif (species.isNonstandard === 'CAP') {\n\t\t\t\t\t\t// Given what this function is generally used for, adding all sketchable moves to Necturna and Necturine's\n\t\t\t\t\t\t// movepools would be undesirable as it would be impossible to tell sketched moves apart from normal ones\n\t\t\t\t\t\t// so any code calling this one will need to get and handle those moves separately themselves\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// Smeargle time\n\t\t\t\t\t// A few moves like Dark Void were made unSketchable in a generation later than when they were introduced\n\t\t\t\t\t// However, this has only happened in a gen where transfer moves are unavailable\n\t\t\t\t\tconst sketchables = this.dex.moves.all().filter(m => !m.flags['nosketch'] && !m.isNonstandard);\n\t\t\t\t\tfor (const move of sketchables) {\n\t\t\t\t\t\tmovePool.add(move.id);\n\t\t\t\t\t}\n\t\t\t\t\t// Smeargle has some event moves; they're all sketchable, so let's just skip them\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (species.evoRegion) {\n\t\t\t\t// species can only evolve in this gen, so prevo can't have any moves\n\t\t\t\t// from after that gen\n\t\t\t\tif (this.dex.gen >= 9) eggMovesOnly = true;\n\t\t\t\tif (this.dex.gen === 8 && species.evoRegion === 'Alola') maxGen = 7;\n\t\t\t}\n\t\t}\n\t\treturn movePool;\n\t}\n\n\tgetFullLearnset(id: ID): (Learnset & { learnset: NonNullable<Learnset['learnset']> })[] {\n\t\tconst originalSpecies = this.get(id);\n\t\tlet species: Species | null = originalSpecies;\n\t\tconst out: (Learnset & { learnset: NonNullable<Learnset['learnset']> })[] = [];\n\t\tconst alreadyChecked: { [k: string]: boolean } = {};\n\n\t\twhile (species?.name && !alreadyChecked[species.id]) {\n\t\t\talreadyChecked[species.id] = true;\n\t\t\tconst learnset = this.getLearnsetData(species.id);\n\t\t\tif (learnset.learnset) {\n\t\t\t\tout.push(learnset as any);\n\t\t\t\tspecies = this.learnsetParent(species, true);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// no learnset\n\t\t\tif ((species.changesFrom || species.baseSpecies) !== species.name) {\n\t\t\t\t// forme without its own learnset\n\t\t\t\tspecies = this.get(species.changesFrom || species.baseSpecies);\n\t\t\t\t// warning: formes with their own learnset, like Wormadam, should NOT\n\t\t\t\t// inherit from their base forme unless they're freely switchable\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (species.isNonstandard) {\n\t\t\t\t// It's normal for a nonstandard species not to have learnset data\n\n\t\t\t\t// Formats should replace the `Obtainable Moves` rule if they want to\n\t\t\t\t// allow pokemon without learnsets.\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\tif (species.prevo && this.getLearnsetData(toID(species.prevo)).learnset) {\n\t\t\t\tspecies = this.get(toID(species.prevo));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// should never happen\n\t\t\tthrow new Error(`Species with no learnset data: ${species.id}`);\n\t\t}\n\n\t\treturn out;\n\t}\n\n\tlearnsetParent(species: Species, checkingMoves = false) {\n\t\t// Own Tempo Rockruff and Battle Bond Greninja are special event formes\n\t\t// that are visually indistinguishable from their base forme but have\n\t\t// different learnsets. To prevent a leak, we make them show up as their\n\t\t// base forme, but hardcode their learnsets into Rockruff-Dusk and\n\t\t// Greninja-Ash\n\t\tif (['Gastrodon', 'Pumpkaboo', 'Sinistea', 'Tatsugiri'].includes(species.baseSpecies) && species.forme) {\n\t\t\treturn this.get(species.baseSpecies);\n\t\t} else if (species.prevo) {\n\t\t\t// there used to be a check for Hidden Ability here, but apparently it's unnecessary\n\t\t\t// Shed Skin Pupitar can definitely evolve into Unnerve Tyranitar\n\t\t\tspecies = this.get(species.prevo);\n\t\t\tif (species.gen > Math.max(2, this.dex.gen)) return null;\n\t\t\treturn species;\n\t\t} else if (species.changesFrom && species.baseSpecies !== 'Kyurem') {\n\t\t\t// For Pokemon like Rotom and Necrozma whose movesets are extensions are their base formes\n\t\t\treturn this.get(species.changesFrom);\n\t\t} else if (\n\t\t\tcheckingMoves && !species.prevo && species.baseSpecies && this.get(species.baseSpecies).prevo\n\t\t) {\n\t\t\t// For Pokemon like Cap Pikachu, who should be able to have egg moves in Gen 9\n\t\t\tlet baseEvo = this.get(species.baseSpecies);\n\t\t\twhile (baseEvo.prevo) {\n\t\t\t\tbaseEvo = this.get(baseEvo.prevo);\n\t\t\t}\n\t\t\treturn baseEvo;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Gets the raw learnset data for the species.\n\t *\n\t * In practice, if you're trying to figure out what moves a pokemon learns,\n\t * you probably want to `getFullLearnset` or `getMovePool` instead.\n\t */\n\tgetLearnsetData(id: ID): Learnset {\n\t\tlet learnsetData = this.learnsetCache.get(id);\n\t\tif (learnsetData) return learnsetData;\n\t\tif (!this.dex.data.Learnsets.hasOwnProperty(id)) {\n\t\t\treturn new Learnset({ exists: false }, this.get(id));\n\t\t}\n\t\tlearnsetData = new Learnset(this.dex.data.Learnsets[id], this.get(id));\n\t\tthis.learnsetCache.set(id, this.dex.deepFreeze(learnsetData));\n\t\treturn learnsetData;\n\t}\n\n\tgetPokemonGoData(id: ID): PokemonGoData {\n\t\treturn this.dex.data.PokemonGoData[id];\n\t}\n\n\tall(): readonly Species[] {\n\t\tif (this.allCache) return this.allCache;\n\t\tconst species = [];\n\t\tfor (const id in this.dex.data.Pokedex) {\n\t\t\tspecies.push(this.getByID(id as ID));\n\t\t}\n\t\tthis.allCache = Object.freeze(species);\n\t\treturn this.allCache;\n\t}\n\n\teggMovesOnly(child: Species, father: Species | null) {\n\t\tif (child.baseSpecies === father?.baseSpecies) return false;\n\t\twhile (father) {\n\t\t\tif (father.name === child.name) return false;\n\t\t\tfather = this.learnsetParent(father);\n\t\t}\n\t\treturn true;\n\t}\n}\n"], | |
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAuD;AACvD,mBAAsB;AACtB,uBAAkC;AAsF3B,MAAM,gBAAgB,4BAAkE;AAAA,EA0L9F,YAAY,MAAiB;AAC5B,UAAM,IAAI;AAEV,SAAK,WAAW,YAAY,KAAK;AACjC,SAAK,aAAa;AAClB,SAAK,cAAc,KAAK,eAAe,KAAK;AAC5C,SAAK,QAAQ,KAAK,SAAS;AAC3B,SAAK,YAAY,KAAK,aAAa;AACnC,SAAK,iBAAiB,KAAK,kBAAkB;AAC7C,SAAK,cAAc,KAAK,eAAe;AACvC,SAAK,aAAa,KAAK,cAAc;AACrC,SAAK,WAAW,KAAK,gBACnB,sBAAK,KAAK,WAAW,KAAK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