mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 07:52:17 +02:00
Adds updateInfo to transform move/ability, mirrors Transform functionality in Imposter
This commit is contained in:
parent
b794662776
commit
3d738a57ca
@ -2297,7 +2297,7 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr {
|
||||
super(true);
|
||||
}
|
||||
|
||||
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
|
||||
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise<boolean> {
|
||||
const targets = pokemon.getOpponents();
|
||||
if (!targets.length) {
|
||||
return false;
|
||||
@ -2309,8 +2309,7 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr {
|
||||
} else {
|
||||
target = targets[0];
|
||||
}
|
||||
|
||||
target = target!; // compiler doesn't know its guranteed to be defined
|
||||
return new Promise(resolve => {
|
||||
pokemon.summonData.speciesForm = target.getSpeciesForm();
|
||||
pokemon.summonData.fusionSpeciesForm = target.getFusionSpeciesForm();
|
||||
pokemon.summonData.ability = target.getAbility().id;
|
||||
@ -2318,16 +2317,17 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr {
|
||||
pokemon.summonData.fusionGender = target.getFusionGender();
|
||||
pokemon.summonData.stats = [ pokemon.stats[Stat.HP] ].concat(target.stats.slice(1));
|
||||
pokemon.summonData.battleStats = target.summonData.battleStats.slice(0);
|
||||
pokemon.summonData.moveset = target.getMoveset().map(m => new PokemonMove(m!.moveId, m!.ppUsed, m!.ppUp)); // TODO: are those bangs correct?
|
||||
pokemon.summonData.moveset = target.getMoveset().map(m => new PokemonMove(m?.moveId!, m?.ppUsed, m?.ppUp));
|
||||
pokemon.summonData.types = target.getTypes();
|
||||
pokemon.updateInfo();
|
||||
|
||||
pokemon.scene.playSound("PRSFX- Transform");
|
||||
pokemon.scene.queueMessage(i18next.t("abilityTriggers:postSummonTransform", {pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), targetName: getPokemonNameWithAffix(target)}));
|
||||
|
||||
pokemon.loadAssets(false).then(() => pokemon.playAnim());
|
||||
|
||||
pokemon.scene.queueMessage(i18next.t("abilityTriggers:postSummonTransform", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), targetName: target.name, }));
|
||||
|
||||
return true;
|
||||
pokemon.loadAssets(false).then(() => {
|
||||
pokemon.playAnim();
|
||||
resolve(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5777,8 +5777,9 @@ export class TransformAttr extends MoveEffectAttr {
|
||||
user.summonData.fusionGender = target.getFusionGender();
|
||||
user.summonData.stats = [ user.stats[Stat.HP] ].concat(target.stats.slice(1));
|
||||
user.summonData.battleStats = target.summonData.battleStats.slice(0);
|
||||
user.summonData.moveset = target.getMoveset().map(m => new PokemonMove(m?.moveId!, m?.ppUsed, m?.ppUp)); // TODO: is this bang correct?
|
||||
user.summonData.moveset = target.getMoveset().map(m => new PokemonMove(m?.moveId!, m?.ppUsed, m?.ppUp));
|
||||
user.summonData.types = target.getTypes();
|
||||
user.updateInfo();
|
||||
|
||||
user.scene.queueMessage(i18next.t("moveTriggers:transformedIntoTarget", {pokemonName: getPokemonNameWithAffix(user), targetName: getPokemonNameWithAffix(target)}));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user