diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 52e039ed874..466b3804004 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -2125,6 +2125,32 @@ export class TarShotTag extends BattlerTag { } } +export class PowerTrickTag extends BattlerTag { + constructor(sourceMove: Moves, sourceId: number) { + super(BattlerTagType.POWER_TRICK, BattlerTagLapseType.CUSTOM, 0, sourceMove, sourceId, true); + } + + onAdd(pokemon: Pokemon): void { + this.swapStat(pokemon); + pokemon.scene.queueMessage(i18next.t("battlerTags:powerTrickActive", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) })); + } + + onRemove(pokemon: Pokemon): void { + this.swapStat(pokemon); + pokemon.scene.queueMessage(i18next.t("battlerTags:powerTrickActive", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) })); + } + + onOverlap(pokemon: Pokemon): void { + pokemon.removeTag(this.tagType); + } + + swapStat(pokemon: Pokemon): void { + const temp = pokemon.getStat(Stat.ATK, false); + pokemon.setStat(Stat.ATK, pokemon.getStat(Stat.DEF, false), false); + pokemon.setStat(Stat.DEF, temp, false); + } +} + /** * Retrieves a {@linkcode BattlerTag} based on the provided tag type, turn count, source move, and source ID. * @@ -2280,6 +2306,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source return new ThroatChoppedTag(); case BattlerTagType.GORILLA_TACTICS: return new GorillaTacticsTag(); + case BattlerTagType.POWER_TRICK: + return new PowerTrickTag(sourceMove, sourceId); case BattlerTagType.NONE: default: return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId); diff --git a/src/data/move.ts b/src/data/move.ts index 9f79d48f11b..9825d803ae1 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -6012,51 +6012,6 @@ export class SwapStatAttr extends MoveEffectAttr { } } - -/** - * Attribute used for status moves, namely Power Trick, - * that swaps user's own stat. - * @extends MoveEffectAttr - * @see {@linkcode apply} - */ -export class SelfSwapStatAttr extends MoveEffectAttr { - /** Swaps the values of two specified stats */ - private firstStat: EffectiveStat; - private secondStat: EffectiveStat; - - constructor(firstStat: EffectiveStat, secondStat: EffectiveStat) { - super(); - - this.firstStat = firstStat; - this.secondStat = secondStat; - } - - /** - * Swap user's {@linkcode firstStat} value with {@linkcode secondStat} value. - * @param user the {@linkcode Pokemon} that used the move - * @param target N/A - * @param move N/A - * @param args N/A - * @returns true if attribute application succeeds - */ - apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - if (super.apply(user, target, move, args)) { - const temp = user.getStat(this.firstStat, false); - user.setStat(this.firstStat, target.getStat(this.secondStat, false), false); - user.setStat(this.secondStat, temp, false); - - user.scene.queueMessage(i18next.t("moveTriggers:selfSwitchedStat", { - pokemonName: getPokemonNameWithAffix(user), - firstStat:i18next.t(getStatKey(this.firstStat)), - secondStat:i18next.t(getStatKey(this.secondStat)), - })); - - return true; - } - return false; - } -} - /** * Attribute used to switch the user's own stats. * Used by Power Shift. @@ -7687,7 +7642,7 @@ export function initMoves() { .attr(OpponentHighHpPowerAttr, 120) .makesContact(), new SelfStatusMove(Moves.POWER_TRICK, Type.PSYCHIC, -1, 10, -1, 0, 4) - .attr(SelfSwapStatAttr, Stat.ATK, Stat.DEF), + .attr(AddBattlerTagAttr, BattlerTagType.POWER_TRICK, true), new StatusMove(Moves.GASTRO_ACID, Type.POISON, 100, 10, -1, 0, 4) .attr(SuppressAbilitiesAttr), new StatusMove(Moves.LUCKY_CHANT, Type.NORMAL, -1, 30, -1, 0, 4) diff --git a/src/enums/battler-tag-type.ts b/src/enums/battler-tag-type.ts index cb83ebf4882..e9ee4f6d065 100644 --- a/src/enums/battler-tag-type.ts +++ b/src/enums/battler-tag-type.ts @@ -76,4 +76,5 @@ export enum BattlerTagType { GORILLA_TACTICS = "GORILLA_TACTICS", THROAT_CHOPPED = "THROAT_CHOPPED", TAR_SHOT = "TAR_SHOT", + POWER_TRICK = "POWER_TRICK", } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 4bc4aca448c..fb50fd40cc5 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -17,7 +17,7 @@ import { initMoveAnim, loadMoveAnimAssets } from "../data/battle-anims"; import { Status, StatusEffect, getRandomStatus } from "../data/status-effect"; import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEvolutionCondition, FusionSpeciesFormEvolution } from "../data/pokemon-evolutions"; import { reverseCompatibleTms, tmSpecies, tmPoolTiers } from "../data/tms"; -import { BattlerTag, BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, TypeBoostTag, MoveRestrictionBattlerTag, ExposedTag, DragonCheerTag, CritBoostTag, TrappedTag, TarShotTag } from "../data/battler-tags"; +import { BattlerTag, BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, TypeBoostTag, MoveRestrictionBattlerTag, ExposedTag, DragonCheerTag, CritBoostTag, TrappedTag, TarShotTag, PowerTrickTag } from "../data/battler-tags"; import { WeatherType } from "../data/weather"; import { ArenaTagSide, NoCritTag, WeakenMoveScreenTag } from "../data/arena-tag"; import { Ability, AbAttr, StatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, IgnoreOpponentStatStagesAbAttr, MoveImmunityAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyStatMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr, DamageBoostAbAttr, IgnoreTypeStatusEffectImmunityAbAttr, ConditionalCritAbAttr, applyFieldStatMultiplierAbAttrs, FieldMultiplyStatAbAttr, AddSecondStrikeAbAttr, UserFieldStatusEffectImmunityAbAttr, UserFieldBattlerTagImmunityAbAttr, BattlerTagImmunityAbAttr, MoveTypeChangeAbAttr, FullHpResistTypeAbAttr, applyCheckTrappedAbAttrs, CheckTrappedAbAttr } from "../data/ability"; @@ -2683,6 +2683,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { continue; } + if (tag instanceof PowerTrickTag) { + tag.swapStat(this); + } + this.summonData.tags.push(tag); } diff --git a/src/locales/de/battler-tags.json b/src/locales/de/battler-tags.json index e65e1ddfe75..d87bcbc705d 100644 --- a/src/locales/de/battler-tags.json +++ b/src/locales/de/battler-tags.json @@ -69,5 +69,6 @@ "cursedLapse": "{{pokemonNameWithAffix}} wurde durch den Fluch verletzt!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} hortet {{stockpiledCount}}!", "disabledOnAdd": " {{moveName}} von {{pokemonNameWithAffix}} wurde blockiert!", - "disabledLapse": "{{moveName}} von {{pokemonNameWithAffix}} ist nicht länger blockiert!" + "disabledLapse": "{{moveName}} von {{pokemonNameWithAffix}} ist nicht länger blockiert!", + "powerTrickActive": "{{pokemonNameWithAffix}} tauscht den Wert seines Angriffs mit dem seiner Verteidigung!" } diff --git a/src/locales/de/move-trigger.json b/src/locales/de/move-trigger.json index 65b71765652..01b22429fb3 100644 --- a/src/locales/de/move-trigger.json +++ b/src/locales/de/move-trigger.json @@ -5,7 +5,6 @@ "switchedStatChanges": "{{pokemonName}} tauschte die Statuswerteveränderungen mit dem Ziel!", "switchedTwoStatChanges": "{{pokemonName}} tauscht Veränderungen an {{firstStat}} und {{secondStat}} mit dem Ziel!", "switchedStat": "{{pokemonName}} tauscht seinen {{stat}}-Wert mit dem des Zieles!", - "selfSwitchedStat": "{{pokemonName}} tauscht den Wert seines {{firstStat}} mit dem seiner {{secondStat}}!", "sharedGuard": "{{pokemonName}} addiert seine Schutzkräfte mit jenen des Zieles und teilt sie gerecht auf!", "sharedPower": "{{pokemonName}} addiert seine Kräfte mit jenen des Zieles und teilt sie gerecht auf!", "goingAllOutForAttack": "{{pokemonName}} legt sich ins Zeug!", diff --git a/src/locales/en/arena-tag.json b/src/locales/en/arena-tag.json index d8fed386b24..37c2ad9a0c6 100644 --- a/src/locales/en/arena-tag.json +++ b/src/locales/en/arena-tag.json @@ -53,5 +53,6 @@ "safeguardOnAddEnemy": "The opposing team cloaked itself in a mystical veil!", "safeguardOnRemove": "The field is no longer protected by Safeguard!", "safeguardOnRemovePlayer": "Your team is no longer protected by Safeguard!", - "safeguardOnRemoveEnemy": "The opposing team is no longer protected by Safeguard!" + "safeguardOnRemoveEnemy": "The opposing team is no longer protected by Safeguard!", + "powerTrickActive": "{{pokemonNameWithAffix}} switched its Attack and Defense!" } \ No newline at end of file diff --git a/src/locales/en/move-trigger.json b/src/locales/en/move-trigger.json index edab1840cd2..375ea354d33 100644 --- a/src/locales/en/move-trigger.json +++ b/src/locales/en/move-trigger.json @@ -5,7 +5,6 @@ "switchedStatChanges": "{{pokemonName}} switched stat changes with the target!", "switchedTwoStatChanges": "{{pokemonName}} switched all changes to its {{firstStat}}\nand {{secondStat}} with its target!", "switchedStat": "{{pokemonName}} switched {{stat}} with its target!", - "selfSwitchedStat": "{{pokemonName}} switched its {{firstStat}} and {{secondStat}}!", "sharedGuard": "{{pokemonName}} shared its guard with the target!", "sharedPower": "{{pokemonName}} shared its power with the target!", "shiftedStats": "{{pokemonName}} switched its {{statToSwitch}} and {{statToSwitchWith}}!", diff --git a/src/locales/es/arena-tag.json b/src/locales/es/arena-tag.json index 0f63b62e784..0127ae309ac 100644 --- a/src/locales/es/arena-tag.json +++ b/src/locales/es/arena-tag.json @@ -53,5 +53,6 @@ "safeguardOnAddEnemy": "¡El equipo enemigo se ha protegido con Velo Sagrado!", "safeguardOnRemove": "¡Velo Sagrado dejó de hacer efecto!", "safeguardOnRemovePlayer": "El efecto de Velo Sagrado en tu equipo se ha disipado.", - "safeguardOnRemoveEnemy": "El efecto de Velo Sagrado en el equipo enemigo se ha disipado." + "safeguardOnRemoveEnemy": "El efecto de Velo Sagrado en el equipo enemigo se ha disipado.", + "powerTrickActive": "¡{{pokemonNameWithAffix}} cambió su Ataque y Defensa!" } \ No newline at end of file diff --git a/src/locales/es/move-trigger.json b/src/locales/es/move-trigger.json index fb28dedcfd7..f92b7950a07 100644 --- a/src/locales/es/move-trigger.json +++ b/src/locales/es/move-trigger.json @@ -1,7 +1,6 @@ { "switchedTwoStatChanges": "{{pokemonName}} ha intercambiado los cambios en {{firstStat}} y {{secondStat}} con los del objetivo!", "switchedStat": "{{pokemonName}} cambia su {{stat}} por la de su objetivo!", - "selfSwitchedStat": "¡{{pokemonName}} cambió {{firstStat}} a {{secondStat}}!", "sharedGuard": "{{pokemonName}} suma su capacidad defensiva a la del objetivo y la reparte equitativamente!", "sharedPower": "{{pokemonName}} suma su capacidad ofensiva a la del objetivo y la reparte equitativamente!", "isChargingPower": "¡{{pokemonName}} está acumulando energía!", diff --git a/src/locales/fr/battler-tags.json b/src/locales/fr/battler-tags.json index f523eb7f07d..7dbd7e80d80 100644 --- a/src/locales/fr/battler-tags.json +++ b/src/locales/fr/battler-tags.json @@ -69,5 +69,6 @@ "cursedLapse": "{{pokemonNameWithAffix}} est touché par la malédiction !", "stockpilingOnAdd": "{{pokemonNameWithAffix}} utilise\nla capacité Stockage {{stockpiledCount}} fois !", "disabledOnAdd": "La capacité {{moveName}}\nde {{pokemonNameWithAffix}} est mise sous entrave !", - "disabledLapse": "La capacité {{moveName}}\nde {{pokemonNameWithAffix}} n’est plus sous entrave !" + "disabledLapse": "La capacité {{moveName}}\nde {{pokemonNameWithAffix}} n’est plus sous entrave !", + "powerTrickActive": "{{pokemonNameWithAffix}} échange\nson Attaque et sa Défense !" } diff --git a/src/locales/fr/move-trigger.json b/src/locales/fr/move-trigger.json index 636eab1b5f1..d9d800c52cc 100644 --- a/src/locales/fr/move-trigger.json +++ b/src/locales/fr/move-trigger.json @@ -5,7 +5,6 @@ "switchedStatChanges": "{{pokemonName}} permute\nles changements de stats avec ceux de sa cible !", "switchedTwoStatChanges": "{{pokemonName}} permute les changements de {{firstStat} et de {{secondStat}} avec ceux de sa cible !", "switchedStat": "{{pokemonName}} et sa cible échangent leur {{stat}} !", - "selfSwitchedStat": "{{pokemonName}} échange\nson {{firstStat}} et sa {{secondStat}} !", "sharedGuard": "{{pokemonName}} additionne sa garde à celle de sa cible et redistribue le tout équitablement !", "sharedPower": "{{pokemonName}} additionne sa force à celle de sa cible et redistribue le tout équitablement !", "goingAllOutForAttack": "{{pokemonName}} a pris\ncette capacité au sérieux !", diff --git a/src/locales/it/battler-tags.json b/src/locales/it/battler-tags.json index e8bda9cfd1e..2b5d3582357 100644 --- a/src/locales/it/battler-tags.json +++ b/src/locales/it/battler-tags.json @@ -69,5 +69,6 @@ "cursedLapse": "{{pokemonNameWithAffix}} subisce la maledizione!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} ha usato Accumulo per la\n{{stockpiledCount}}ª volta!", "disabledOnAdd": "La mossa {{moveName}} di\n{{pokemonNameWithAffix}} è stata bloccata!", - "disabledLapse": "La mossa {{moveName}} di\n{{pokemonNameWithAffix}} non è più bloccata!" + "disabledLapse": "La mossa {{moveName}} di\n{{pokemonNameWithAffix}} non è più bloccata!", + "powerTrickActive": "{{pokemonNameWithAffix}} switched its Attack and Defense!" } diff --git a/src/locales/ko/battler-tags.json b/src/locales/ko/battler-tags.json index 0993cafa04a..02a72f7c19d 100644 --- a/src/locales/ko/battler-tags.json +++ b/src/locales/ko/battler-tags.json @@ -69,5 +69,6 @@ "cursedLapse": "{{pokemonNameWithAffix}}[[는]]\n저주받고 있다!", "stockpilingOnAdd": "{{pokemonNameWithAffix}}[[는]]\n{{stockpiledCount}}개 비축했다!", "disabledOnAdd": "{{pokemonNameWithAffix}}의 {{moveName}}[[는]]\n사용할 수 없다!", - "disabledLapse": "{{pokemonNameWithAffix}}의 {{moveName}}[[는]]\n이제 사용할 수 있다." + "disabledLapse": "{{pokemonNameWithAffix}}의 {{moveName}}[[는]]\n이제 사용할 수 있다.", + "powerTrickActive": "{{pokemonNameWithAffix}}[[는]]\n공격과 방어를 바꿨다!" } diff --git a/src/locales/ko/move-trigger.json b/src/locales/ko/move-trigger.json index b1e62649c0f..2a38bb13b0a 100644 --- a/src/locales/ko/move-trigger.json +++ b/src/locales/ko/move-trigger.json @@ -5,7 +5,6 @@ "switchedStatChanges": "{{pokemonName}}[[는]] 상대와 자신의\n능력 변화를 바꿨다!", "switchedTwoStatChanges": "{{pokemonName}} 상대와 자신의 {{firstStat}}과 {{secondStat}}의 능력 변화를 바꿨다!", "switchedStat": "{{pokemonName}} 서로의 {{stat}}를 교체했다!", - "selfSwitchedStat": "{{pokemonName}}[[는]]\n{{firstStat}}과 {{secondStat}}를 바꿨다!", "sharedGuard": "{{pokemonName}} 서로의 가드를 셰어했다!", "sharedPower": "{{pokemonName}} 서로의 파워를 셰어했다!", "goingAllOutForAttack": "{{pokemonName}}[[는]]\n전력을 다하기 시작했다!", diff --git a/src/locales/pt_BR/battler-tags.json b/src/locales/pt_BR/battler-tags.json index 9c0f4732013..b2b5103db45 100644 --- a/src/locales/pt_BR/battler-tags.json +++ b/src/locales/pt_BR/battler-tags.json @@ -69,5 +69,6 @@ "cursedLapse": "{{pokemonNameWithAffix}} foi ferido pelo Curse!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} estocou {{stockpiledCount}}!", "disabledOnAdd": "{{moveName}} de {{pokemonNameWithAffix}}\nfoi desabilitado!", - "disabledLapse": "{{moveName}} de {{pokemonNameWithAffix}}\nnão está mais desabilitado." + "disabledLapse": "{{moveName}} de {{pokemonNameWithAffix}}\nnão está mais desabilitado.", + "powerTrickActive": "{{pokemonNameWithAffix}} trocou seu atributo de Ataque pela sua Defesa!" } diff --git a/src/locales/pt_BR/move-trigger.json b/src/locales/pt_BR/move-trigger.json index a98e28b7381..9aa13dedad5 100644 --- a/src/locales/pt_BR/move-trigger.json +++ b/src/locales/pt_BR/move-trigger.json @@ -6,7 +6,6 @@ "goingAllOutForAttack": "{{pokemonName}} está arriscando tudo nesse ataque!", "regainedHealth": "{{pokemonName}} recuperou/nsaúde!", "keptGoingAndCrashed": "{{pokemonName}} errou o alvo/ne se arrebentou!", - "selfSwitchedStat": "{{pokemonName}} trocou seu atributo de {{firstStat}} pela sua {{secondStat}}!", "fled": "{{pokemonName}} fugiu!", "cannotBeSwitchedOut": "{{pokemonName}} não pode ser trocado!", "swappedAbilitiesWithTarget": "{{pokemonName}} trocou/nde habilidades com o alvo!", diff --git a/src/locales/zh_CN/battler-tags.json b/src/locales/zh_CN/battler-tags.json index 792551d1ab1..341dbb3d041 100644 --- a/src/locales/zh_CN/battler-tags.json +++ b/src/locales/zh_CN/battler-tags.json @@ -69,5 +69,6 @@ "cursedLapse": "{{pokemonNameWithAffix}}\n正受到诅咒!", "stockpilingOnAdd": "{{pokemonNameWithAffix}}蓄力了{{stockpiledCount}}次!", "disabledOnAdd": "封住了{{pokemonNameWithAffix}}的\n{{moveName}}!", - "disabledLapse": "{{pokemonNameWithAffix}}的\n定身法解除了!" + "disabledLapse": "{{pokemonNameWithAffix}}的\n定身法解除了!", + "powerTrickActive": "{{pokemonNameWithAffix}}互换了攻击和防御!" } diff --git a/src/locales/zh_CN/move-trigger.json b/src/locales/zh_CN/move-trigger.json index 9bc7475fb30..1eb4c397f45 100644 --- a/src/locales/zh_CN/move-trigger.json +++ b/src/locales/zh_CN/move-trigger.json @@ -5,7 +5,6 @@ "switchedStatChanges": "{{pokemonName}}和对手互换了\n自己的能力变化!", "switchedTwoStatChanges": "{{pokemonName}} 和对手互换了自己的{{firstStat}}和{{secondStat}}的能力变化!", "switchedStat": "{{pokemonName}} 互换了各自的{{stat}}!", - "selfSwitchedStat": "{{pokemonName}} 互换了{{firstStat}}和{{secondStat}}!", "sharedGuard": "{{pokemonName}} 平分了各自的防守!", "sharedPower": "{{pokemonName}} 平分了各自的力量!", "goingAllOutForAttack": "{{pokemonName}}拿出全力了!", diff --git a/src/locales/zh_TW/battler-tags.json b/src/locales/zh_TW/battler-tags.json index b5a2760f7ac..8f304d5c51d 100644 --- a/src/locales/zh_TW/battler-tags.json +++ b/src/locales/zh_TW/battler-tags.json @@ -68,5 +68,6 @@ "cursedOnAdd": "{{pokemonNameWithAffix}}削減了自己的體力,並詛咒了{{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}}正受到詛咒!", "disabledOnAdd": "封住了{{pokemonNameWithAffix}}的\n{moveName}}!", - "disabledLapse": "{{pokemonNameWithAffix}}的\n定身法解除了!" + "disabledLapse": "{{pokemonNameWithAffix}}的\n定身法解除了!", + "powerTrickActive": "{{pokemonNameWithAffix}}互換了攻擊和防禦!" } diff --git a/src/locales/zh_TW/move-trigger.json b/src/locales/zh_TW/move-trigger.json index 97fbf8c8d83..d6d0ce659ea 100644 --- a/src/locales/zh_TW/move-trigger.json +++ b/src/locales/zh_TW/move-trigger.json @@ -5,7 +5,6 @@ "switchedStatChanges": "{{pokemonName}}和對手互換了\n自身的能力變化!", "switchedTwoStatChanges": "{{pokemonName}} 和對手互換了自身的{{firstStat}}和{{secondStat}}的能力變化!", "switchedStat": "{{pokemonName}} 互換了各自的{{stat}}!", - "selfSwitchedStat": "{{pokemonName}} 互换{{firstStat}}击和{{secondStat}}", "sharedGuard": "{{pokemonName}} 平分了各自的防守!", "sharedPower": "{{pokemonName}} 平分了各自的力量!", "goingAllOutForAttack": "{{pokemonName}}拿出全力了!", diff --git a/src/test/moves/power_trick.test.ts b/src/test/moves/power_trick.test.ts index b9cfe4172af..4ace898e7c3 100644 --- a/src/test/moves/power_trick.test.ts +++ b/src/test/moves/power_trick.test.ts @@ -7,6 +7,7 @@ import { Stat } from "#enums/stat"; import { Species } from "#enums/species"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Abilities } from "#enums/abilities"; +import { BattlerTagType } from "#enums/battler-tag-type"; describe("Moves - Power Trick", () => { let phaserGame: Phaser.Game; @@ -47,6 +48,7 @@ describe("Moves - Power Trick", () => { expect(player.getStat(Stat.ATK, false)).toBe(baseDEF); expect(player.getStat(Stat.DEF, false)).toBe(baseATK); + expect(player.getTag(BattlerTagType.POWER_TRICK)).toBeDefined(); }, 20000); it("reset changes when used consecutively", async () => { @@ -66,5 +68,28 @@ describe("Moves - Power Trick", () => { expect(player.getStat(Stat.ATK, false)).toBe(baseATK); expect(player.getStat(Stat.DEF, false)).toBe(baseDEF); + expect(player.getTag(BattlerTagType.POWER_TRICK)).toBeUndefined(); + }, 20000); + + it("passing with baton pass", async () => { + await game.classicMode.startBattle([Species.SHUCKLE, Species.SHUCKLE]); + await game.override.moveset([Moves.POWER_TRICK, Moves.BATON_PASS]); + + game.move.select(Moves.POWER_TRICK); + + await game.phaseInterceptor.to(TurnEndPhase); + + game.move.select(Moves.BATON_PASS); + game.doSelectPartyPokemon(1); + + await game.phaseInterceptor.to(TurnEndPhase); + + const player = game.scene.getPlayerPokemon()!; + const baseATK = player.getStat(Stat.ATK); + const baseDEF = player.getStat(Stat.DEF); + + expect(player.getStat(Stat.ATK, false)).toBe(baseDEF); + expect(player.getStat(Stat.DEF, false)).toBe(baseATK); + expect(player.getTag(BattlerTagType.POWER_TRICK)).toBeDefined(); }, 20000); });