diff --git a/sim/battle.ts b/sim/battle.ts index dba8f006b52c..294a7113acbf 100644 --- a/sim/battle.ts +++ b/sim/battle.ts @@ -2043,13 +2043,15 @@ export class Battle { this.lastDamage = damage; if (target.volatiles['substitute']) { const hint = "In Gen 1, if a Pokemon with a Substitute hurts itself due to confusion or Jump Kick/Hi Jump Kick recoil and the target"; - if (source?.volatiles['substitute']) { - source.volatiles['substitute'].hp -= damage; - if (source.volatiles['substitute'].hp <= 0) { - source.removeVolatile('substitute'); - source.subFainted = true; + // if the move was a self-targeting move, the source is the same as the target. We need the check the opposing substitute + const foe = target.side.foe.active[0]; + if (foe?.volatiles['substitute']) { + foe.volatiles['substitute'].hp -= damage; + if (foe.volatiles['substitute'].hp <= 0) { + foe.removeVolatile('substitute'); + foe.subFainted = true; } else { - this.add('-activate', source, 'Substitute', '[damage]'); + this.add('-activate', foe, 'Substitute', '[damage]'); } this.hint(hint + " has a Substitute, the target's Substitute takes the damage."); return damage;