From a75faf7bcfe16796625a87d3857d6e64ab1c0dea Mon Sep 17 00:00:00 2001 From: andrebastosdias Date: Fri, 20 Mar 2026 09:04:20 +0000 Subject: [PATCH 1/4] Re-implement --- config/formats.ts | 26 +++++++++--------- data/mods/gen1/rulesets.ts | 2 +- data/mods/gen1stadium/rulesets.ts | 2 +- data/mods/gen2stadium2/rulesets.ts | 2 +- data/mods/gen3/rulesets.ts | 4 +-- data/mods/gen4/rulesets.ts | 4 +-- data/rulesets.ts | 26 +++--------------- sim/battle-queue.ts | 8 ++++++ sim/battle.ts | 16 ++++++++++++ test/sim/misc/turn-order.js | 42 ++++++++++++++++++++++++++++++ 10 files changed, 90 insertions(+), 42 deletions(-) diff --git a/config/formats.ts b/config/formats.ts index b2fb884b51..3f08357d2c 100644 --- a/config/formats.ts +++ b/config/formats.ts @@ -4063,7 +4063,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen4', team: 'random', bestOfDefault: true, - ruleset: ['Obtainable', 'Sleep Clause Mod', 'HP Percentage Mod', 'Cancel Mod'], + ruleset: ['Standard'], }, { name: "[Gen 3] Random Battle", @@ -4093,7 +4093,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ team: 'randomCC', searchShow: false, challengeShow: false, - ruleset: ['Obtainable', 'HP Percentage Mod', 'Cancel Mod', 'Desync Clause Mod', 'Sleep Clause Mod', 'Freeze Clause Mod'], + ruleset: ['Obtainable', 'Switch Priority Clause Mod', 'HP Percentage Mod', 'Cancel Mod', 'Sleep Clause Mod', 'Freeze Clause Mod'], }, { name: "[Gen 1] Hackmons Cup", @@ -4102,7 +4102,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ team: 'randomHC', searchShow: false, challengeShow: false, - ruleset: ['HP Percentage Mod', 'Cancel Mod', 'Desync Clause Mod', 'Sleep Clause Mod', 'Freeze Clause Mod', 'Team Type Preview'], + ruleset: ['HP Percentage Mod', 'Switch Priority Clause Mod', 'Cancel Mod', 'Sleep Clause Mod', 'Freeze Clause Mod', 'Team Type Preview'], banlist: ['Nonexistent'], onModifySpecies(species, target, source, effect) { if (!target) return; @@ -4223,7 +4223,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen3', gameType: 'doubles', searchShow: false, - ruleset: ['Standard', '!Switch Priority Clause Mod'], + ruleset: ['Standard'], banlist: ['Uber', 'Quick Claw', 'Soul Dew', 'Explosion', 'Self-Destruct', 'Swagger'], unbanlist: ['Wobbuffet', 'Wynaut'], }, @@ -5187,7 +5187,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ name: "[Gen 3] Ubers", mod: 'gen3', searchShow: false, - ruleset: ['Standard', 'Deoxys Camouflage Clause Mod', 'One Baton Pass Clause'], + ruleset: ['Standard', 'One Baton Pass Clause'], banlist: ['Wobbuffet + Leftovers', 'Wynaut + Leftovers', 'Baton Pass'], }, { @@ -5270,7 +5270,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen3rs', gameType: 'doubles', searchShow: false, - ruleset: ['Standard', '!Switch Priority Clause Mod'], + ruleset: ['Standard'], banlist: ['Uber', 'Quick Claw', 'Soul Dew', 'Swagger'], }, { @@ -5280,7 +5280,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ gameType: 'doubles', ruleset: [ 'Obtainable', 'Team Preview', 'Species Clause', 'Stadium Sleep Clause', 'Freeze Clause Mod', 'Max Team Size = 6', 'VGC Timer', - 'Nickname Clause', 'Beat Up Nicknames Mod', 'Endless Battle Clause', 'Cancel Mod', 'Picked Team Size = 4', 'Exact HP Mod', 'Item Clause = 1', 'Open Team Sheets', + 'Nickname Clause', 'Switch Priority Clause Mod', 'Beat Up Nicknames Mod', 'Endless Battle Clause', 'Cancel Mod', 'Picked Team Size = 4', 'Exact HP Mod', 'Item Clause = 1', 'Open Team Sheets', ], banlist: ['Restricted Legendary', 'Mythical', 'Soul Dew'], bestOfDefault: true, @@ -5301,7 +5301,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ gameType: 'singles', ruleset: [ 'Obtainable', 'Team Preview', 'Species Clause', 'Stadium Sleep Clause', 'Freeze Clause Mod', 'Max Team Size = 6', 'VGC Timer', - 'Nickname Clause', 'Beat Up Nicknames Mod', 'Endless Battle Clause', 'Cancel Mod', 'Picked Team Size = 3', 'Exact HP Mod', "Item Clause = 1", 'Open Team Sheets', + 'Nickname Clause', 'Switch Priority Clause Mod', 'Beat Up Nicknames Mod', 'Endless Battle Clause', 'Cancel Mod', 'Picked Team Size = 3', 'Exact HP Mod', "Item Clause = 1", 'Open Team Sheets', ], banlist: ['Soul Dew', 'Restricted Legendary', 'Mythical', 'Wobbuffet + Leftovers', 'Wynaut + Leftovers'], restricted: [], @@ -5387,8 +5387,8 @@ export const Formats: import('../sim/dex-formats').FormatList = [ ruleset: [ 'Picked Team Size = 3', 'Min Level = 50', 'Max Level = 55', 'Max Total Level = 155', 'Obtainable', 'Stadium Sleep Clause', 'Freeze Clause Mod', 'Species Clause', 'Item Clause = 1', - 'Endless Battle Clause', 'Cancel Mod', 'Event Moves Clause', 'Nickname Clause', 'Beat Up Nicknames Mod', - 'Team Preview', + 'Endless Battle Clause', 'Cancel Mod', 'Event Moves Clause', 'Nickname Clause', 'Switch Priority Clause Mod', + 'Beat Up Nicknames Mod', 'Team Preview', ], banlist: ['Uber'], }, @@ -5465,7 +5465,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ searchShow: false, ruleset: [ 'Picked Team Size = 3', 'Min Level = 50', 'Max Level = 55', 'Max Total Level = 155', - 'Obtainable', 'Team Preview', 'Stadium Sleep Clause', 'Species Clause', 'Nickname Clause', 'Cancel Mod', 'NC 1997 Move Legality', + 'Obtainable', 'Switch Priority Clause Mod', 'Team Preview', 'Stadium Sleep Clause', 'Species Clause', 'Nickname Clause', 'Cancel Mod', 'NC 1997 Move Legality', ], banlist: ['Uber'], }, @@ -5492,7 +5492,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ desc: `Only Pokémon sets that can be rented through the American Stadium Poké Cup are legal.`, mod: 'gen1stadium', searchShow: false, - ruleset: ['Stadium Sleep Clause', 'Freeze Clause Mod', 'Species Clause', 'Nickname Clause', 'Team Preview', 'Stadium Poke Cup Rentals'], + ruleset: ['Stadium Sleep Clause', 'Freeze Clause Mod', 'Species Clause', 'Nickname Clause', 'Team Preview', 'Switch Priority Clause Mod', 'Stadium Poke Cup Rentals'], banlist: ['Uber'], }, { @@ -5508,6 +5508,6 @@ export const Formats: import('../sim/dex-formats').FormatList = [ searchShow: false, debug: true, battle: { trunc: Math.trunc }, - ruleset: ['HP Percentage Mod', 'Cancel Mod', 'Desync Clause Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], + ruleset: ['HP Percentage Mod', 'Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], }, ]; diff --git a/data/mods/gen1/rulesets.ts b/data/mods/gen1/rulesets.ts index d6bfeaa805..ea6cc7c698 100644 --- a/data/mods/gen1/rulesets.ts +++ b/data/mods/gen1/rulesets.ts @@ -2,7 +2,7 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable standardag: { inherit: true, ruleset: [ - 'Obtainable', 'Desync Clause Mod', 'HP Percentage Mod', 'Cancel Mod', 'Endless Battle Clause', + 'Obtainable', 'Switch Priority Clause Mod', 'HP Percentage Mod', 'Cancel Mod', 'Endless Battle Clause', ], }, standard: { diff --git a/data/mods/gen1stadium/rulesets.ts b/data/mods/gen1stadium/rulesets.ts index 6d81137ec5..135b6dd9f0 100644 --- a/data/mods/gen1stadium/rulesets.ts +++ b/data/mods/gen1stadium/rulesets.ts @@ -2,7 +2,7 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable standardag: { inherit: true, ruleset: [ - 'Obtainable', 'Exact HP Mod', 'Cancel Mod', + 'Obtainable', 'Switch Priority Clause Mod', 'Exact HP Mod', 'Cancel Mod', ], }, standard: { diff --git a/data/mods/gen2stadium2/rulesets.ts b/data/mods/gen2stadium2/rulesets.ts index 7da1a4ed93..09e76cd416 100644 --- a/data/mods/gen2stadium2/rulesets.ts +++ b/data/mods/gen2stadium2/rulesets.ts @@ -2,7 +2,7 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable standardag: { inherit: true, ruleset: [ - 'Obtainable', 'Team Preview', 'Exact HP Mod', 'Cancel Mod', 'Beat Up Nicknames Mod', + 'Obtainable', 'Team Preview', 'Exact HP Mod', 'Cancel Mod', 'Switch Priority Clause Mod', 'Beat Up Nicknames Mod', ], }, standard: { diff --git a/data/mods/gen3/rulesets.ts b/data/mods/gen3/rulesets.ts index 637f7d2197..5249c30c5c 100644 --- a/data/mods/gen3/rulesets.ts +++ b/data/mods/gen3/rulesets.ts @@ -5,7 +5,7 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable desc: "The standard ruleset for all official Smogon singles tiers (Ubers, OU, etc.)", ruleset: [ 'Standard AG', - 'Sleep Clause Mod', 'Switch Priority Clause Mod', 'Species Clause', 'Nickname Clause', 'OHKO Clause', 'Evasion Items Clause', 'Evasion Moves Clause', + 'Sleep Clause Mod', 'Species Clause', 'Nickname Clause', 'OHKO Clause', 'Evasion Items Clause', 'Evasion Moves Clause', ], }, standarddraft: { @@ -13,7 +13,7 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable name: 'Standard Draft', desc: "The custom Draft League ruleset", ruleset: [ - 'Obtainable', 'Nickname Clause', 'Beat Up Nicknames Mod', '+Unreleased', 'Sleep Clause Mod', 'OHKO Clause', 'Evasion Clause', 'Endless Battle Clause', 'HP Percentage Mod', 'Cancel Mod', + 'Obtainable', 'Nickname Clause', 'Switch Priority Clause Mod', 'Beat Up Nicknames Mod', '+Unreleased', 'Sleep Clause Mod', 'OHKO Clause', 'Evasion Clause', 'Endless Battle Clause', 'HP Percentage Mod', 'Cancel Mod', 'One Boost Passer Clause', 'Freeze Clause Mod', 'Accuracy Moves Clause', 'Baton Pass Trap Clause', ], banlist: [ diff --git a/data/mods/gen4/rulesets.ts b/data/mods/gen4/rulesets.ts index 1a75078179..01fb03eb13 100644 --- a/data/mods/gen4/rulesets.ts +++ b/data/mods/gen4/rulesets.ts @@ -2,7 +2,7 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable standardag: { inherit: true, ruleset: [ - 'Obtainable', 'HP Percentage Mod', 'Cancel Mod', 'Beat Up Nicknames Mod', 'Endless Battle Clause', + 'Obtainable', 'HP Percentage Mod', 'Cancel Mod', 'Switch Priority Clause Mod', 'Beat Up Nicknames Mod', 'Endless Battle Clause', ], }, standard: { @@ -14,7 +14,7 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable }, flatrules: { inherit: true, - ruleset: ['Obtainable', 'Species Clause', 'Nickname Clause', 'Beat Up Nicknames Mod', 'Item Clause = 1', 'Adjust Level Down = 50', 'Picked Team Size = Auto', 'Cancel Mod'], + ruleset: ['Obtainable', 'Species Clause', 'Nickname Clause', 'Switch Priority Clause Mod', 'Beat Up Nicknames Mod', 'Item Clause = 1', 'Adjust Level Down = 50', 'Picked Team Size = Auto', 'Cancel Mod'], }, teampreview: { inherit: true, diff --git a/data/rulesets.ts b/data/rulesets.ts index 0bb49b3aac..3f01e4a5ec 100644 --- a/data/rulesets.ts +++ b/data/rulesets.ts @@ -38,7 +38,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { effectType: 'ValidatorRule', name: 'Flat Rules', desc: "The in-game Flat Rules: Adjust Level Down 50, Species Clause, Item Clause = 1, -Mythical, -Restricted Legendary, Bring 6 Pick 3-6 depending on game type.", - ruleset: ['Obtainable', 'Team Preview', 'Species Clause', 'Nickname Clause', 'Beat Up Nicknames Mod', 'Item Clause = 1', 'Adjust Level Down = 50', 'Picked Team Size = Auto', 'Cancel Mod'], + ruleset: ['Obtainable', 'Team Preview', 'Species Clause', 'Nickname Clause', 'Item Clause = 1', 'Adjust Level Down = 50', 'Picked Team Size = Auto', 'Cancel Mod'], banlist: ['Mythical', 'Restricted Legendary', 'Greninja-Bond'], }, limittworestricted: { @@ -159,7 +159,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { name: 'Standard Draft', desc: "The custom Draft League ruleset", ruleset: [ - 'Obtainable', 'Nickname Clause', 'Beat Up Nicknames Mod', '+Unreleased', '+CAP', 'Sketch Post-Gen 7 Moves', 'Team Preview', 'Sleep Clause Mod', 'OHKO Clause', 'Evasion Clause', 'Endless Battle Clause', 'HP Percentage Mod', 'Cancel Mod', + 'Obtainable', 'Nickname Clause', '+Unreleased', '+CAP', 'Sketch Post-Gen 7 Moves', 'Team Preview', 'Sleep Clause Mod', 'OHKO Clause', 'Evasion Clause', 'Endless Battle Clause', 'HP Percentage Mod', 'Cancel Mod', ], // timer: {starting: 60 * 60, grace: 0, addPerTurn: 10, maxPerTurn: 100, timeoutAutoChoose: true}, }, @@ -1424,30 +1424,12 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { switchpriorityclausemod: { effectType: 'Rule', name: 'Switch Priority Clause Mod', - desc: "Makes a faster Pokémon switch first when double-switching, unlike in Emerald link battles, where player 1's Pokémon would switch first", + desc: "Makes a faster Pokémon switch first when double-switching, unlike in link battles, where player 1's Pokémon would switch first", + // Implemented in battle-queue.ts onBegin() { this.add('rule', 'Switch Priority Clause Mod: Faster Pokémon switch first'); }, }, - desyncclausemod: { - effectType: 'Rule', - name: 'Desync Clause Mod', - desc: 'If a desync would happen, the move fails instead. This rule currently covers Bide, Counter, and Psywave.', - onBegin() { - this.add('rule', 'Desync Clause Mod: Desyncs changed to move failure.'); - }, - // Hardcoded in gen1/moves.ts - // Can't be disabled (no precedent for how else to handle desyncs) - }, - deoxyscamouflageclausemod: { - effectType: 'Rule', - name: 'Deoxys Camouflage Clause Mod', - desc: "Reveals the Deoxys forme when it is sent in battle.", - // Hardcoded into effect, cannot be disabled. - onBegin() { - this.add('rule', 'Deoxys Camouflage Clause Mod: Reveals the Deoxys forme when it is sent in battle.'); - }, - }, freezeclausemod: { effectType: 'Rule', name: 'Freeze Clause Mod', diff --git a/sim/battle-queue.ts b/sim/battle-queue.ts index e2c81d4f7f..cdfc6cc39e 100644 --- a/sim/battle-queue.ts +++ b/sim/battle-queue.ts @@ -202,6 +202,14 @@ export class BattleQueue { } } } + if (this.battle.turn > 0 && !this.battle.ruleTable.has('switchpriorityclausemod') && ( + (this.battle.gen <= 4 && action.choice === 'instaswitch') || + (this.battle.gen <= 3 && action.choice === 'switch') + )) { + // Port switch priority goes: p1a, p2a, p1b, p2b + // Not supported: in Gen 1, each trainer sees his own Pokemon switch first + action.order += (action as SwitchAction).pokemon.getFieldPositionValue() / (this.battle.activePerHalf * 2); + } if (!midTurn) { if (action.choice === 'move') { if (!action.maxMove && !action.zmove && action.move.beforeTurnCallback) { diff --git a/sim/battle.ts b/sim/battle.ts index 6263b73f47..de543b4fc3 100644 --- a/sim/battle.ts +++ b/sim/battle.ts @@ -1927,6 +1927,22 @@ export class Battle { this.add('rated', typeof this.rated === 'string' ? this.rated : ''); } + if (this.gen === 1) { + // If a desync would happen, the move fails instead. This rule currently covers Bide, Counter, and Psywave. + this.add('rule', 'Desync Clause Mod: Desyncs changed to move failure.'); + } + if (this.gen === 3) { + // Reveals the Deoxys forme when it is sent in battle. + const deoxys = ['Deoxys', 'Deoxys-Attack', 'Deoxys-Defense', 'Deoxys-Speed']; + for (const forme of deoxys) { + const species = this.dex.species.get(forme); + if (!this.ruleTable.isBannedSpecies(species)) { + this.add('rule', `Deoxys Camouflage Clause${this.dex.currentMod === 'gen3colosseum' ? '' : ' Mod'}: Reveals the Deoxys forme when it is sent in battle.`); + break; + } + } + } + format.onBegin?.call(this); for (const rule of this.ruleTable.keys()) { if ('+*-!'.includes(rule.charAt(0))) continue; diff --git a/test/sim/misc/turn-order.js b/test/sim/misc/turn-order.js index 72516c77d2..ad602a9903 100644 --- a/test/sim/misc/turn-order.js +++ b/test/sim/misc/turn-order.js @@ -171,6 +171,48 @@ describe('Switching out', () => { battle.makeChoices('switch 2', 'switch 2'); assert.equal(battle.p2.pokemon[0].boosts.atk, 0); }); + + describe(`Switch Priority Clause Mod`, () => { + it('should default to speed switch priority', () => { + battle = common.createBattle({ formatid: 'gen3doublesou' }, [[ + { species: 'Wynaut', moves: ['sleeptalk'], evs: { spe: 0 } }, + { species: 'Wynaut', moves: ['sleeptalk'], evs: { spe: 4 } }, + { species: 'Pelipper', ability: 'drizzle', moves: ['sleeptalk'] }, + { species: 'Gyarados', ability: 'intimidate', moves: ['sleeptalk'] }, + ], [ + { species: 'Wynaut', moves: ['sleeptalk'], evs: { spe: 8 } }, + { species: 'Wynaut', moves: ['sleeptalk'], evs: { spe: 12 } }, + { species: 'Torkoal', ability: 'drought', moves: ['sleeptalk'] }, + { species: 'Salamence', ability: 'intimidate', moves: ['sleeptalk'] }, + ]]); + battle.makeChoices('switch 3, switch 4', 'switch 3, switch 4'); + assert.equal(battle.field.weather, 'raindance'); + assert.equal(battle.p1.active[0].boosts.atk, 0); + assert.equal(battle.p1.active[1].boosts.atk, 0); + assert.equal(battle.p2.active[0].boosts.atk, -1); + assert.equal(battle.p2.active[1].boosts.atk, -1); + }); + + it('should use port priority order if Switch Priority Clause Mod is excluded', () => { + battle = common.createBattle({ formatid: 'gen3doublesou@@@!switchpriorityclausemod' }, [[ + { species: 'Wynaut', moves: ['sleeptalk'], evs: { spe: 0 } }, + { species: 'Wynaut', moves: ['sleeptalk'], evs: { spe: 4 } }, + { species: 'Pelipper', ability: 'drizzle', moves: ['sleeptalk'] }, + { species: 'Gyarados', ability: 'intimidate', moves: ['sleeptalk'] }, + ], [ + { species: 'Wynaut', moves: ['sleeptalk'], evs: { spe: 8 } }, + { species: 'Wynaut', moves: ['sleeptalk'], evs: { spe: 12 } }, + { species: 'Torkoal', ability: 'drought', moves: ['sleeptalk'] }, + { species: 'Salamence', ability: 'intimidate', moves: ['sleeptalk'] }, + ]]); + battle.makeChoices('switch 3, switch 4', 'switch 3, switch 4'); + assert.equal(battle.field.weather, 'sunnyday'); + assert.equal(battle.p1.active[0].boosts.atk, -1); + assert.equal(battle.p1.active[1].boosts.atk, -1); + assert.equal(battle.p2.active[0].boosts.atk, -1); + assert.equal(battle.p2.active[1].boosts.atk, 0); + }); + }); }); describe('Switching in', () => { From a3d8decbf21239afc3c5c4fe3350e00bcdc81137 Mon Sep 17 00:00:00 2001 From: andrebastosdias Date: Sat, 21 Mar 2026 02:19:23 +0000 Subject: [PATCH 2/4] Include the Switch Priority Clause mod in tests by default --- test/common.js | 1 + test/sim/misc/turn-order.js | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/common.js b/test/common.js index eb7596e95e..b2926de915 100644 --- a/test/common.js +++ b/test/common.js @@ -56,6 +56,7 @@ class TestTools { options.preview ? '^Team Preview' : '^!Team Preview', options.sleepClause && 'Sleep Clause Mod', !options.cancel && '!Cancel Mod', + !options.portPriority && '^Switch Priority Clause Mod', options.endlessBattleClause ? '^Endless Battle Clause' : '^!Endless Battle Clause', options.inverseMod && 'Inverse Mod', options.overflowStatMod && 'Overflow Stat Mod', diff --git a/test/sim/misc/turn-order.js b/test/sim/misc/turn-order.js index ad602a9903..554bcd421b 100644 --- a/test/sim/misc/turn-order.js +++ b/test/sim/misc/turn-order.js @@ -172,9 +172,9 @@ describe('Switching out', () => { assert.equal(battle.p2.pokemon[0].boosts.atk, 0); }); - describe(`Switch Priority Clause Mod`, () => { - it('should default to speed switch priority', () => { - battle = common.createBattle({ formatid: 'gen3doublesou' }, [[ + describe(`Switch Priority Clause Mod [Gen 3]`, () => { + it('should follow speed priority if Switch Priority Clause Mod is included', () => { + battle = common.gen(3).createBattle({ gameType: 'doubles' }, [[ { species: 'Wynaut', moves: ['sleeptalk'], evs: { spe: 0 } }, { species: 'Wynaut', moves: ['sleeptalk'], evs: { spe: 4 } }, { species: 'Pelipper', ability: 'drizzle', moves: ['sleeptalk'] }, @@ -193,8 +193,8 @@ describe('Switching out', () => { assert.equal(battle.p2.active[1].boosts.atk, -1); }); - it('should use port priority order if Switch Priority Clause Mod is excluded', () => { - battle = common.createBattle({ formatid: 'gen3doublesou@@@!switchpriorityclausemod' }, [[ + it('should follow port priority if Switch Priority Clause Mod is excluded', () => { + battle = common.gen(3).createBattle({ gameType: 'doubles', portPriority: true }, [[ { species: 'Wynaut', moves: ['sleeptalk'], evs: { spe: 0 } }, { species: 'Wynaut', moves: ['sleeptalk'], evs: { spe: 4 } }, { species: 'Pelipper', ability: 'drizzle', moves: ['sleeptalk'] }, From 6fc99e0b646b97573b0eafab1ba7a3abda7ca633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= <80102738+andrebastosdias@users.noreply.github.com> Date: Tue, 31 Mar 2026 21:51:33 +0100 Subject: [PATCH 3/4] =?UTF-8?q?Desyncs=20should=20never=20happen=20in=20Po?= =?UTF-8?q?k=C3=A9mon=20Stadium?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sim/battle.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/battle.ts b/sim/battle.ts index de543b4fc3..e455fc7b18 100644 --- a/sim/battle.ts +++ b/sim/battle.ts @@ -1927,7 +1927,7 @@ export class Battle { this.add('rated', typeof this.rated === 'string' ? this.rated : ''); } - if (this.gen === 1) { + if (this.gen === 1 && this.dex.currentMod !== 'gen1stadium') { // If a desync would happen, the move fails instead. This rule currently covers Bide, Counter, and Psywave. this.add('rule', 'Desync Clause Mod: Desyncs changed to move failure.'); } From 22530e197805479d7f26931b42c4c55ecf626777 Mon Sep 17 00:00:00 2001 From: andrebastosdias Date: Sat, 11 Apr 2026 18:29:57 +0100 Subject: [PATCH 4/4] Fix --- data/mods/gen3frlg/rulesets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/mods/gen3frlg/rulesets.ts b/data/mods/gen3frlg/rulesets.ts index 0dec9020f9..786d156bad 100644 --- a/data/mods/gen3frlg/rulesets.ts +++ b/data/mods/gen3frlg/rulesets.ts @@ -5,7 +5,7 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable desc: "The standard ruleset for all official Smogon singles tiers (Ubers, OU, etc.)", ruleset: [ 'Standard AG', - 'Sleep Clause Mod', 'Switch Priority Clause Mod', 'Species Clause', 'Nickname Clause', 'OHKO Clause', 'Evasion Items Clause', 'Evasion Moves Clause', + 'Sleep Clause Mod', 'Species Clause', 'Nickname Clause', 'OHKO Clause', 'Evasion Items Clause', 'Evasion Moves Clause', ], }, standarddraft: {