Merge branch 'hotfix-1.9.1' of https://github.com/pagefaultgames/pokerogue into chrcdtfx

This commit is contained in:
AJ Fontaine 2025-05-05 18:00:11 -04:00
commit 58629be5f2
3 changed files with 24 additions and 32 deletions

View File

@ -91,8 +91,8 @@ export default class PokemonData {
this.formIndex = Math.max(Math.min(source.formIndex, getPokemonSpecies(this.species).forms.length - 1), 0); this.formIndex = Math.max(Math.min(source.formIndex, getPokemonSpecies(this.species).forms.length - 1), 0);
this.abilityIndex = source.abilityIndex; this.abilityIndex = source.abilityIndex;
this.passive = source.passive; this.passive = source.passive;
this.shiny = sourcePokemon?.isShiny() ?? source.shiny; this.shiny = source.shiny;
this.variant = sourcePokemon?.getVariant() ?? source.variant; this.variant = source.variant;
this.pokeball = source.pokeball ?? PokeballType.POKEBALL; this.pokeball = source.pokeball ?? PokeballType.POKEBALL;
this.level = source.level; this.level = source.level;
this.exp = source.exp; this.exp = source.exp;

View File

@ -873,6 +873,7 @@ export default class PokedexUiHandler extends MessageUiHandler {
const tweenChain: Phaser.Types.Tweens.TweenChainBuilderConfig = { const tweenChain: Phaser.Types.Tweens.TweenChainBuilderConfig = {
targets: icon, targets: icon,
loop: -1, loop: -1,
paused: startPaused,
// Make the initial bounce a little randomly delayed // Make the initial bounce a little randomly delayed
delay: randIntRange(0, 50) * 5, delay: randIntRange(0, 50) * 5,
loopDelay: 1000, loopDelay: 1000,
@ -894,19 +895,14 @@ export default class PokedexUiHandler extends MessageUiHandler {
], ],
}; };
const isPassiveAvailable = this.isPassiveAvailable(species.speciesId); if (
const isValueReductionAvailable = this.isValueReductionAvailable(species.speciesId); this.isPassiveAvailable(species.speciesId) ||
const isSameSpeciesEggAvailable = this.isSameSpeciesEggAvailable(species.speciesId); (globalScene.candyUpgradeNotification === 2 &&
(this.isValueReductionAvailable(species.speciesId) || this.isSameSpeciesEggAvailable(species.speciesId)))
// 'Passives Only' mode ) {
if (globalScene.candyUpgradeNotification === 1) { const chain = globalScene.tweens.chain(tweenChain);
if (isPassiveAvailable) { if (!startPaused) {
globalScene.tweens.chain(tweenChain).paused = startPaused; chain.play();
}
// 'On' mode
} else if (globalScene.candyUpgradeNotification === 2) {
if (isPassiveAvailable || isValueReductionAvailable || isSameSpeciesEggAvailable) {
globalScene.tweens.chain(tweenChain).paused = startPaused;
} }
} }
} }
@ -2040,7 +2036,7 @@ export default class PokedexUiHandler extends MessageUiHandler {
this.checkIconId(lastSpeciesIcon, container.species, props.female, props.formIndex, props.shiny, props.variant); this.checkIconId(lastSpeciesIcon, container.species, props.female, props.formIndex, props.shiny, props.variant);
this.iconAnimHandler.addOrUpdate(lastSpeciesIcon, PokemonIconAnimMode.NONE); this.iconAnimHandler.addOrUpdate(lastSpeciesIcon, PokemonIconAnimMode.NONE);
// Resume the animation for the previously selected species // Resume the animation for the previously selected species
globalScene.tweens.getTweensOf(lastSpeciesIcon).forEach(tween => tween.resume()); globalScene.tweens.getTweensOf(lastSpeciesIcon).forEach(tween => tween.play());
} }
} }

View File

@ -1444,6 +1444,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
const tweenChain: Phaser.Types.Tweens.TweenChainBuilderConfig = { const tweenChain: Phaser.Types.Tweens.TweenChainBuilderConfig = {
targets: icon, targets: icon,
paused: startPaused,
loop: -1, loop: -1,
// Make the initial bounce a little randomly delayed // Make the initial bounce a little randomly delayed
delay: randIntRange(0, 50) * 5, delay: randIntRange(0, 50) * 5,
@ -1451,14 +1452,14 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
tweens: [ tweens: [
{ {
targets: icon, targets: icon,
y: 2 - 5, y: "-=5",
duration: fixedInt(125), duration: fixedInt(125),
ease: "Cubic.easeOut", ease: "Cubic.easeOut",
yoyo: true, yoyo: true,
}, },
{ {
targets: icon, targets: icon,
y: 2 - 3, y: "-=3",
duration: fixedInt(150), duration: fixedInt(150),
ease: "Cubic.easeOut", ease: "Cubic.easeOut",
yoyo: true, yoyo: true,
@ -1466,19 +1467,14 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
], ],
}; };
const isPassiveAvailable = this.isPassiveAvailable(species.speciesId); if (
const isValueReductionAvailable = this.isValueReductionAvailable(species.speciesId); this.isPassiveAvailable(species.speciesId) ||
const isSameSpeciesEggAvailable = this.isSameSpeciesEggAvailable(species.speciesId); (globalScene.candyUpgradeNotification === 2 &&
(this.isValueReductionAvailable(species.speciesId) || this.isSameSpeciesEggAvailable(species.speciesId)))
// 'Passives Only' mode ) {
if (globalScene.candyUpgradeNotification === 1) { const chain = globalScene.tweens.chain(tweenChain);
if (isPassiveAvailable) { if (!startPaused) {
globalScene.tweens.chain(tweenChain).paused = startPaused; chain.play();
}
// 'On' mode
} else if (globalScene.candyUpgradeNotification === 2) {
if (isPassiveAvailable || isValueReductionAvailable || isSameSpeciesEggAvailable) {
globalScene.tweens.chain(tweenChain).paused = startPaused;
} }
} }
} }
@ -3478,7 +3474,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
// Resume the animation for the previously selected species // Resume the animation for the previously selected species
const icon = this.starterContainers[speciesIndex].icon; const icon = this.starterContainers[speciesIndex].icon;
globalScene.tweens.getTweensOf(icon).forEach(tween => tween.resume()); globalScene.tweens.getTweensOf(icon).forEach(tween => tween.play());
} }
this.lastSpecies = species!; // TODO: is this bang correct? this.lastSpecies = species!; // TODO: is this bang correct?