mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 14:29:28 +02:00
[ME] GTS shows shiny sparkle for received Pokemon
This commit is contained in:
parent
a67da46ea2
commit
f674476bbe
@ -797,6 +797,14 @@ function doTradeReceivedSequence(scene: BattleScene, receivedPokemon: PlayerPoke
|
|||||||
receivedPokeballSprite.x = tradeBaseBg.displayWidth / 2;
|
receivedPokeballSprite.x = tradeBaseBg.displayWidth / 2;
|
||||||
receivedPokeballSprite.y = tradeBaseBg.displayHeight / 2 - 100;
|
receivedPokeballSprite.y = tradeBaseBg.displayHeight / 2 - 100;
|
||||||
|
|
||||||
|
// Received pokemon sparkles
|
||||||
|
let pokemonShinySparkle: Phaser.GameObjects.Sprite;
|
||||||
|
if (receivedPokemon.shiny) {
|
||||||
|
pokemonShinySparkle = scene.add.sprite(receivedPokemonSprite.x, receivedPokemonSprite.y, "shiny");
|
||||||
|
pokemonShinySparkle.setVisible(false);
|
||||||
|
tradeContainer.add(pokemonShinySparkle);
|
||||||
|
}
|
||||||
|
|
||||||
const BASE_ANIM_DURATION = 1000;
|
const BASE_ANIM_DURATION = 1000;
|
||||||
|
|
||||||
// Pokeball falls to the screen
|
// Pokeball falls to the screen
|
||||||
@ -835,6 +843,12 @@ function doTradeReceivedSequence(scene: BattleScene, receivedPokemon: PlayerPoke
|
|||||||
scale: 1,
|
scale: 1,
|
||||||
alpha: 0,
|
alpha: 0,
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
|
if (receivedPokemon.shiny) {
|
||||||
|
scene.time.delayedCall(500, () => {
|
||||||
|
pokemonShinySparkle.play(`sparkle${receivedPokemon.variant ? `_${receivedPokemon.variant + 1}` : ""}`);
|
||||||
|
scene.playSound("se/sparkle");
|
||||||
|
});
|
||||||
|
}
|
||||||
receivedPokeballSprite.destroy();
|
receivedPokeballSprite.destroy();
|
||||||
scene.time.delayedCall(2000, () => resolve());
|
scene.time.delayedCall(2000, () => resolve());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user