From a333f7886cf1e4ab742d901b7e19f9205f6d46c7 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sat, 23 Mar 2024 10:54:16 -0400 Subject: [PATCH] Fix effect spore and similar abilities activating on the wrong target --- src/data/ability.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 3bac26bce..4a359a62f 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -392,7 +392,7 @@ export class PostDefendContactApplyStatusEffectAbAttr extends PostDefendAbAttr { applyPostDefend(pokemon: Pokemon, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && pokemon.randSeedInt(100) < this.chance && !pokemon.status) { const effect = this.effects.length === 1 ? this.effects[0] : this.effects[pokemon.randSeedInt(this.effects.length)]; - return pokemon.trySetStatus(effect, true); + return attacker.trySetStatus(effect, true); } return false; @@ -414,7 +414,7 @@ export class PostDefendContactApplyTagChanceAbAttr extends PostDefendAbAttr { applyPostDefend(pokemon: Pokemon, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && pokemon.randSeedInt(100) < this.chance) - return attacker.addTag(this.tagType, this.turnCount, move.moveId, pokemon.id); + return attacker.addTag(this.tagType, this.turnCount, move.moveId, attacker.id); return false; }