{ "version": 3, "sources": ["../../../../data/random-battles/gen5/teams.ts"], "sourcesContent": ["import RandomGen6Teams from '../gen6/teams';\nimport type { PRNG } from '../../../sim';\nimport type { MoveCounter } from '../gen8/teams';\nimport { toID } from '../../../sim/dex';\n\n// Moves that restore HP:\nconst RECOVERY_MOVES = [\n\t'healorder', 'milkdrink', 'moonlight', 'morningsun', 'recover', 'roost', 'slackoff', 'softboiled', 'synthesis',\n];\n// Moves that boost Attack:\nconst PHYSICAL_SETUP = [\n\t'bellydrum', 'bulkup', 'coil', 'curse', 'dragondance', 'honeclaws', 'howl', 'meditate', 'screech', 'swordsdance',\n];\n// Some moves that only boost Speed:\nconst SPEED_SETUP = [\n\t'agility', 'autotomize', 'flamecharge', 'rockpolish',\n];\n// Conglomerate for ease of access\nconst SETUP = [\n\t'acidarmor', 'agility', 'autotomize', 'bellydrum', 'bulkup', 'calmmind', 'coil', 'curse', 'dragondance', 'flamecharge',\n\t'growth', 'honeclaws', 'howl', 'irondefense', 'meditate', 'nastyplot', 'quiverdance', 'raindance', 'rockpolish',\n\t'shellsmash', 'shiftgear', 'sunnyday', 'swordsdance', 'tailglow', 'workup',\n];\n// Moves that shouldn't be the only STAB moves:\nconst NO_STAB = [\n\t'aquajet', 'bulletpunch', 'chatter', 'clearsmog', 'dragontail', 'eruption', 'explosion', 'fakeout', 'flamecharge',\n\t'futuresight', 'iceshard', 'icywind', 'incinerate', 'knockoff', 'machpunch', 'pluck', 'pursuit', 'quickattack',\n\t'rapidspin', 'reversal', 'selfdestruct', 'shadowsneak', 'skyattack', 'skydrop', 'snarl', 'suckerpunch',\n\t'uturn', 'vacuumwave', 'voltswitch', 'waterspout',\n];\n// Hazard-setting moves\nconst HAZARDS = [\n\t'spikes', 'stealthrock', 'toxicspikes',\n];\n// Moves that switch the user out\nconst PIVOT_MOVES = [\n\t'uturn', 'voltswitch',\n];\n\n// Moves that should be paired together when possible\nconst MOVE_PAIRS = [\n\t['lightscreen', 'reflect'],\n\t['sleeptalk', 'rest'],\n\t['protect', 'wish'],\n\t['leechseed', 'substitute'],\n];\n\n/** Pokemon who always want priority STAB, and are fine with it as its only STAB move of that type */\nconst PRIORITY_POKEMON = [\n\t'bisharp', 'breloom', 'cacturne', 'dusknoir', 'honchkrow', 'scizor', 'shedinja', 'shiftry',\n];\n\nexport class RandomGen5Teams extends RandomGen6Teams {\n\trandomSets: { [species: string]: RandomTeamsTypes.RandomSpeciesData } = require('./sets.json');\n\n\tconstructor(format: string | Format, prng: PRNG | PRNGSeed | null) {\n\t\tsuper(format, prng);\n\t\tthis.noStab = NO_STAB;\n\t\tthis.priorityPokemon = PRIORITY_POKEMON;\n\n\t\tthis.moveEnforcementCheckers = {\n\t\t\tBug: (movePool, moves, abilities, types, counter) => (\n\t\t\t\t!counter.get('Bug') && (movePool.includes('megahorn') || abilities.includes('Tinted Lens'))\n\t\t\t),\n\t\t\tDark: (movePool, moves, abilities, types, counter) => !counter.get('Dark'),\n\t\t\tDragon: (movePool, moves, abilities, types, counter) => !counter.get('Dragon'),\n\t\t\tElectric: (movePool, moves, abilities, types, counter) => !counter.get('Electric'),\n\t\t\tFighting: (movePool, moves, abilities, types, counter) => !counter.get('Fighting'),\n\t\t\tFire: (movePool, moves, abilities, types, counter) => !counter.get('Fire'),\n\t\t\tFlying: (movePool, moves, abilities, types, counter, species) => (\n\t\t\t\t!counter.get('Flying') && !['aerodactyl', 'mantine', 'murkrow'].includes(species.id) &&\n\t\t\t\t!movePool.includes('hiddenpowerflying')\n\t\t\t),\n\t\t\tGhost: (movePool, moves, abilities, types, counter) => !counter.get('Ghost'),\n\t\t\tGrass: (movePool, moves, abilities, types, counter, species) => (\n\t\t\t\t!counter.get('Grass') && (species.baseStats.atk >= 100 || movePool.includes('leafstorm'))\n\t\t\t),\n\t\t\tGround: (movePool, moves, abilities, types, counter) => !counter.get('Ground'),\n\t\t\tIce: (movePool, moves, abilities, types, counter) => !counter.get('Ice'),\n\t\t\tPoison: (movePool, moves, abilities, types, counter) => (\n\t\t\t\t!counter.get('Poison') && (types.has('Grass') || types.has('Ground'))\n\t\t\t),\n\t\t\tPsychic: (movePool, moves, abilities, types, counter) => (\n\t\t\t\t!counter.get('Psychic') && (types.has('Fighting') || movePool.includes('calmmind'))\n\t\t\t),\n\t\t\tRock: (movePool, moves, abilities, types, counter, species) => (!counter.get('Rock') && species.baseStats.atk >= 80),\n\t\t\tSteel: (movePool, moves, abilities, types, counter, species) => (\n\t\t\t\t!counter.get('Steel') && ['aggron', 'metagross'].includes(species.id)\n\t\t\t),\n\t\t\tWater: (movePool, moves, abilities, types, counter) => !counter.get('Water'),\n\t\t};\n\t\t// Nature Power is Earthquake this gen\n\t\tthis.cachedStatusMoves = this.dex.moves.all()\n\t\t\t.filter(move => move.category === 'Status' && move.id !== 'naturepower')\n\t\t\t.map(move => move.id);\n\t}\n\n\tcullMovePool(\n\t\ttypes: string[],\n\t\tmoves: Set,\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\tpreferredType: string,\n\t\trole: RandomTeamsTypes.Role,\n\t): void {\n\t\t// Pokemon cannot have multiple Hidden Powers in any circumstance\n\t\tlet hasHiddenPower = false;\n\t\tfor (const move of moves) {\n\t\t\tif (move.startsWith('hiddenpower')) hasHiddenPower = true;\n\t\t}\n\t\tif (hasHiddenPower) {\n\t\t\tlet movePoolHasHiddenPower = true;\n\t\t\twhile (movePoolHasHiddenPower) {\n\t\t\t\tmovePoolHasHiddenPower = false;\n\t\t\t\tfor (const moveid of movePool) {\n\t\t\t\t\tif (moveid.startsWith('hiddenpower')) {\n\t\t\t\t\t\tthis.fastPop(movePool, movePool.indexOf(moveid));\n\t\t\t\t\t\tmovePoolHasHiddenPower = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\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 is not room for them 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// 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.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.rapidSpin) {\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\t\tif (teamDetails.statusCure) {\n\t\t\tif (movePool.includes('aromatherapy')) this.fastPop(movePool, movePool.indexOf('aromatherapy'));\n\t\t\tif (movePool.includes('healbell')) this.fastPop(movePool, movePool.indexOf('healbell'));\n\t\t\tif (moves.size + movePool.length <= this.maxMoveCount) return;\n\t\t}\n\n\t\t// Develop additional move lists\n\t\tconst badWithSetup = ['healbell', 'pursuit', 'toxic'];\n\t\tconst statusMoves = this.cachedStatusMoves;\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[statusMoves, ['healingwish', 'switcheroo', 'trick']],\n\t\t\t[SETUP, PIVOT_MOVES],\n\t\t\t[SETUP, HAZARDS],\n\t\t\t[SETUP, badWithSetup],\n\t\t\t[PHYSICAL_SETUP, PHYSICAL_SETUP],\n\t\t\t[['fakeout', 'uturn'], ['switcheroo', 'trick']],\n\t\t\t['substitute', PIVOT_MOVES],\n\t\t\t['rest', 'substitute'],\n\n\t\t\t// These attacks are redundant with each other\n\t\t\t['psychic', 'psyshock'],\n\t\t\t[['scald', 'surf'], 'hydropump'],\n\t\t\t[['bodyslam', 'return'], ['bodyslam', 'doubleedge']],\n\t\t\t[['gigadrain', 'leafstorm'], ['leafstorm', 'petaldance', 'powerwhip']],\n\t\t\t[['drainpunch', 'focusblast'], ['closecombat', 'highjumpkick', 'superpower']],\n\t\t\t['payback', 'pursuit'],\n\n\t\t\t// Assorted hardcodes go here:\n\t\t\t// Zebstrika\n\t\t\t['wildcharge', 'thunderbolt'],\n\t\t\t// Manectric\n\t\t\t['flamethrower', 'overheat'],\n\t\t\t// Meganium\n\t\t\t['leechseed', 'dragontail'],\n\t\t\t// Volcarona and Heatran\n\t\t\t[['fierydance', 'lavaplume'], 'fireblast'],\n\t\t\t// Walrein\n\t\t\t['encore', 'roar'],\n\t\t\t// Lunatone\n\t\t\t['moonlight', 'rockpolish'],\n\t\t\t// Smeargle\n\t\t\t['memento', 'whirlwind'],\n\t\t\t// Seviper\n\t\t\t['switcheroo', 'suckerpunch'],\n\t\t\t// Jirachi\n\t\t\t['bodyslam', 'healingwish'],\n\t\t];\n\n\t\tfor (const pair of incompatiblePairs) this.incompatibleMoves(moves, movePool, pair[0], pair[1]);\n\n\t\tif (species.id === 'dugtrio') this.incompatibleMoves(moves, movePool, statusMoves, 'memento');\n\n\t\tconst statusInflictingMoves = ['stunspore', 'thunderwave', 'toxic', 'willowisp', 'yawn'];\n\t\tif (!abilities.includes('Prankster') && role !== 'Staller') {\n\t\t\tthis.incompatibleMoves(moves, movePool, statusInflictingMoves, statusInflictingMoves);\n\t\t}\n\n\t\tif (abilities.includes('Guts')) this.incompatibleMoves(moves, movePool, 'protect', 'swordsdance');\n\n\t\t// Cull filler moves for otherwise fixed set Stealth Rock users\n\t\tif (!teamDetails.stealthRock) {\n\t\t\tif (species.id === 'registeel' && role === 'Staller') {\n\t\t\t\tif (movePool.includes('thunderwave')) this.fastPop(movePool, movePool.indexOf('thunderwave'));\n\t\t\t\tif (moves.size + movePool.length <= this.maxMoveCount) return;\n\t\t\t}\n\t\t\tif (species.baseSpecies === 'Wormadam' && role === 'Staller') {\n\t\t\t\tif (movePool.includes('suckerpunch')) this.fastPop(movePool, movePool.indexOf('suckerpunch'));\n\t\t\t\tif (moves.size + movePool.length <= this.maxMoveCount) return;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Generate random moveset for a given species, role, preferred 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\tmovePool: string[],\n\t\tpreferredType: string,\n\t\trole: RandomTeamsTypes.Role,\n\t): Set {\n\t\tconst moves = new Set();\n\t\tlet counter = this.newQueryMoves(moves, species, preferredType, abilities);\n\t\tthis.cullMovePool(types, moves, abilities, counter, movePool, teamDetails, species, isLead,\n\t\t\tpreferredType, 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\t// Still need to ensure that multiple Hidden Powers are not added (if maxMoveCount is increased)\n\t\t\twhile (movePool.length) {\n\t\t\t\tconst moveid = this.sample(movePool);\n\t\t\t\tcounter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead,\n\t\t\t\t\tmovePool, preferredType, role);\n\t\t\t}\n\t\t\treturn moves;\n\t\t}\n\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, new Set(types), counter, species, teamDetails\n\t\t\t);\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,\n\t\t\t\tmovePool, preferredType, 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,\n\t\t\t\tmovePool, preferredType, role);\n\t\t}\n\n\t\t// Enforce Seismic Toss and Spore\n\t\tfor (const moveid of ['seismictoss', 'spore']) {\n\t\t\tif (movePool.includes(moveid)) {\n\t\t\t\tcounter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead,\n\t\t\t\t\tmovePool, preferredType, role);\n\t\t\t}\n\t\t}\n\n\t\t// Enforce Thunder Wave on Prankster users\n\t\tif (movePool.includes('thunderwave') && abilities.includes('Prankster')) {\n\t\t\tcounter = this.addMove('thunderwave', moves, types, abilities, teamDetails, species, isLead,\n\t\t\t\tmovePool, preferredType, role);\n\t\t}\n\n\t\t// Enforce hazard removal on Bulky Support and Spinner if the team doesn't already have it\n\t\tif (['Bulky Support', 'Spinner'].includes(role) && !teamDetails.rapidSpin) {\n\t\t\tif (movePool.includes('rapidspin')) {\n\t\t\t\tcounter = this.addMove('rapidspin', moves, types, abilities, teamDetails, species, isLead,\n\t\t\t\t\tmovePool, preferredType, role);\n\t\t\t}\n\t\t}\n\n\t\t// Enforce STAB priority\n\t\tif (['Bulky Attacker', 'Bulky Setup'].includes(role) || this.priorityPokemon.includes(species.id)) {\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, preferredType);\n\t\t\t\tif (types.includes(moveType) && move.priority > 0 && (move.basePower || move.basePowerCallback)) {\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,\n\t\t\t\t\tmovePool, preferredType, 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, preferredType);\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,\n\t\t\t\t\tmovePool, preferredType, role);\n\t\t\t}\n\t\t}\n\n\t\t// Enforce Preferred Type\n\t\tif (!counter.get('preferred')) {\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, preferredType);\n\t\t\t\tif (!this.noStab.includes(moveid) && (move.basePower || move.basePowerCallback) && preferredType === 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,\n\t\t\t\t\tmovePool, preferredType, 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, preferredType);\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,\n\t\t\t\t\tmovePool, preferredType, role);\n\t\t\t} else {\n\t\t\t\t// If they have no regular STAB move, enforce U-turn on Bug types.\n\t\t\t\tif (movePool.includes('uturn') && types.includes('Bug')) {\n\t\t\t\t\tcounter = this.addMove('uturn', moves, types, abilities, teamDetails, species, isLead,\n\t\t\t\t\t\tmovePool, preferredType, role);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Enforce recovery\n\t\tif (['Bulky Support', 'Bulky Attacker', 'Bulky Setup', 'Spinner', 'Staller'].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,\n\t\t\t\t\tmovePool, preferredType, role);\n\t\t\t}\n\t\t}\n\n\t\t// Enforce Staller moves\n\t\tif (role === 'Staller') {\n\t\t\tconst enforcedMoves = ['protect', 'toxic'];\n\t\t\tfor (const move of enforcedMoves) {\n\t\t\t\tif (movePool.includes(move)) {\n\t\t\t\t\tcounter = this.addMove(move, moves, types, abilities, teamDetails, species, isLead,\n\t\t\t\t\t\tmovePool, preferredType, role);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Enforce setup\n\t\tif (role.includes('Setup')) {\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,\n\t\t\t\t\tmovePool, preferredType, 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,\n\t\t\t\t\t\tmovePool, preferredType, 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 && !(moves.has('uturn') && types.includes('Bug'))) {\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,\n\t\t\t\t\tmovePool, preferredType, role);\n\t\t\t}\n\t\t}\n\n\t\t// Enforce coverage move\n\t\tif (['Fast Attacker', 'Setup Sweeper', 'Bulky Attacker', 'Wallbreaker'].includes(role)) {\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, preferredType);\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,\n\t\t\t\t\t\tmovePool, preferredType, role);\n\t\t\t\t}\n\t\t\t}\n\t\t}\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\tconst moveid = this.sample(movePool);\n\t\t\tcounter = this.addMove(moveid, moves, types, abilities, teamDetails, species, isLead,\n\t\t\t\tmovePool, preferredType, 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,\n\t\t\t\t\t\tmovePool, preferredType, 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,\n\t\t\t\t\t\tmovePool, preferredType, role);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn moves;\n\t}\n\n\tshouldCullAbility(\n\t\tability: string,\n\t\ttypes: Set,\n\t\tmoves: Set,\n\t\tabilities: string[],\n\t\tcounter: MoveCounter,\n\t\tmovePool: string[],\n\t\tteamDetails: RandomTeamsTypes.TeamDetails,\n\t\tspecies: Species,\n\t\tpreferredType: string,\n\t\trole: RandomTeamsTypes.Role\n\t): boolean {\n\t\tswitch (ability) {\n\t\tcase 'Chlorophyll': case 'Solar Power':\n\t\t\treturn !teamDetails.sun;\n\t\tcase 'Hydration': case 'Swift Swim':\n\t\t\treturn !teamDetails.rain;\n\t\tcase 'Iron Fist': case 'Sheer Force':\n\t\t\treturn !counter.get(toID(ability));\n\t\tcase 'Overgrow':\n\t\t\treturn !counter.get('Grass');\n\t\tcase 'Rock Head':\n\t\t\treturn !counter.get('recoil');\n\t\tcase 'Sand Force': case 'Sand Rush':\n\t\t\treturn !teamDetails.sand;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetAbility(\n\t\ttypes: Set,\n\t\tmoves: Set,\n\t\tabilities: string[],\n\t\tcounter: MoveCounter,\n\t\tmovePool: string[],\n\t\tteamDetails: RandomTeamsTypes.TeamDetails,\n\t\tspecies: Species,\n\t\tpreferredType: 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 === 'marowak' && counter.get('recoil')) return 'Rock Head';\n\t\tif (species.id === 'kingler' && counter.get('sheerforce')) return 'Sheer Force';\n\t\tif (species.id === 'golduck' && 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, movePool, teamDetails, species, preferredType, 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', '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,\n\t\tcounter: MoveCounter,\n\t\tteamDetails: RandomTeamsTypes.TeamDetails,\n\t\tspecies: Species,\n\t\tisLead: boolean,\n\t\tpreferredType: string,\n\t\trole: RandomTeamsTypes.Role,\n\t): string | undefined {\n\t\tif (species.requiredItems) return this.sample(species.requiredItems);\n\t\tif (species.id === 'farfetchd') return 'Stick';\n\t\tif (species.id === 'latias' || species.id === 'latios') return 'Soul Dew';\n\t\tif (species.id === 'marowak') return 'Thick Club';\n\t\tif (species.id === 'pikachu') return 'Light Ball';\n\t\tif (species.id === 'shedinja' || species.id === 'smeargle') return 'Focus Sash';\n\t\tif (species.id === 'unown') return 'Choice Specs';\n\t\tif (species.id === 'wobbuffet') return 'Custap Berry';\n\t\tif (ability === 'Harvest') return 'Sitrus Berry';\n\t\tif (species.id === 'ditto') return 'Choice Scarf';\n\t\tif (species.id === 'exploud' && role === 'Bulky Attacker') return 'Choice Band';\n\t\tif (ability === 'Poison Heal' || moves.has('facade')) return 'Toxic Orb';\n\t\tif (ability === 'Speed Boost' && species.id !== 'ninjask') return 'Life Orb';\n\t\tif (species.nfe) return 'Eviolite';\n\t\tif (['healingwish', 'memento', 'switcheroo', 'trick'].some(m => moves.has(m))) {\n\t\t\tif (\n\t\t\t\tspecies.baseStats.spe >= 60 && species.baseStats.spe <= 108 && role !== 'Wallbreaker' && !counter.get('priority')\n\t\t\t) {\n\t\t\t\treturn 'Choice Scarf';\n\t\t\t} else {\n\t\t\t\treturn (counter.get('Physical') > counter.get('Special')) ? 'Choice Band' : 'Choice Specs';\n\t\t\t}\n\t\t}\n\t\tif (moves.has('bellydrum')) return 'Sitrus Berry';\n\t\tif (moves.has('waterspout')) return 'Choice Scarf';\n\t\tif (moves.has('shellsmash')) return 'White Herb';\n\t\tif (moves.has('psychoshift')) return 'Flame Orb';\n\t\tif (ability === 'Magic Guard') return moves.has('counter') ? 'Focus Sash' : 'Life Orb';\n\t\tif (species.id === 'rampardos' && role === 'Fast Attacker') return 'Choice Scarf';\n\t\tif (ability === 'Sheer Force' && counter.get('sheerforce')) return 'Life Orb';\n\t\tif (moves.has('acrobatics')) return 'Flying Gem';\n\t\tif (species.id === 'hitmonlee' && ability === 'Unburden') return moves.has('fakeout') ? 'Normal Gem' : 'Fighting Gem';\n\t\tif (moves.has('lightscreen') && moves.has('reflect')) return 'Light Clay';\n\t\tif (moves.has('rest') && !moves.has('sleeptalk') && !['Natural Cure', 'Shed Skin'].includes(ability)) {\n\t\t\treturn (moves.has('raindance') && ability === 'Hydration') ? 'Damp Rock' : 'Chesto Berry';\n\t\t}\n\t\tif (role === 'Staller') return 'Leftovers';\n\t}\n\n\tgetItem(\n\t\tability: string,\n\t\ttypes: string[],\n\t\tmoves: Set,\n\t\tcounter: MoveCounter,\n\t\tteamDetails: RandomTeamsTypes.TeamDetails,\n\t\tspecies: Species,\n\t\tisLead: boolean,\n\t\tpreferredType: string,\n\t\trole: RandomTeamsTypes.Role,\n\t): string {\n\t\tconst defensiveStatTotal = species.baseStats.hp + species.baseStats.def + species.baseStats.spd;\n\n\t\tconst scarfReqs = (\n\t\t\trole !== 'Wallbreaker' &&\n\t\t\tspecies.baseStats.spe >= 60 && species.baseStats.spe <= 108 &&\n\t\t\t!counter.get('priority') && !moves.has('pursuit')\n\t\t);\n\n\t\tif (\n\t\t\tmoves.has('pursuit') && moves.has('suckerpunch') && counter.get('Dark') &&\n\t\t\t(!this.priorityPokemon.includes(species.id) || counter.get('Dark') >= 2)\n\t\t) return 'Black Glasses';\n\t\tif (counter.get('Special') === 4) {\n\t\t\treturn (\n\t\t\t\tscarfReqs && species.baseStats.spa >= 90 && this.randomChance(1, 2)\n\t\t\t) ? 'Choice Scarf' : 'Choice Specs';\n\t\t}\n\t\tif (counter.get('Special') === 3 && moves.has('uturn')) return 'Choice Specs';\n\t\tif (counter.get('Physical') === 4 && species.id !== 'jirachi' && species.id !== 'spinda' &&\n\t\t\t['dragontail', 'fakeout', 'rapidspin'].every(m => !moves.has(m))\n\t\t) {\n\t\t\treturn (\n\t\t\t\tscarfReqs && (species.baseStats.atk >= 100 || ability === 'Pure Power' || ability === 'Huge Power') &&\n\t\t\t\tthis.randomChance(1, 2)\n\t\t\t) ? 'Choice Scarf' : 'Choice Band';\n\t\t}\n\n\t\tif (ability === 'Sturdy' && moves.has('explosion')) return 'Custap Berry';\n\t\tif (types.includes('Normal') && moves.has('fakeout') && !!counter.get('Normal')) return 'Silk Scarf';\n\t\tif (species.id === 'palkia') return 'Lustrous Orb';\n\t\tif (moves.has('outrage') && counter.get('setup')) return 'Lum Berry';\n\t\tif (\n\t\t\t(ability === 'Rough Skin') || (species.id !== 'hooh' && role !== 'Wallbreaker' &&\n\t\t\t\tability === 'Regenerator' && species.baseStats.hp + species.baseStats.def >= 180 && this.randomChance(1, 2))\n\t\t) return 'Rocky Helmet';\n\t\tif (['protect', 'substitute'].some(m => moves.has(m))) return 'Leftovers';\n\t\tif (\n\t\t\tthis.dex.getEffectiveness('Ground', species) >= 2 &&\n\t\t\tability !== 'Levitate'\n\t\t) {\n\t\t\treturn 'Air Balloon';\n\t\t}\n\t\tif (\n\t\t\trole === 'Fast Support' && isLead && defensiveStatTotal < 255 && !counter.get('recovery') &&\n\t\t\t(counter.get('hazards') || counter.get('setup')) && (!counter.get('recoil') || ability === 'Rock Head')\n\t\t) return 'Focus Sash';\n\n\t\t// Default Items\n\t\tif (role === 'Fast Support') {\n\t\t\treturn (\n\t\t\t\tcounter.get('Physical') + counter.get('Special') >= 3 &&\n\t\t\t\t['rapidspin', 'uturn', 'voltswitch'].every(m => !moves.has(m)) &&\n\t\t\t\tthis.dex.getEffectiveness('Rock', species) < 2\n\t\t\t) ? 'Life Orb' : 'Leftovers';\n\t\t}\n\t\t// noStab moves that should reject Expert Belt\n\t\tconst noExpertBeltMoves = (\n\t\t\tthis.noStab.filter(moveid => ['Dragon', 'Normal', 'Poison'].includes(this.dex.moves.get(moveid).type))\n\t\t);\n\t\tconst expertBeltReqs = (\n\t\t\t!counter.get('Dragon') && !counter.get('Normal') && !counter.get('Poison') &&\n\t\t\tnoExpertBeltMoves.every(m => !moves.has(m))\n\t\t);\n\t\tif (\n\t\t\t!counter.get('Status') && expertBeltReqs &&\n\t\t\t(moves.has('uturn') || moves.has('voltswitch') || role === 'Fast Attacker')\n\t\t) return 'Expert Belt';\n\t\tif (\n\t\t\t['Fast Attacker', 'Setup Sweeper', 'Wallbreaker'].some(m => role === m) &&\n\t\t\tthis.dex.getEffectiveness('Rock', species) < 2 && ability !== 'Sturdy'\n\t\t) return 'Life Orb';\n\t\treturn 'Leftovers';\n\t}\n\n\trandomSet(\n\t\tspecies: string | Species,\n\t\tteamDetails: RandomTeamsTypes.TeamDetails = {},\n\t\tisLead = false\n\t): RandomTeamsTypes.RandomSet {\n\t\tspecies = this.dex.species.get(species);\n\t\tconst forme = this.getForme(species);\n\t\tconst sets = this.randomSets[species.id][\"sets\"];\n\t\tconst possibleSets = [];\n\t\t// Check if the Pokemon has a Spinner set\n\t\tlet canSpinner = false;\n\t\tfor (const set of sets) {\n\t\t\tif (!teamDetails.rapidSpin && set.role === 'Spinner') canSpinner = true;\n\t\t}\n\t\tfor (const set of sets) {\n\t\t\t// Prevent Spinner if the team already has removal\n\t\t\tif (teamDetails.rapidSpin && set.role === 'Spinner') continue;\n\t\t\t// Enforce Spinner if the team does not have removal\n\t\t\tif (canSpinner && set.role !== 'Spinner') continue;\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[] = Array.from(set.movepool);\n\t\tconst preferredTypes = set.preferredTypes;\n\t\tconst preferredType = this.sampleIfArray(preferredTypes) || '';\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, movePool,\n\t\t\tpreferredType, role);\n\t\tconst counter = this.newQueryMoves(moves, species, preferredType, abilities);\n\n\t\t// Get ability\n\t\tability = this.getAbility(new Set(types), moves, abilities, counter, movePool, teamDetails, species,\n\t\t\tpreferredType, role);\n\n\t\t// Get items\n\t\titem = this.getPriorityItem(ability, types, moves, counter, teamDetails, species, isLead, preferredType, role);\n\t\tif (item === undefined) {\n\t\t\titem = this.getItem(ability, types, moves, counter, teamDetails, species, isLead, preferredType, role);\n\t\t}\n\n\t\t// For Trick / Switcheroo\n\t\tif (item === 'Leftovers' && types.includes('Poison')) {\n\t\t\titem = 'Black Sludge';\n\t\t}\n\n\t\tconst level = this.getLevel(species);\n\n\t\t// We use a special variable to track Hidden Power\n\t\t// so that we can check for all Hidden Powers at once\n\t\tlet hasHiddenPower = false;\n\t\tfor (const move of moves) {\n\t\t\tif (move.startsWith('hiddenpower')) hasHiddenPower = true;\n\t\t}\n\n\t\tif (hasHiddenPower) {\n\t\t\tlet hpType;\n\t\t\tfor (const move of moves) {\n\t\t\t\tif (move.startsWith('hiddenpower')) hpType = move.substr(11);\n\t\t\t}\n\t\t\tif (!hpType) throw new Error(`hasHiddenPower is true, but no Hidden Power move was found.`);\n\t\t\tconst HPivs = this.dex.types.get(hpType).HPivs;\n\t\t\tlet iv: StatID;\n\t\t\tfor (iv in HPivs) {\n\t\t\t\tivs[iv] = HPivs[iv]!;\n\t\t\t}\n\t\t}\n\n\t\t// Prepare optimal HP\n\t\tconst srImmunity = ability === 'Magic Guard';\n\t\tconst srWeakness = srImmunity ? 0 : this.dex.getEffectiveness('Rock', species);\n\t\twhile (evs.hp > 1) {\n\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\tif (moves.has('substitute') && !['Black Sludge', 'Leftovers'].includes(item)) {\n\t\t\t\tif (item === 'Sitrus Berry') {\n\t\t\t\t\t// Two Substitutes should activate Sitrus Berry\n\t\t\t\t\tif (hp % 4 === 0) break;\n\t\t\t\t} else {\n\t\t\t\t\t// Should be able to use Substitute four times from full HP without fainting\n\t\t\t\t\tif (hp % 4 > 0) break;\n\t\t\t\t}\n\t\t\t} else if (moves.has('bellydrum') && item === 'Sitrus Berry') {\n\t\t\t\t// Belly Drum should activate Sitrus Berry\n\t\t\t\tif (hp % 2 === 0) break;\n\t\t\t} else if (['highjumpkick', 'jumpkick'].some(m => moves.has(m))) {\n\t\t\t\t// Crash damage move users want an odd HP to survive two misses\n\t\t\t\tif (hp % 2 > 0) break;\n\t\t\t} else {\n\t\t\t\t// Maximize number of Stealth Rock switch-ins\n\t\t\t\tif (srWeakness <= 0 || ability === 'Regenerator') break;\n\t\t\t\tif (srWeakness === 1 && ['Black Sludge', 'Leftovers', 'Life Orb'].includes(item)) break;\n\t\t\t\tif (item !== 'Sitrus Berry' && hp % (4 / srWeakness) > 0) break;\n\t\t\t\t// Minimise number of Stealth Rock switch-ins to activate Sitrus Berry\n\t\t\t\tif (item === 'Sitrus Berry' && hp % (4 / srWeakness) === 0) break;\n\t\t\t}\n\t\t\tevs.hp -= 4;\n\t\t}\n\n\t\t// Minimize confusion damage, including if Foul Play is its only physical attack\n\t\tif (\n\t\t\t(!counter.get('Physical') || (counter.get('Physical') <= 1 && (moves.has('foulplay') || moves.has('rapidspin')))) &&\n\t\t\t!moves.has('transform')\n\t\t) {\n\t\t\tevs.atk = 0;\n\t\t\tivs.atk = hasHiddenPower ? (ivs.atk || 31) - 28 : 0;\n\t\t}\n\n\t\tif (['gyroball', 'metalburst', 'trickroom'].some(m => moves.has(m))) {\n\t\t\tevs.spe = 0;\n\t\t\tivs.spe = hasHiddenPower ? (ivs.spe || 31) - 28 : 0;\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.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\trole,\n\t\t};\n\t}\n\n\trandomTeam() {\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();\n\t\tconst type = this.forceMonotype || this.sample(typePool);\n\n\t\tconst baseFormes: { [k: string]: number } = {};\n\t\tconst typeCount: { [k: string]: number } = {};\n\t\tconst typeWeaknesses: { [k: string]: number } = {};\n\t\tconst typeDoubleWeaknesses: { [k: string]: number } = {};\n\t\tconst teamDetails: RandomTeamsTypes.TeamDetails = {};\n\t\tlet numMaxLevelPokemon = 0;\n\n\t\tconst pokemonList = Object.keys(this.randomSets);\n\t\tconst [pokemonPool, baseSpeciesPool] = this.getPokemonPool(type, pokemon, isMonotype, pokemonList);\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[species.baseSpecies]) continue;\n\n\t\t\t// Illusion shouldn't be in the last slot\n\t\t\tif (species.name === 'Zoroark' && pokemon.length >= (this.maxTeamSize - 1)) continue;\n\n\t\t\t// Prevent Shedinja from generating after Sandstorm/Hail setters\n\t\t\tif (species.name === 'Shedinja' && (teamDetails.sand || teamDetails.hail)) 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\tconst types = species.types;\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[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[typeName]) typeWeaknesses[typeName] = 0;\n\t\t\t\t\t\tif (typeWeaknesses[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[typeName]) typeDoubleWeaknesses[typeName] = 0;\n\t\t\t\t\t\tif (typeDoubleWeaknesses[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 as a Fire weakness\n\t\t\t\tif (this.dex.getEffectiveness('Fire', species) === 0 && Object.values(species.abilities).includes('Dry Skin')) {\n\t\t\t\t\tif (!typeWeaknesses['Fire']) typeWeaknesses['Fire'] = 0;\n\t\t\t\t\tif (typeWeaknesses['Fire'] >= 3 * limitFactor) continue;\n\t\t\t\t}\n\n\t\t\t\t// Limit one level 100 Pokemon\n\t\t\t\tif (!this.adjustLevel && (this.getLevel(species) === 100) && numMaxLevelPokemon >= limitFactor) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst set = this.randomSet(species, teamDetails, pokemon.length === 0);\n\n\t\t\t// Okay, the set passes, add it to our team\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[species.baseSpecies] = 1;\n\n\t\t\t// Increment type counters\n\t\t\tfor (const typeName of types) {\n\t\t\t\tif (typeName in typeCount) {\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// 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[typeName]++;\n\t\t\t\t}\n\t\t\t\tif (this.dex.getEffectiveness(typeName, species) > 1) {\n\t\t\t\t\ttypeDoubleWeaknesses[typeName]++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Count Dry Skin as a Fire weakness\n\t\t\tif (set.ability === 'Dry Skin' && this.dex.getEffectiveness('Fire', species) === 0) typeWeaknesses['Fire']++;\n\n\t\t\t// Increment level 100 counter\n\t\t\tif (set.level === 100) numMaxLevelPokemon++;\n\n\t\t\t// Team details\n\t\t\tif (set.ability === 'Snow Warning' || set.moves.includes('hail')) teamDetails.hail = 1;\n\t\t\tif (set.ability === 'Drizzle' || set.moves.includes('raindance')) teamDetails.rain = 1;\n\t\t\tif (set.ability === 'Sand Stream') teamDetails.sand = 1;\n\t\t\tif (set.ability === 'Drought' || set.moves.includes('sunnyday')) teamDetails.sun = 1;\n\t\t\tif (set.moves.includes('aromatherapy') || set.moves.includes('healbell')) teamDetails.statusCure = 1;\n\t\t\tif (set.moves.includes('spikes')) teamDetails.spikes = (teamDetails.spikes || 0) + 1;\n\t\t\tif (set.moves.includes('stealthrock')) teamDetails.stealthRock = 1;\n\t\t\tif (set.moves.includes('toxicspikes')) teamDetails.toxicSpikes = 1;\n\t\t\tif (set.moves.includes('rapidspin')) teamDetails.rapidSpin = 1;\n\t\t\tif (set.moves.includes('reflect') && set.moves.includes('lightscreen')) teamDetails.screens = 1;\n\t\t}\n\t\tif (pokemon.length < this.maxTeamSize && pokemon.length < 12) {\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 RandomGen5Teams;\n"], "mappings": ";;;;;;;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