From fe7ed72afac5d853f9bd0ed07f3e64ba0a3cd139 Mon Sep 17 00:00:00 2001 From: Adrian T <68144167+torranx@users.noreply.github.com> Date: Thu, 13 Jun 2024 01:30:10 +0800 Subject: [PATCH] [Enhancement] add revealed ability flag (#2105) --- src/field/pokemon.ts | 3 ++- src/phases.ts | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index d7072d717e1..908a8464d84 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1111,7 +1111,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return undefined; } - return this.getAttackMoveEffectiveness(source, move, true); + return this.getAttackMoveEffectiveness(source, move, !this.battleData?.abilityRevealed); } /** @@ -3821,6 +3821,7 @@ export class PokemonBattleData { public endured: boolean = false; public berriesEaten: BerryType[] = []; public abilitiesApplied: Abilities[] = []; + public abilityRevealed: boolean = false; } export class PokemonBattleSummonData { diff --git a/src/phases.ts b/src/phases.ts index d01b83d837a..53ccd110f9c 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -3122,7 +3122,10 @@ export class ShowAbilityPhase extends PokemonPhase { start() { super.start(); - this.scene.abilityBar.showAbility(this.getPokemon(), this.passive); + const pokemon = this.getPokemon(); + + this.scene.abilityBar.showAbility(pokemon, this.passive); + pokemon.battleData.abilityRevealed = true; this.end(); }