Fix checking the wrong Pokemon for statuses when determining if abilities such as Static should activate.
parent
f762cf1eb3
commit
c1a4463b1d
|
|
@ -476,7 +476,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.status && (this.chance === -1 || pokemon.randSeedInt(100) < this.chance)) {
|
||||
if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && !attacker.status && (this.chance === -1 || pokemon.randSeedInt(100) < this.chance)) {
|
||||
const effect = this.effects.length === 1 ? this.effects[0] : this.effects[pokemon.randSeedInt(this.effects.length)];
|
||||
return attacker.trySetStatus(effect, true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue