Compare commits

..

No commits in common. "5a1fbda44a36a5d3647c90b724c9adab94549635" and "fb11f7377b52f533b39659c5a47d1616b9961605" have entirely different histories.

3 changed files with 19 additions and 3 deletions

View File

@ -3903,7 +3903,12 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr {
const targets = pokemon.getOpponents(); const targets = pokemon.getOpponents();
const target = this.getTarget(targets); const target = this.getTarget(targets);
if (target?.summonData?.illusion || pokemon?.isTransformed() || target?.isTransformed()) { //Prevents Imposter from triggering on a transformed target or if the user is already transformed
if (pokemon?.isTransformed() || target?.isTransformed()) {
return false;
}
if (target?.summonData?.illusion) {
return false; return false;
} }

View File

@ -7610,13 +7610,13 @@ export class SuppressAbilitiesIfActedAttr extends MoveEffectAttr {
*/ */
export class TransformAttr extends MoveEffectAttr { export class TransformAttr extends MoveEffectAttr {
override apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { override apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (!super.apply(user, target, move, args) || (target.isTransformed() || user.isTransformed())) { if (!super.apply(user, target, move, args)) {
globalScene.phaseManager.queueMessage(i18next.t("battle:attackFailed"));
return false; return false;
} }
globalScene.phaseManager.unshiftNew("PokemonTransformPhase", user.getBattlerIndex(), target.getBattlerIndex()); globalScene.phaseManager.unshiftNew("PokemonTransformPhase", user.getBattlerIndex(), target.getBattlerIndex());
return true; return true;
} }
} }

View File

@ -339,6 +339,17 @@ export class MovePhase extends BattlePhase {
this.showMoveText(); this.showMoveText();
} }
if (
//Prevent using Transform if either the user or target is already transformed
this.move.getMove().id === MoveId.TRANSFORM &&
(targets[0].isTransformed() || this.pokemon.isTransformed())
) {
this.showMoveText();
this.showFailedText();
this.end();
return;
}
// Clear out any two turn moves once they've been used. // Clear out any two turn moves once they've been used.
// TODO: Refactor move queues and remove this assignment; // TODO: Refactor move queues and remove this assignment;
// Move queues should be handled by the calling `CommandPhase` or a manager for it // Move queues should be handled by the calling `CommandPhase` or a manager for it