This commit is contained in:
Jonathan Bankston 2025-06-20 02:35:48 -05:00 committed by GitHub
commit d0fb9c85b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 4 deletions

View File

@ -3903,7 +3903,7 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr {
const targets = pokemon.getOpponents();
const target = this.getTarget(targets);
if (target.summonData.illusion) {
if (target?.summonData?.illusion || pokemon?.isTransformed() || target?.isTransformed()) {
return false;
}

View File

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

View File

@ -1062,6 +1062,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return species;
}
isTransformed(): boolean {
return this.summonData.speciesForm !== null;
}
/**
* @param {boolean} useIllusion - Whether we want the fusionSpeciesForm of the illusion or not.
*/