From c41410f9d490f1f7e13a95c094caf9bde06626a5 Mon Sep 17 00:00:00 2001 From: Rezzo Date: Thu, 21 Dec 2023 00:59:43 +0000 Subject: [PATCH 01/33] update ancient chooseMove code --- play.pokemonshowdown.com/js/client-teambuilder.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/play.pokemonshowdown.com/js/client-teambuilder.js b/play.pokemonshowdown.com/js/client-teambuilder.js index dd7af7ed9..252a74f63 100644 --- a/play.pokemonshowdown.com/js/client-teambuilder.js +++ b/play.pokemonshowdown.com/js/client-teambuilder.js @@ -3295,13 +3295,13 @@ set.ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; if (this.curTeam.gen > 2) { var HPivs = this.curTeam.dex.types.get(hpType).HPivs; - for (var i in exports.BattleTypeChart[hpType].HPivs) { - set.ivs[i] = exports.BattleTypeChart[hpType].HPivs[i]; + for (var i in HPivs) { + set.ivs[i] = HPivs[i]; } } else { var HPdvs = this.curTeam.dex.types.get(hpType).HPdvs; - for (var i in exports.BattleTypeChart[hpType].HPdvs) { - set.ivs[i] = exports.BattleTypeChart[hpType].HPdvs[i] * 2; + for (var i in HPdvs) { + set.ivs[i] = HPdvs[i] * 2; } var atkDV = Math.floor(set.ivs.atk / 2); var defDV = Math.floor(set.ivs.def / 2); From 4205e04ebe335d8912adf0edd417f6d300e96f6c Mon Sep 17 00:00:00 2001 From: Rezzo Date: Thu, 21 Dec 2023 15:19:52 +0000 Subject: [PATCH 02/33] update lower tiers tierOrder --- build-tools/build-indexes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/build-indexes b/build-tools/build-indexes index e773ca269..25ec980d9 100755 --- a/build-tools/build-indexes +++ b/build-tools/build-indexes @@ -1310,7 +1310,7 @@ function buildTeambuilderTables() { BattleTeambuilderTable[modConfigId].formatSlices = formatSlices; const doublesFormatSlices = {}; if (hasDoublesFormats) BattleTeambuilderTable[modConfigId].doubles.formatSlices = doublesFormatSlices; - const tierOrder = ["OU", "AG", "Uber", "(Uber)", "OU", "(OU)", "UUBL", "UU", "RUBL", "RU", "NUBL", "NU", "PUBL", "PU", "(PU)", "New", "NFE", "LC Uber", "LC", "Unreleased"]; + const tierOrder = ["OU", "AG", "Uber", "(Uber)", "OU", "(OU)", "UUBL", "UU", "RUBL", "RU", "NUBL", "NU", "PUBL", "PU", "(PU)", "ZUBL", "ZU", "New", "NFE", "LC Uber", "LC", "Unreleased"]; const tierOrderDoubles = ["DUber", "(DUber)", "DOU", "DBL", "(DOU)", "DUU", "(DUU)", "New", "NFE", "LC Uber", "LC"]; if (hasSinglesFormats) buildTiers(modConfigId, tierTable, tiers, customTiers, formatSlices, tierOrder); if (hasDoublesFormats) buildTiers(modConfigId, tierTable, doublesTiers, customDoublesTiers, doublesFormatSlices, tierOrderDoubles); From e0ee4e4e669ad1d266b4aad64a16f0290a392c7d Mon Sep 17 00:00:00 2001 From: Kris Johnson <11083252+KrisXV@users.noreply.github.com> Date: Mon, 25 Dec 2023 16:00:50 -0700 Subject: [PATCH 03/33] Fix National Dex Doubles teambuilder --- build-tools/build-indexes | 10 +++++++++- .../src/battle-dex-search.ts | 19 ++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/build-tools/build-indexes b/build-tools/build-indexes index 1e9e7a0b3..b3d2a04ae 100755 --- a/build-tools/build-indexes +++ b/build-tools/build-indexes @@ -356,6 +356,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); const tierTable = {}; const overrideTier = {}; const ubersUUBans = {}; + const ndDoublesBans = {}; const monotypeBans = {}; const nonstandardMoves = []; for (const id of pokemon) { @@ -468,8 +469,14 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); if (ubersUU.exists && Dex.formats.getRuleTable(ubersUU).isBannedSpecies(species)) { ubersUUBans[species.id] = 1; } + const ndDoubles = Dex.formats.get(gen + 'nationaldexdoubles'); + if (ndDoubles.exists && Dex.formats.getRuleTable(ndDoubles).isBannedSpecies(species)) { + ndDoublesBans[species.id] = 1; + } + } + if (genNum >= 5) { const mono = Dex.formats.get(gen + (isNatDex ? 'nationaldex' : '') + 'monotype'); - if (Dex.formats.getRuleTable(mono).isBannedSpecies(species)) { + if (mono.exists && Dex.formats.getRuleTable(mono).isBannedSpecies(species)) { monotypeBans[species.id] = 1; } } @@ -490,6 +497,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); BattleTeambuilderTable['gen' + genNum + 'natdex'].tiers = tiers; BattleTeambuilderTable['gen' + genNum + 'natdex'].overrideTier = overrideTier; BattleTeambuilderTable['gen' + genNum + 'natdex'].items = items; + BattleTeambuilderTable['gen' + genNum + 'natdex'].ndDoublesBans = ndDoublesBans; BattleTeambuilderTable['gen' + genNum + 'natdex'].monotypeBans = monotypeBans; BattleTeambuilderTable['gen' + genNum + 'natdex'].formatSlices = formatSlices; } else if (isMetBattle) { diff --git a/play.pokemonshowdown.com/src/battle-dex-search.ts b/play.pokemonshowdown.com/src/battle-dex-search.ts index 0bf695396..e9966b7b3 100644 --- a/play.pokemonshowdown.com/src/battle-dex-search.ts +++ b/play.pokemonshowdown.com/src/battle-dex-search.ts @@ -635,8 +635,10 @@ abstract class BattleTypedSearch { this.dex = Dex.mod('gen7letsgo' as ID); } if (format.includes('nationaldex') || format.startsWith('nd') || format.includes('natdex')) { - format = (format.startsWith('nd') ? format.slice(2) : - format.includes('natdex') ? format.slice(6) : format.slice(11)) as ID; + if (format !== 'nationaldexdoubles') { + format = (format.startsWith('nd') ? format.slice(2) : + format.includes('natdex') ? format.slice(6) : format.slice(11)) as ID; + } this.formatType = 'natdex'; if (!format) format = 'ou' as ID; } @@ -931,7 +933,7 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { table['gen' + dex.gen + 'doubles'] && dex.gen > 4 && this.formatType !== 'letsgo' && this.formatType !== 'bdspdoubles' && this.formatType !== 'ssdlc1doubles' && this.formatType !== 'predlcdoubles' && - this.formatType !== 'svdlc1doubles' && + this.formatType !== 'svdlc1doubles' && !this.formatType?.includes('natdex') && ( format.includes('doubles') || format.includes('triples') || format === 'freeforall' || format.startsWith('ffa') || @@ -989,8 +991,9 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { } let tierSet: SearchRow[] = table.tierSet; let slices: {[k: string]: number} = table.formatSlices; - if (format === 'ubers' || format === 'uber' || format === 'ubersuu') tierSet = tierSet.slice(slices.Uber); - else if (isVGCOrBS || (isHackmons && dex.gen === 9 && !this.formatType)) { + if (format === 'ubers' || format === 'uber' || format === 'ubersuu' || format === 'nationaldexdoubles') { + tierSet = tierSet.slice(slices.Uber); + } else if (isVGCOrBS || (isHackmons && dex.gen === 9 && !this.formatType)) { if (format.endsWith('series13') || isHackmons) { // Show Mythicals } else if ( @@ -1044,6 +1047,12 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { return true; }); } + if (format === 'nationaldexdoubles' && table.ndDoublesBans) { + tierSet = tierSet.filter(([type, id]) => { + if (id in table.ndDoublesBans) return false; + return true; + }); + } if (dex.gen >= 5) { if ((format === 'monotype' || format.startsWith('monothreat')) && table.monotypeBans) { tierSet = tierSet.filter(([type, id]) => { From 24821c589509330e4f5c72cea3bdd6fd37d2d4fe Mon Sep 17 00:00:00 2001 From: Kris Johnson <11083252+KrisXV@users.noreply.github.com> Date: Mon, 25 Dec 2023 16:07:06 -0700 Subject: [PATCH 04/33] Fix some minor move animation bugs --- play.pokemonshowdown.com/src/battle-animations-moves.ts | 3 +++ play.pokemonshowdown.com/src/battle.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/play.pokemonshowdown.com/src/battle-animations-moves.ts b/play.pokemonshowdown.com/src/battle-animations-moves.ts index fc51b0136..48a2483b2 100644 --- a/play.pokemonshowdown.com/src/battle-animations-moves.ts +++ b/play.pokemonshowdown.com/src/battle-animations-moves.ts @@ -2622,6 +2622,9 @@ export const BattleMoveAnims: AnimTable = { spikyshield: { anim: BattleOtherAnims.selfstatus.anim, }, + burningbulwark: { + anim: BattleOtherAnims.selfstatus.anim, + }, banefulbunker: { anim(scene, [attacker]) { scene.backgroundEffect('linear-gradient(#440044 30%, #000000', 600, 0.2); diff --git a/play.pokemonshowdown.com/src/battle.ts b/play.pokemonshowdown.com/src/battle.ts index 03837399d..8cf2f2a6f 100644 --- a/play.pokemonshowdown.com/src/battle.ts +++ b/play.pokemonshowdown.com/src/battle.ts @@ -2903,6 +2903,7 @@ export class Battle { case 'hyperdrill': case 'hyperspacefury': case 'hyperspacehole': + case 'mightycleave': case 'phantomforce': case 'shadowforce': case 'feint': From d623ccc3fc68e6eae993833f8000603f978688de Mon Sep 17 00:00:00 2001 From: Kris Johnson <11083252+KrisXV@users.noreply.github.com> Date: Mon, 25 Dec 2023 16:59:13 -0700 Subject: [PATCH 05/33] Add Stellar type button CSS --- play.pokemonshowdown.com/style/sim-types.css | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/play.pokemonshowdown.com/style/sim-types.css b/play.pokemonshowdown.com/style/sim-types.css index 18f988f9d..9f2381dc5 100644 --- a/play.pokemonshowdown.com/style/sim-types.css +++ b/play.pokemonshowdown.com/style/sim-types.css @@ -393,3 +393,19 @@ background: linear-gradient(to bottom, hsl(310,41%,77%), hsl(310,41%,83%)); border-color: hsl(310,41%,41%); } + +.movemenu button.type-Stellar { + background: linear-gradient(90deg, hsl(330, 65%, 65%), hsl(126, 71%, 73%), hsl(231, 100%, 77%)); + border-color: linear-gradient(90deg, hsl(330, 66%, 58%), hsl(126, 79%, 65%), hsl(231, 98%, 65%)); +} +.movemenu button.type-Stellar small { + color: hsl(244, 24%, 24%); +} +.movemenu button.type-Stellar:hover { + background: linear-gradient(90deg, hsl(330, 65%, 62%), hsl(126, 71%, 67%), hsl(231, 100%, 68%)); + border-color: linear-gradient(90deg, hsl(330, 66%, 58%), hsl(126, 79%, 65%), hsl(231, 98%, 65%)); +} +.movemenu button.type-Stellar:active, .movemenu button.type-Stellar.pressed { + background: linear-gradient(90deg, hsl(330, 65%, 45%), hsl(126, 71%, 73%), hsl(231, 100%, 86%)); + border-color: linear-gradient(90deg, hsl(330, 66%, 58%), hsl(126, 79%, 65%), hsl(231, 98%, 65%)); +} From de56bff9b509b68c0a6579221d7f86924328330c Mon Sep 17 00:00:00 2001 From: pyuk-bot Date: Mon, 25 Dec 2023 23:52:29 -0600 Subject: [PATCH 06/33] Hyper Drill and Mighty Cleave only bypass protection (#2203) --- data/pokemon-showdown | 1 + play.pokemonshowdown.com/src/battle.ts | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) create mode 160000 data/pokemon-showdown diff --git a/data/pokemon-showdown b/data/pokemon-showdown new file mode 160000 index 000000000..534cd3511 --- /dev/null +++ b/data/pokemon-showdown @@ -0,0 +1 @@ +Subproject commit 534cd35119398a901943bc5adab0db2dc8c0f42e diff --git a/play.pokemonshowdown.com/src/battle.ts b/play.pokemonshowdown.com/src/battle.ts index 8cf2f2a6f..46a00e412 100644 --- a/play.pokemonshowdown.com/src/battle.ts +++ b/play.pokemonshowdown.com/src/battle.ts @@ -2900,10 +2900,8 @@ export class Battle { target!.side.removeSideCondition('Reflect'); target!.side.removeSideCondition('LightScreen'); break; - case 'hyperdrill': case 'hyperspacefury': case 'hyperspacehole': - case 'mightycleave': case 'phantomforce': case 'shadowforce': case 'feint': From 7ac7a95849015c752143abd514a17515adb23177 Mon Sep 17 00:00:00 2001 From: singiamtel <47090312+singiamtel@users.noreply.github.com> Date: Tue, 26 Dec 2023 06:52:57 +0100 Subject: [PATCH 07/33] Don't crash when spamming join (#2200) --- play.pokemonshowdown.com/js/client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/play.pokemonshowdown.com/js/client.js b/play.pokemonshowdown.com/js/client.js index 4ab58ca34..cc376093f 100644 --- a/play.pokemonshowdown.com/js/client.js +++ b/play.pokemonshowdown.com/js/client.js @@ -1500,7 +1500,9 @@ function toId() { if (roomEl && roomEl.id) { var roomid = roomEl.id.slice(5); window.app.renameRoom(roomid, target); - window.app.rooms[target].join(); + if (window.app.rooms[target]) { + window.app.rooms[target].join(); + } e.preventDefault(); e.stopPropagation(); e.stopImmediatePropagation(); From 07efb0ff405df0c55d7560209e87014b5688511a Mon Sep 17 00:00:00 2001 From: Karthik <32044378+Karthik99999@users.noreply.github.com> Date: Tue, 26 Dec 2023 00:53:35 -0500 Subject: [PATCH 08/33] Tooltips: Fix issues with Stellar type (#2199) --- play.pokemonshowdown.com/src/battle-dex-data.ts | 2 +- play.pokemonshowdown.com/src/battle-tooltips.ts | 6 ++++-- play.pokemonshowdown.com/src/battle.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/play.pokemonshowdown.com/src/battle-dex-data.ts b/play.pokemonshowdown.com/src/battle-dex-data.ts index 519a56e3b..b312d1a99 100644 --- a/play.pokemonshowdown.com/src/battle-dex-data.ts +++ b/play.pokemonshowdown.com/src/battle-dex-data.ts @@ -1048,7 +1048,7 @@ type NatureName = 'Adamant' | 'Bashful' | 'Bold' | 'Brave' | 'Calm' | 'Careful' 'Quiet' | 'Quirky' | 'Rash' | 'Relaxed' | 'Sassy' | 'Serious' | 'Timid'; type StatNameExceptHP = 'atk' | 'def' | 'spa' | 'spd' | 'spe'; type TypeName = 'Normal' | 'Fighting' | 'Flying' | 'Poison' | 'Ground' | 'Rock' | 'Bug' | 'Ghost' | 'Steel' | - 'Fire' | 'Water' | 'Grass' | 'Electric' | 'Psychic' | 'Ice' | 'Dragon' | 'Dark' | 'Fairy' | '???'; + 'Fire' | 'Water' | 'Grass' | 'Electric' | 'Psychic' | 'Ice' | 'Dragon' | 'Dark' | 'Fairy' | 'Stellar' | '???'; type StatusName = 'par' | 'psn' | 'frz' | 'slp' | 'brn'; type BoostStatName = 'atk' | 'def' | 'spa' | 'spd' | 'spe' | 'evasion' | 'accuracy' | 'spc'; type GenderName = 'M' | 'F' | 'N'; diff --git a/play.pokemonshowdown.com/src/battle-tooltips.ts b/play.pokemonshowdown.com/src/battle-tooltips.ts index 50085413b..fff00c2db 100644 --- a/play.pokemonshowdown.com/src/battle-tooltips.ts +++ b/play.pokemonshowdown.com/src/battle-tooltips.ts @@ -494,6 +494,7 @@ class BattleTooltips { Flying: "Supersonic Skystrike", Ground: "Tectonic Rage", Fairy: "Twinkle Tackle", + Stellar: "", "???": "", }; @@ -516,6 +517,7 @@ class BattleTooltips { Flying: "Max Airstream", Ground: "Max Quake", Fairy: "Max Starfall", + Stellar: "", "???": "", }; @@ -1460,8 +1462,8 @@ class BattleTooltips { if (move.id === 'terablast' && pokemon.terastallized) { moveType = pokemon.terastallized as TypeName; } - if (move.id === 'terastarstorm' && pokemon.terastallized === 'Stellar') { - moveType = pokemon.terastallized as TypeName; + if (move.id === 'terastarstorm' && pokemon.getSpeciesForme() === 'Terapagos-Stellar') { + moveType = 'Stellar'; } // Aura Wheel as Morpeko-Hangry changes the type to Dark diff --git a/play.pokemonshowdown.com/src/battle.ts b/play.pokemonshowdown.com/src/battle.ts index 46a00e412..bf8660f5e 100644 --- a/play.pokemonshowdown.com/src/battle.ts +++ b/play.pokemonshowdown.com/src/battle.ts @@ -476,7 +476,7 @@ export class Pokemon implements PokemonDetails, PokemonHealth { } getTypes(serverPokemon?: ServerPokemon, preterastallized = false): [ReadonlyArray, TypeName | ''] { let types: ReadonlyArray; - if (this.terastallized && !preterastallized) { + if (!preterastallized && this.terastallized && this.terastallized !== 'Stellar') { types = [this.terastallized as TypeName]; } else if (this.volatiles.typechange) { types = this.volatiles.typechange[1].split('/'); From 392eb3a60f8aace77c3f567d57dff70068e2e937 Mon Sep 17 00:00:00 2001 From: Marty-D Date: Wed, 27 Dec 2023 17:49:05 -0500 Subject: [PATCH 09/33] Fix some icon sheet positioning --- play.pokemonshowdown.com/src/battle-dex-data.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/play.pokemonshowdown.com/src/battle-dex-data.ts b/play.pokemonshowdown.com/src/battle-dex-data.ts index b312d1a99..af18f361f 100644 --- a/play.pokemonshowdown.com/src/battle-dex-data.ts +++ b/play.pokemonshowdown.com/src/battle-dex-data.ts @@ -433,8 +433,8 @@ const BattlePokemonIconIndexes: {[id: string]: number} = { // alt forms with duplicate icons greninjabond: 658, gumshoostotem: 735, - raticatealolatotem: 1020 + 120, - marowakalolatotem: 1020 + 136, + raticatealolatotem: 1032 + 120, + marowakalolatotem: 1032 + 136, araquanidtotem: 752, lurantistotem: 754, salazzletotem: 758, From ffb4ebe5047e233477ceccef6d0fbe02fe15baaf Mon Sep 17 00:00:00 2001 From: Rezzo Date: Fri, 29 Dec 2023 16:31:40 +0000 Subject: [PATCH 10/33] fix hidden power dropdown behaviour --- play.pokemonshowdown.com/js/storage.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/play.pokemonshowdown.com/js/storage.js b/play.pokemonshowdown.com/js/storage.js index ff06e52cc..3a61322a3 100644 --- a/play.pokemonshowdown.com/js/storage.js +++ b/play.pokemonshowdown.com/js/storage.js @@ -1368,11 +1368,11 @@ Storage.importTeam = function (buffer, teams) { if (line.substr(0, 14) === 'Hidden Power [') { var hptype = line.substr(14, line.length - 15); line = 'Hidden Power ' + hptype; - var type = Dex.types.get(hptype); - if (!curSet.ivs && window.BattleTypeChart && window.BattleTypeChart[hptype]) { + var type = Dex.types.get(hptype).toLowerCase; + if (!curSet.ivs && window.BattleTypeChart && window.BattleTypeChart[type]) { curSet.ivs = {}; - for (var stat in window.BattleTypeChart[hptype].HPivs) { - curSet.ivs[stat] = window.BattleTypeChart[hptype].HPivs[stat]; + for (var stat in window.BattleTypeChart[type].HPivs) { + curSet.ivs[stat] = window.BattleTypeChart[type].HPivs[stat]; } } } From 98106fe7d5c548111cbff9aa1414c91959a0059b Mon Sep 17 00:00:00 2001 From: Rezzo Date: Fri, 29 Dec 2023 16:38:32 +0000 Subject: [PATCH 11/33] Revert "update ancient chooseMove code" This reverts commit c41410f9d490f1f7e13a95c094caf9bde06626a5. --- play.pokemonshowdown.com/js/client-teambuilder.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/play.pokemonshowdown.com/js/client-teambuilder.js b/play.pokemonshowdown.com/js/client-teambuilder.js index 252a74f63..dd7af7ed9 100644 --- a/play.pokemonshowdown.com/js/client-teambuilder.js +++ b/play.pokemonshowdown.com/js/client-teambuilder.js @@ -3295,13 +3295,13 @@ set.ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; if (this.curTeam.gen > 2) { var HPivs = this.curTeam.dex.types.get(hpType).HPivs; - for (var i in HPivs) { - set.ivs[i] = HPivs[i]; + for (var i in exports.BattleTypeChart[hpType].HPivs) { + set.ivs[i] = exports.BattleTypeChart[hpType].HPivs[i]; } } else { var HPdvs = this.curTeam.dex.types.get(hpType).HPdvs; - for (var i in HPdvs) { - set.ivs[i] = HPdvs[i] * 2; + for (var i in exports.BattleTypeChart[hpType].HPdvs) { + set.ivs[i] = exports.BattleTypeChart[hpType].HPdvs[i] * 2; } var atkDV = Math.floor(set.ivs.atk / 2); var defDV = Math.floor(set.ivs.def / 2); From f6c5c93ed3e0af0669581d79cb568e6c200ff9b6 Mon Sep 17 00:00:00 2001 From: Rezzo Date: Fri, 29 Dec 2023 16:45:10 +0000 Subject: [PATCH 12/33] refactor chooseMove Hidden Power --- play.pokemonshowdown.com/js/client-teambuilder.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/play.pokemonshowdown.com/js/client-teambuilder.js b/play.pokemonshowdown.com/js/client-teambuilder.js index dd7af7ed9..252a74f63 100644 --- a/play.pokemonshowdown.com/js/client-teambuilder.js +++ b/play.pokemonshowdown.com/js/client-teambuilder.js @@ -3295,13 +3295,13 @@ set.ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; if (this.curTeam.gen > 2) { var HPivs = this.curTeam.dex.types.get(hpType).HPivs; - for (var i in exports.BattleTypeChart[hpType].HPivs) { - set.ivs[i] = exports.BattleTypeChart[hpType].HPivs[i]; + for (var i in HPivs) { + set.ivs[i] = HPivs[i]; } } else { var HPdvs = this.curTeam.dex.types.get(hpType).HPdvs; - for (var i in exports.BattleTypeChart[hpType].HPdvs) { - set.ivs[i] = exports.BattleTypeChart[hpType].HPdvs[i] * 2; + for (var i in HPdvs) { + set.ivs[i] = HPdvs[i] * 2; } var atkDV = Math.floor(set.ivs.atk / 2); var defDV = Math.floor(set.ivs.def / 2); From 635c17ceb2db22ca0e9d815df8d1999a323c427c Mon Sep 17 00:00:00 2001 From: Rezzo Date: Fri, 29 Dec 2023 16:48:10 +0000 Subject: [PATCH 13/33] Revert "refactor chooseMove Hidden Power" This reverts commit f6c5c93ed3e0af0669581d79cb568e6c200ff9b6. --- play.pokemonshowdown.com/js/client-teambuilder.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/play.pokemonshowdown.com/js/client-teambuilder.js b/play.pokemonshowdown.com/js/client-teambuilder.js index 252a74f63..dd7af7ed9 100644 --- a/play.pokemonshowdown.com/js/client-teambuilder.js +++ b/play.pokemonshowdown.com/js/client-teambuilder.js @@ -3295,13 +3295,13 @@ set.ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; if (this.curTeam.gen > 2) { var HPivs = this.curTeam.dex.types.get(hpType).HPivs; - for (var i in HPivs) { - set.ivs[i] = HPivs[i]; + for (var i in exports.BattleTypeChart[hpType].HPivs) { + set.ivs[i] = exports.BattleTypeChart[hpType].HPivs[i]; } } else { var HPdvs = this.curTeam.dex.types.get(hpType).HPdvs; - for (var i in HPdvs) { - set.ivs[i] = HPdvs[i] * 2; + for (var i in exports.BattleTypeChart[hpType].HPdvs) { + set.ivs[i] = exports.BattleTypeChart[hpType].HPdvs[i] * 2; } var atkDV = Math.floor(set.ivs.atk / 2); var defDV = Math.floor(set.ivs.def / 2); From b17bef9bff76e9a9cf75110b0bce6c6049208b62 Mon Sep 17 00:00:00 2001 From: Rezzo Date: Fri, 29 Dec 2023 17:04:04 +0000 Subject: [PATCH 14/33] correct refactor of hidden power IV DV update --- play.pokemonshowdown.com/js/client-teambuilder.js | 5 +---- play.pokemonshowdown.com/js/storage.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/play.pokemonshowdown.com/js/client-teambuilder.js b/play.pokemonshowdown.com/js/client-teambuilder.js index dd7af7ed9..ea89ae232 100644 --- a/play.pokemonshowdown.com/js/client-teambuilder.js +++ b/play.pokemonshowdown.com/js/client-teambuilder.js @@ -3290,16 +3290,13 @@ if (resetSpeed) minSpe = false; if (moveName.substr(0, 13) === 'Hidden Power ') { if (!this.canHyperTrain(set)) { - var hpType = moveName.substr(13); - + var hpType = moveName.substr(13).toLowerCase(); set.ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; if (this.curTeam.gen > 2) { - var HPivs = this.curTeam.dex.types.get(hpType).HPivs; for (var i in exports.BattleTypeChart[hpType].HPivs) { set.ivs[i] = exports.BattleTypeChart[hpType].HPivs[i]; } } else { - var HPdvs = this.curTeam.dex.types.get(hpType).HPdvs; for (var i in exports.BattleTypeChart[hpType].HPdvs) { set.ivs[i] = exports.BattleTypeChart[hpType].HPdvs[i] * 2; } diff --git a/play.pokemonshowdown.com/js/storage.js b/play.pokemonshowdown.com/js/storage.js index 3a61322a3..a6b7dea08 100644 --- a/play.pokemonshowdown.com/js/storage.js +++ b/play.pokemonshowdown.com/js/storage.js @@ -1368,7 +1368,7 @@ Storage.importTeam = function (buffer, teams) { if (line.substr(0, 14) === 'Hidden Power [') { var hptype = line.substr(14, line.length - 15); line = 'Hidden Power ' + hptype; - var type = Dex.types.get(hptype).toLowerCase; + var type = Dex.types.get(hptype.toLowerCase()); if (!curSet.ivs && window.BattleTypeChart && window.BattleTypeChart[type]) { curSet.ivs = {}; for (var stat in window.BattleTypeChart[type].HPivs) { From 61653bd727855706ce7d7a0e8e290475cd155a56 Mon Sep 17 00:00:00 2001 From: Rezzo Date: Fri, 29 Dec 2023 19:21:07 +0000 Subject: [PATCH 15/33] teambuilder: notify client that IVs are not default for exports --- play.pokemonshowdown.com/js/storage.js | 1 + 1 file changed, 1 insertion(+) diff --git a/play.pokemonshowdown.com/js/storage.js b/play.pokemonshowdown.com/js/storage.js index a6b7dea08..3656034ca 100644 --- a/play.pokemonshowdown.com/js/storage.js +++ b/play.pokemonshowdown.com/js/storage.js @@ -1491,6 +1491,7 @@ Storage.exportTeam = function (team, gen, hidestats) { } for (var stat in BattleStatNames) { if ((curSet.ivs[stat] === undefined ? 31 : curSet.ivs[stat]) !== (Dex.types.get(hpType).HPivs[stat] || 31)) { + defaultIvs = false; break; } } From 29c39bb861122cd6398608cc3f219a7ea22a2e0d Mon Sep 17 00:00:00 2001 From: Rezzo Date: Fri, 29 Dec 2023 22:14:15 +0000 Subject: [PATCH 16/33] update hp type check for validation --- play.pokemonshowdown.com/js/storage.js | 61 ++++++-------------------- 1 file changed, 13 insertions(+), 48 deletions(-) diff --git a/play.pokemonshowdown.com/js/storage.js b/play.pokemonshowdown.com/js/storage.js index 3656034ca..3eeaa4e33 100644 --- a/play.pokemonshowdown.com/js/storage.js +++ b/play.pokemonshowdown.com/js/storage.js @@ -888,15 +888,7 @@ Storage.fastUnpackTeam = function (buf) { while (true) { var set = {}; team.push(set); - - var thisDex = Dex; - for (var teamid in this.teams) { - var teamData = this.teams[teamid]; - if (teamData.team === buf && teamData.mod) { - thisDex = Dex.mod(teamData.mod); - } - } - + // name j = buf.indexOf('|', i); set.name = buf.substring(i, j); @@ -915,7 +907,7 @@ Storage.fastUnpackTeam = function (buf) { // ability j = buf.indexOf('|', i); var ability = buf.substring(i, j); - var species = thisDex.species.get(set.species); + var species = Dex.species.get(set.species); if (species.baseSpecies === 'Zygarde' && ability === 'H') ability = 'Power Construct'; set.ability = (species.abilities && ['', '0', '1', 'H', 'S'].includes(ability) ? species.abilities[ability] || '!!!ERROR!!!' : ability); i = j + 1; @@ -1007,14 +999,6 @@ Storage.fastUnpackTeam = function (buf) { Storage.unpackTeam = function (buf) { if (!buf) return []; - var thisDex = Dex; - for (var teamid in this.teams) { - var teamData = this.teams[teamid]; - if (teamData.team === buf && teamData.mod) { - thisDex = Dex.mod(teamData.mod); - } - } - var team = []; var i = 0, j = 0; @@ -1029,25 +1013,25 @@ Storage.unpackTeam = function (buf) { // species j = buf.indexOf('|', i); - set.species = thisDex.species.get(buf.substring(i, j)).name || set.name; + set.species = Dex.species.get(buf.substring(i, j)).name || set.name; i = j + 1; // item j = buf.indexOf('|', i); - set.item = thisDex.items.get(buf.substring(i, j)).name; + set.item = Dex.items.get(buf.substring(i, j)).name; i = j + 1; // ability j = buf.indexOf('|', i); - var ability = thisDex.abilities.get(buf.substring(i, j)).name; - var species = thisDex.species.get(set.species); + var ability = Dex.abilities.get(buf.substring(i, j)).name; + var species = Dex.species.get(set.species); set.ability = (species.abilities && ability in {'':1, 0:1, 1:1, H:1} ? species.abilities[ability || '0'] : ability); i = j + 1; // moves j = buf.indexOf('|', i); set.moves = buf.substring(i, j).split(',').map(function (moveid) { - return thisDex.moves.get(moveid).name; + return Dex.moves.get(moveid).name; }); i = j + 1; @@ -1213,7 +1197,6 @@ Storage.importTeam = function (buffer, teams) { } else if (text.length === 1 || (text.length === 2 && !text[1])) { return Storage.unpackTeam(text[0]); } - const mod = (window.room.curTeam && window.room.curTeam.mod) ? window.room.curTeam.mod : ""; for (var i = 0; i < text.length; i++) { var line = $.trim(text[i]); if (line === '' || line === '---') { @@ -1275,29 +1258,11 @@ Storage.importTeam = function (buffer, teams) { var parenIndex = line.lastIndexOf(' ('); if (line.substr(line.length - 1) === ')' && parenIndex !== -1) { line = line.substr(0, line.length - 1); - var thisDex = Dex.species.get(line.substr(parenIndex + 2)).exists ? Dex : null; - if (!thisDex) { - for (var modid in (ModConfig)) { - if (Dex.mod(modid).species.get(line.substr(parenIndex + 2)).exists) { - thisDex = Dex.mod(modid); - } - } - } - curSet.species = thisDex.species.get(line.substr(parenIndex + 2)).name; + curSet.species = Dex.species.get(line.substr(parenIndex + 2)).name; line = line.substr(0, parenIndex); curSet.name = line; } else { - var thisDex = Dex.species.get(line).exists ? Dex : null; - if (!thisDex) { - for (var modid in (ModConfig)) { - if (Dex.mod(modid).species.get(line).exists) { - thisDex = Dex.mod(modid); - } - } - } - console.log(curSet); - console.log(line); - curSet.species = thisDex.species.get(line).name; + curSet.species = Dex.species.get(line).name; curSet.name = ''; } } else if (line.substr(0, 7) === 'Trait: ') { @@ -1368,11 +1333,11 @@ Storage.importTeam = function (buffer, teams) { if (line.substr(0, 14) === 'Hidden Power [') { var hptype = line.substr(14, line.length - 15); line = 'Hidden Power ' + hptype; - var type = Dex.types.get(hptype.toLowerCase()); - if (!curSet.ivs && window.BattleTypeChart && window.BattleTypeChart[type]) { + var type = Dex.types.get(hptype); + if (!curSet.ivs && type) { curSet.ivs = {}; - for (var stat in window.BattleTypeChart[type].HPivs) { - curSet.ivs[stat] = window.BattleTypeChart[type].HPivs[stat]; + for (var stat in type.HPivs) { + curSet.ivs[stat] = type.HPivs[stat]; } } } From 84d8459d5a860e06ca21916a7adc3a51104d5235 Mon Sep 17 00:00:00 2001 From: Rezzo Date: Fri, 29 Dec 2023 22:14:56 +0000 Subject: [PATCH 17/33] Revert "update hp type check for validation" This reverts commit 29c39bb861122cd6398608cc3f219a7ea22a2e0d. --- play.pokemonshowdown.com/js/storage.js | 61 ++++++++++++++++++++------ 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/play.pokemonshowdown.com/js/storage.js b/play.pokemonshowdown.com/js/storage.js index 3eeaa4e33..3656034ca 100644 --- a/play.pokemonshowdown.com/js/storage.js +++ b/play.pokemonshowdown.com/js/storage.js @@ -888,7 +888,15 @@ Storage.fastUnpackTeam = function (buf) { while (true) { var set = {}; team.push(set); - + + var thisDex = Dex; + for (var teamid in this.teams) { + var teamData = this.teams[teamid]; + if (teamData.team === buf && teamData.mod) { + thisDex = Dex.mod(teamData.mod); + } + } + // name j = buf.indexOf('|', i); set.name = buf.substring(i, j); @@ -907,7 +915,7 @@ Storage.fastUnpackTeam = function (buf) { // ability j = buf.indexOf('|', i); var ability = buf.substring(i, j); - var species = Dex.species.get(set.species); + var species = thisDex.species.get(set.species); if (species.baseSpecies === 'Zygarde' && ability === 'H') ability = 'Power Construct'; set.ability = (species.abilities && ['', '0', '1', 'H', 'S'].includes(ability) ? species.abilities[ability] || '!!!ERROR!!!' : ability); i = j + 1; @@ -999,6 +1007,14 @@ Storage.fastUnpackTeam = function (buf) { Storage.unpackTeam = function (buf) { if (!buf) return []; + var thisDex = Dex; + for (var teamid in this.teams) { + var teamData = this.teams[teamid]; + if (teamData.team === buf && teamData.mod) { + thisDex = Dex.mod(teamData.mod); + } + } + var team = []; var i = 0, j = 0; @@ -1013,25 +1029,25 @@ Storage.unpackTeam = function (buf) { // species j = buf.indexOf('|', i); - set.species = Dex.species.get(buf.substring(i, j)).name || set.name; + set.species = thisDex.species.get(buf.substring(i, j)).name || set.name; i = j + 1; // item j = buf.indexOf('|', i); - set.item = Dex.items.get(buf.substring(i, j)).name; + set.item = thisDex.items.get(buf.substring(i, j)).name; i = j + 1; // ability j = buf.indexOf('|', i); - var ability = Dex.abilities.get(buf.substring(i, j)).name; - var species = Dex.species.get(set.species); + var ability = thisDex.abilities.get(buf.substring(i, j)).name; + var species = thisDex.species.get(set.species); set.ability = (species.abilities && ability in {'':1, 0:1, 1:1, H:1} ? species.abilities[ability || '0'] : ability); i = j + 1; // moves j = buf.indexOf('|', i); set.moves = buf.substring(i, j).split(',').map(function (moveid) { - return Dex.moves.get(moveid).name; + return thisDex.moves.get(moveid).name; }); i = j + 1; @@ -1197,6 +1213,7 @@ Storage.importTeam = function (buffer, teams) { } else if (text.length === 1 || (text.length === 2 && !text[1])) { return Storage.unpackTeam(text[0]); } + const mod = (window.room.curTeam && window.room.curTeam.mod) ? window.room.curTeam.mod : ""; for (var i = 0; i < text.length; i++) { var line = $.trim(text[i]); if (line === '' || line === '---') { @@ -1258,11 +1275,29 @@ Storage.importTeam = function (buffer, teams) { var parenIndex = line.lastIndexOf(' ('); if (line.substr(line.length - 1) === ')' && parenIndex !== -1) { line = line.substr(0, line.length - 1); - curSet.species = Dex.species.get(line.substr(parenIndex + 2)).name; + var thisDex = Dex.species.get(line.substr(parenIndex + 2)).exists ? Dex : null; + if (!thisDex) { + for (var modid in (ModConfig)) { + if (Dex.mod(modid).species.get(line.substr(parenIndex + 2)).exists) { + thisDex = Dex.mod(modid); + } + } + } + curSet.species = thisDex.species.get(line.substr(parenIndex + 2)).name; line = line.substr(0, parenIndex); curSet.name = line; } else { - curSet.species = Dex.species.get(line).name; + var thisDex = Dex.species.get(line).exists ? Dex : null; + if (!thisDex) { + for (var modid in (ModConfig)) { + if (Dex.mod(modid).species.get(line).exists) { + thisDex = Dex.mod(modid); + } + } + } + console.log(curSet); + console.log(line); + curSet.species = thisDex.species.get(line).name; curSet.name = ''; } } else if (line.substr(0, 7) === 'Trait: ') { @@ -1333,11 +1368,11 @@ Storage.importTeam = function (buffer, teams) { if (line.substr(0, 14) === 'Hidden Power [') { var hptype = line.substr(14, line.length - 15); line = 'Hidden Power ' + hptype; - var type = Dex.types.get(hptype); - if (!curSet.ivs && type) { + var type = Dex.types.get(hptype.toLowerCase()); + if (!curSet.ivs && window.BattleTypeChart && window.BattleTypeChart[type]) { curSet.ivs = {}; - for (var stat in type.HPivs) { - curSet.ivs[stat] = type.HPivs[stat]; + for (var stat in window.BattleTypeChart[type].HPivs) { + curSet.ivs[stat] = window.BattleTypeChart[type].HPivs[stat]; } } } From 57c3e5ecf899e50f8cc39c303011872f5713a203 Mon Sep 17 00:00:00 2001 From: Rezzo Date: Fri, 29 Dec 2023 22:17:47 +0000 Subject: [PATCH 18/33] update hp type check for validation, fr this time --- play.pokemonshowdown.com/js/storage.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/play.pokemonshowdown.com/js/storage.js b/play.pokemonshowdown.com/js/storage.js index 3656034ca..1ffaef6af 100644 --- a/play.pokemonshowdown.com/js/storage.js +++ b/play.pokemonshowdown.com/js/storage.js @@ -1368,11 +1368,11 @@ Storage.importTeam = function (buffer, teams) { if (line.substr(0, 14) === 'Hidden Power [') { var hptype = line.substr(14, line.length - 15); line = 'Hidden Power ' + hptype; - var type = Dex.types.get(hptype.toLowerCase()); - if (!curSet.ivs && window.BattleTypeChart && window.BattleTypeChart[type]) { + var type = Dex.types.get(hptype); + if (!curSet.ivs && type) { curSet.ivs = {}; - for (var stat in window.BattleTypeChart[type].HPivs) { - curSet.ivs[stat] = window.BattleTypeChart[type].HPivs[stat]; + for (var stat in type.HPivs) { + curSet.ivs[stat] = type.HPivs[stat]; } } } From 32d247e37edc788763efe9d18fa43242e4541c62 Mon Sep 17 00:00:00 2001 From: Kris Johnson <11083252+KrisXV@users.noreply.github.com> Date: Fri, 29 Dec 2023 17:31:41 -0700 Subject: [PATCH 19/33] Remove empty folder --- data/pokemon-showdown | 1 - 1 file changed, 1 deletion(-) delete mode 160000 data/pokemon-showdown diff --git a/data/pokemon-showdown b/data/pokemon-showdown deleted file mode 160000 index 534cd3511..000000000 --- a/data/pokemon-showdown +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 534cd35119398a901943bc5adab0db2dc8c0f42e From 0da111e26efefe8ffaaf2632ef95256b51fb66ea Mon Sep 17 00:00:00 2001 From: Kris Johnson <11083252+KrisXV@users.noreply.github.com> Date: Fri, 29 Dec 2023 19:30:58 -0700 Subject: [PATCH 20/33] Add Electro Shot animation --- .../src/battle-animations-moves.ts | 221 +++++++++++++++++- 1 file changed, 216 insertions(+), 5 deletions(-) diff --git a/play.pokemonshowdown.com/src/battle-animations-moves.ts b/play.pokemonshowdown.com/src/battle-animations-moves.ts index 48a2483b2..4979d272a 100644 --- a/play.pokemonshowdown.com/src/battle-animations-moves.ts +++ b/play.pokemonshowdown.com/src/battle-animations-moves.ts @@ -6954,7 +6954,7 @@ export const BattleMoveAnims: AnimTable = { lick: { anim: BattleOtherAnims.contactattack.anim, }, - vicegrip: { + visegrip: { anim: BattleOtherAnims.contactattack.anim, }, headbutt: { @@ -22867,6 +22867,221 @@ export const BattleMoveAnims: AnimTable = { }, prepareAnim: BattleOtherAnims.chargestatus.anim, }, + electroshot: { + anim(scene, [attacker, defender]) { + let xstep = (defender.x - attacker.x) / 5; + let ystep = (defender.x - 200 - attacker.x) / 5; + let zstep = (defender.z - attacker.z) / 5; + + scene.backgroundEffect('#000000', 900, 0.5); + + for (let i = 0; i < 5; i++) { + scene.showEffect('electroball', { + x: attacker.x + xstep * (i + 1), + y: (attacker.y + 200) + ystep * (i + 1), + z: attacker.z + zstep * (i + 1), + scale: 0.7, + opacity: 0.6, + time: 40 * i + 300, + }, { + opacity: 0, + time: 100 * i + 500, + }, 'linear', '', {filter: 'hue-rotate(120deg)'}); + } + + scene.showEffect('electroball', { + x: attacker.x, + y: attacker.y, + z: attacker.z, + scale: 0.75, + opacity: 0.6, + }, { + x: attacker.x, + y: attacker.y + 200, + z: attacker.z, + scale: 1.25, + opacity: 0, + time: 200, + }, 'decel', '', {filter: 'hue-rotate(120deg)'}); + scene.showEffect('wisp', { + x: attacker.x, + y: attacker.y, + z: attacker.z, + scale: 1, + opacity: 0.6, + }, { + x: attacker.x, + y: attacker.y + 200, + z: attacker.z, + scale: 1.5, + opacity: 0, + time: 200, + }, 'decel'); + + scene.showEffect('electroball', { + x: attacker.x, + y: attacker.y + 200, + z: attacker.z, + scale: 0.4, + opacity: 0.6, + time: 300, + }, { + x: defender.x + 30, + y: defender.y + 30, + z: defender.z, + scale: 0.6, + opacity: 0.3, + time: 500, + }, 'linear', 'explode', {filter: 'hue-rotate(120deg)'}); + scene.showEffect('electroball', { + x: attacker.x, + y: attacker.y + 200, + z: attacker.z, + scale: 0.4, + opacity: 0.6, + time: 375, + }, { + x: defender.x + 20, + y: defender.y - 30, + z: defender.z, + scale: 0.6, + opacity: 0.3, + time: 575, + }, 'linear', 'explode'); + scene.showEffect('electroball', { + x: attacker.x, + y: attacker.y + 200, + z: attacker.z, + scale: 0.4, + opacity: 0.6, + time: 425, + }, { + x: defender.x - 10, + y: defender.y + 10, + z: defender.z, + scale: 0.6, + opacity: 0.3, + time: 625, + }, 'linear', 'explode'); + scene.showEffect('electroball', { + x: attacker.x, + y: attacker.y + 200, + z: attacker.z, + scale: 0.4, + opacity: 0.6, + time: 450, + }, { + x: defender.x - 30, + y: defender.y, + z: defender.z, + scale: 0.6, + opacity: 0.3, + time: 650, + }, 'linear', 'explode', {filter: 'hue-rotate(120deg)'}); + scene.showEffect('electroball', { + x: attacker.x, + y: attacker.y + 200, + z: attacker.z, + scale: 0.4, + opacity: 0.6, + time: 500, + }, { + x: defender.x + 10, + y: defender.y - 10, + z: defender.z, + scale: 0.6, + opacity: 0.3, + time: 700, + }, 'linear', 'explode', {filter: 'hue-rotate(120deg)'}); + scene.showEffect('electroball', { + x: attacker.x, + y: attacker.y + 200, + z: attacker.z, + scale: 0.4, + opacity: 0.6, + time: 575, + }, { + x: defender.x - 20, + y: defender.y, + z: defender.z, + scale: 0.6, + opacity: 0.3, + time: 775, + }, 'linear', 'explode'); + }, + prepareAnim(scene, [attacker]) { + scene.showEffect('electroball', { + x: attacker.x - 60, + y: attacker.y + 40, + z: attacker.z, + scale: 0.7, + opacity: 0.7, + time: 0, + }, { + x: attacker.x, + y: attacker.y, + scale: 0.2, + opacity: 0.2, + time: 300, + }, 'linear', 'fade', {filter: 'hue-rotate(120deg)'}); + scene.showEffect('electroball', { + x: attacker.x + 60, + y: attacker.y - 5, + z: attacker.z, + scale: 0.7, + opacity: 0.7, + time: 100, + }, { + x: attacker.x, + y: attacker.y, + scale: 0.2, + opacity: 0.2, + time: 300, + }, 'linear', 'fade', {filter: 'hue-rotate(120deg)'}); + scene.showEffect('electroball', { + x: attacker.x - 30, + y: attacker.y + 60, + z: attacker.z, + scale: 0.7, + opacity: 0.7, + time: 100, + }, { + x: attacker.x, + y: attacker.y, + scale: 0.2, + opacity: 0.2, + time: 400, + }, 'linear', 'fade', {filter: 'hue-rotate(120deg)'}); + scene.showEffect('electroball', { + x: attacker.x + 20, + y: attacker.y - 50, + z: attacker.z, + scale: 0.7, + opacity: 0.7, + time: 100, + }, { + x: attacker.x, + y: attacker.y, + scale: 0.2, + opacity: 0.2, + time: 400, + }, 'linear', 'fade', {filter: 'hue-rotate(120deg)'}); + scene.showEffect('electroball', { + x: attacker.x - 70, + y: attacker.y - 50, + z: attacker.z, + scale: 0.7, + opacity: 0.7, + time: 200, + }, { + x: attacker.x, + y: attacker.y, + scale: 0.2, + opacity: 0.2, + time: 500, + }, 'linear', 'fade', {filter: 'hue-rotate(120deg)'}); + }, + }, solarblade: { anim(scene, [attacker, defender]) { let xstep = 0; @@ -35896,7 +36111,3 @@ BattleMoveAnims['trailblaze'] = {anim: BattleMoveAnims['powerwhip'].anim}; BattleMoveAnims['tripledive'] = {anim: BattleMoveAnims['dive'].anim}; BattleMoveAnims['hydrosteam'] = {anim: BattleMoveAnims['steameruption'].anim}; BattleMoveAnims['psyblade'] = {anim: BattleMoveAnims['psychocut'].anim}; -BattleMoveAnims['electroshot'] = { - anim: BattleMoveAnims['zapcannon'].anim, - prepareAnim: BattleOtherAnims.lightstatus.anim, -}; From 1926c68b38d6d88e4d43e89a1c4779e1d816d85c Mon Sep 17 00:00:00 2001 From: Kris Johnson <11083252+KrisXV@users.noreply.github.com> Date: Sat, 30 Dec 2023 20:58:13 -0700 Subject: [PATCH 21/33] Reroute <> hyperlink --- play.pokemonshowdown.com/.htaccess | 2 +- pokemonshowdown.com/.htaccess | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/play.pokemonshowdown.com/.htaccess b/play.pokemonshowdown.com/.htaccess index bdc899847..7d782014c 100644 --- a/play.pokemonshowdown.com/.htaccess +++ b/play.pokemonshowdown.com/.htaccess @@ -36,7 +36,7 @@ RewriteRule ^adminrequests?\/?$ https://www.smogon.com/forums/threads/names-pass RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC] RewriteRule ^forgotpassword\/?$ https://www.smogon.com/forums/threads/names-passwords-rooms-and-servers-contacting-upper-staff.3538721/post-6227626/ [R=302,L] RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC] -RewriteRule ^bugs?(reports?)?\/?$ https://www.smogon.com/forums/threads/3663703/ [R=302,L] +RewriteRule ^bugs?(reports?)?\/?$ https://www.smogon.com/forums/ps-bug-report-form/ [R=302,L] RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC] RewriteRule ^rules?\/?$ https://pokemonshowdown.com/rules [R=302,L] RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC] diff --git a/pokemonshowdown.com/.htaccess b/pokemonshowdown.com/.htaccess index 58266a864..5b6b17f26 100644 --- a/pokemonshowdown.com/.htaccess +++ b/pokemonshowdown.com/.htaccess @@ -92,7 +92,7 @@ RewriteRule ^help\/?$ https://play.pokemonshowdown.com/help [R=302,L] RewriteRule ^rooms?suggestions?\/?$ https://www.smogon.com/forums/threads/room-suggestions-are-no-longer-being-taken.3522130/ [R=302,L] RewriteRule ^suggestions?\/?$ https://www.smogon.com/forums/forums/suggestions.517/ [R=302,L] RewriteRule ^adminrequests?\/?$ https://www.smogon.com/forums/threads/names-rooms-and-servers-contacting-senior-staff.3538721/ [R=302,L] -RewriteRule ^bugs?(reports?)?\/?$ https://www.smogon.com/forums/threads/3663703/ [R=302,L] +RewriteRule ^bugs?(reports?)?\/?$ https://www.smogon.com/forums/ps-bug-report-form/ [R=302,L] RewriteRule ^faq\/?$ https://www.smogon.com/forums/posts/6774128/ [R=302,L] RewriteRule ^whatismyip$ whatismyip.php [L,QSA] From 7d1943952c4f8b5c079bba8357228ef20d4b3d88 Mon Sep 17 00:00:00 2001 From: pyuk-bot Date: Mon, 1 Jan 2024 01:36:27 -0600 Subject: [PATCH 22/33] Tooltips: Fix Tera BP minimum (#2202) --- build-tools/build-indexes | 1 + play.pokemonshowdown.com/src/battle-tooltips.ts | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build-tools/build-indexes b/build-tools/build-indexes index b3d2a04ae..7ab6a55af 100755 --- a/build-tools/build-indexes +++ b/build-tools/build-indexes @@ -1238,6 +1238,7 @@ process.stdout.write("Building `data/moves,items,abilities,typechart,learnsets.j const move = Dex.moves.get(Moves[id].name); if (move.desc) Moves[id].desc = move.desc; if (move.shortDesc) Moves[id].shortDesc = move.shortDesc; + if (move.basePowerCallback) Moves[id].basePowerCallback = true; } const buf = 'exports.BattleMovedex = ' + es3stringify(Moves) + ';'; fs.writeFileSync('play.pokemonshowdown.com/data/moves.js', buf); diff --git a/play.pokemonshowdown.com/src/battle-tooltips.ts b/play.pokemonshowdown.com/src/battle-tooltips.ts index fff00c2db..84b19d93d 100644 --- a/play.pokemonshowdown.com/src/battle-tooltips.ts +++ b/play.pokemonshowdown.com/src/battle-tooltips.ts @@ -1879,9 +1879,6 @@ class BattleTooltips { if (['psn', 'tox'].includes(pokemon.status) && move.category === 'Physical') { value.abilityModify(1.5, "Toxic Boost"); } - if (this.battle.gen > 2 && serverPokemon.status === 'brn' && move.id !== 'facade' && move.category === 'Physical') { - if (!value.tryAbility("Guts")) value.modify(0.5, 'Burn'); - } if (['Rock', 'Ground', 'Steel'].includes(moveType) && this.battle.weather === 'sandstorm') { if (value.tryAbility("Sand Force")) value.weatherModify(1.3, "Sandstorm", "Sand Force"); } @@ -2015,6 +2012,11 @@ class BattleTooltips { value.set(60, 'Tera type BP minimum'); } + // Burn isn't really a base power modifier, so it needs to be applied after the Tera BP floor + if (this.battle.gen > 2 && serverPokemon.status === 'brn' && move.id !== 'facade' && move.category === 'Physical') { + if (!value.tryAbility("Guts")) value.modify(0.5, 'Burn'); + } + if ( move.id === 'steelroller' && !this.battle.hasPseudoWeather('Electric Terrain') && From 4bb1cdb1cb2799a334f680ccf39063d72655d9ae Mon Sep 17 00:00:00 2001 From: Alexander B <4866817+MathyFurret@users.noreply.github.com> Date: Mon, 1 Jan 2024 12:48:37 -0600 Subject: [PATCH 23/33] Tooltips: Fix Hadron Engine/Orichalcum Pulse modifier (#2205) --- play.pokemonshowdown.com/src/battle-tooltips.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/play.pokemonshowdown.com/src/battle-tooltips.ts b/play.pokemonshowdown.com/src/battle-tooltips.ts index 84b19d93d..7079679f8 100644 --- a/play.pokemonshowdown.com/src/battle-tooltips.ts +++ b/play.pokemonshowdown.com/src/battle-tooltips.ts @@ -1122,7 +1122,7 @@ class BattleTooltips { stats.spa = Math.floor(stats.spa * 1.5); } if (ability === 'orichalcumpulse') { - stats.atk = Math.floor(stats.atk * 1.3); + stats.atk = Math.floor(stats.atk * 1.3333); } let allyActive = clientPokemon?.side.active; if (allyActive) { @@ -1187,7 +1187,7 @@ class BattleTooltips { speedModifiers.push(2); } if (ability === 'hadronengine') { - stats.spa = Math.floor(stats.spa * 1.3); + stats.spa = Math.floor(stats.spa * 1.3333); } } if (item === 'choicespecs' && !clientPokemon?.volatiles['dynamax']) { From 694b4cda1d23f3192d909a1e7c47ecb4b4dd0a0b Mon Sep 17 00:00:00 2001 From: Kris Johnson <11083252+KrisXV@users.noreply.github.com> Date: Mon, 1 Jan 2024 11:57:24 -0700 Subject: [PATCH 24/33] Fix ADV RU teambuilder --- play.pokemonshowdown.com/src/battle-dex-search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.pokemonshowdown.com/src/battle-dex-search.ts b/play.pokemonshowdown.com/src/battle-dex-search.ts index e9966b7b3..5fffdaa52 100644 --- a/play.pokemonshowdown.com/src/battle-dex-search.ts +++ b/play.pokemonshowdown.com/src/battle-dex-search.ts @@ -1005,7 +1005,7 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { tierSet = tierSet.slice(slices.Regular); } } else if (format === 'ou') tierSet = tierSet.slice(slices.OU); - else if (format === 'uu') tierSet = tierSet.slice(slices.UU); + else if (format === 'uu' || (format === 'ru' && dex.gen === 3)) tierSet = tierSet.slice(slices.UU); else if (format === 'ru') tierSet = tierSet.slice(slices.RU || slices.UU); else if (format === 'nu') tierSet = tierSet.slice(slices.NU || slices.RU || slices.UU); else if (format === 'pu') tierSet = tierSet.slice(slices.PU || slices.NU); From 7c015469da5fd83bed8c283ed3c9e908796d3c97 Mon Sep 17 00:00:00 2001 From: Mia <49593536+mia-pi-git@users.noreply.github.com> Date: Fri, 5 Jan 2024 13:50:55 -0600 Subject: [PATCH 25/33] Memorialize xbossarux --- pokemonshowdown.com/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pokemonshowdown.com/users.php b/pokemonshowdown.com/users.php index 6a69d89e8..8f4c35b88 100644 --- a/pokemonshowdown.com/users.php +++ b/pokemonshowdown.com/users.php @@ -463,7 +463,7 @@

;_;7

'; } From 0c34eca0505e4ef667a8c82108b2bddfe15944d0 Mon Sep 17 00:00:00 2001 From: Marty-D Date: Sat, 6 Jan 2024 10:49:10 -0500 Subject: [PATCH 26/33] Memorialize victoriousbig --- pokemonshowdown.com/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pokemonshowdown.com/users.php b/pokemonshowdown.com/users.php index 8f4c35b88..5ffc1a384 100644 --- a/pokemonshowdown.com/users.php +++ b/pokemonshowdown.com/users.php @@ -463,7 +463,7 @@

;_;7

'; } From 3c605772545078f244de337e39bff9d1de144437 Mon Sep 17 00:00:00 2001 From: Distrib Date: Sun, 7 Jan 2024 10:39:09 +0100 Subject: [PATCH 27/33] Client: Fix Undefined usernames on replays (#2209) --- play.pokemonshowdown.com/js/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.pokemonshowdown.com/js/client.js b/play.pokemonshowdown.com/js/client.js index cc376093f..50c4f4857 100644 --- a/play.pokemonshowdown.com/js/client.js +++ b/play.pokemonshowdown.com/js/client.js @@ -1037,7 +1037,7 @@ function toId() { var replayLink = 'https://' + Config.routes.replays + '/' + replayid; $.ajax(replayLink + '.json', {dataType: 'json'}).done(function (replay) { if (replay) { - var title = replay.p1 + ' vs. ' + replay.p2; + var title = replay.players[0] + ' vs. ' + replay.players[1]; app.receive('>battle-' + replayid + '\n|init|battle\n|title|' + title + '\n' + replay.log); app.receive('>battle-' + replayid + '\n|expire|Open replay in new tab'); } else { From 8820a14f5449807b7f9d719351d7eb70937e395f Mon Sep 17 00:00:00 2001 From: malaow3 Date: Sun, 7 Jan 2024 15:09:36 -0500 Subject: [PATCH 28/33] Fix copy replay button functionality (#2195) Co-authored-by: HoeenHero --- play.pokemonshowdown.com/js/client.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/play.pokemonshowdown.com/js/client.js b/play.pokemonshowdown.com/js/client.js index 50c4f4857..6b3c68e6d 100644 --- a/play.pokemonshowdown.com/js/client.js +++ b/play.pokemonshowdown.com/js/client.js @@ -2557,6 +2557,10 @@ function toId() { this.$el.html('

' + (data.htmlMessage || BattleLog.parseMessage(data.message)) + '

' + (data.buttons || '') + '

').css('max-width', data.maxWidth || 480); }, + copyText: function (value, target) { + app.curRoom.copyText(value, target); + }, + dispatchClickButton: function (e) { var target = e.currentTarget; if (target.name) { From 17eef20bcf5dc556c60970eb3da2d8230334e3a1 Mon Sep 17 00:00:00 2001 From: Karthik <32044378+Karthik99999@users.noreply.github.com> Date: Mon, 8 Jan 2024 17:10:58 -0700 Subject: [PATCH 29/33] Support new ability flags (#2210) --- build-tools/build-indexes | 2 +- .../src/battle-dex-data.ts | 23 +++++++++++++++++-- play.pokemonshowdown.com/src/battle.ts | 15 ++++++------ 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/build-tools/build-indexes b/build-tools/build-indexes index 7ab6a55af..01e935a45 100755 --- a/build-tools/build-indexes +++ b/build-tools/build-indexes @@ -1063,7 +1063,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); // Client relevant data that should be overriden by past gens and mods const overrideSpeciesKeys = ['abilities', 'baseStats', 'cosmeticFormes', 'isNonstandard', 'requiredItems', 'types', 'unreleasedHidden']; const overrideMoveKeys = ['accuracy', 'basePower', 'category', 'desc', 'flags', 'isNonstandard', 'noSketch', 'pp', 'priority', 'shortDesc', 'target', 'type']; - const overrideAbilityKeys = ['desc', 'isNonstandard', 'rating', 'shortDesc']; + const overrideAbilityKeys = ['desc', 'flags', 'isNonstandard', 'rating', 'shortDesc']; // // Past gen table diff --git a/play.pokemonshowdown.com/src/battle-dex-data.ts b/play.pokemonshowdown.com/src/battle-dex-data.ts index af18f361f..b6523073a 100644 --- a/play.pokemonshowdown.com/src/battle-dex-data.ts +++ b/play.pokemonshowdown.com/src/battle-dex-data.ts @@ -1372,6 +1372,25 @@ class Move implements Effect { } } +interface AbilityFlags { + /** Can be suppressed by Mold Breaker and related effects */ + breakable?: 1; + /** Ability can't be suppressed by e.g. Gastro Acid or Neutralizing Gas */ + cantsuppress?: 1; + /** Role Play fails if target has this Ability */ + failroleplay?: 1; + /** Skill Swap fails if either the user or target has this Ability */ + failskillswap?: 1; + /** Entrainment fails if user has this Ability */ + noentrain?: 1; + /** Receiver and Power of Alchemy will not activate if an ally faints with this Ability */ + noreceiver?: 1; + /** Trace cannot copy this Ability */ + notrace?: 1; + /** Disables the Ability if the user is Transformed */ + notransform?: 1; +} + class Ability implements Effect { // effect readonly effectType = 'Ability'; @@ -1385,7 +1404,7 @@ class Ability implements Effect { readonly desc: string; readonly rating: number; - readonly isPermanent: boolean; + readonly flags: AbilityFlags; readonly isNonstandard: boolean; constructor(id: ID, name: string, data: any) { @@ -1399,7 +1418,7 @@ class Ability implements Effect { this.shortDesc = data.shortDesc || data.desc || ''; this.desc = data.desc || data.shortDesc || ''; this.rating = data.rating || 1; - this.isPermanent = !!data.isPermanent; + this.flags = data.flags || {}; this.isNonstandard = !!data.isNonstandard; if (!this.gen) { if (this.num >= 234) { diff --git a/play.pokemonshowdown.com/src/battle.ts b/play.pokemonshowdown.com/src/battle.ts index bf8660f5e..04ca1b915 100644 --- a/play.pokemonshowdown.com/src/battle.ts +++ b/play.pokemonshowdown.com/src/battle.ts @@ -521,11 +521,14 @@ export class Pokemon implements PokemonDetails, PokemonHealth { return !this.getTypeList(serverPokemon).includes('Flying'); } effectiveAbility(serverPokemon?: ServerPokemon) { - if (this.fainted || this.volatiles['gastroacid']) return ''; const ability = this.side.battle.dex.abilities.get( serverPokemon?.ability || this.ability || serverPokemon?.baseAbility || '' ); - if (this.side.battle.ngasActive() && !ability.isPermanent) { + if ( + this.fainted || + (this.volatiles['transform'] && ability.flags['notransform']) || + (!ability.flags['cantsuppress'] && (this.side.battle.ngasActive() || this.volatiles['gastroacid'])) + ) { return ''; } return ability.name; @@ -1224,6 +1227,7 @@ export class Battle { } return pokemonList; } + // Used in Pokemon#effectiveAbility over abilityActive to prevent infinite recursion ngasActive() { for (const active of this.getAllActive()) { if (active.ability === 'Neutralizing Gas' && !active.volatiles['gastroacid']) { @@ -1234,12 +1238,9 @@ export class Battle { } abilityActive(abilities: string | string[]) { if (typeof abilities === 'string') abilities = [abilities]; - if (this.ngasActive()) { - abilities = abilities.filter(a => this.dex.abilities.get(a).isPermanent); - if (!abilities.length) return false; - } + abilities = abilities.map(toID); for (const active of this.getAllActive()) { - if (abilities.includes(active.ability) && !active.volatiles['gastroacid']) { + if (abilities.includes(toID(active.effectiveAbility()))) { return true; } } From 2cca9bc1bd31e7b67e5b5dc5d6485deff50cd233 Mon Sep 17 00:00:00 2001 From: Mia <49593536+mia-pi-git@users.noreply.github.com> Date: Wed, 10 Jan 2024 01:36:19 -0600 Subject: [PATCH 30/33] Battle-log: Support seeking to a timestamp in tags --- play.pokemonshowdown.com/src/battle-log.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/play.pokemonshowdown.com/src/battle-log.ts b/play.pokemonshowdown.com/src/battle-log.ts index 1010c18b1..cb2ac17b8 100644 --- a/play.pokemonshowdown.com/src/battle-log.ts +++ b/play.pokemonshowdown.com/src/battle-log.ts @@ -929,6 +929,7 @@ export class BattleLog { this.players.push(null); const idx = this.players.length; this.initYoutubePlayer(idx); + console.log(src, time); return { tagName: 'iframe', attribs: [ @@ -936,6 +937,7 @@ export class BattleLog { 'width', width, 'height', height, 'src', `https://www.youtube.com/embed/${videoId}?enablejsapi=1&playsinline=1${time ? `&start=${time}` : ''}`, 'frameborder', '0', 'allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture', 'allowfullscreen', 'allowfullscreen', + 'time', (time || 0) + "", ], }; } else if (tagName === 'formatselect') { @@ -1069,7 +1071,8 @@ export class BattleLog { static initYoutubePlayer(idx: number) { const id = `youtube-iframe-${idx}`; const loadPlayer = () => { - if (!$(`#${id}`).length) return; + const el = $(`#${id}`); + if (!el.length) return; const player = new window.YT.Player(id, { events: { onStateChange: (event: any) => { @@ -1082,7 +1085,12 @@ export class BattleLog { }, }, }); + const time = Number(el.attr('time')); + if (time) { + player.seekTo(time); + } this.players[idx - 1] = player; + }; // wait for html element to be in DOM this.ensureYoutube().then(() => { From cd181c26946136a3118582b0176fd83c88726e33 Mon Sep 17 00:00:00 2001 From: Mia <49593536+mia-pi-git@users.noreply.github.com> Date: Wed, 10 Jan 2024 18:23:17 -0600 Subject: [PATCH 31/33] Battle-log: Allow customizing Youtube player size --- play.pokemonshowdown.com/src/battle-log.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/play.pokemonshowdown.com/src/battle-log.ts b/play.pokemonshowdown.com/src/battle-log.ts index cb2ac17b8..722f4089a 100644 --- a/play.pokemonshowdown.com/src/battle-log.ts +++ b/play.pokemonshowdown.com/src/battle-log.ts @@ -916,11 +916,13 @@ export class BattleLog { const src = getAttrib('src') || ''; // Google's ToS requires a minimum of 200x200 - let width = '320'; - let height = '200'; - if (window.innerWidth >= 400) { - width = '400'; - height = '225'; + let width = getAttrib('width') || '0'; + let height = getAttrib('height') || '0'; + if (Number(width) < 200) { + width = window.innerWidth >= 400 ? '400' : '320'; + } + if (Number(height) < 200) { + height = window.innerWidth >= 400 ? '225' : '200'; } const videoId = /(?:\?v=|\/embed\/)([A-Za-z0-9_\-]+)/.exec(src)?.[1]; if (!videoId) return {tagName: 'img', attribs: ['alt', `invalid src for `]}; @@ -929,7 +931,6 @@ export class BattleLog { this.players.push(null); const idx = this.players.length; this.initYoutubePlayer(idx); - console.log(src, time); return { tagName: 'iframe', attribs: [ From 605cabb8925d99da28138d100d96e59c935756a7 Mon Sep 17 00:00:00 2001 From: Kris Johnson <11083252+KrisXV@users.noreply.github.com> Date: Thu, 11 Jan 2024 22:44:40 -0700 Subject: [PATCH 32/33] Fix BST display in RBY teambuilder --- play.pokemonshowdown.com/js/search.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/play.pokemonshowdown.com/js/search.js b/play.pokemonshowdown.com/js/search.js index abecd6263..5fafa1ba3 100644 --- a/play.pokemonshowdown.com/js/search.js +++ b/play.pokemonshowdown.com/js/search.js @@ -387,7 +387,10 @@ } buf += 'Spe
' + stats.spe + '
'; var bst = 0; - for (i in stats) bst += stats[i]; + for (i in stats) { + if (i === 'spd' && gen === 1) continue; + bst += stats[i]; + } buf += 'BST
' + bst + '
'; buf += ''; From 7e3202cc87e12f9132cdd9f83d44bddf5051b63f Mon Sep 17 00:00:00 2001 From: Kris Johnson <11083252+KrisXV@users.noreply.github.com> Date: Thu, 11 Jan 2024 22:48:38 -0700 Subject: [PATCH 33/33] Teambuilder: Fix sorting by BST in RBY --- play.pokemonshowdown.com/src/battle-dex-search.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/play.pokemonshowdown.com/src/battle-dex-search.ts b/play.pokemonshowdown.com/src/battle-dex-search.ts index 5fffdaa52..5d6d2604b 100644 --- a/play.pokemonshowdown.com/src/battle-dex-search.ts +++ b/play.pokemonshowdown.com/src/battle-dex-search.ts @@ -1109,8 +1109,12 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { return results.sort(([rowType1, id1], [rowType2, id2]) => { const base1 = this.dex.species.get(id1).baseStats; const base2 = this.dex.species.get(id2).baseStats; - const bst1 = base1.hp + base1.atk + base1.def + base1.spa + base1.spd + base1.spe; - const bst2 = base2.hp + base2.atk + base2.def + base2.spa + base2.spd + base2.spe; + let bst1 = base1.hp + base1.atk + base1.def + base1.spa + base1.spd + base1.spe; + let bst2 = base2.hp + base2.atk + base2.def + base2.spa + base2.spd + base2.spe; + if (this.dex.gen === 1) { + bst1 -= base1.spd; + bst2 -= base2.spd; + } return (bst2 - bst1) * sortOrder; }); } else if (sortCol === 'name') {