apply power trick with battler tag way

This commit is contained in:
cadi 2024-09-11 23:22:16 +09:00
parent f3bff1b1ab
commit 5c46fa1095
22 changed files with 78 additions and 64 deletions

View File

@ -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. * 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(); return new ThroatChoppedTag();
case BattlerTagType.GORILLA_TACTICS: case BattlerTagType.GORILLA_TACTICS:
return new GorillaTacticsTag(); return new GorillaTacticsTag();
case BattlerTagType.POWER_TRICK:
return new PowerTrickTag(sourceMove, sourceId);
case BattlerTagType.NONE: case BattlerTagType.NONE:
default: default:
return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId); return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId);

View File

@ -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. * Attribute used to switch the user's own stats.
* Used by Power Shift. * Used by Power Shift.
@ -7687,7 +7642,7 @@ export function initMoves() {
.attr(OpponentHighHpPowerAttr, 120) .attr(OpponentHighHpPowerAttr, 120)
.makesContact(), .makesContact(),
new SelfStatusMove(Moves.POWER_TRICK, Type.PSYCHIC, -1, 10, -1, 0, 4) 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) new StatusMove(Moves.GASTRO_ACID, Type.POISON, 100, 10, -1, 0, 4)
.attr(SuppressAbilitiesAttr), .attr(SuppressAbilitiesAttr),
new StatusMove(Moves.LUCKY_CHANT, Type.NORMAL, -1, 30, -1, 0, 4) new StatusMove(Moves.LUCKY_CHANT, Type.NORMAL, -1, 30, -1, 0, 4)

View File

@ -76,4 +76,5 @@ export enum BattlerTagType {
GORILLA_TACTICS = "GORILLA_TACTICS", GORILLA_TACTICS = "GORILLA_TACTICS",
THROAT_CHOPPED = "THROAT_CHOPPED", THROAT_CHOPPED = "THROAT_CHOPPED",
TAR_SHOT = "TAR_SHOT", TAR_SHOT = "TAR_SHOT",
POWER_TRICK = "POWER_TRICK",
} }

View File

@ -17,7 +17,7 @@ import { initMoveAnim, loadMoveAnimAssets } from "../data/battle-anims";
import { Status, StatusEffect, getRandomStatus } from "../data/status-effect"; import { Status, StatusEffect, getRandomStatus } from "../data/status-effect";
import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEvolutionCondition, FusionSpeciesFormEvolution } from "../data/pokemon-evolutions"; import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEvolutionCondition, FusionSpeciesFormEvolution } from "../data/pokemon-evolutions";
import { reverseCompatibleTms, tmSpecies, tmPoolTiers } from "../data/tms"; 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 { WeatherType } from "../data/weather";
import { ArenaTagSide, NoCritTag, WeakenMoveScreenTag } from "../data/arena-tag"; 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"; 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; continue;
} }
if (tag instanceof PowerTrickTag) {
tag.swapStat(this);
}
this.summonData.tags.push(tag); this.summonData.tags.push(tag);
} }

View File

@ -69,5 +69,6 @@
"cursedLapse": "{{pokemonNameWithAffix}} wurde durch den Fluch verletzt!", "cursedLapse": "{{pokemonNameWithAffix}} wurde durch den Fluch verletzt!",
"stockpilingOnAdd": "{{pokemonNameWithAffix}} hortet {{stockpiledCount}}!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} hortet {{stockpiledCount}}!",
"disabledOnAdd": " {{moveName}} von {{pokemonNameWithAffix}} wurde blockiert!", "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!"
} }

View File

@ -5,7 +5,6 @@
"switchedStatChanges": "{{pokemonName}} tauschte die Statuswerteveränderungen mit dem Ziel!", "switchedStatChanges": "{{pokemonName}} tauschte die Statuswerteveränderungen mit dem Ziel!",
"switchedTwoStatChanges": "{{pokemonName}} tauscht Veränderungen an {{firstStat}} und {{secondStat}} 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!", "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!", "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!", "sharedPower": "{{pokemonName}} addiert seine Kräfte mit jenen des Zieles und teilt sie gerecht auf!",
"goingAllOutForAttack": "{{pokemonName}} legt sich ins Zeug!", "goingAllOutForAttack": "{{pokemonName}} legt sich ins Zeug!",

View File

@ -53,5 +53,6 @@
"safeguardOnAddEnemy": "The opposing team cloaked itself in a mystical veil!", "safeguardOnAddEnemy": "The opposing team cloaked itself in a mystical veil!",
"safeguardOnRemove": "The field is no longer protected by Safeguard!", "safeguardOnRemove": "The field is no longer protected by Safeguard!",
"safeguardOnRemovePlayer": "Your team 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!"
} }

View File

@ -5,7 +5,6 @@
"switchedStatChanges": "{{pokemonName}} switched stat changes with the target!", "switchedStatChanges": "{{pokemonName}} switched stat changes with the target!",
"switchedTwoStatChanges": "{{pokemonName}} switched all changes to its {{firstStat}}\nand {{secondStat}} with its target!", "switchedTwoStatChanges": "{{pokemonName}} switched all changes to its {{firstStat}}\nand {{secondStat}} with its target!",
"switchedStat": "{{pokemonName}} switched {{stat}} 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!", "sharedGuard": "{{pokemonName}} shared its guard with the target!",
"sharedPower": "{{pokemonName}} shared its power with the target!", "sharedPower": "{{pokemonName}} shared its power with the target!",
"shiftedStats": "{{pokemonName}} switched its {{statToSwitch}} and {{statToSwitchWith}}!", "shiftedStats": "{{pokemonName}} switched its {{statToSwitch}} and {{statToSwitchWith}}!",

View File

@ -53,5 +53,6 @@
"safeguardOnAddEnemy": "¡El equipo enemigo se ha protegido con Velo Sagrado!", "safeguardOnAddEnemy": "¡El equipo enemigo se ha protegido con Velo Sagrado!",
"safeguardOnRemove": "¡Velo Sagrado dejó de hacer efecto!", "safeguardOnRemove": "¡Velo Sagrado dejó de hacer efecto!",
"safeguardOnRemovePlayer": "El efecto de Velo Sagrado en tu equipo se ha disipado.", "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!"
} }

View File

@ -1,7 +1,6 @@
{ {
"switchedTwoStatChanges": "{{pokemonName}} ha intercambiado los cambios en {{firstStat}} y {{secondStat}} con los del objetivo!", "switchedTwoStatChanges": "{{pokemonName}} ha intercambiado los cambios en {{firstStat}} y {{secondStat}} con los del objetivo!",
"switchedStat": "{{pokemonName}} cambia su {{stat}} por la de su 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!", "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!", "sharedPower": "{{pokemonName}} suma su capacidad ofensiva a la del objetivo y la reparte equitativamente!",
"isChargingPower": "¡{{pokemonName}} está acumulando energía!", "isChargingPower": "¡{{pokemonName}} está acumulando energía!",

View File

@ -69,5 +69,6 @@
"cursedLapse": "{{pokemonNameWithAffix}} est touché par la malédiction !", "cursedLapse": "{{pokemonNameWithAffix}} est touché par la malédiction !",
"stockpilingOnAdd": "{{pokemonNameWithAffix}} utilise\nla capacité Stockage {{stockpiledCount}} fois !", "stockpilingOnAdd": "{{pokemonNameWithAffix}} utilise\nla capacité Stockage {{stockpiledCount}} fois !",
"disabledOnAdd": "La capacité {{moveName}}\nde {{pokemonNameWithAffix}} est mise sous entrave !", "disabledOnAdd": "La capacité {{moveName}}\nde {{pokemonNameWithAffix}} est mise sous entrave !",
"disabledLapse": "La capacité {{moveName}}\nde {{pokemonNameWithAffix}} nest plus sous entrave !" "disabledLapse": "La capacité {{moveName}}\nde {{pokemonNameWithAffix}} nest plus sous entrave !",
"powerTrickActive": "{{pokemonNameWithAffix}} échange\nson Attaque et sa Défense !"
} }

View File

@ -5,7 +5,6 @@
"switchedStatChanges": "{{pokemonName}} permute\nles changements de stats avec ceux de sa cible !", "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 !", "switchedTwoStatChanges": "{{pokemonName}} permute les changements de {{firstStat} et de {{secondStat}} avec ceux de sa cible !",
"switchedStat": "{{pokemonName}} et sa cible échangent leur {{stat}} !", "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 !", "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 !", "sharedPower": "{{pokemonName}} additionne sa force à celle de sa cible et redistribue le tout équitablement !",
"goingAllOutForAttack": "{{pokemonName}} a pris\ncette capacité au sérieux !", "goingAllOutForAttack": "{{pokemonName}} a pris\ncette capacité au sérieux !",

View File

@ -69,5 +69,6 @@
"cursedLapse": "{{pokemonNameWithAffix}} subisce la maledizione!", "cursedLapse": "{{pokemonNameWithAffix}} subisce la maledizione!",
"stockpilingOnAdd": "{{pokemonNameWithAffix}} ha usato Accumulo per la\n{{stockpiledCount}}ª volta!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} ha usato Accumulo per la\n{{stockpiledCount}}ª volta!",
"disabledOnAdd": "La mossa {{moveName}} di\n{{pokemonNameWithAffix}} è stata bloccata!", "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!"
} }

View File

@ -69,5 +69,6 @@
"cursedLapse": "{{pokemonNameWithAffix}}[[는]]\n저주받고 있다!", "cursedLapse": "{{pokemonNameWithAffix}}[[는]]\n저주받고 있다!",
"stockpilingOnAdd": "{{pokemonNameWithAffix}}[[는]]\n{{stockpiledCount}}개 비축했다!", "stockpilingOnAdd": "{{pokemonNameWithAffix}}[[는]]\n{{stockpiledCount}}개 비축했다!",
"disabledOnAdd": "{{pokemonNameWithAffix}}의 {{moveName}}[[는]]\n사용할 수 없다!", "disabledOnAdd": "{{pokemonNameWithAffix}}의 {{moveName}}[[는]]\n사용할 수 없다!",
"disabledLapse": "{{pokemonNameWithAffix}}의 {{moveName}}[[는]]\n이제 사용할 수 있다." "disabledLapse": "{{pokemonNameWithAffix}}의 {{moveName}}[[는]]\n이제 사용할 수 있다.",
"powerTrickActive": "{{pokemonNameWithAffix}}[[는]]\n공격과 방어를 바꿨다!"
} }

View File

@ -5,7 +5,6 @@
"switchedStatChanges": "{{pokemonName}}[[는]] 상대와 자신의\n능력 변화를 바꿨다!", "switchedStatChanges": "{{pokemonName}}[[는]] 상대와 자신의\n능력 변화를 바꿨다!",
"switchedTwoStatChanges": "{{pokemonName}} 상대와 자신의 {{firstStat}}과 {{secondStat}}의 능력 변화를 바꿨다!", "switchedTwoStatChanges": "{{pokemonName}} 상대와 자신의 {{firstStat}}과 {{secondStat}}의 능력 변화를 바꿨다!",
"switchedStat": "{{pokemonName}} 서로의 {{stat}}를 교체했다!", "switchedStat": "{{pokemonName}} 서로의 {{stat}}를 교체했다!",
"selfSwitchedStat": "{{pokemonName}}[[는]]\n{{firstStat}}과 {{secondStat}}를 바꿨다!",
"sharedGuard": "{{pokemonName}} 서로의 가드를 셰어했다!", "sharedGuard": "{{pokemonName}} 서로의 가드를 셰어했다!",
"sharedPower": "{{pokemonName}} 서로의 파워를 셰어했다!", "sharedPower": "{{pokemonName}} 서로의 파워를 셰어했다!",
"goingAllOutForAttack": "{{pokemonName}}[[는]]\n전력을 다하기 시작했다!", "goingAllOutForAttack": "{{pokemonName}}[[는]]\n전력을 다하기 시작했다!",

View File

@ -69,5 +69,6 @@
"cursedLapse": "{{pokemonNameWithAffix}} foi ferido pelo Curse!", "cursedLapse": "{{pokemonNameWithAffix}} foi ferido pelo Curse!",
"stockpilingOnAdd": "{{pokemonNameWithAffix}} estocou {{stockpiledCount}}!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} estocou {{stockpiledCount}}!",
"disabledOnAdd": "{{moveName}} de {{pokemonNameWithAffix}}\nfoi desabilitado!", "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!"
} }

View File

@ -6,7 +6,6 @@
"goingAllOutForAttack": "{{pokemonName}} está arriscando tudo nesse ataque!", "goingAllOutForAttack": "{{pokemonName}} está arriscando tudo nesse ataque!",
"regainedHealth": "{{pokemonName}} recuperou/nsaúde!", "regainedHealth": "{{pokemonName}} recuperou/nsaúde!",
"keptGoingAndCrashed": "{{pokemonName}} errou o alvo/ne se arrebentou!", "keptGoingAndCrashed": "{{pokemonName}} errou o alvo/ne se arrebentou!",
"selfSwitchedStat": "{{pokemonName}} trocou seu atributo de {{firstStat}} pela sua {{secondStat}}!",
"fled": "{{pokemonName}} fugiu!", "fled": "{{pokemonName}} fugiu!",
"cannotBeSwitchedOut": "{{pokemonName}} não pode ser trocado!", "cannotBeSwitchedOut": "{{pokemonName}} não pode ser trocado!",
"swappedAbilitiesWithTarget": "{{pokemonName}} trocou/nde habilidades com o alvo!", "swappedAbilitiesWithTarget": "{{pokemonName}} trocou/nde habilidades com o alvo!",

View File

@ -69,5 +69,6 @@
"cursedLapse": "{{pokemonNameWithAffix}}\n正受到诅咒", "cursedLapse": "{{pokemonNameWithAffix}}\n正受到诅咒",
"stockpilingOnAdd": "{{pokemonNameWithAffix}}蓄力了{{stockpiledCount}}次!", "stockpilingOnAdd": "{{pokemonNameWithAffix}}蓄力了{{stockpiledCount}}次!",
"disabledOnAdd": "封住了{{pokemonNameWithAffix}}的\n{{moveName}}", "disabledOnAdd": "封住了{{pokemonNameWithAffix}}的\n{{moveName}}",
"disabledLapse": "{{pokemonNameWithAffix}}的\n定身法解除了" "disabledLapse": "{{pokemonNameWithAffix}}的\n定身法解除了",
"powerTrickActive": "{{pokemonNameWithAffix}}互换了攻击和防御!"
} }

View File

@ -5,7 +5,6 @@
"switchedStatChanges": "{{pokemonName}}和对手互换了\n自己的能力变化", "switchedStatChanges": "{{pokemonName}}和对手互换了\n自己的能力变化",
"switchedTwoStatChanges": "{{pokemonName}} 和对手互换了自己的{{firstStat}}和{{secondStat}}的能力变化!", "switchedTwoStatChanges": "{{pokemonName}} 和对手互换了自己的{{firstStat}}和{{secondStat}}的能力变化!",
"switchedStat": "{{pokemonName}} 互换了各自的{{stat}}", "switchedStat": "{{pokemonName}} 互换了各自的{{stat}}",
"selfSwitchedStat": "{{pokemonName}} 互换了{{firstStat}}和{{secondStat}}",
"sharedGuard": "{{pokemonName}} 平分了各自的防守!", "sharedGuard": "{{pokemonName}} 平分了各自的防守!",
"sharedPower": "{{pokemonName}} 平分了各自的力量!", "sharedPower": "{{pokemonName}} 平分了各自的力量!",
"goingAllOutForAttack": "{{pokemonName}}拿出全力了!", "goingAllOutForAttack": "{{pokemonName}}拿出全力了!",

View File

@ -68,5 +68,6 @@
"cursedOnAdd": "{{pokemonNameWithAffix}}削減了自己的體力,並詛咒了{{pokemonName}}", "cursedOnAdd": "{{pokemonNameWithAffix}}削減了自己的體力,並詛咒了{{pokemonName}}",
"cursedLapse": "{{pokemonNameWithAffix}}正受到詛咒!", "cursedLapse": "{{pokemonNameWithAffix}}正受到詛咒!",
"disabledOnAdd": "封住了{{pokemonNameWithAffix}}的\n{moveName}}", "disabledOnAdd": "封住了{{pokemonNameWithAffix}}的\n{moveName}}",
"disabledLapse": "{{pokemonNameWithAffix}}的\n定身法解除了" "disabledLapse": "{{pokemonNameWithAffix}}的\n定身法解除了",
"powerTrickActive": "{{pokemonNameWithAffix}}互換了攻擊和防禦!"
} }

View File

@ -5,7 +5,6 @@
"switchedStatChanges": "{{pokemonName}}和對手互換了\n自身的能力變化", "switchedStatChanges": "{{pokemonName}}和對手互換了\n自身的能力變化",
"switchedTwoStatChanges": "{{pokemonName}} 和對手互換了自身的{{firstStat}}和{{secondStat}}的能力變化!", "switchedTwoStatChanges": "{{pokemonName}} 和對手互換了自身的{{firstStat}}和{{secondStat}}的能力變化!",
"switchedStat": "{{pokemonName}} 互換了各自的{{stat}}", "switchedStat": "{{pokemonName}} 互換了各自的{{stat}}",
"selfSwitchedStat": "{{pokemonName}} 互换{{firstStat}}击和{{secondStat}}",
"sharedGuard": "{{pokemonName}} 平分了各自的防守!", "sharedGuard": "{{pokemonName}} 平分了各自的防守!",
"sharedPower": "{{pokemonName}} 平分了各自的力量!", "sharedPower": "{{pokemonName}} 平分了各自的力量!",
"goingAllOutForAttack": "{{pokemonName}}拿出全力了!", "goingAllOutForAttack": "{{pokemonName}}拿出全力了!",

View File

@ -7,6 +7,7 @@ import { Stat } from "#enums/stat";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { BattlerTagType } from "#enums/battler-tag-type";
describe("Moves - Power Trick", () => { describe("Moves - Power Trick", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -47,6 +48,7 @@ describe("Moves - Power Trick", () => {
expect(player.getStat(Stat.ATK, false)).toBe(baseDEF); expect(player.getStat(Stat.ATK, false)).toBe(baseDEF);
expect(player.getStat(Stat.DEF, false)).toBe(baseATK); expect(player.getStat(Stat.DEF, false)).toBe(baseATK);
expect(player.getTag(BattlerTagType.POWER_TRICK)).toBeDefined();
}, 20000); }, 20000);
it("reset changes when used consecutively", async () => { 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.ATK, false)).toBe(baseATK);
expect(player.getStat(Stat.DEF, false)).toBe(baseDEF); 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); }, 20000);
}); });