{ "version": 3, "sources": ["../../../../../data/mods/gen1/random-teams.ts"], "sourcesContent": ["import RandomGen2Teams from '../gen2/random-teams';\nimport {Utils} from '../../../lib';\n\ninterface HackmonsCupEntry {\n\ttypes: string[];\n\tbaseStats: StatsTable;\n}\n\ninterface Gen1RandomBattleSpecies {\n\tlevel?: number;\n\tmoves?: ID[];\n\tessentialMoves?: ID[];\n\texclusiveMoves?: ID[];\n\tcomboMoves?: ID[];\n}\n\nexport class RandomGen1Teams extends RandomGen2Teams {\n\trandomData: {[species: string]: Gen1RandomBattleSpecies} = require('./random-data.json');\n\n\t// Challenge Cup or CC teams are basically fully random teams.\n\trandomCCTeam() {\n\t\tthis.enforceNoDirectCustomBanlistChanges();\n\n\t\tconst team = [];\n\n\t\tconst randomN = this.randomNPokemon(this.maxTeamSize, this.forceMonotype);\n\n\t\tfor (const pokemon of randomN) {\n\t\t\tconst species = this.dex.species.get(pokemon);\n\n\t\t\t// Level balance: calculate directly from stats rather than using some silly lookup table.\n\t\t\tconst mbstmin = 1307;\n\t\t\tconst stats = species.baseStats;\n\n\t\t\t// Modified base stat total assumes 15 DVs, 255 EVs in every stat\n\t\t\tlet mbst = (stats[\"hp\"] * 2 + 30 + 63 + 100) + 10;\n\t\t\tmbst += (stats[\"atk\"] * 2 + 30 + 63 + 100) + 5;\n\t\t\tmbst += (stats[\"def\"] * 2 + 30 + 63 + 100) + 5;\n\t\t\tmbst += (stats[\"spa\"] * 2 + 30 + 63 + 100) + 5;\n\t\t\tmbst += (stats[\"spd\"] * 2 + 30 + 63 + 100) + 5;\n\t\t\tmbst += (stats[\"spe\"] * 2 + 30 + 63 + 100) + 5;\n\n\t\t\tlet level;\n\t\t\tif (this.adjustLevel) {\n\t\t\t\tlevel = this.adjustLevel;\n\t\t\t} else {\n\t\t\t\tlevel = Math.floor(100 * mbstmin / mbst); // Initial level guess will underestimate\n\n\t\t\t\twhile (level < 100) {\n\t\t\t\t\tmbst = Math.floor((stats[\"hp\"] * 2 + 30 + 63 + 100) * level / 100 + 10);\n\t\t\t\t\t// Since damage is roughly proportional to lvl\n\t\t\t\t\tmbst += Math.floor(((stats[\"atk\"] * 2 + 30 + 63 + 100) * level / 100 + 5) * level / 100);\n\t\t\t\t\tmbst += Math.floor((stats[\"def\"] * 2 + 30 + 63 + 100) * level / 100 + 5);\n\t\t\t\t\tmbst += Math.floor(((stats[\"spa\"] * 2 + 30 + 63 + 100) * level / 100 + 5) * level / 100);\n\t\t\t\t\tmbst += Math.floor((stats[\"spd\"] * 2 + 30 + 63 + 100) * level / 100 + 5);\n\t\t\t\t\tmbst += Math.floor((stats[\"spe\"] * 2 + 30 + 63 + 100) * level / 100 + 5);\n\n\t\t\t\t\tif (mbst >= mbstmin) break;\n\t\t\t\t\tlevel++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Random DVs.\n\t\t\tconst ivs = {\n\t\t\t\thp: 0,\n\t\t\t\tatk: this.random(16),\n\t\t\t\tdef: this.random(16),\n\t\t\t\tspa: this.random(16),\n\t\t\t\tspd: 0,\n\t\t\t\tspe: this.random(16),\n\t\t\t};\n\t\t\tivs[\"hp\"] = (ivs[\"atk\"] % 2) * 16 + (ivs[\"def\"] % 2) * 8 + (ivs[\"spe\"] % 2) * 4 + (ivs[\"spa\"] % 2) * 2;\n\t\t\tivs[\"atk\"] *= 2;\n\t\t\tivs[\"def\"] *= 2;\n\t\t\tivs[\"spa\"] *= 2;\n\t\t\tivs[\"spd\"] = ivs[\"spa\"];\n\t\t\tivs[\"spe\"] *= 2;\n\n\t\t\t// Maxed EVs.\n\t\t\tconst evs = {hp: 255, atk: 255, def: 255, spa: 255, spd: 255, spe: 255};\n\n\t\t\t// Four random unique moves from movepool. don't worry about \"attacking\" or \"viable\".\n\t\t\t// Since Gens 1 and 2 learnsets are shared, we need to weed out Gen 2 moves.\n\t\t\tconst pool = [...this.dex.species.getMovePool(species.id)];\n\n\t\t\tteam.push({\n\t\t\t\tname: species.baseSpecies,\n\t\t\t\tspecies: species.name,\n\t\t\t\tmoves: this.multipleSamplesNoReplace(pool, 4),\n\t\t\t\tgender: false,\n\t\t\t\tability: 'No Ability',\n\t\t\t\tevs: evs,\n\t\t\t\tivs: ivs,\n\t\t\t\titem: '',\n\t\t\t\tlevel,\n\t\t\t\thappiness: 0,\n\t\t\t\tshiny: false,\n\t\t\t\tnature: 'Serious',\n\t\t\t});\n\t\t}\n\n\t\treturn team;\n\t}\n\n\t// Random team generation for Gen 1 Random Battles.\n\trandomTeam() {\n\t\tthis.enforceNoDirectCustomBanlistChanges();\n\n\t\t// Get what we need ready.\n\t\tconst seed = this.prng.seed;\n\t\tconst ruleTable = this.dex.formats.getRuleTable(this.format);\n\t\tconst pokemon: RandomTeamsTypes.RandomSet[] = [];\n\n\t\t// For Monotype\n\t\tconst isMonotype = !!this.forceMonotype || ruleTable.has('sametypeclause');\n\t\tconst typePool = this.dex.types.names();\n\t\tconst type = this.forceMonotype || this.sample(typePool);\n\n\t\t/** Pok\u00E9mon that are not wholly incompatible with the team, but still pretty bad */\n\t\tconst rejectedButNotInvalidPool: string[] = [];\n\n\t\t// Now let's store what we are getting.\n\t\tconst typeCount: {[k: string]: number} = {};\n\t\tconst weaknessCount: {[k: string]: number} = {Electric: 0, Psychic: 0, Water: 0, Ice: 0, Ground: 0, Fire: 0};\n\t\tlet numMaxLevelPokemon = 0;\n\n\t\tconst pokemonPool = Object.keys(this.getPokemonPool(type, pokemon, isMonotype, Object.keys(this.randomData))[0]);\n\t\twhile (pokemonPool.length && pokemon.length < this.maxTeamSize) {\n\t\t\tconst species = this.dex.species.get(this.sampleNoReplace(pokemonPool));\n\t\t\tif (!species.exists) continue;\n\n\t\t\t// Only one Ditto is allowed per battle in Generation 1,\n\t\t\t// as it can cause an endless battle if two Dittos are forced\n\t\t\t// to face each other.\n\t\t\tif (species.id === 'ditto' && this.battleHasDitto) continue;\n\n\t\t\t// Dynamically scale limits for different team sizes. The default and minimum value is 1.\n\t\t\tconst limitFactor = Math.round(this.maxTeamSize / 6) || 1;\n\n\t\t\tlet skip = false;\n\n\t\t\tif (!isMonotype && !this.forceMonotype) {\n\t\t\t\t// Limit two of any type\n\t\t\t\tfor (const typeName of species.types) {\n\t\t\t\t\tif (typeCount[typeName] >= 2 * limitFactor) {\n\t\t\t\t\t\tskip = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skip) {\n\t\t\t\t\trejectedButNotInvalidPool.push(species.id);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We need a weakness count of spammable attacks to avoid being swept by those.\n\t\t\t// Spammable attacks are: Thunderbolt, Psychic, Surf, Blizzard, Earthquake, Fire Blast.\n\t\t\tconst pokemonWeaknesses = [];\n\t\t\tfor (const typeName in weaknessCount) {\n\t\t\t\tconst increaseCount = this.dex.getImmunity(typeName, species) && this.dex.getEffectiveness(typeName, species) > 0;\n\t\t\t\tif (!increaseCount) continue;\n\t\t\t\tif (weaknessCount[typeName] >= 2 * limitFactor) {\n\t\t\t\t\tskip = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tpokemonWeaknesses.push(typeName);\n\t\t\t}\n\n\t\t\tif (skip) {\n\t\t\t\trejectedButNotInvalidPool.push(species.id);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Limit one level 100 Pokemon\n\t\t\tif (!this.adjustLevel && (this.getLevel(species) === 100) && numMaxLevelPokemon >= limitFactor) {\n\t\t\t\trejectedButNotInvalidPool.push(species.id);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// The set passes the limitations.\n\t\t\tpokemon.push(this.randomSet(species));\n\n\t\t\t// Now let's increase the counters.\n\t\t\t// Type counter.\n\t\t\tfor (const typeName of species.types) {\n\t\t\t\tif (typeCount[typeName]) {\n\t\t\t\t\ttypeCount[typeName]++;\n\t\t\t\t} else {\n\t\t\t\t\ttypeCount[typeName] = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Weakness counter.\n\t\t\tfor (const weakness of pokemonWeaknesses) {\n\t\t\t\tweaknessCount[weakness]++;\n\t\t\t}\n\n\t\t\t// Increment level 100 counter\n\t\t\tif (this.getLevel(species) === 100) numMaxLevelPokemon++;\n\n\t\t\t// Ditto check\n\t\t\tif (species.id === 'ditto') this.battleHasDitto = true;\n\t\t}\n\n\t\t// if we don't have enough Pok\u00E9mon, go back to rejects, which are already known to not be invalid.\n\t\twhile (pokemon.length < this.maxTeamSize && rejectedButNotInvalidPool.length) {\n\t\t\tconst species = this.sampleNoReplace(rejectedButNotInvalidPool);\n\t\t\tpokemon.push(this.randomSet(species));\n\t\t}\n\n\t\tif (pokemon.length < this.maxTeamSize && pokemon.length < 12 && !isMonotype) {\n\t\t\tthrow new Error(`Could not build a random team for ${this.format} (seed=${seed})`);\n\t\t}\n\n\t\treturn pokemon;\n\t}\n\n\t/**\n\t * Random set generation for Gen 1 Random Battles.\n\t */\n\trandomSet(species: string | Species): RandomTeamsTypes.RandomSet {\n\t\tspecies = this.dex.species.get(species);\n\t\tif (!species.exists) species = this.dex.species.get('pikachu'); // Because Gen 1.\n\n\t\tconst data = this.randomData[species.id];\n\t\tconst movePool = data.moves?.slice() || [];\n\t\tconst moves = new Set();\n\n\t\t// Either add all moves or add none\n\t\tif (data.comboMoves && data.comboMoves.length <= this.maxMoveCount && this.randomChance(1, 2)) {\n\t\t\tfor (const m of data.comboMoves) moves.add(m);\n\t\t}\n\n\t\t// Add one of the semi-mandatory moves\n\t\t// Often, these are used so that the Pokemon only gets one of the less useful moves\n\t\t// This is added before the essential moves so that combos containing three moves can roll an exclusive move\n\t\tif (moves.size < this.maxMoveCount && data.exclusiveMoves) {\n\t\t\tmoves.add(this.sample(data.exclusiveMoves));\n\t\t}\n\n\t\t// Add the mandatory moves.\n\t\tif (moves.size < this.maxMoveCount && data.essentialMoves) {\n\t\t\tfor (const moveid of data.essentialMoves) {\n\t\t\t\tmoves.add(moveid);\n\t\t\t\tif (moves.size === this.maxMoveCount) break;\n\t\t\t}\n\t\t}\n\n\t\twhile (moves.size < this.maxMoveCount && movePool.length) {\n\t\t\t// Choose next 4 moves from learnset/viable moves and add them to moves list:\n\t\t\twhile (moves.size < this.maxMoveCount && movePool.length) {\n\t\t\t\tconst moveid = this.sampleNoReplace(movePool);\n\t\t\t\tmoves.add(moveid);\n\t\t\t}\n\t\t}\n\n\t\tconst level = this.getLevel(species);\n\n\t\tconst evs = {hp: 255, atk: 255, def: 255, spa: 255, spd: 255, spe: 255};\n\t\tconst ivs = {hp: 30, atk: 30, def: 30, spa: 30, spd: 30, spe: 30};\n\n\t\t// Should be able to use Substitute four times from full HP without fainting\n\t\tif (moves.has('substitute')) {\n\t\t\twhile (evs.hp > 3) {\n\t\t\t\tconst hp = Math.floor(Math.floor(2 * species.baseStats.hp + ivs.hp + Math.floor(evs.hp / 4) + 100) * level / 100 + 10);\n\t\t\t\tif (hp % 4 !== 0) break;\n\t\t\t\tevs.hp -= 4;\n\t\t\t}\n\t\t}\n\n\t\t// Minimize confusion damage\n\t\tconst noAttackStatMoves = [...moves].every(m => {\n\t\t\tconst move = this.dex.moves.get(m);\n\t\t\tif (move.damageCallback || move.damage) return true;\n\t\t\treturn move.category !== 'Physical';\n\t\t});\n\t\tif (noAttackStatMoves && !moves.has('mimic') && !moves.has('transform')) {\n\t\t\tevs.atk = 0;\n\t\t\t// We don't want to lower the HP DV/IV\n\t\t\tivs.atk = 2;\n\t\t}\n\n\t\t// shuffle moves to add more randomness to camomons\n\t\tconst shuffledMoves = Array.from(moves);\n\t\tthis.prng.shuffle(shuffledMoves);\n\n\t\treturn {\n\t\t\tname: species.name,\n\t\t\tspecies: species.name,\n\t\t\tmoves: shuffledMoves,\n\t\t\tability: 'No Ability',\n\t\t\tevs,\n\t\t\tivs,\n\t\t\titem: '',\n\t\t\tlevel,\n\t\t\tshiny: false,\n\t\t\tgender: false,\n\t\t};\n\t}\n\n\trandomHCTeam(): PokemonSet[] {\n\t\tthis.enforceNoDirectCustomBanlistChanges();\n\n\t\tconst team = [];\n\n\t\tconst movePool = [...this.dex.moves.all()];\n\t\tconst typesPool = ['Bird', ...this.dex.types.names()];\n\n\t\tconst randomN = this.randomNPokemon(this.maxTeamSize);\n\t\tconst hackmonsCup: {[k: string]: HackmonsCupEntry} = {};\n\n\t\tfor (const forme of randomN) {\n\t\t\t// Choose forme\n\t\t\tconst species = this.dex.species.get(forme);\n\t\t\tif (!hackmonsCup[species.id]) {\n\t\t\t\thackmonsCup[species.id] = {\n\t\t\t\t\ttypes: [this.sample(typesPool), this.sample(typesPool)],\n\t\t\t\t\tbaseStats: {\n\t\t\t\t\t\thp: Utils.clampIntRange(this.random(256), 1),\n\t\t\t\t\t\tatk: Utils.clampIntRange(this.random(256), 1),\n\t\t\t\t\t\tdef: Utils.clampIntRange(this.random(256), 1),\n\t\t\t\t\t\tspa: Utils.clampIntRange(this.random(256), 1),\n\t\t\t\t\t\tspd: 0,\n\t\t\t\t\t\tspe: Utils.clampIntRange(this.random(256), 1),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tif (this.forceMonotype && !hackmonsCup[species.id].types.includes(this.forceMonotype)) {\n\t\t\t\t\thackmonsCup[species.id].types[1] = this.forceMonotype;\n\t\t\t\t}\n\t\t\t\thackmonsCup[species.id].baseStats.spd = hackmonsCup[species.id].baseStats.spa;\n\t\t\t}\n\t\t\tif (hackmonsCup[species.id].types[0] === hackmonsCup[species.id].types[1]) {\n\t\t\t\thackmonsCup[species.id].types.splice(1, 1);\n\t\t\t}\n\n\t\t\t// Random unique moves\n\t\t\tconst moves = [];\n\t\t\tdo {\n\t\t\t\tconst move = this.sampleNoReplace(movePool);\n\t\t\t\tif (move.gen <= this.gen && !move.isNonstandard && !move.name.startsWith('Hidden Power ')) {\n\t\t\t\t\tmoves.push(move.id);\n\t\t\t\t}\n\t\t\t} while (moves.length < this.maxMoveCount);\n\n\t\t\t// Random EVs\n\t\t\tconst evs = {\n\t\t\t\thp: this.random(256),\n\t\t\t\tatk: this.random(256),\n\t\t\t\tdef: this.random(256),\n\t\t\t\tspa: this.random(256),\n\t\t\t\tspd: 0,\n\t\t\t\tspe: this.random(256),\n\t\t\t};\n\t\t\tevs['spd'] = evs['spa'];\n\n\t\t\t// Random DVs\n\t\t\tconst ivs: StatsTable = {\n\t\t\t\thp: 0,\n\t\t\t\tatk: this.random(16),\n\t\t\t\tdef: this.random(16),\n\t\t\t\tspa: this.random(16),\n\t\t\t\tspd: 0,\n\t\t\t\tspe: this.random(16),\n\t\t\t};\n\t\t\tivs[\"hp\"] = (ivs[\"atk\"] % 2) * 16 + (ivs[\"def\"] % 2) * 8 + (ivs[\"spe\"] % 2) * 4 + (ivs[\"spa\"] % 2) * 2;\n\t\t\tfor (const iv in ivs) {\n\t\t\t\tif (iv === 'hp' || iv === 'spd') continue;\n\t\t\t\tivs[iv as keyof StatsTable] *= 2;\n\t\t\t}\n\t\t\tivs['spd'] = ivs['spa'];\n\n\t\t\t// Level balance\n\t\t\tconst mbstmin = 425;\n\t\t\tconst baseStats = hackmonsCup[species.id].baseStats;\n\t\t\tconst calcStat = (statName: StatID, lvl?: number) => {\n\t\t\t\tif (lvl) {\n\t\t\t\t\treturn Math.floor(Math.floor(2 * baseStats[statName] + ivs[statName] + Math.floor(evs[statName] / 4)) * lvl / 100 + 5);\n\t\t\t\t}\n\t\t\t\treturn Math.floor(2 * baseStats[statName] + ivs[statName] + Math.floor(evs[statName] / 4)) + 5;\n\t\t\t};\n\t\t\tlet mbst = 0;\n\t\t\tfor (const statName of Object.keys(baseStats)) {\n\t\t\t\tmbst += calcStat(statName as StatID);\n\t\t\t\tif (statName === 'hp') mbst += 5;\n\t\t\t}\n\t\t\tlet level;\n\t\t\tif (this.adjustLevel) {\n\t\t\t\tlevel = this.adjustLevel;\n\t\t\t} else {\n\t\t\t\tlevel = Math.floor(100 * mbstmin / mbst);\n\t\t\t\twhile (level < 100) {\n\t\t\t\t\tfor (const statName of Object.keys(baseStats)) {\n\t\t\t\t\t\tmbst += calcStat(statName as StatID, level);\n\t\t\t\t\t\tif (statName === 'hp') mbst += 5;\n\t\t\t\t\t}\n\t\t\t\t\tif (mbst >= mbstmin) break;\n\t\t\t\t\tlevel++;\n\t\t\t\t}\n\t\t\t\tif (level > 100) level = 100;\n\t\t\t}\n\n\t\t\tteam.push({\n\t\t\t\tname: species.baseSpecies,\n\t\t\t\tspecies: species.name,\n\t\t\t\tgender: species.gender,\n\t\t\t\titem: '',\n\t\t\t\tability: 'No Ability',\n\t\t\t\tmoves,\n\t\t\t\tevs,\n\t\t\t\tivs,\n\t\t\t\tnature: '',\n\t\t\t\tlevel,\n\t\t\t\tshiny: false,\n\t\t\t\t// Hacky but the only way to communicate stats/level generation properly\n\t\t\t\thc: hackmonsCup[species.id],\n\t\t\t});\n\t\t}\n\n\t\treturn team;\n\t}\n}\n\nexport default RandomGen1Teams;\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4B;AAC5B,iBAAoB;AAeb,MAAM,wBAAwB,oBAAAA,QAAgB;AAAA,EAA9C;AAAA;AACN,sBAA2D,QAAQ,oBAAoB;AAAA;AAAA;AAAA,EAGvF,eAAe;AACd,SAAK,oCAAoC;AAEzC,UAAM,OAAO,CAAC;AAEd,UAAM,UAAU,KAAK,eAAe,KAAK,aAAa,KAAK,aAAa;AAExE,eAAW,WAAW,SAAS;AAC9B,YAAM,UAAU,KAAK,IAAI,QAAQ,IAAI,OAAO;AAG5C,YAAM,UAAU;AAChB,YAAM,QAAQ,QAAQ;AAGtB,UAAI,OAAQ,MAAM,IAAI,IAAI,IAAI,KAAK,KAAK,MAAO;AAC/C,cAAS,MAAM,KAAK,IAAI,IAAI,KAAK,KAAK,MAAO;AAC7C,cAAS,MAAM,KAAK,IAAI,IAAI,KAAK,KAAK,MAAO;AAC7C,cAAS,MAAM,KAAK,IAAI,IAAI,KAAK,KAAK,MAAO;AAC7C,cAAS,M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