mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 00:52:47 +02:00
Fixed Transform and Imposter Bug
This commit is contained in:
parent
6ff258fb37
commit
9e892597ea
@ -3909,8 +3909,13 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr {
|
|||||||
override canApplyPostSummon(pokemon: Pokemon, _passive: boolean, simulated: boolean, _args: any[]): boolean {
|
override canApplyPostSummon(pokemon: Pokemon, _passive: boolean, simulated: boolean, _args: any[]): boolean {
|
||||||
const targets = pokemon.getOpponents();
|
const targets = pokemon.getOpponents();
|
||||||
const target = this.getTarget(targets);
|
const target = this.getTarget(targets);
|
||||||
|
const user = pokemon;
|
||||||
|
|
||||||
if (target.summonData.illusion) {
|
if (user?.getTag(BattlerTagType.TRANSFORM) || target?.getTag(BattlerTagType.TRANSFORM)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (target?.summonData?.illusion) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3221,6 +3221,15 @@ export class ImprisonTag extends MoveRestrictionBattlerTag {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class TransformTag extends BattlerTag {
|
||||||
|
constructor(sourceId: number) {
|
||||||
|
super(BattlerTagType.TRANSFORM, BattlerTagLapseType.MOVE, Number.MAX_SAFE_INTEGER, MoveId.TRANSFORM, sourceId);
|
||||||
|
}
|
||||||
|
override onAdd(pokemon: Pokemon): void {
|
||||||
|
super.onAdd(pokemon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Battler Tag that applies the effects of Syrup Bomb to the target Pokemon.
|
* Battler Tag that applies the effects of Syrup Bomb to the target Pokemon.
|
||||||
* For three turns, starting from the turn of hit, at the end of each turn, the target Pokemon's speed will decrease by 1.
|
* For three turns, starting from the turn of hit, at the end of each turn, the target Pokemon's speed will decrease by 1.
|
||||||
@ -3629,6 +3638,8 @@ export function getBattlerTag(
|
|||||||
return new TauntTag();
|
return new TauntTag();
|
||||||
case BattlerTagType.IMPRISON:
|
case BattlerTagType.IMPRISON:
|
||||||
return new ImprisonTag(sourceId);
|
return new ImprisonTag(sourceId);
|
||||||
|
case BattlerTagType.TRANSFORM:
|
||||||
|
return new TransformTag(sourceId);
|
||||||
case BattlerTagType.SYRUP_BOMB:
|
case BattlerTagType.SYRUP_BOMB:
|
||||||
return new SyrupBombTag(sourceId);
|
return new SyrupBombTag(sourceId);
|
||||||
case BattlerTagType.TELEKINESIS:
|
case BattlerTagType.TELEKINESIS:
|
||||||
|
@ -7599,7 +7599,6 @@ export class TransformAttr extends MoveEffectAttr {
|
|||||||
|
|
||||||
globalScene.phaseManager.unshiftNew("PokemonTransformPhase", user.getBattlerIndex(), target.getBattlerIndex());
|
globalScene.phaseManager.unshiftNew("PokemonTransformPhase", user.getBattlerIndex(), target.getBattlerIndex());
|
||||||
|
|
||||||
globalScene.phaseManager.queueMessage(i18next.t("moveTriggers:transformedIntoTarget", { pokemonName: getPokemonNameWithAffix(user), targetName: getPokemonNameWithAffix(target) }));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,7 @@ export enum BattlerTagType {
|
|||||||
HEAL_BLOCK = "HEAL_BLOCK",
|
HEAL_BLOCK = "HEAL_BLOCK",
|
||||||
TORMENT = "TORMENT",
|
TORMENT = "TORMENT",
|
||||||
TAUNT = "TAUNT",
|
TAUNT = "TAUNT",
|
||||||
|
TRANSFORM = "TRANSFORM",
|
||||||
IMPRISON = "IMPRISON",
|
IMPRISON = "IMPRISON",
|
||||||
SYRUP_BOMB = "SYRUP_BOMB",
|
SYRUP_BOMB = "SYRUP_BOMB",
|
||||||
ELECTRIFIED = "ELECTRIFIED",
|
ELECTRIFIED = "ELECTRIFIED",
|
||||||
|
@ -339,6 +339,16 @@ export class MovePhase extends BattlePhase {
|
|||||||
this.showMoveText();
|
this.showMoveText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
this.move.getMove().id === MoveId.TRANSFORM &&
|
||||||
|
(targets[0].getTag(BattlerTagType.TRANSFORM) || this.pokemon.getTag(BattlerTagType.TRANSFORM))
|
||||||
|
) {
|
||||||
|
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
|
||||||
|
@ -39,6 +39,8 @@ export class PokemonTransformPhase extends PokemonPhase {
|
|||||||
|
|
||||||
// Power Trick's effect is removed after using Transform
|
// Power Trick's effect is removed after using Transform
|
||||||
user.removeTag(BattlerTagType.POWER_TRICK);
|
user.removeTag(BattlerTagType.POWER_TRICK);
|
||||||
|
//Begin tracking Pokemon as transformed
|
||||||
|
user.addTag(BattlerTagType.TRANSFORM);
|
||||||
|
|
||||||
// Copy all stats (except HP)
|
// Copy all stats (except HP)
|
||||||
for (const s of EFFECTIVE_STATS) {
|
for (const s of EFFECTIVE_STATS) {
|
||||||
|
Loading…
Reference in New Issue
Block a user