Jofthomas's picture
Jofthomas HF staff
Upload 4781 files
5c2ed06 verified
{
"version": 3,
"sources": ["../../../../data/random-battles/gen9baby/teams.ts"],
"sourcesContent": ["import type { PRNG, PRNGSeed } from \"../../../sim/prng\";\nimport { RandomTeams, type MoveCounter } from \"../gen9/teams\";\nimport { Utils } from '../../../lib';\n\n// First, some lists of moves that can be used for rules throughout set generation. Taken from regular gen9.\n\n// Moves that drop stats:\nconst CONTRARY_MOVES = [\n\t'armorcannon', 'closecombat', 'leafstorm', 'makeitrain', 'overheat', 'spinout', 'superpower', 'vcreate',\n];\n\n// Hazard-setting moves\nconst HAZARDS = [\n\t'spikes', 'stealthrock', 'stickyweb', 'toxicspikes',\n];\n\n// Moves that switch the user out\nconst PIVOT_MOVES = [\n\t'chillyreception', 'flipturn', 'partingshot', 'shedtail', 'teleport', 'uturn', 'voltswitch',\n];\n\n// Moves that boost Attack:\nconst PHYSICAL_SETUP = [\n\t'bellydrum', 'bulkup', 'coil', 'curse', 'dragondance', 'honeclaws', 'howl', 'meditate', 'poweruppunch', 'swordsdance', 'tidyup', 'victorydance',\n];\n\n// Moves that restore HP:\nconst RECOVERY_MOVES = [\n\t'healorder', 'milkdrink', 'moonlight', 'morningsun', 'recover', 'roost', 'shoreup', 'slackoff', 'softboiled', 'strengthsap', 'synthesis',\n];\n\n// Setup (stat-boosting) moves\nconst SETUP = [\n\t'acidarmor', 'agility', 'autotomize', 'bellydrum', 'bulkup', 'calmmind', 'clangoroussoul', 'coil', 'cosmicpower', 'curse',\n\t'dragondance', 'flamecharge', 'growth', 'honeclaws', 'howl', 'irondefense', 'meditate', 'nastyplot', 'noretreat', 'poweruppunch',\n\t'quiverdance', 'raindance', 'rockpolish', 'shellsmash', 'shiftgear', 'snowscape', 'sunnyday', 'swordsdance', 'tailglow', 'tidyup',\n\t'trailblaze', 'workup', 'victorydance',\n];\n\n// Some moves that only boost Speed:\nconst SPEED_SETUP = [\n\t'agility', 'autotomize', 'flamecharge', 'rockpolish', 'trailblaze',\n];\n\n// Moves that would want to generate together\nconst MOVE_PAIRS = [\n\t['lightscreen', 'reflect'],\n\t['sleeptalk', 'rest'],\n\t['protect', 'wish'],\n];\n\nexport class RandomBabyTeams extends RandomTeams {\n\tconstructor(format: Format | string, prng: PRNG | PRNGSeed | null) {\n\t\tsuper(format, prng);\n\n\t\t// Overwrite enforcementcheckers where needed here\n\t\tthis.moveEnforcementCheckers['Bug'] = (movePool, moves, abilities, types, counter) => (\n\t\t\t!counter.get('Bug')\n\t\t);\n\t\tthis.moveEnforcementCheckers['Grass'] = (movePool, moves, abilities, types, counter, species) => (\n\t\t\t!counter.get('Grass') && species.id !== 'rowlet'\n\t\t);\n\t}\n\n\tcullMovePool(\n\t\ttypes: string[],\n\t\tmoves: Set<string>,\n\t\tabilities: string[],\n\t\tcounter: MoveCounter,\n\t\tmovePool: string[],\n\t\tteamDetails: RandomTeamsTypes.TeamDetails,\n\t\tspecies: Species,\n\t\tisLead: boolean,\n\t\tisDoubles: boolean,\n\t\tteraType: string,\n\t\trole: RandomTeamsTypes.Role,\n\t): void {\n\t\tif (moves.size + movePool.length <= this.maxMoveCount) return;\n\t\t// If we have two unfilled moves and only one unpaired move, cull the unpaired move.\n\t\tif (moves.size === this.maxMoveCount - 2) {\n\t\t\tconst unpairedMoves = [...movePool];\n\t\t\tfor (const pair of MOVE_PAIRS) {\n\t\t\t\tif (movePool.includes(pair[0]) && movePool.includes(pair[1])) {\n\t\t\t\t\tthis.fastPop(unpairedMoves, unpairedMoves.indexOf(pair[0]));\n\t\t\t\t\tthis.fastPop(unpairedMoves, unpairedMoves.indexOf(pair[1]));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (unpairedMoves.length === 1) {\n\t\t\t\tthis.fastPop(movePool, movePool.indexOf(unpairedMoves[0]));\n\t\t\t}\n\t\t}\n\n\t\t// These moves are paired, and shouldn't appear if there isn't room for both.\n\t\tif (moves.size === this.maxMoveCount - 1) {\n\t\t\tfor (const pair of MOVE_PAIRS) {\n\t\t\t\tif (movePool.includes(pair[0]) && movePool.includes(pair[1])) {\n\t\t\t\t\tthis.fastPop(movePool, movePool.indexOf(pair[0]));\n\t\t\t\t\tthis.fastPop(movePool, movePool.indexOf(pair[1]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Create list of all status moves to be used later\n\t\tconst statusMoves = this.cachedStatusMoves;\n\n\t\t// Team-based move culls\n\t\tif (teamDetails.screens && movePool.length >= this.maxMoveCount + 2) {\n\t\t\tif (movePool.includes('reflect')) this.fastPop(movePool, movePool.indexOf('reflect'));\n\t\t\tif (movePool.includes('lightscreen')) this.fastPop(movePool, movePool.indexOf('lightscreen'));\n\t\t\tif (moves.size + movePool.length <= this.maxMoveCount) return;\n\t\t}\n\t\tif (teamDetails.stickyWeb) {\n\t\t\tif (movePool.includes('stickyweb')) this.fastPop(movePool, movePool.indexOf('stickyweb'));\n\t\t\tif (moves.size + movePool.length <= this.maxMoveCount) return;\n\t\t}\n\t\tif (teamDetails.stealthRock) {\n\t\t\tif (movePool.includes('stealthrock')) this.fastPop(movePool, movePool.indexOf('stealthrock'));\n\t\t\tif (moves.size + movePool.length <= this.maxMoveCount) return;\n\t\t}\n\t\tif (teamDetails.defog || teamDetails.rapidSpin) {\n\t\t\tif (movePool.includes('defog')) this.fastPop(movePool, movePool.indexOf('defog'));\n\t\t\tif (movePool.includes('rapidspin')) this.fastPop(movePool, movePool.indexOf('rapidspin'));\n\t\t\tif (moves.size + movePool.length <= this.maxMoveCount) return;\n\t\t}\n\t\tif (teamDetails.toxicSpikes) {\n\t\t\tif (movePool.includes('toxicspikes')) this.fastPop(movePool, movePool.indexOf('toxicspikes'));\n\t\t\tif (moves.size + movePool.length <= this.maxMoveCount) return;\n\t\t}\n\t\tif (teamDetails.spikes && teamDetails.spikes >= 2) {\n\t\t\tif (movePool.includes('spikes')) this.fastPop(movePool, movePool.indexOf('spikes'));\n\t\t\tif (moves.size + movePool.length <= this.maxMoveCount) return;\n\t\t}\n\n\t\t// General incompatibilities\n\t\tconst incompatiblePairs = [\n\t\t\t// These moves don't mesh well with other aspects of the set\n\t\t\t[SETUP, 'defog'],\n\t\t\t[SETUP, PIVOT_MOVES],\n\t\t\t[SETUP, HAZARDS],\n\t\t\t[PHYSICAL_SETUP, PHYSICAL_SETUP],\n\t\t\t[statusMoves, ['destinybond', 'healingwish', 'switcheroo', 'trick']],\n\t\t\t['curse', 'rapidspin'],\n\n\t\t\t// These moves are redundant with each other\n\t\t\t[\n\t\t\t\t['alluringvoice', 'dazzlinggleam', 'drainingkiss', 'moonblast'],\n\t\t\t\t['alluringvoice', 'dazzlinggleam', 'drainingkiss', 'moonblast'],\n\t\t\t],\n\t\t\t[['bulletseed', 'gigadrain', 'leafstorm', 'seedbomb'], ['bulletseed', 'gigadrain', 'leafstorm', 'seedbomb']],\n\t\t\t[['hypnosis', 'thunderwave', 'toxic', 'willowisp', 'yawn'], ['hypnosis', 'thunderwave', 'toxic', 'willowisp', 'yawn']],\n\t\t\t['roar', 'yawn'],\n\t\t\t['dragonclaw', 'outrage'],\n\t\t\t['dracometeor', 'dragonpulse'],\n\t\t\t['toxic', 'toxicspikes'],\n\t\t\t['rockblast', 'stoneedge'],\n\t\t\t['bodyslam', 'doubleedge'],\n\t\t\t['gunkshot', 'poisonjab'],\n\t\t\t[['hydropump', 'liquidation'], 'surf'],\n\t\t];\n\n\t\tfor (const pair of incompatiblePairs) this.incompatibleMoves(moves, movePool, pair[0], pair[1]);\n\t}\n\n\t// Generate random moveset for a given species, role, tera type.\n\trandomMoveset(\n\t\ttypes: string[],\n\t\tabilities: string[],\n\t\tteamDetails: RandomTeamsTypes.TeamDetails,\n\t\tspecies: Species,\n\t\tisLead: boolean,\n\t\tisDoubles: boolean,\n\t\tmovePool: string[],\n\t\tteraType: string,\n\t\trole: RandomTeamsTypes.Role,\n\t): Set<string> {\n\t\tconst moves = new Set<string>();\n\t\tlet counter = this.queryMoves(moves, species, teraType, abilities);\n\t\tthis.cullMovePool(types, moves, abilities, counter, movePool, teamDetails, species, isLead, isDoubles, teraType, role);\n\n\t\t// If there are only four moves, add all moves and return early\n\t\tif (movePool.length <= this.maxMoveCount) {\n\t\t\tfor (const moveid of movePool) {\n\t\t\t\tmoves.add(moveid);\n\t\t\t}\n\t\t\treturn moves;\n\t\t}\n\n\t\t// Helper function for (STAB-)move enforcement later on\n\t\tconst runEnforcementChecker = (checkerName: string) => {\n\t\t\tif (!this.moveEnforcementCheckers[checkerName]) return false;\n\t\t\treturn this.moveEnforcementCheckers[checkerName](\n\t\t\t\tmovePool, moves, abilities, types, counter, species, teamDetails, isLead, isDoubles, teraType, role\n\t\t\t);\n\t\t};\n\n\t\tif (role === 'Tera Blast user') {\n\t\t\tcounter = this.addMove('terablast', moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\tmovePool, teraType, role);\n\t\t}\n\n\t\t// Add required move (e.g. Relic Song for Meloetta-P)\n\t\tif (species.requiredMove) {\n\t\t\tconst move = this.dex.moves.get(species.requiredMove).id;\n\t\t\tcounter = this.addMove(move, moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\tmovePool, teraType, role);\n\t\t}\n\n\t\t// Add other moves you really want to have, e.g. STAB, recovery, setup.\n\n\t\t// Enforce Facade if Guts is a possible ability\n\t\tif (movePool.includes('facade') && abilities.includes('Guts')) {\n\t\t\tcounter = this.addMove('facade', moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\tmovePool, teraType, role);\n\t\t}\n\n\t\t// Enforce Sticky Web\n\t\tif (movePool.includes('stickyweb')) {\n\t\t\tcounter = this.addMove('stickyweb', moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\tmovePool, teraType, role);\n\t\t}\n\n\t\t// Enforce Knock Off on most roles\n\t\tif (movePool.includes('knockoff') && role !== 'Bulky Support') {\n\t\t\tcounter = this.addMove('knockoff', moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\tmovePool, teraType, role);\n\t\t}\n\n\t\t// Enforce hazard removal on Bulky Support if the team doesn't already have it\n\t\tif (role === 'Bulky Support' && !teamDetails.defog && !teamDetails.rapidSpin) {\n\t\t\tif (movePool.includes('rapidspin')) {\n\t\t\t\tcounter = this.addMove('rapidspin', moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\tmovePool, teraType, role);\n\t\t\t}\n\t\t\tif (movePool.includes('defog')) {\n\t\t\t\tcounter = this.addMove('defog', moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\tmovePool, teraType, role);\n\t\t\t}\n\t\t}\n\n\t\t// Enforce Knock Off on pure Normal- and Fighting-types\n\t\tif (types.length === 1 && (types.includes('Normal') || types.includes('Fighting'))) {\n\t\t\tif (movePool.includes('knockoff')) {\n\t\t\t\tcounter = this.addMove('knockoff', moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\tmovePool, teraType, role);\n\t\t\t}\n\t\t}\n\n\t\t// Enforce STAB priority\n\t\tif (role === 'Wallbreaker') {\n\t\t\tconst priorityMoves = [];\n\t\t\tfor (const moveid of movePool) {\n\t\t\t\tconst move = this.dex.moves.get(moveid);\n\t\t\t\tconst moveType = this.getMoveType(move, species, abilities, teraType);\n\t\t\t\tif (\n\t\t\t\t\ttypes.includes(moveType) && (move.priority > 0 || (moveid === 'grassyglide' && abilities.includes('Grassy Surge'))) &&\n\t\t\t\t\t(move.basePower || move.basePowerCallback)\n\t\t\t\t) {\n\t\t\t\t\tpriorityMoves.push(moveid);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (priorityMoves.length) {\n\t\t\t\tconst moveid = this.sample(priorityMoves);\n\t\t\t\tcounter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\tmovePool, teraType, role);\n\t\t\t}\n\t\t}\n\n\t\t// Enforce STAB\n\t\tfor (const type of types) {\n\t\t\t// Check if a STAB move of that type should be required\n\t\t\tconst stabMoves = [];\n\t\t\tfor (const moveid of movePool) {\n\t\t\t\tconst move = this.dex.moves.get(moveid);\n\t\t\t\tconst moveType = this.getMoveType(move, species, abilities, teraType);\n\t\t\t\tif (!this.noStab.includes(moveid) && (move.basePower || move.basePowerCallback) && type === moveType) {\n\t\t\t\t\tstabMoves.push(moveid);\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (runEnforcementChecker(type)) {\n\t\t\t\tif (!stabMoves.length) break;\n\t\t\t\tconst moveid = this.sampleNoReplace(stabMoves);\n\t\t\t\tcounter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\tmovePool, teraType, role);\n\t\t\t}\n\t\t}\n\n\t\t// Enforce Tera STAB\n\t\tif (!counter.get('stabtera') && role !== 'Bulky Support') {\n\t\t\tconst stabMoves = [];\n\t\t\tfor (const moveid of movePool) {\n\t\t\t\tconst move = this.dex.moves.get(moveid);\n\t\t\t\tconst moveType = this.getMoveType(move, species, abilities, teraType);\n\t\t\t\tif (!this.noStab.includes(moveid) && (move.basePower || move.basePowerCallback) && teraType === moveType) {\n\t\t\t\t\tstabMoves.push(moveid);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (stabMoves.length) {\n\t\t\t\tconst moveid = this.sample(stabMoves);\n\t\t\t\tcounter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\tmovePool, teraType, role);\n\t\t\t}\n\t\t}\n\n\t\t// If no STAB move was added, add a STAB move\n\t\tif (!counter.get('stab')) {\n\t\t\tconst stabMoves = [];\n\t\t\tfor (const moveid of movePool) {\n\t\t\t\tconst move = this.dex.moves.get(moveid);\n\t\t\t\tconst moveType = this.getMoveType(move, species, abilities, teraType);\n\t\t\t\tif (!this.noStab.includes(moveid) && (move.basePower || move.basePowerCallback) && types.includes(moveType)) {\n\t\t\t\t\tstabMoves.push(moveid);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (stabMoves.length) {\n\t\t\t\tconst moveid = this.sample(stabMoves);\n\t\t\t\tcounter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\tmovePool, teraType, role);\n\t\t\t}\n\t\t}\n\n\t\t// Enforce contrary moves\n\t\tif (abilities.includes('Contrary')) {\n\t\t\tconst contraryMoves = movePool.filter(moveid => CONTRARY_MOVES.includes(moveid));\n\t\t\tfor (const moveid of contraryMoves) {\n\t\t\t\tcounter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\tmovePool, teraType, role);\n\t\t\t}\n\t\t}\n\n\t\t// Enforce recovery\n\t\tif (['Bulky Support', 'Bulky Attacker', 'Bulky Setup'].includes(role)) {\n\t\t\tconst recoveryMoves = movePool.filter(moveid => RECOVERY_MOVES.includes(moveid));\n\t\t\tif (recoveryMoves.length) {\n\t\t\t\tconst moveid = this.sample(recoveryMoves);\n\t\t\t\tcounter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\tmovePool, teraType, role);\n\t\t\t}\n\t\t}\n\n\t\t// Enforce setup\n\t\tif (role.includes('Setup') || role === 'Tera Blast user') {\n\t\t\t// First, try to add a non-Speed setup move\n\t\t\tconst nonSpeedSetupMoves = movePool.filter(moveid => SETUP.includes(moveid) && !SPEED_SETUP.includes(moveid));\n\t\t\tif (nonSpeedSetupMoves.length) {\n\t\t\t\tconst moveid = this.sample(nonSpeedSetupMoves);\n\t\t\t\tcounter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\tmovePool, teraType, role);\n\t\t\t} else {\n\t\t\t\t// No non-Speed setup moves, so add any (Speed) setup move\n\t\t\t\tconst setupMoves = movePool.filter(moveid => SETUP.includes(moveid));\n\t\t\t\tif (setupMoves.length) {\n\t\t\t\t\tconst moveid = this.sample(setupMoves);\n\t\t\t\t\tcounter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\t\tmovePool, teraType, role);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Enforce a move not on the noSTAB list\n\t\tif (!counter.damagingMoves.size) {\n\t\t\t// Choose an attacking move\n\t\t\tconst attackingMoves = [];\n\t\t\tfor (const moveid of movePool) {\n\t\t\t\tconst move = this.dex.moves.get(moveid);\n\t\t\t\tif (!this.noStab.includes(moveid) && (move.category !== 'Status')) attackingMoves.push(moveid);\n\t\t\t}\n\t\t\tif (attackingMoves.length) {\n\t\t\t\tconst moveid = this.sample(attackingMoves);\n\t\t\t\tcounter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\tmovePool, teraType, role);\n\t\t\t}\n\t\t}\n\n\t\t// Enforce coverage move\n\t\tif (!['Fast Support', 'Bulky Support'].includes(role) || species.id === 'magnemite') {\n\t\t\tif (counter.damagingMoves.size === 1) {\n\t\t\t\t// Find the type of the current attacking move\n\t\t\t\tconst currentAttackType = counter.damagingMoves.values().next().value!.type;\n\t\t\t\t// Choose an attacking move that is of different type to the current single attack\n\t\t\t\tconst coverageMoves = [];\n\t\t\t\tfor (const moveid of movePool) {\n\t\t\t\t\tconst move = this.dex.moves.get(moveid);\n\t\t\t\t\tconst moveType = this.getMoveType(move, species, abilities, teraType);\n\t\t\t\t\tif (!this.noStab.includes(moveid) && (move.basePower || move.basePowerCallback)) {\n\t\t\t\t\t\tif (currentAttackType !== moveType) coverageMoves.push(moveid);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (coverageMoves.length) {\n\t\t\t\t\tconst moveid = this.sample(coverageMoves);\n\t\t\t\t\tcounter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\t\tmovePool, teraType, role);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add (moves.size < this.maxMoveCount) as a condition if moves is getting larger than 4 moves.\n\t\t// If you want moves to be favored but not required, add something like && this.randomChance(1, 2) to your condition.\n\n\t\t// Choose remaining moves randomly from movepool and add them to moves list:\n\t\twhile (moves.size < this.maxMoveCount && movePool.length) {\n\t\t\tif (moves.size + movePool.length <= this.maxMoveCount) {\n\t\t\t\tfor (const moveid of movePool) {\n\t\t\t\t\tmoves.add(moveid);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst moveid = this.sample(movePool);\n\t\t\tcounter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\tmovePool, teraType, role);\n\t\t\tfor (const pair of MOVE_PAIRS) {\n\t\t\t\tif (moveid === pair[0] && movePool.includes(pair[1])) {\n\t\t\t\t\tcounter = this.addMove(pair[1], moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\t\tmovePool, teraType, role);\n\t\t\t\t}\n\t\t\t\tif (moveid === pair[1] && movePool.includes(pair[0])) {\n\t\t\t\t\tcounter = this.addMove(pair[0], moves, types, abilities, teamDetails, species, isLead, isDoubles,\n\t\t\t\t\t\tmovePool, teraType, role);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn moves;\n\t}\n\n\tgetAbility(\n\t\ttypes: string[],\n\t\tmoves: Set<string>,\n\t\tabilities: string[],\n\t\tcounter: MoveCounter,\n\t\tteamDetails: RandomTeamsTypes.TeamDetails,\n\t\tspecies: Species,\n\t\tisLead: boolean,\n\t\tisDoubles: boolean,\n\t\tteraType: string,\n\t\trole: RandomTeamsTypes.Role,\n\t): string {\n\t\tif (abilities.length <= 1) return abilities[0];\n\n\t\t// Hard-code abilities here\n\t\tif (species.id === 'rowlet' && counter.get('Grass')) return 'Overgrow';\n\t\tif (species.id === 'riolu') return moves.has('copycat') ? 'Prankster' : 'Inner Focus';\n\t\tif (species.id === 'pikipek' && counter.get('skilllink')) return 'Skill Link';\n\t\tif (species.id === 'psyduck' && teamDetails.rain) return 'Swift Swim';\n\n\t\tconst abilityAllowed: string[] = [];\n\t\t// Obtain a list of abilities that are allowed (not culled)\n\t\tfor (const ability of abilities) {\n\t\t\tif (!this.shouldCullAbility(\n\t\t\t\tability, types, moves, abilities, counter, teamDetails, species, isLead, isDoubles, teraType, role\n\t\t\t)) {\n\t\t\t\tabilityAllowed.push(ability);\n\t\t\t}\n\t\t}\n\n\t\t// Pick a random allowed ability\n\t\tif (abilityAllowed.length >= 1) return this.sample(abilityAllowed);\n\n\t\t// If all abilities are rejected, prioritize weather abilities over non-weather abilities\n\t\tif (!abilityAllowed.length) {\n\t\t\tconst weatherAbilities = abilities.filter(\n\t\t\t\ta => ['Chlorophyll', 'Hydration', 'Sand Force', 'Sand Rush', 'Slush Rush', 'Solar Power', 'Swift Swim'].includes(a)\n\t\t\t);\n\t\t\tif (weatherAbilities.length) return this.sample(weatherAbilities);\n\t\t}\n\n\t\t// Pick a random ability\n\t\treturn this.sample(abilities);\n\t}\n\n\tgetPriorityItem(\n\t\tability: string,\n\t\ttypes: string[],\n\t\tmoves: Set<string>,\n\t\tcounter: MoveCounter,\n\t\tteamDetails: RandomTeamsTypes.TeamDetails,\n\t\tspecies: Species,\n\t\tisLead: boolean,\n\t\tisDoubles: boolean,\n\t\tteraType: string,\n\t\trole: RandomTeamsTypes.Role,\n\t) {\n\t\tif (species.requiredItems) {\n\t\t\treturn this.sample(species.requiredItems);\n\t\t}\n\n\t\tif (moves.has('focusenergy')) return 'Scope Lens';\n\t\tif (moves.has('thief')) return '';\n\t\tif (moves.has('trick') || moves.has('switcheroo')) return 'Choice Scarf';\n\n\t\tif (moves.has('acrobatics')) return ability === 'Unburden' ? 'Oran Berry' : '';\n\t\tif (moves.has('auroraveil') || moves.has('lightscreen') && moves.has('reflect')) return 'Light Clay';\n\n\t\tif (ability === 'Guts' && moves.has('facade')) return 'Flame Orb';\n\t\tif (ability === 'Quick Feet') return 'Toxic Orb';\n\n\t\tif (['Harvest', 'Ripen', 'Unburden'].includes(ability) || moves.has('bellydrum')) return 'Oran Berry';\n\t}\n\n\tgetItem(\n\t\tability: string,\n\t\ttypes: string[],\n\t\tmoves: Set<string>,\n\t\tcounter: MoveCounter,\n\t\tteamDetails: RandomTeamsTypes.TeamDetails,\n\t\tspecies: Species,\n\t\tisLead: boolean,\n\t\tteraType: string,\n\t\trole: RandomTeamsTypes.Role,\n\t): string {\n\t\tif (role === 'Fast Attacker' && (!counter.get('Status') || (counter.get('Status') === 1 && moves.has('destinybond')))) {\n\t\t\treturn 'Choice Scarf';\n\t\t}\n\t\tif (['Setup Sweeper', 'Wallbreaker'].includes(role)) {\n\t\t\treturn 'Life Orb';\n\t\t}\n\t\treturn 'Eviolite';\n\t}\n\n\tgetLevel(\n\t\tspecies: Species,\n\t): number {\n\t\tif (this.adjustLevel) return this.adjustLevel;\n\t\t// This should frankly always work, but 10 is the default level in case something bad happens\n\t\treturn this.randomSets[species.id]?.level || 10;\n\t}\n\n\tgetForme(species: Species): string {\n\t\tif (typeof species.battleOnly === 'string') {\n\t\t\t// Only change the forme. The species has custom moves, and may have different typing and requirements.\n\t\t\treturn species.battleOnly;\n\t\t}\n\t\tif (species.cosmeticFormes) return this.sample([species.name].concat(species.cosmeticFormes));\n\n\t\t// Consolidate mostly-cosmetic formes, at least for the purposes of Random Battles\n\t\tif (['Poltchageist', 'Sinistea'].includes(species.baseSpecies)) {\n\t\t\treturn this.sample([species.name].concat(species.otherFormes!));\n\t\t}\n\t\treturn species.name;\n\t}\n\n\trandomSet(\n\t\ts: string | Species,\n\t\tteamDetails: RandomTeamsTypes.TeamDetails = {},\n\t\tisLead = false,\n\t\tisDoubles = false\n\t): RandomTeamsTypes.RandomSet {\n\t\tconst species = this.dex.species.get(s);\n\t\tconst forme = this.getForme(species);\n\t\tconst sets = this.randomSets[species.id][\"sets\"];\n\t\tconst possibleSets = [];\n\n\t\tconst ruleTable = this.dex.formats.getRuleTable(this.format);\n\n\t\tfor (const set of sets) {\n\t\t\t// Prevent Tera Blast user if the team already has one, or if Terastallizion is prevented.\n\t\t\tif ((teamDetails.teraBlast || ruleTable.has('terastalclause')) && set.role === 'Tera Blast user') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tpossibleSets.push(set);\n\t\t}\n\t\tconst set = this.sampleIfArray(possibleSets);\n\t\tconst role = set.role;\n\t\tconst movePool: string[] = [];\n\t\tfor (const movename of set.movepool) {\n\t\t\tmovePool.push(this.dex.moves.get(movename).id);\n\t\t}\n\t\tconst teraTypes = set.teraTypes;\n\t\tlet teraType = this.sampleIfArray(teraTypes);\n\n\t\tlet ability = '';\n\t\tlet item = undefined;\n\n\t\tconst evs = { hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85 };\n\t\tconst ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 };\n\n\t\tconst types = species.types;\n\t\tconst abilities = set.abilities!;\n\n\t\t// Get moves\n\t\tconst moves = this.randomMoveset(types, abilities, teamDetails, species, isLead, isDoubles, movePool, teraType!, role);\n\t\tconst counter = this.queryMoves(moves, species, teraType!, abilities);\n\n\t\t// Get ability\n\t\tability = this.getAbility(types, moves, abilities, counter, teamDetails, species, isLead, isDoubles, teraType!, role);\n\n\t\t// Get items\n\t\t// First, the priority items\n\t\titem = this.getPriorityItem(ability, types, moves, counter, teamDetails, species, isLead, isDoubles, teraType!, role);\n\t\tif (item === undefined) {\n\t\t\titem = this.getItem(ability, types, moves, counter, teamDetails, species, isLead, teraType!, role);\n\t\t}\n\n\t\t// Get level\n\t\tconst level = this.getLevel(species);\n\n\t\t// Prepare optimal HP for Belly Drum and Life Orb\n\t\tlet hp = Math.floor(Math.floor(2 * species.baseStats.hp + ivs.hp + Math.floor(evs.hp / 4) + 100) * level / 100 + 10);\n\t\tlet targetHP = hp;\n\t\tconst minimumHP = Math.floor(Math.floor(2 * species.baseStats.hp + 100) * level / 100 + 10);\n\t\tif (item === \"Life Orb\") {\n\t\t\ttargetHP = Math.floor(hp / 10) * 10 - 1;\n\t\t} else if (moves.has(\"bellydrum\")) {\n\t\t\ttargetHP = Math.floor(hp / 2) * 2;\n\t\t}\n\t\t// If the difference is too extreme, don't adjust HP\n\t\tif (hp > targetHP && hp - targetHP <= 3 && targetHP >= minimumHP) {\n\t\t\t// If setting evs to 0 is sufficient, decrement evs, otherwise decrement ivs with evs set to 0\n\t\t\tif (Math.floor(Math.floor(2 * species.baseStats.hp + ivs.hp + 100) * level / 100 + 10) >= targetHP) {\n\t\t\t\tevs.hp = 0;\n\t\t\t\thp = Math.floor(Math.floor(2 * species.baseStats.hp + ivs.hp + Math.floor(evs.hp / 4) + 100) * level / 100 + 10);\n\t\t\t\twhile (hp > targetHP) {\n\t\t\t\t\tivs.hp -= 1;\n\t\t\t\t\thp = Math.floor(Math.floor(2 * species.baseStats.hp + ivs.hp + Math.floor(evs.hp / 4) + 100) * level / 100 + 10);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile (hp > targetHP) {\n\t\t\t\t\tevs.hp -= 4;\n\t\t\t\t\thp = Math.floor(Math.floor(2 * species.baseStats.hp + ivs.hp + Math.floor(evs.hp / 4) + 100) * level / 100 + 10);\n\t\t\t\t}\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\tif (move.id === 'shellsidearm') return false;\n\t\t\tif (move.id === 'terablast' && (\n\t\t\t\tspecies.id === 'porygon' || species.baseStats.atk > species.baseStats.spa)\n\t\t\t) return false;\n\t\t\treturn move.category !== 'Physical' || move.id === 'bodypress' || move.id === 'foulplay';\n\t\t});\n\n\t\tif (noAttackStatMoves) {\n\t\t\tevs.atk = 0;\n\t\t\tivs.atk = 0;\n\t\t}\n\n\t\tif (moves.has('gyroball') || moves.has('trickroom')) {\n\t\t\tevs.spe = 0;\n\t\t\tivs.spe = 0;\n\t\t}\n\n\t\t// Enforce Tera Type after all set generation is done to prevent infinite generation\n\t\tif (this.forceTeraType) teraType = this.forceTeraType;\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\t\treturn {\n\t\t\tname: species.baseSpecies,\n\t\t\tspecies: forme,\n\t\t\tgender: species.gender,\n\t\t\tshiny: this.randomChance(1, 1024),\n\t\t\tlevel,\n\t\t\tmoves: shuffledMoves,\n\t\t\tability,\n\t\t\tevs,\n\t\t\tivs,\n\t\t\titem,\n\t\t\tteraType,\n\t\t\trole,\n\t\t};\n\t}\n\n\trandomSets: { [species: string]: RandomTeamsTypes.RandomSpeciesData } = require('./sets.json');\n\n\trandomBabyTeam() {\n\t\tthis.enforceNoDirectCustomBanlistChanges();\n\n\t\tconst seed = this.prng.getSeed();\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().filter(name => name !== \"Stellar\");\n\t\tconst type = this.forceMonotype || this.sample(typePool);\n\n\t\tconst baseFormes = new Set<string>();\n\n\t\tconst typeCount = new Utils.Multiset<string>();\n\t\tconst typeComboCount = new Utils.Multiset<string>();\n\t\tconst typeWeaknesses = new Utils.Multiset<string>();\n\t\tconst typeDoubleWeaknesses = new Utils.Multiset<string>();\n\t\tconst teamDetails: RandomTeamsTypes.TeamDetails = {};\n\n\t\tconst pokemonList = Object.keys(this.randomSets);\n\t\tconst [pokemonPool, baseSpeciesPool] = this.getPokemonPool(type, pokemon, isMonotype, pokemonList);\n\n\t\twhile (baseSpeciesPool.length && pokemon.length < this.maxTeamSize) {\n\t\t\tconst baseSpecies = this.sampleNoReplace(baseSpeciesPool);\n\t\t\tconst species = this.dex.species.get(this.sample(pokemonPool[baseSpecies]));\n\t\t\tif (!species.exists) continue;\n\n\t\t\t// Limit to one of each species (Species Clause)\n\t\t\tif (baseFormes.has(species.baseSpecies)) continue;\n\n\t\t\t// Illusion shouldn't be on the last slot\n\t\t\tif (species.baseSpecies === 'Zorua' && pokemon.length >= (this.maxTeamSize - 1)) continue;\n\n\t\t\tconst types = species.types;\n\t\t\tconst typeCombo = types.slice().sort().join();\n\t\t\tconst weakToFreezeDry = (\n\t\t\t\tthis.dex.getEffectiveness('Ice', species) > 0 ||\n\t\t\t\t(this.dex.getEffectiveness('Ice', species) > -2 && types.includes('Water'))\n\t\t\t);\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\tif (!isMonotype && !this.forceMonotype) {\n\t\t\t\tlet skip = false;\n\n\t\t\t\t// Limit two of any type\n\t\t\t\tfor (const typeName of types) {\n\t\t\t\t\tif (typeCount.get(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\t\t\t\tif (skip) continue;\n\n\t\t\t\t// Limit three weak to any type, and one double weak to any type\n\t\t\t\tfor (const typeName of this.dex.types.names()) {\n\t\t\t\t\t// it's weak to the type\n\t\t\t\t\tif (this.dex.getEffectiveness(typeName, species) > 0) {\n\t\t\t\t\t\tif (typeWeaknesses.get(typeName) >= 3 * limitFactor) {\n\t\t\t\t\t\t\tskip = true;\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\tif (this.dex.getEffectiveness(typeName, species) > 1) {\n\t\t\t\t\t\tif (typeDoubleWeaknesses.get(typeName) >= limitFactor) {\n\t\t\t\t\t\t\tskip = true;\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\tif (skip) continue;\n\n\t\t\t\t// Count Dry Skin/Fluffy as Fire weaknesses\n\t\t\t\tif (\n\t\t\t\t\tthis.dex.getEffectiveness('Fire', species) === 0 &&\n\t\t\t\t\tObject.values(species.abilities).filter(a => ['Dry Skin', 'Fluffy'].includes(a)).length &&\n\t\t\t\t\ttypeWeaknesses.get('Fire') >= 3 * limitFactor\n\t\t\t\t) continue;\n\n\t\t\t\t// Limit four weak to Freeze-Dry\n\t\t\t\tif (weakToFreezeDry) {\n\t\t\t\t\tif (typeWeaknesses.get('Freeze-Dry') >= 4 * limitFactor) continue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Limit three of any type combination in Monotype\n\t\t\tif (!this.forceMonotype && isMonotype && typeComboCount.get(typeCombo) >= 3 * limitFactor) continue;\n\n\t\t\tconst set: RandomTeamsTypes.RandomSet = this.randomSet(species, teamDetails, false, false);\n\t\t\tpokemon.push(set);\n\n\t\t\t// Don't bother tracking details for the last Pokemon\n\t\t\tif (pokemon.length === this.maxTeamSize) break;\n\n\t\t\t// Now that our Pokemon has passed all checks, we can increment our counters\n\t\t\tbaseFormes.add(species.baseSpecies);\n\n\t\t\t// Increment type counters\n\t\t\tfor (const typeName of types) {\n\t\t\t\ttypeCount.add(typeName);\n\t\t\t}\n\t\t\ttypeComboCount.add(typeCombo);\n\n\t\t\t// Increment weakness counter\n\t\t\tfor (const typeName of this.dex.types.names()) {\n\t\t\t\t// it's weak to the type\n\t\t\t\tif (this.dex.getEffectiveness(typeName, species) > 0) {\n\t\t\t\t\ttypeWeaknesses.add(typeName);\n\t\t\t\t}\n\t\t\t\tif (this.dex.getEffectiveness(typeName, species) > 1) {\n\t\t\t\t\ttypeDoubleWeaknesses.add(typeName);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Count Dry Skin/Fluffy as Fire weaknesses\n\t\t\tif (['Dry Skin', 'Fluffy'].includes(set.ability) && this.dex.getEffectiveness('Fire', species) === 0) {\n\t\t\t\ttypeWeaknesses.add('Fire');\n\t\t\t}\n\t\t\tif (weakToFreezeDry) typeWeaknesses.add('Freeze-Dry');\n\n\t\t\t// Track what the team has\n\t\t\tif (set.ability === 'Drizzle' || set.moves.includes('raindance')) teamDetails.rain = 1;\n\t\t\tif (set.ability === 'Drought' || set.moves.includes('sunnyday')) teamDetails.sun = 1;\n\t\t\tif (set.ability === 'Sand Stream') teamDetails.sand = 1;\n\t\t\tif (set.ability === 'Snow Warning' || set.moves.includes('snowscape') || set.moves.includes('chillyreception')) {\n\t\t\t\tteamDetails.snow = 1;\n\t\t\t}\n\t\t\tif (set.moves.includes('spikes')) {\n\t\t\t\tteamDetails.spikes = (teamDetails.spikes || 0) + 1;\n\t\t\t}\n\t\t\tif (set.moves.includes('stealthrock')) teamDetails.stealthRock = 1;\n\t\t\tif (set.moves.includes('stickyweb')) teamDetails.stickyWeb = 1;\n\t\t\tif (set.moves.includes('toxicspikes') || set.ability === 'Toxic Debris') teamDetails.toxicSpikes = 1;\n\t\t\tif (set.moves.includes('defog')) teamDetails.defog = 1;\n\t\t\tif (set.moves.includes('rapidspin') || set.moves.includes('mortalspin')) teamDetails.rapidSpin = 1;\n\t\t\tif (set.moves.includes('auroraveil') || (set.moves.includes('reflect') && set.moves.includes('lightscreen'))) {\n\t\t\t\tteamDetails.screens = 1;\n\t\t\t}\n\t\t\tif (set.role === 'Tera Blast user') {\n\t\t\t\tteamDetails.teraBlast = 1;\n\t\t\t}\n\t\t}\n\t\t// large teams sometimes cannot be built, and monotype is also at user's own risk\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\nexport default RandomBabyTeams;\n"],
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAA8C;AAC9C,iBAAsB;AAKtB,MAAM,iBAAiB;AAAA,EACtB;AAAA,EAAe;AAAA,EAAe;AAAA,EAAa;AAAA,EAAc;AAAA,EAAY;AAAA,EAAW;AAAA,EAAc;AAC/F;AAGA,MAAM,UAAU;AAAA,EACf;AAAA,EAAU;AAAA,EAAe;AAAA,EAAa;AACvC;AAGA,MAAM,cAAc;AAAA,EACnB;AAAA,EAAmB;AAAA,EAA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