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);
|
super(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
|
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise<boolean> {
|
||||||
const targets = pokemon.getOpponents();
|
const targets = pokemon.getOpponents();
|
||||||
if (!targets.length) {
|
if (!targets.length) {
|
||||||
return false;
|
return false;
|
||||||
@ -2309,25 +2309,25 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr {
|
|||||||
} else {
|
} else {
|
||||||
target = targets[0];
|
target = targets[0];
|
||||||
}
|
}
|
||||||
|
return new Promise(resolve => {
|
||||||
|
pokemon.summonData.speciesForm = target.getSpeciesForm();
|
||||||
|
pokemon.summonData.fusionSpeciesForm = target.getFusionSpeciesForm();
|
||||||
|
pokemon.summonData.ability = target.getAbility().id;
|
||||||
|
pokemon.summonData.gender = target.getGender();
|
||||||
|
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));
|
||||||
|
pokemon.summonData.types = target.getTypes();
|
||||||
|
pokemon.updateInfo();
|
||||||
|
|
||||||
target = target!; // compiler doesn't know its guranteed to be defined
|
pokemon.scene.queueMessage(i18next.t("abilityTriggers:postSummonTransform", {pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), targetName: getPokemonNameWithAffix(target)}));
|
||||||
pokemon.summonData.speciesForm = target.getSpeciesForm();
|
|
||||||
pokemon.summonData.fusionSpeciesForm = target.getFusionSpeciesForm();
|
|
||||||
pokemon.summonData.ability = target.getAbility().id;
|
|
||||||
pokemon.summonData.gender = target.getGender();
|
|
||||||
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.types = target.getTypes();
|
|
||||||
|
|
||||||
pokemon.scene.playSound("PRSFX- Transform");
|
pokemon.loadAssets(false).then(() => {
|
||||||
|
pokemon.playAnim();
|
||||||
pokemon.loadAssets(false).then(() => pokemon.playAnim());
|
resolve(true);
|
||||||
|
});
|
||||||
pokemon.scene.queueMessage(i18next.t("abilityTriggers:postSummonTransform", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), targetName: target.name, }));
|
});
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5777,8 +5777,9 @@ export class TransformAttr extends MoveEffectAttr {
|
|||||||
user.summonData.fusionGender = target.getFusionGender();
|
user.summonData.fusionGender = target.getFusionGender();
|
||||||
user.summonData.stats = [ user.stats[Stat.HP] ].concat(target.stats.slice(1));
|
user.summonData.stats = [ user.stats[Stat.HP] ].concat(target.stats.slice(1));
|
||||||
user.summonData.battleStats = target.summonData.battleStats.slice(0);
|
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.summonData.types = target.getTypes();
|
||||||
|
user.updateInfo();
|
||||||
|
|
||||||
user.scene.queueMessage(i18next.t("moveTriggers:transformedIntoTarget", {pokemonName: getPokemonNameWithAffix(user), targetName: getPokemonNameWithAffix(target)}));
|
user.scene.queueMessage(i18next.t("moveTriggers:transformedIntoTarget", {pokemonName: getPokemonNameWithAffix(user), targetName: getPokemonNameWithAffix(target)}));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user