mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-20 16:42:45 +02:00
Merge 5a1fbda44a
into 4b70fab608
This commit is contained in:
commit
d0fb9c85b3
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user