diff --git a/src/data/mystery-encounters/encounters/the-pokemon-salesman-encounter.ts b/src/data/mystery-encounters/encounters/the-pokemon-salesman-encounter.ts index c1c5a1f2e94..71295b42bde 100644 --- a/src/data/mystery-encounters/encounters/the-pokemon-salesman-encounter.ts +++ b/src/data/mystery-encounters/encounters/the-pokemon-salesman-encounter.ts @@ -71,7 +71,7 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter = let pokemon: PlayerPokemon; if (randSeedInt(SHINY_MAGIKARP_WEIGHT) === 0 || isNullOrUndefined(species.abilityHidden) || species.abilityHidden === Abilities.NONE) { - // If no HA mon found or you roll 1%, give shiny Magikarp with HA and random variant + // If no HA mon found or you roll 1%, give shiny Magikarp with random variant species = getPokemonSpecies(Species.MAGIKARP); pokemon = new PlayerPokemon(scene, species, 5, 2, species.formIndex, undefined, true); } else { diff --git a/src/field/mystery-encounter-intro.ts b/src/field/mystery-encounter-intro.ts index be75ed8d525..ee88312eb2f 100644 --- a/src/field/mystery-encounter-intro.ts +++ b/src/field/mystery-encounter-intro.ts @@ -84,8 +84,6 @@ export default class MysteryEncounterIntroVisuals extends Phaser.GameObjects.Con constructor(scene: BattleScene, encounter: MysteryEncounter) { super(scene, -72, 76); - this.shinySparkleSprites = []; - this.encounter = encounter; this.enterFromRight = encounter.enterIntroVisualsFromRight ?? false; // Shallow copy configs to allow visual config updates at runtime without dirtying master copy of Encounter @@ -129,6 +127,7 @@ export default class MysteryEncounterIntroVisuals extends Phaser.GameObjects.Con // Sprites with custom X or Y defined will not count for normal spacing requirements const spacingValue = Math.round((maxX - minX) / Math.max(this.spriteConfigs.filter(s => !s.x && !s.y).length, 1)); + this.shinySparkleSprites = []; const shinySparkleSprites = scene.add.container(0, 0); this.spriteConfigs?.forEach((config) => { const { spriteKey, isItem, hasShadow, scale, x, y, yShadow, alpha, isPokemon, isShiny, variant } = config; @@ -274,18 +273,22 @@ export default class MysteryEncounterIntroVisuals extends Phaser.GameObjects.Con this.getSprites().map((sprite, i) => { if (!this.spriteConfigs[i].isItem) { - sprite.setTexture(this.spriteConfigs[i].spriteKey); - // Show the first frame for a smooth transition when the animation starts. - const firstFrame = sprite.texture.frames["0001.png"]; - sprite.setFrame(firstFrame ?? 0); + sprite.setTexture(this.spriteConfigs[i].spriteKey).setFrame(0); + if (sprite.texture.frameTotal > 1) { + // Show the first animation frame for a smooth transition when the animation starts. + const firstFrame = sprite.texture.frames["0001.png"]; + sprite.setFrame(firstFrame ?? 0); + } } }); this.getTintSprites().map((tintSprite, i) => { if (!this.spriteConfigs[i].isItem) { - tintSprite.setTexture(this.spriteConfigs[i].spriteKey); - // Show the first frame for a smooth transition when the animation starts. - const firstFrame = tintSprite.texture.frames["0001.png"]; - tintSprite.setFrame(firstFrame ?? 0); + tintSprite.setTexture(this.spriteConfigs[i].spriteKey).setFrame(0); + if (tintSprite.texture.frameTotal > 1) { + // Show the first frame for a smooth transition when the animation starts. + const firstFrame = tintSprite.texture.frames["0001.png"]; + tintSprite.setFrame(firstFrame ?? 0); + } } }); diff --git a/src/phases/encounter-phase.ts b/src/phases/encounter-phase.ts index 64a9641316a..5988ec9ddc9 100644 --- a/src/phases/encounter-phase.ts +++ b/src/phases/encounter-phase.ts @@ -204,7 +204,6 @@ export class EncounterPhase extends BattlePhase { battle.seenEnemyPartyMemberIds.add(enemyPokemon.id); const playerPokemon = this.scene.getPlayerPokemon(); if (playerPokemon?.visible) { - //TODO HERE this.scene.field.moveBelow(enemyPokemon as Pokemon, playerPokemon); } enemyPokemon.tint(0, 0.5);