Ability only functions on player side

This commit is contained in:
Samuel-Hudson-uark 2024-05-07 17:13:17 -05:00 committed by Frederico Santos
parent 7db92937a5
commit d0b3a10357

View File

@ -2283,7 +2283,7 @@ export class FetchBallAbAttr extends PostTurnAbAttr {
} }
applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean { applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
let lastUsed = pokemon.scene.currentBattle.lastUsedPokeball; let lastUsed = pokemon.scene.currentBattle.lastUsedPokeball;
if(lastUsed != null) { if(lastUsed != null && pokemon.isPlayer) {
pokemon.scene.pokeballCounts[lastUsed]++; pokemon.scene.pokeballCounts[lastUsed]++;
pokemon.scene.currentBattle.lastUsedPokeball = null; pokemon.scene.currentBattle.lastUsedPokeball = null;
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` found a\n${getPokeballName(lastUsed)}!`)); pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` found a\n${getPokeballName(lastUsed)}!`));