Add CAP 1v1 format

This commit is contained in:
The Immortal 2020-05-16 08:11:54 +04:00
parent 2a642afac9
commit ec4bb6cb4d
4 changed files with 568 additions and 0 deletions

1
build
View File

@ -90,6 +90,7 @@ if (!fs.existsSync('./.data-dist/README.md')) {
}
// sucrase doesn't copy JSON over, so we'll have to do it ourselves
copyOverData('cap-1v1-sets.json');
copyOverData('mods/gen7/factory-sets.json');
copyOverData('mods/gen7/bss-factory-sets.json');
copyOverData('mods/gen6/factory-sets.json');

View File

@ -859,6 +859,20 @@ const Formats = [
searchShow: false,
ruleset: ['Obtainable', 'HP Percentage Mod', 'Cancel Mod'],
},
{
name: "[Gen 8] CAP 1v1",
desc: `Randomly generated 1v1-style teams only including Pokémon made by the Create-A-Pokémon Project.`,
threads: [
`&bullet; <a href="https://www.smogon.com/forums/threads/3591157/">CAP 1v1</a>`,
],
mod: 'gen8',
team: 'randomCAP1v1',
teamLength: {
battle: 1,
},
ruleset: ['Species Clause', 'Team Preview', 'HP Percentage Mod', 'Cancel Mod', 'Sleep Clause Mod', 'Dynamax Clause'],
},
{
name: "[Gen 7] Random Battle",
desc: `Randomized teams of level-balanced Pok&eacute;mon with sets that are generated to be competitively viable.`,

524
data/cap-1v1-sets.json Normal file
View File

@ -0,0 +1,524 @@
{
"Arghonaut": [{
"item": "Wacan Berry",
"ability": "Unaware",
"evs": {"hp": 252, "atk": 4, "spd": 252},
"nature": "Careful",
"moves": [["Focus Punch"], ["Waterfall"], ["Yawn"], ["Protect"]]
}, {
"item": "Choice Band",
"ability": "Technician",
"evs": {"hp": 252, "atk": 204, "spd": 52},
"nature": "Adamant",
"moves": [["Mach Punch"], ["Waterfall"], ["Earthquake"], ["Knock Off"]]
}, {
"item": "Life Orb",
"ability": "Technician",
"evs": {"hp": 252, "atk": 176, "spd": 80},
"nature": "Adamant",
"moves": [["Mach Punch"], ["Aqua Jet"], ["Earthquake"], ["Knock Off"]]
}],
"Aurumoth": [{
"item": "Choice Scarf",
"ability": "No Guard",
"evs": {"hp": 40, "spa": 252, "spe": 216},
"nature": "Modest",
"ivs": {"atk": 0},
"moves": [["Psyshock", "Psychic"], ["Thunder"], ["Focus Blast", "Overheat"], ["Bug Buzz"]]
}, {
"item": "Choice Specs",
"ability": "No Guard",
"evs": {"hp": 72, "spa": 252, "spe": 184},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Thunder"], ["Blizzard"], ["Bug Buzz"], ["Psychic"]]
}],
"Caribolt": [{
"item": "Magnet",
"ability": "Galvanize",
"evs": {"atk": 252, "def": 4, "spe": 252},
"nature": "Jolly",
"moves": [["Swords Dance"], ["Double-Edge"], ["Quick Attack"], ["Power Whip", "Horn Leech"]]
}, {
"item": "Life Orb",
"ability": "Galvanize",
"evs": {"hp": 96, "atk": 252, "spe": 160},
"nature": "Jolly",
"moves": [["Giga Impact"], ["Horn Leech"], ["Swords Dance"], ["Rapid Spin"]]
}, {
"item": "Choice Specs",
"ability": "Galvanize",
"evs": {"spa": 252, "spd": 4, "spe": 252},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Flash Cannon"], ["Thunderbolt"], ["Boomburst"], ["Energy Ball"]]
}],
"Cawmodore": [{
"item": "Sitrus Berry",
"ability": "Intimidate",
"evs": {"atk": 252, "def": 4, "spe": 252},
"nature": "Jolly",
"moves": [["Belly Drum"], ["Bullet Punch"], ["Iron Head"], ["Acrobatics"]]
}, {
"item": "Petaya Berry",
"ability": "Volt Absorb",
"evs": {"atk": 28, "spa": 252, "spe": 228},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Substitute"], ["Belch"], ["Metal Sound"], ["Flash Cannon"]]
}, {
"item": "Choice Specs",
"ability": "Volt Absorb",
"evs": {"def": 28, "spa": 252, "spe": 228},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Surf"], ["Hurricane"], ["Flash Cannon"], ["Hyper Beam"]]
}, {
"item": "Choice Band",
"ability": "Volt Absorb",
"evs": {"hp": 28, "atk": 252, "spe": 228},
"nature": "Jolly",
"moves": [["Drill Peck"], ["Iron Head"], ["Knock Off"], ["Bullet Punch"]]
}],
"Colossoil": [{
"item": "Flame Orb",
"ability": "Guts",
"evs": {"hp": 252, "atk": 252, "spe": 4},
"nature": "Adamant",
"moves": [["Rock Tomb"], ["Crunch"], ["Earthquake"], ["Taunt"]]
}, {
"item": "Flame Orb",
"ability": "Guts",
"evs": {"atk": 252, "spd": 4, "spe": 252},
"nature": "Jolly",
"moves": [["Fake Out"], ["Facade", "Aqua Tail"], ["Earthquake"], ["Knock Off"]]
}],
"Crucibelle": [{
"item": "Chesto Berry",
"ability": "Liquid Ooze",
"evs": {"hp": 252, "def": 4, "spd": 252},
"nature": "Jolly",
"moves": [["Coil"], ["Stone Edge"], ["Gunk Shot"], ["Rest"]]
}, {
"item": "Choice Scarf",
"ability": "Liquid Ooze",
"evs": {"hp": 252, "def": 176, "spd": 80},
"nature": "Impish",
"moves": [["Trick"], ["Torment"], ["Toxic"], ["Rest"]]
}, {
"item": "Shuca Berry",
"ability": "Liquid Ooze",
"evs": {"hp": 252, "def": 252, "spd": 4},
"nature": "Impish",
"ivs": {"atk": 0},
"moves": [["Torment"], ["Protect"], ["Substitute"], ["Draining Kiss"]]
}],
"Cyclohm": [{
"item": "Kee Berry",
"ability": "Shield Dust",
"evs": {"hp": 252, "spd": 252, "spe": 4},
"nature": "Calm",
"ivs": {"atk": 0},
"moves": [["Charge"], ["Slack Off"], ["Thunderbolt"], ["Draco Meteor"]]
}, {
"item": "Choice Scarf",
"ability": "Shield Dust",
"evs": {"hp": 216, "spa": 100, "spd": 40, "spe": 152},
"nature": "Modest",
"ivs": {"atk": 0},
"moves": [["Thunderbolt"], ["Draco Meteor"], ["Flamethrower"], ["Surf"]]
}],
"Equilibra": [{
"item": "Choice Scarf",
"ability": ["Bulletproof", "Levitate"],
"evs": {"hp": 24, "spa": 252, "spd": 4, "spe": 228},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Earth Power"], ["Steel Beam"], ["Aura Sphere"], ["Hyper Beam"]]
}, {
"item": "Choice Specs",
"ability": ["Levitate", "Bulletproof"],
"evs": {"hp": 248, "def": 40, "spa": 160, "spd": 60},
"nature": "Modest",
"ivs": {"atk": 0},
"moves": [["Earth Power"], ["Steel Beam"], ["Aura Sphere"], ["Doom Desire"]]
}],
"Fidgit": [{
"item": "Sitrus Berry",
"ability": "Frisk",
"evs": {"hp": 252, "def": 4, "spe": 252},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Encore"], ["Disable"], ["Sludge Wave", "Earth Power"], ["Protect"]]
}, {
"item": "Choice Specs",
"ability": "Frisk",
"evs": {"spa": 252, "spd": 4, "spe": 252},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Earth Power"], ["Sludge Wave"], ["Shadow Ball"], ["Hyper Beam"]]
}, {
"item": "Choice Band",
"ability": "Frisk",
"evs": {"hp": 252, "atk": 252, "def": 4},
"nature": "Adamant",
"moves": [["Earthquake"], ["Giga Impact"], ["Gunk Shot"], ["Stone Edge"]]
}],
"Jumbao": [{
"item": "Choice Scarf",
"ability": "Drought",
"evs": {"hp": 216, "def": 92, "spa": 32, "spe": 168},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Moonblast"], ["Solar Beam"], ["Shadow Ball"], ["Focus Blast"]]
}, {
"item": "Life Orb",
"ability": "Drought",
"evs": {"hp": 88, "spa": 252, "spe": 168},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Substitute"], ["Synthesis"], ["Moonblast"], ["Leaf Storm"]]
}],
"Kerfluffle": [{
"item": "Petaya Berry",
"ability": "Aroma Veil",
"evs": {"hp": 200, "spd": 88, "spe": 220},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Yawn"], ["Protect"], ["Moonblast"], ["Dream Eater"]]
}, {
"item": "Choice Specs",
"ability": "Aroma Veil",
"evs": {"spa": 252, "spd": 4, "spe": 252},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Focus Blast"], ["Moonblast"], ["Sludge Wave"], ["Flash Cannon"]]
}, {
"item": "Babiri Berry",
"ability": "Aroma Veil",
"evs": {"hp": 248, "def": 8, "spd": 252},
"nature": "Calm",
"ivs": {"atk": 0},
"moves": [["Torment"], ["Wish"], ["Protect"], ["Moonblast"]]
}],
"Kitsunoh": [{
"item": "Choice Band",
"ability": "Iron Fist",
"evs": {"atk": 252, "spd": 4, "spe": 252},
"nature": "Jolly",
"moves": [["Trick"], ["Shadow Strike"], ["Meteor Mash"], ["Earthquake"]]
}, {
"item": "Life Orb",
"ability": "Iron Fist",
"evs": {"atk": 252, "spd": 4, "spe": 252},
"nature": "Jolly",
"moves": [["Ice Punch"], ["Meteor Mash"], ["Thunder Punch"], ["Shadow Sneak"]]
}, {
"item": "Shuca Berry",
"ability": "Frisk",
"evs": {"hp": 252, "def": 252, "spd": 4},
"nature": "Impish",
"moves": [["Torment"], ["Wish"], ["Protect"], ["Shadow Strike"]]
}],
"Krilowatt": [{
"item": "Sitrus Berry",
"ability": "Minus",
"evs": {"hp": 252, "def": 32, "spe": 224},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Magnetic Flux"], ["Rest"], ["Whirlpool"], ["Imprison"]]
}, {
"item": "Sitrus Berry",
"ability": "Magic Guard",
"evs": {"hp": 252, "def": 4, "spd": 252},
"nature": "Calm",
"ivs": {"atk": 0},
"moves": [["Counter"], ["Mirror Coat"], ["Toxic"], ["Protect"]]
}, {
"item": "Life Orb",
"ability": "Magic Guard",
"evs": {"spa": 252, "spd": 4, "spe": 252},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Surf"], ["Thunderbolt"], ["Ice Beam"], ["Earth Power"]]
}],
"Malaconda": [{
"item": "Chesto Berry",
"ability": "Harvest",
"evs": {"hp": 244, "def": 12, "spd": 252},
"nature": "Calm",
"ivs": {"atk": 0},
"moves": [["Substitute"], ["Toxic"], ["Spiky Shield"], ["Rest"]]
}, {
"item": "Choice Scarf",
"ability": "Drought",
"evs": {"atk": 252, "spd": 4, "spe": 252},
"nature": "Jolly",
"moves": [["Solar Blade"], ["Iron Tail"], ["Wild Charge"], ["Crunch"]]
}, {
"item": "Sitrus Berry",
"ability": "Harvest",
"evs": {"hp": 244, "def": 92, "spe": 172},
"nature": "Careful",
"moves": [["Glare"], ["Substitute"], ["Taunt"], ["Knock Off"]]
}],
"Mollux": [{
"item": "Choice Scarf",
"ability": "Dry Skin",
"evs": {"hp": 92, "def": 164, "spe": 252},
"nature": "Modest",
"ivs": {"atk": 0},
"moves": [["Eruption", "Fire Blast"], ["Sludge Bomb"], ["Thunderbolt"], ["Trick"]]
}, {
"item": "Power Herb",
"ability": "Dry Skin",
"evs": {"hp": 252, "spa": 8, "spd": 136, "spe": 112},
"nature": "Modest",
"ivs": {"atk": 0},
"moves": [["Solar Beam"], ["Overheat"], ["Sludge Wave"], ["Thunder"]]
}, {
"item": "Air Balloon",
"ability": "Dry Skin",
"evs": {"hp": 252, "def": 148, "spd": 108},
"nature": "Bold",
"ivs": {"atk": 0},
"moves": [["Acid Armor"], ["Calm Mind"], ["Recover"], ["Lava Plume"]]
}],
"Naviathan": [{
"item": "Leftovers",
"ability": "Heatproof",
"evs": {"hp": 248, "def": 12, "spe": 248},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Iron Defense"], ["Calm Mind"], ["Slack Off"], ["Flash Cannon"]]
}, {
"item": "Flame Orb",
"ability": "Guts",
"evs": {"atk": 220, "spd": 152, "spe": 136},
"nature": "Careful",
"moves": [["Dragon Dance"], ["Iron Defense"], ["Slack Off"], ["Iron Head"]]
}, {
"item": "Choice Specs",
"ability": "Heatproof",
"evs": {"spa": 252, "spd": 8, "spe": 248},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Hurricane"], ["Hydro Pump"], ["Steel Beam"], ["Ice Beam"]]
}],
"Necturna": [{
"item": "Life Orb",
"ability": "Forewarn",
"evs": {"hp": 232, "atk": 36, "spd": 56, "spe": 184},
"nature": "Adamant",
"moves": [["Shadow Claw"], ["Shell Smash"], ["Power Whip"], ["Substitute"]]
}, {
"item": "Leftovers",
"ability": "Forewarn",
"evs": {"hp": 248, "def": 160, "spd": 100},
"nature": "Calm",
"ivs": {"atk": 0},
"moves": [["Spore"], ["Leech Seed"], ["Hex"], ["Substitute"]]
}, {
"item": "Choice Band",
"ability": "Forewarn",
"evs": {"hp": 248, "atk": 92, "def": 156, "spd": 12},
"nature": "Adamant",
"moves": [["Power Whip"], ["Shadow Sneak"], ["Stone Edge"], ["V-Create"]]
}],
"Pajantom": [{
"item": "Assault Vest",
"ability": "Comatose",
"evs": {"atk": 252, "spd": 4, "spe": 252},
"nature": "Jolly",
"moves": [["Brave Bird"], ["Outrage"], ["Leech Life"], ["Spirit Shackle"]]
}, {
"item": "Sitrus Berry",
"ability": "Comatose",
"evs": {"hp": 240, "atk": 176, "spd": 92},
"nature": "Adamant",
"moves": [["Imprison"], ["Shadow Claw"], ["Earthquake"], ["Draco Meteor"]]
}, {
"item": "Choice Band",
"ability": "Comatose",
"evs": {"hp": 32, "atk": 252, "spe": 224},
"nature": "Jolly",
"moves": [["Outrage"], ["Spirit Shackle"], ["Earthquake"], ["Brave Bird"]]
}],
"Plasmanta": [{
"item": "Life Orb",
"ability": "Storm Drain",
"evs": {"hp": 40, "spa": 252, "spe": 216},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Magnet Rise"], ["Aura Sphere"], ["Psychic"], ["Sludge Wave"]]
}, {
"item": "Choice Specs",
"ability": "Storm Drain",
"evs": {"hp": 24, "spa": 252, "spe": 232},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Thunderbolt"], ["Sludge Wave"], ["Hyper Beam"], ["Psychic"]]
}],
"Pyroak": [{
"item": "Sitrus Berry",
"ability": "Battle Armor",
"evs": {"hp": 248, "def": 8, "spd": 252},
"nature": "Calm",
"ivs": {"atk": 0},
"moves": [["Amnesia"], ["Acid Armor"], ["Lava Plume"], ["Synthesis", "Leech Seed", "Rest"]]
}, {
"item": "Choice Specs",
"ability": "White Smoke",
"evs": {"hp": 248, "spa": 252, "spd": 8},
"nature": "Modest",
"ivs": {"atk": 0},
"moves": [["Overheat"], ["Giga Drain"], ["Earth Power"], ["Fire Blast"]]
}],
"Revenankh": [{
"item": "Choice Band",
"ability": "Triage",
"evs": {"hp": 252, "atk": 152, "def": 28, "spd": 76},
"nature": "Adamant",
"moves": [["Drain Punch"], ["Earthquake"], ["Shadow Claw"], ["Trick"]]
}, {
"item": "Life Orb",
"ability": "Triage",
"evs": {"hp": 100, "atk": 252, "spe": 156},
"nature": "Adamant",
"moves": [["Rock Slide"], ["Glare"], ["Drain Punch"], ["Knock Off"]]
}],
"Smokomodo": [{
"item": "Life Orb",
"ability": "Blaze",
"evs": {"hp": 12, "atk": 244, "spe": 252},
"nature": "Jolly",
"moves": [["Flare Blitz"], ["Earthquake"], ["Taunt"], ["Superpower"]]
}, {
"item": "Choice Band",
"ability": "Technician",
"evs": {"hp": 8, "atk": 252, "spe": 248},
"nature": "Jolly",
"moves": [["Flare Blitz"], ["Bulldoze"], ["Gunk Shot"], ["Storm Throw"]]
}, {
"item": "Life Orb",
"ability": "Technician",
"evs": {"atk": 252, "spd": 4, "spe": 252},
"nature": "Adamant",
"moves": [["Bulldoze"], ["Earthquake"], ["Flare Blitz"], ["Taunt"]]
}],
"Snaelstrom": [{
"item": "Toxic Orb",
"ability": "Poison Heal",
"evs": {"hp": 248, "def": 8, "spd": 252},
"nature": "Careful",
"moves": [["Swords Dance"], ["Acid Armor"], ["Spiky Shield"], ["Leech Life"]]
}, {
"item": "Toxic Orb",
"ability": "Poison Heal",
"evs": {"hp": 252, "spa": 4, "spd": 252},
"nature": "Calm",
"moves": [["Acid Armor"], ["Confide"], ["Rest"], ["Infestation"]]
}],
"Stratagem": [{
"item": "Choice Specs",
"ability": "Levitate ",
"evs": {"spa": 252, "spd": 4, "spe": 252},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Earth Power"], ["Fire Blast"], ["Paleo Wave"], ["Trick", "Dazzling Gleam"]]
}, {
"item": ["Passho Berry", "Sitrus Berry"],
"ability": "Levitate ",
"evs": {"spa": 252, "spd": 4, "spe": 252},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Substitute", "Protect"], ["Disable"], ["Paleo Wave"], ["Fire Blast", "Dazzling Gleam"]]
}],
"Syclant": [{
"item": "Choice Specs",
"ability": "Compound Eyes",
"evs": {"hp": 16, "spa": 252, "spd": 240},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Blizzard"], ["Focus Blast"], ["Bug Buzz"], ["Hyper Beam"]]
}, {
"item": "Life Orb",
"ability": "Compound Eyes",
"evs": {"hp": 16, "spa": 252, "spd": 240},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Blizzard"], ["Focus Blast"], ["Bug Buzz"], ["Taunt"]]
}, {
"item": "Choice Band",
"ability": "Compound Eyes",
"evs": {"atk": 252, "spd": 4, "spe": 252},
"nature": ["Adamant", "Jolly"],
"moves": [["Icicle Crash"], ["Leech Life"], ["Superpower"], ["Earthquake", "Stone Edge"]]
}],
"Tomohawk": [{
"item": "Leftovers",
"ability": "Prankster",
"evs": {"hp": 252, "def": 48, "spd": 208},
"nature": "Bold",
"ivs": {"atk": 0},
"moves": [["Toxic"], ["Substitute"], ["Protect"], ["Taunt"]]
}, {
"item": "Roseli Berry",
"ability": "Prankster",
"evs": {"spa": 252, "spd": 4, "spe": 252},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Yawn"], ["Protect"], ["Hurricane"], ["Heat Wave"]]
}, {
"item": "Choice Specs",
"ability": "Intimidate",
"evs": {"hp": 252, "spa": 252, "spd": 4},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Hurricane"], ["Aura Sphere"], ["Heat Wave"], ["Hyper Beam"]]
}],
"Volkraken": [{
"item": "Choice Scarf",
"ability": ["Infiltrator", "Analytic"],
"evs": {"hp": 248, "spa": 56, "spe": 204},
"nature": "Modest",
"ivs": {"atk": 0},
"moves": [["Overheat", "Fire Blast"], ["Hydro Pump"], ["Surf"], ["Power Gem"]]
}, {
"item": "Choice Specs",
"ability": "Analytic",
"evs": {"hp": 252, "def": 4, "spa": 252},
"nature": "Quiet",
"ivs": {"atk": 0, "spe": 0},
"moves": ["Overheat", ["Hydro Pump"], ["Hyper Beam"], ["Power Gem"]]
}, {
"item": "Air Balloon",
"ability": "Analytic",
"evs": {"hp": 248, "def": 8, "spd": 252},
"nature": "Calm",
"ivs": {"atk": 0},
"moves": [["Scald"], ["Flamethrower"], ["Will-O-Wisp"], ["Reflect Type"]]
}],
"Voodoom": [{
"item": "Chople Berry",
"ability": "Lightning Rod",
"evs": {"hp": 32, "spa": 252, "spe": 224},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Charge"], ["Thunderbolt"], ["Dark Pulse"], ["Focus Blast"]]
}, {
"item": "Choice Specs",
"ability": "Lightning Rod",
"evs": {"spa": 252, "spd": 4, "spe": 252},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Dark Pulse"], ["Focus Blast"], ["Aura Sphere"], ["Thunderbolt"]]
}, {
"item": "Lum Berry",
"ability": "Volt Absorb",
"evs": {"hp": 248, "spa": 36, "spe": 224},
"nature": "Timid",
"ivs": {"atk": 0},
"moves": [["Pain Split"], ["Dark Pulse"], ["Taunt"], ["Acupressure"]]
}]
}

View File

@ -24,12 +24,15 @@ export class RandomTeams {
format: Format;
prng: PRNG;
randomCAP1v1Sets: AnyObject;
constructor(format: Format | string, prng: PRNG | PRNGSeed | null) {
format = Dex.getFormat(format);
this.dex = Dex.forFormat(format);
this.gen = this.dex.gen;
// this.randomFactorySets = randomFactorySets;
// this.randomBSSFactorySets = randomBSSFactorySets;
this.randomCAP1v1Sets = require('./cap-1v1-sets.json');
this.factoryTier = '';
this.format = format;
@ -1537,6 +1540,32 @@ export class RandomTeams {
return pokemon;
}
randomCAP1v1Team() {
const pokemon = [];
const pokemonPool = Object.keys(this.randomCAP1v1Sets);
while (pokemonPool.length && pokemon.length < 3) {
const species = this.dex.getSpecies(this.sampleNoReplace(pokemonPool));
if (!species.exists) throw new Error(`Invalid Pokemon "${species}" in ${this.format}`);
const setData: AnyObject = this.sample(this.randomCAP1v1Sets[species.name]);
const set = {
name: species.baseSpecies,
species: species.name,
gender: species.gender,
item: (Array.isArray(setData.item) ? this.sample(setData.item) : setData.item) || '',
ability: (Array.isArray(setData.ability) ? this.sample(setData.ability) : setData.ability),
shiny: this.randomChance(1, 1024),
evs: Object.assign({hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0}, setData.evs),
nature: setData.nature,
ivs: Object.assign({hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}, setData.ivs || {}),
moves: setData.moves.map((move: any) => this.sample(move)),
};
pokemon.push(set);
}
return pokemon;
}
}
export default RandomTeams;