Add Move Effect Message to Speed Swap

This commit is contained in:
xsn34kzx 2024-08-20 23:23:59 -04:00
parent e97e965085
commit dc0f90d4d5
2 changed files with 18 additions and 9 deletions

View File

@ -2831,9 +2831,9 @@ export class SwapStatStagesAttr extends MoveEffectAttr {
user.updateInfo(); user.updateInfo();
if (this.stats.length === 7) { if (this.stats.length === 7) {
target.scene.queueMessage(i18next.t("moveTriggers:switchedStatChanges", { pokemonName: getPokemonNameWithAffix(user) })); user.scene.queueMessage(i18next.t("moveTriggers:switchedStatChanges", { pokemonName: getPokemonNameWithAffix(user) }));
} else if (this.stats.length === 2) { } else if (this.stats.length === 2) {
target.scene.queueMessage(i18next.t("moveTriggers:switchedTwoStatChanges", { user.scene.queueMessage(i18next.t("moveTriggers:switchedTwoStatChanges", {
pokemonName: getPokemonNameWithAffix(user), pokemonName: getPokemonNameWithAffix(user),
firstStat: i18next.t(getStatKey(this.stats[0])), firstStat: i18next.t(getStatKey(this.stats[0])),
secondStat: i18next.t(getStatKey(this.stats[1])) secondStat: i18next.t(getStatKey(this.stats[1]))
@ -5888,17 +5888,25 @@ export class SwapStatAttr extends MoveEffectAttr {
* temporarily. * temporarily.
* @param user the {@linkcode Pokemon} that used the move * @param user the {@linkcode Pokemon} that used the move
* @param target the {@linkcode Pokemon} that the move was used on * @param target the {@linkcode Pokemon} that the move was used on
* @param _move N/A * @param move N/A
* @param _args N/A * @param args N/A
* @returns true if attribute application succeeds * @returns true if attribute application succeeds
*/ */
apply(user: Pokemon, target: Pokemon, _move: Move, _args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (super.apply(user, target, move, args)) {
const temp = user.getStat(this.stat, false); const temp = user.getStat(this.stat, false);
user.setStat(this.stat, target.getStat(this.stat, false), false); user.setStat(this.stat, target.getStat(this.stat, false), false);
target.setStat(this.stat, temp, false); target.setStat(this.stat, temp, false);
user.scene.queueMessage(i18next.t("moveTriggers:swappedStat", {
pokemonName: getPokemonNameWithAffix(user),
stat: i18next.t(getStatKey(this.stat)),
}));
return true; return true;
} }
return false;
}
} }
/** /**

View File

@ -6,6 +6,7 @@ export const moveTriggers: SimpleTranslationEntries = {
"absorbedElectricity": "{{pokemonName}} absorbed electricity!", "absorbedElectricity": "{{pokemonName}} absorbed electricity!",
"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!",
"swappedStat": "{{pokemonName}} switched {{stat}} with its target!",
"goingAllOutForAttack": "{{pokemonName}} is going all out for this attack!", "goingAllOutForAttack": "{{pokemonName}} is going all out for this attack!",
"regainedHealth": "{{pokemonName}} regained\nhealth!", "regainedHealth": "{{pokemonName}} regained\nhealth!",
"keptGoingAndCrashed": "{{pokemonName}} kept going\nand crashed!", "keptGoingAndCrashed": "{{pokemonName}} kept going\nand crashed!",