From 8becfdfc4ebc0db9a2021c6c432f3299148a77d5 Mon Sep 17 00:00:00 2001 From: cadi Date: Fri, 28 Jun 2024 18:36:48 +0900 Subject: [PATCH] the actual base stats are swapped by Power Trick --- src/data/move.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index a6ebc450419..f0a0ef1de86 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1,7 +1,7 @@ import { ChargeAnim, MoveChargeAnim, initMoveAnim, loadMoveAnimAssets } from "./battle-anims"; import { BattleEndPhase, MoveEffectPhase, MovePhase, NewBattlePhase, PartyStatusCurePhase, PokemonHealPhase, StatChangePhase, SwitchSummonPhase } from "../phases"; import { BattleStat, getBattleStatName } from "./battle-stat"; -import { EncoreTag, PowerTrickTag, SemiInvulnerableTag } from "./battler-tags"; +import { EncoreTag, SemiInvulnerableTag } from "./battler-tags"; import { getPokemonMessage, getPokemonNameWithAffix } from "../messages"; import Pokemon, { AttackMoveResult, EnemyPokemon, HitResult, MoveResult, PlayerPokemon, PokemonMove, TurnMove } from "../field/pokemon"; import { StatusEffect, getStatusEffectHealText, isNonVolatileStatusEffect, getNonVolatileStatusEffects} from "./status-effect"; @@ -4173,7 +4173,7 @@ export class FaintCountdownAttr extends AddBattlerTagAttr { /** * Swap the Pokémon's base Attack stat with its base Defense stat. - * Pokémon with the Power Trick Tag will have their altered base stat values displayed. + * Pokémon with the Power Trick Tag will have their altered base stat values. * @extends AddBattlerTagAttr */ export class PowerTrickAttr extends AddBattlerTagAttr { @@ -4195,12 +4195,14 @@ export class PowerTrickAttr extends AddBattlerTagAttr { return false; } - if (user.findTag(t => t instanceof PowerTrickTag)) { + if (user.getTag(BattlerTagType.POWER_TRICK)) { user.removeTag(BattlerTagType.POWER_TRICK); } else { super.apply(user, target, move, args); } + [user.stats[Stat.ATK], user.stats[Stat.DEF]] = [user.stats[Stat.DEF], user.stats[Stat.ATK]]; + user.scene.queueMessage(i18next.t("battle:battlerTagsPowerTrickApply", { pokemonNameWithAffix: getPokemonNameWithAffix(user) })); return true;