Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivaD173 committed Nov 13, 2024
2 parents 56f9bd2 + 4cece4e commit 125a704
Show file tree
Hide file tree
Showing 39 changed files with 371 additions and 210 deletions.
15 changes: 14 additions & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ At the highest level, PS is split into three parts:

All three communicate directly with each other.

A user starts by visiting `https://play.pokemonshowdown.com/`. This is handled by an Apache server (in the Client), which serves mostly static files but uses some PHP (legacy, intended to be migrated to Loginserver).

The user's web browser (running Client code) will then communicate with the Login server (mounted at `https://play.pokemonshowdown.com/api/` to handle logins mostly, or otherwise interface with the Client databases one way or another).

The user's web browser will also connect to the Game server, through SockJS. The Game server handles the chat rooms, matchmaking, and actual battle simulation.

The Game server also communicates with the Login server, to handle replay uploads (and, for the main server, ladder updates).


Game server
-----------

Expand All @@ -26,6 +35,7 @@ Its entry point is [server/index.ts](./server/index.ts), which launches several

`Rooms` also includes support for battle rooms, which is where the server connects to the game simulator itself. Game simulation code is in [sim/](./sim/).


Client
------

Expand All @@ -35,9 +45,12 @@ Its entry point is [index.template.html](https://github.com/smogon/pokemon-showd

It was written long ago, so instead of a single JS entry point, it includes a lot of JS files. Everything important is launched from [js/client.js](https://github.com/smogon/pokemon-showdown-client/blob/master/play.pokemonshowdown.com/js/client.js)


Login server
------------

The client’s login server, which handles logins and most database interaction, is written in TypeScript in progress. The backend is split between a MySQL InnoDB database (for most things) and a Postgres database (for Replays).
The client’s login server, which handles logins and most database interaction, is written in TypeScript. The backend is currently split between a MySQL InnoDB database (for users, ladder, and most other things) and a Postgres (technically Cockroach) database (for Replays).

Its entry point is [server.ts](https://github.com/smogon/pokemon-showdown-loginserver/blob/master/src/server.ts).

It's intended to replace all of the old PHP code in the Client, but that migration is only halfway done at the moment.
52 changes: 21 additions & 31 deletions config/formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,6 @@ export const Formats: import('../sim/dex-formats').FormatList = [
ruleset: ['[Gen 3] OU', 'Pre RU Tier Shift Mod'],
searchShow: true,
},
{
name: "[Gen 3] RU",
mod: 'gen3',
ruleset: ['[Gen 3] UU'],
banlist: ['UU', 'RUBL'],
},
{
name: "[Gen 3] SU",
mod: 'gen3',
Expand Down Expand Up @@ -940,13 +934,13 @@ export const Formats: import('../sim/dex-formats').FormatList = [
desc: `All forms of passive damage deal type-based damage based on the primary type of the Pokémon that inflicted the passive damage against the target Pokémon.`,
mod: 'passiveaggressive',
// searchShow: false,
ruleset: ['Standard OMs', 'Sleep Moves Clause', 'Evasion Items Clause'],
ruleset: ['Standard OMs', 'Sleep Moves Clause', 'Evasion Items Clause', 'Terastal Clause'],
banlist: [
'Arceus', 'Baxcalibur', 'Calyrex-Ice', 'Calyrex-Shadow', 'Chi-Yu', 'Chien-Pao', 'Deoxys-Attack', 'Deoxys-Normal', 'Dialga', 'Dialga-Origin', 'Eternatus', 'Flutter Mane',
'Gholdengo', 'Giratina', 'Giratina-Origin', 'Gouging Fire', 'Groudon', 'Ho-Oh', 'Iron Bundle', 'Koraidon', 'Kyogre', 'Kyurem', 'Kyurem-Black', 'Kyurem-White', 'Lugia',
'Lunala', 'Magearna', 'Mewtwo', 'Miraidon', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Ogerpon-Hearthflame', 'Palafin', 'Palkia', 'Palkia-Origin', 'Raging Bolt',
'Rayquaza', 'Reshiram', 'Shaymin-Sky', 'Sneasler', 'Solgaleo', 'Zacian', 'Zacian-Crowned', 'Zamazenta-Crowned', 'Zekrom', 'Arena Trap', 'Moody', 'Shadow Tag', 'Speed Boost',
'Heat Rock', 'King\'s Rock', 'Razor Fang', 'Quick Claw', 'Baton Pass', 'Last Respects', 'Shed Tail',
'Annihilape', 'Arceus', 'Baxcalibur', 'Calyrex-Ice', 'Calyrex-Shadow', 'Chi-Yu', 'Chien-Pao', 'Deoxys-Attack', 'Deoxys-Normal', 'Dialga', 'Dialga-Origin', 'Eternatus', 'Flutter Mane',
'Gholdengo', 'Giratina', 'Giratina-Origin', 'Gouging Fire', 'Groudon', 'Ho-Oh', 'Iron Bundle', 'Koraidon', 'Kyogre', 'Kyurem', 'Kyurem-Black', 'Kyurem-White', 'Landorus-Incarnate',
'Lugia', 'Lunala', 'Magearna', 'Mewtwo', 'Miraidon', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Ogerpon-Hearthflame', 'Palafin', 'Palkia', 'Palkia-Origin', 'Raging Bolt', 'Rayquaza',
'Reshiram', 'Shaymin-Sky', 'Sneasler', 'Solgaleo', 'Spectrier', 'Ursaluna-Bloodmoon', 'Zacian', 'Zacian-Crowned', 'Zamazenta-Crowned', 'Zekrom', 'Arena Trap', 'Moody', 'Shadow Tag',
'Speed Boost', 'Heat Rock', 'King\'s Rock', 'Razor Fang', 'Quick Claw', 'Baton Pass', 'Last Respects', 'Shed Tail',
],
},
{
Expand Down Expand Up @@ -1660,7 +1654,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [
'Sand Veil', 'Snow Cloak', 'King\'s Rock', 'Razor Fang', 'Baton Pass', 'Dire Claw', 'Last Respects', 'Shed Tail',
],
restricted: [
'Beat Up', 'Belly Drum', 'Clangorous Soul', 'Dragon Dance', 'Endeavor', 'Quiver Dance', 'Shell Smash', 'Shift Gear', 'Tail Glow', 'Tidy Up', 'Victory Dance',
'Belly Drum', 'Clangorous Soul', 'Dragon Dance', 'Endeavor', 'Quiver Dance', 'Shell Smash', 'Shift Gear', 'Tail Glow', 'Tidy Up', 'Victory Dance',
],
onValidateSet(set) {
const fsMove = this.dex.moves.get(set.moves[0]);
Expand All @@ -1680,6 +1674,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [
const moveData = this.dex.getActiveMove(move.id);
moveData.flags['futuremove'] = 1;
delete moveData.flags['protect'];
if (moveData.id === 'beatup') this.singleEvent('ModifyMove', moveData, null, pokemon, null, null, moveData);
Object.assign(t.side.slotConditions[t.position]['futuremove'], {
duration: 3,
move: moveData.id,
Expand Down Expand Up @@ -2673,13 +2668,13 @@ export const Formats: import('../sim/dex-formats').FormatList = [
'Sleep Clause Mod', 'Forme Clause', 'Z-Move Clause', 'Terastal Clause', 'Mega Rayquaza Clause',
],
banlist: [
'ND Uber', 'ND AG', 'ND OU', 'ND UUBL', 'ND UU', 'ND RUBL', 'ND RU', 'ND NFE', ' ND LC',
'ND Uber', 'ND AG', 'ND OU', 'ND UUBL', 'ND UU', 'ND RUBL', 'ND RU', 'ND NFE', 'ND LC',
'Battle Bond', 'Moody', 'Shadow Tag', 'Berserk Gene', 'King\'s Rock', 'Quick Claw', 'Razor Fang', 'Acupressure', 'Last Respects',
],
unbanlist: [
'Ampharos-Base', 'Appletun', 'Araquanid', 'Arbok', 'Centiskorch', 'Drampa', 'Dusknoir', 'Exeggutor-Alola', 'Exeggutor-Base', 'Frosmoth', 'Gabite', 'Glaceon',
'Golduck', 'Gourgeist-Average', 'Gourgeist-Super', 'Granbull', 'Gumshoos', 'Guzzlord', 'Kecleon', 'Ledian', 'Lurantis', 'Oricorio-Baile', 'Overqwil',
'Pinsir-Base', 'Qwilfish-Base', 'Reuniclus', 'Shedinja', 'Shelgon', 'Spiritomb', 'Trapinch', 'Tsareena', 'Turtonator', 'Unown', 'Wigglytuff', 'Wishiwashi',
'Ampharos-Base', 'Appletun', 'Araquanid', 'Arbok', 'Centiskorch', 'Drampa', 'Dusknoir', 'Exeggutor-Alola', 'Exeggutor-Base', 'Frosmoth', 'Gabite', 'Galvantula',
'Glaceon', 'Golduck', 'Gorebyss', 'Gourgeist-Average', 'Gourgeist-Super', 'Granbull', 'Gumshoos', 'Guzzlord', 'Kecleon', 'Ledian', 'Lurantis', 'Pinsir-Base',
'Qwilfish-Base', 'Reuniclus', 'Shedinja', 'Shelgon', 'Spiritomb', 'Trapinch', 'Tsareena', 'Turtonator', 'Unown', 'Wigglytuff', 'Wishiwashi',
],
// Stupid hardcode
onValidateSet(set, format, setHas, teamHas) {
Expand Down Expand Up @@ -4547,18 +4542,13 @@ export const Formats: import('../sim/dex-formats').FormatList = [
ruleset: ['Standard'],
banlist: ['Uber', 'OU', 'UUBL', 'Smeargle + Ingrain', 'Arena Trap', 'Baton Pass', 'Swagger'],
},
// {
// name: "[Gen 3] RU",
// mod: 'gen3',
// searchShow: false,
// ruleset: ['[Gen 3] UU'],
// banlist: [
// 'Altaria', 'Ampharos', 'Arcanine', 'Blastoise', 'Clefable', 'Cradily', 'Electabuzz', 'Electrode', 'Fearow', 'Feraligatr', 'Gligar', 'Golduck',
// 'Golem', 'Gorebyss', 'Granbull', 'Grumpig', 'Hitmonlee', 'Hitmontop', 'Jumpluff', 'Kangaskhan', 'Lanturn', 'Lunatone', 'Manectric', 'Misdreavus',
// 'Muk', 'Nidoking', 'Nidoqueen', 'Ninjask', 'Omastar', 'Pinsir', 'Qwilfish', 'Sandslash', 'Scyther', 'Slowking', 'Solrock', 'Tentacruel', 'Vileplume',
// 'Walrein', 'Xatu',
// ],
// },
{
name: "[Gen 3] RU",
mod: 'gen3',
searchShow: false,
ruleset: ['Standard'],
banlist: ['Uber', 'OU', 'UUBL', 'UU', 'RUBL', 'Smeargle + Ingrain', 'Arena Trap', 'Baton Pass', 'Swagger'],
},
{
name: "[Gen 3] NU",
mod: 'gen3',
Expand All @@ -4571,7 +4561,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [
mod: 'gen3',
searchShow: false,
ruleset: ['Standard', 'Baton Pass Stat Clause'],
banlist: ['Uber', 'OU', 'UUBL', 'UU', 'NUBL', 'NU', 'PUBL'],
banlist: ['Uber', 'OU', 'UUBL', 'UU', 'RUBL', 'RU', 'NUBL', 'NU', 'PUBL'],
},
{
name: "[Gen 3] LC",
Expand Down Expand Up @@ -4600,7 +4590,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [
mod: 'gen3',
searchShow: false,
ruleset: ['Standard', 'Sleep Moves Clause', 'Baton Pass Stat Trap Clause', 'Swagger Clause'],
banlist: ['Uber', 'OU', 'UUBL', 'UU', 'NUBL', 'NU', 'PUBL', 'PU', 'ZUBL', 'Baton Pass + Substitute'],
banlist: ['Uber', 'OU', 'UUBL', 'UU', 'RUBL', 'RU', 'NUBL', 'NU', 'PUBL', 'PU', 'ZUBL', 'Baton Pass + Substitute'],
},
{
name: "[Gen 3] Custom Game",
Expand Down
18 changes: 9 additions & 9 deletions data/cg-teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export default class TeamGenerator {
let types = nonStatusMoves.map(move => TeamGenerator.moveType(this.dex.moves.get(move), species));
const noStellar = ability === 'Adaptability' || new Set(types).size < 3;
if (hasTeraBlast || hasRevelationDance || !nonStatusMoves.length) {
types = [...this.dex.types.all().map(t => t.name)];
types = [...this.dex.types.names()];
if (noStellar) types.splice(types.indexOf('Stellar'));
} else {
if (!noStellar) types.push('Stellar');
Expand Down Expand Up @@ -327,23 +327,23 @@ export default class TeamGenerator {
*/
protected speciesIsGoodFit(species: Species, stats: TeamStats): boolean {
// type check
for (const type of this.dex.types.all()) {
const effectiveness = this.dex.getEffectiveness(type.name, species.types);
for (const typeName of this.dex.types.names()) {
const effectiveness = this.dex.getEffectiveness(typeName, species.types);
if (effectiveness === 1) { // WEAKNESS!
if (stats.typeWeaknesses[type.name] === undefined) {
stats.typeWeaknesses[type.name] = 0;
if (stats.typeWeaknesses[typeName] === undefined) {
stats.typeWeaknesses[typeName] = 0;
}
if (stats.typeWeaknesses[type.name] >= MAX_WEAK_TO_SAME_TYPE) {
if (stats.typeWeaknesses[typeName] >= MAX_WEAK_TO_SAME_TYPE) {
// too many weaknesses to this type
return false;
}
}
}
// species passes; increment counters
for (const type of this.dex.types.all()) {
const effectiveness = this.dex.getEffectiveness(type.name, species.types);
for (const typeName of this.dex.types.names()) {
const effectiveness = this.dex.getEffectiveness(typeName, species.types);
if (effectiveness === 1) {
stats.typeWeaknesses[type.name]++;
stats.typeWeaknesses[typeName]++;
}
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion data/formats-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5605,7 +5605,7 @@ export const FormatsData: import('../sim/dex-species').SpeciesFormatsDataTable =
natDexTier: "RU",
},
okidogi: {
tier: "UU",
tier: "UUBL",
doublesTier: "(DUU)",
natDexTier: "RU",
},
Expand Down
9 changes: 5 additions & 4 deletions data/learnsets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67280,7 +67280,7 @@ export const Learnsets: import('../sim/dex-species').LearnsetDataTable = {
drainpunch: ["9M", "7T", "6T", "5T"],
dreameater: ["7M", "6M", "5M"],
dualchop: ["7T", "6T", "5T"],
echoedvoice: ["9L36", "7M", "7L36", "6M", "6L36", "5M", "5L36"],
echoedvoice: ["9L36", "9S5", "7M", "7L36", "6M", "6L36", "5M", "5L36"],
embargo: ["7M", "6M", "5M"],
endure: ["9M"],
energyball: ["9M", "7M", "6M", "5M"],
Expand Down Expand Up @@ -67316,14 +67316,14 @@ export const Learnsets: import('../sim/dex-species').LearnsetDataTable = {
playrough: ["9M"],
poweruppunch: ["6M"],
protect: ["9M", "7M", "6M", "5M"],
psybeam: ["9M", "9L31", "7L31", "6L31", "5L31"],
psybeam: ["9M", "9L31", "9S5", "7L31", "6L31", "5L31"],
psychic: ["9M", "9L57", "9S4", "7M", "7L57", "7S2", "6M", "6L57", "5M", "5L57", "5S1"],
psychup: ["9M", "7M", "6M", "5M"],
psyshock: ["9M", "7M", "6M", "5M"],
quickattack: ["9L1", "7L1", "6L6", "5L6", "5S0"],
raindance: ["9M", "7M", "6M", "5M"],
recycle: ["7T", "6T", "5T"],
relicsong: ["9L50", "9S4", "7T", "7S3", "6T", "5T"],
relicsong: ["9L50", "9S4", "9S5", "7T", "7S3", "6T", "5T"],
rest: ["9M", "7M", "6M", "5M"],
retaliate: ["6M", "5M"],
return: ["7M", "6M", "5M"],
Expand All @@ -67337,7 +67337,7 @@ export const Learnsets: import('../sim/dex-species').LearnsetDataTable = {
shadowclaw: ["9M", "7M", "6M", "5M"],
shockwave: ["7T", "6T"],
signalbeam: ["7T", "6T", "5T"],
sing: ["9L1", "9S4", "7L1", "7S2", "7S3", "6L16", "5L16"],
sing: ["9L1", "9S4", "9S5", "7L1", "7S2", "7S3", "6L16", "5L16"],
skillswap: ["9M", "7T", "6T", "5T"],
sleeptalk: ["9M", "7M", "6M", "5T"],
snatch: ["7T", "6T", "5T"],
Expand Down Expand Up @@ -67373,6 +67373,7 @@ export const Learnsets: import('../sim/dex-species').LearnsetDataTable = {
{generation: 7, level: 15, moves: ["sing", "psychic", "closecombat"], pokeball: "cherishball"},
{generation: 7, level: 50, moves: ["sing", "celebrate", "round", "relicsong"], pokeball: "cherishball"},
{generation: 9, level: 70, moves: ["relicsong", "hypervoice", "sing", "psychic"]},
{generation: 9, level: 50, shiny: true, nature: "Modest", ivs: {hp: 20, atk: 20, def: 20, spa: 31, spd: 31, spe: 31}, moves: ["relicsong", "echoedvoice", "psybeam", "sing"], pokeball: "cherishball"},
],
eventOnly: true,
},
Expand Down
2 changes: 1 addition & 1 deletion data/mods/gen1rbycap/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = {
icicle: {
accuracy: 100,
basePower: 70,
category: "Physical",
category: "Special",
shortDesc: "High critical hit ratio.",
name: "Icicle",
pp: 15,
Expand Down
4 changes: 2 additions & 2 deletions data/mods/gen3/formats-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormat
tier: "SU",
},
clefable: {
tier: "UU",
tier: "RU",
},
vulpix: {
tier: "IU",
Expand Down Expand Up @@ -576,7 +576,7 @@ export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormat
tier: "SU",
},
xatu: {
tier: "UU",
tier: "RU",
},
mareep: {
tier: "IU",
Expand Down
8 changes: 4 additions & 4 deletions data/mods/gen8linked/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = {
if (!lastMove) return false;
const possibleTypes = [];
const attackType = lastMove.type;
for (const type of this.dex.types.all()) {
if (source.hasType(type.name)) continue;
const typeCheck = type.damageTaken[attackType];
for (const typeName of this.dex.types.names()) {
if (source.hasType(typeName)) continue;
const typeCheck = this.dex.types.get(typeName).damageTaken[attackType];
if (typeCheck === 2 || typeCheck === 3) {
possibleTypes.push(type.name);
possibleTypes.push(typeName);
}
}
if (!possibleTypes.length) {
Expand Down
9 changes: 3 additions & 6 deletions data/mods/gen9ssb/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,9 @@ export function changeSet(context: Battle, pokemon: Pokemon, newSet: SSBSet, cha
if (newSet.species === 'Shedinja') percent = 1;
pokemon.formeChange(newSet.species, context.effect, true);
if (!pokemon.terastallized && newSet.teraType) {
const allTypes = context.dex.types.all().map(x => x.name);
pokemon.teraType = newSet.teraType === 'Any' ?
allTypes[Math.floor(Math.random() * allTypes.length)] :
Array.isArray(newSet.teraType) ?
newSet.teraType[Math.floor(Math.random() * newSet.teraType.length)] :
newSet.teraType;
const allTypes = context.dex.types.names();
pokemon.teraType = newSet.teraType === 'Any' ? context.sample(allTypes) :
Array.isArray(newSet.teraType) ? context.sample(newSet.teraType) : newSet.teraType;
}
const details = pokemon.species.name + (pokemon.level === 100 ? '' : ', L' + pokemon.level) +
(pokemon.gender === '' ? '' : ', ' + pokemon.gender) + (pokemon.set.shiny ? ', shiny' : '');
Expand Down
8 changes: 4 additions & 4 deletions data/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2908,11 +2908,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = {
}
const possibleTypes = [];
const attackType = target.lastMoveUsed.type;
for (const type of this.dex.types.all()) {
if (source.hasType(type.name)) continue;
const typeCheck = type.damageTaken[attackType];
for (const typeName of this.dex.types.names()) {
if (source.hasType(typeName)) continue;
const typeCheck = this.dex.types.get(typeName).damageTaken[attackType];
if (typeCheck === 2 || typeCheck === 3) {
possibleTypes.push(type.name);
possibleTypes.push(typeName);
}
}
if (!possibleTypes.length) {
Expand Down
4 changes: 1 addition & 3 deletions data/random-battles/gen3/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ export class RandomGen3Teams extends RandomGen4Teams {

// Develop additional move lists
const badWithSetup = ['knockoff', 'rapidspin', 'toxic'];
const statusMoves = this.dex.moves.all()
.filter(move => move.category === 'Status')
.map(move => move.id);
const statusMoves = this.cachedStatusMoves;

// General incompatibilities
const incompatiblePairs = [
Expand Down
7 changes: 4 additions & 3 deletions data/random-battles/gen4/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export class RandomGen4Teams extends RandomGen5Teams {
Steel: (movePool, moves, abilities, types, counter, species) => (!counter.get('Steel') && species.id === 'metagross'),
Water: (movePool, moves, abilities, types, counter) => !counter.get('Water'),
};
this.cachedStatusMoves = this.dex.moves.all()
.filter(move => move.category === 'Status')
.map(move => move.id);
}

cullMovePool(
Expand Down Expand Up @@ -164,9 +167,7 @@ export class RandomGen4Teams extends RandomGen5Teams {

// Develop additional move lists
const badWithSetup = ['pursuit', 'toxic'];
const statusMoves = this.dex.moves.all()
.filter(move => move.category === 'Status')
.map(move => move.id);
const statusMoves = this.cachedStatusMoves;

// General incompatibilities
const incompatiblePairs = [
Expand Down
9 changes: 5 additions & 4 deletions data/random-battles/gen5/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export class RandomGen5Teams extends RandomGen6Teams {
),
Water: (movePool, moves, abilities, types, counter) => !counter.get('Water'),
};
// Nature Power is Earthquake this gen
this.cachedStatusMoves = this.dex.moves.all()
.filter(move => move.category === 'Status' && move.id !== 'naturepower')
.map(move => move.id);
}

cullMovePool(
Expand Down Expand Up @@ -177,10 +181,7 @@ export class RandomGen5Teams extends RandomGen6Teams {

// Develop additional move lists
const badWithSetup = ['healbell', 'pursuit', 'toxic'];
// Nature Power is Earthquake this gen
const statusMoves = this.dex.moves.all()
.filter(move => move.category === 'Status' && move.id !== 'naturepower')
.map(move => move.id);
const statusMoves = this.cachedStatusMoves;

// General incompatibilities
const incompatiblePairs = [
Expand Down
7 changes: 4 additions & 3 deletions data/random-battles/gen6/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ export class RandomGen6Teams extends RandomGen7Teams {
Steel: (movePool, moves, abilities, types, counter, species) => (!counter.get('Steel') && species.baseStats.atk >= 100),
Water: (movePool, moves, abilities, types, counter) => !counter.get('Water'),
};
this.cachedStatusMoves = this.dex.moves.all()
.filter(move => move.category === 'Status')
.map(move => move.id);
}

cullMovePool(
Expand Down Expand Up @@ -196,9 +199,7 @@ export class RandomGen6Teams extends RandomGen7Teams {

// Develop additional move lists
const badWithSetup = ['defog', 'dragontail', 'haze', 'healbell', 'nuzzle', 'pursuit', 'rapidspin', 'toxic'];
const statusMoves = this.dex.moves.all()
.filter(move => move.category === 'Status')
.map(move => move.id);
const statusMoves = this.cachedStatusMoves;

// General incompatibilities
const incompatiblePairs = [
Expand Down
Loading

0 comments on commit 125a704

Please sign in to comment.