From 9ad6807fcf6835c5547cc1cd19ad667edf45466c Mon Sep 17 00:00:00 2001 From: andrebastosdias Date: Thu, 19 Mar 2026 09:47:30 +0000 Subject: [PATCH 1/2] Gen 4: Focus Punch shouldn't broadcast if asleep or loafing around --- data/mods/gen3/abilities.ts | 11 +++++++++++ data/mods/gen3/moves.ts | 2 +- data/mods/gen4/moves.ts | 15 +++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/data/mods/gen3/abilities.ts b/data/mods/gen3/abilities.ts index 86958fe650..8170de74b0 100644 --- a/data/mods/gen3/abilities.ts +++ b/data/mods/gen3/abilities.ts @@ -207,6 +207,12 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onStart() {}, onSwitchIn(pokemon) { pokemon.truantTurn = this.turn !== 0; + // it is unnecessary to keep a volatile, but it helps with cross-gen implementation + if (pokemon.truantTurn) { + pokemon.addVolatile('truant'); + } else { + pokemon.removeVolatile('truant'); + } }, onBeforeMove(pokemon) { if (pokemon.truantTurn) { @@ -217,6 +223,11 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onResidualOrder: 27, onResidual(pokemon) { pokemon.truantTurn = !pokemon.truantTurn; + if (pokemon.truantTurn) { + pokemon.addVolatile('truant'); + } else { + pokemon.removeVolatile('truant'); + } }, }, voltabsorb: { diff --git a/data/mods/gen3/moves.ts b/data/mods/gen3/moves.ts index 11dccce120..77c5535a5f 100644 --- a/data/mods/gen3/moves.ts +++ b/data/mods/gen3/moves.ts @@ -584,7 +584,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { inherit: true, beforeTurnCallback(pokemon, target) { if (['frz', 'slp'].includes(pokemon.status) || - (pokemon.hasAbility('truant') && pokemon.truantTurn)) return; + (pokemon.hasAbility('truant') && pokemon.volatiles['truant'])) return; if (pokemon.isAlly(target)) return; target.addVolatile('pursuit'); const data = target.volatiles['pursuit']; diff --git a/data/mods/gen4/moves.ts b/data/mods/gen4/moves.ts index 44903ec997..0009507399 100644 --- a/data/mods/gen4/moves.ts +++ b/data/mods/gen4/moves.ts @@ -610,6 +610,21 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { return null; } }, + condition: { + duration: 1, + onStart(pokemon) { + if (pokemon.status === 'slp' || (pokemon.hasAbility('truant') && pokemon.volatiles['truant'])) return; + this.add('-singleturn', pokemon, 'move: Focus Punch'); + }, + onHit(pokemon, source, move) { + if (move.category !== 'Status') { + this.effectState.lostFocus = true; + } + }, + onTryAddVolatile(status, pokemon) { + if (status.id === 'flinch') return null; + }, + }, }, foresight: { inherit: true, From aca00669ae15b324ab457fef7471ca25f4e0eb01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= <80102738+andrebastosdias@users.noreply.github.com> Date: Thu, 19 Mar 2026 11:10:34 +0000 Subject: [PATCH 2/2] Update with new condition inheritance --- data/mods/gen4/moves.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/data/mods/gen4/moves.ts b/data/mods/gen4/moves.ts index 0009507399..714a43d2c9 100644 --- a/data/mods/gen4/moves.ts +++ b/data/mods/gen4/moves.ts @@ -611,19 +611,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } }, condition: { - duration: 1, + inherit: true, onStart(pokemon) { if (pokemon.status === 'slp' || (pokemon.hasAbility('truant') && pokemon.volatiles['truant'])) return; this.add('-singleturn', pokemon, 'move: Focus Punch'); }, - onHit(pokemon, source, move) { - if (move.category !== 'Status') { - this.effectState.lostFocus = true; - } - }, - onTryAddVolatile(status, pokemon) { - if (status.id === 'flinch') return null; - }, }, }, foresight: {