From eb0e8ccca7e2433d2390f92891075dec48354b66 Mon Sep 17 00:00:00 2001 From: ImperialSympathizer Date: Sun, 22 Sep 2024 14:19:47 -0400 Subject: [PATCH] possible Pokemon Salesman shiny fix --- .../encounters/the-pokemon-salesman-encounter.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 ba6a628f51e..edd687b4270 100644 --- a/src/data/mystery-encounters/encounters/the-pokemon-salesman-encounter.ts +++ b/src/data/mystery-encounters/encounters/the-pokemon-salesman-encounter.ts @@ -59,11 +59,12 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter = const encounter = scene.currentBattle.mysteryEncounter!; let species = getPokemonSpecies(getRandomSpeciesByStarterTier([0, 5], undefined, undefined, false, false, false)); - const tries = 0; + let tries = 0; // Reroll any species that don't have HAs while ((isNullOrUndefined(species.abilityHidden) || species.abilityHidden === Abilities.NONE) && tries < 5) { species = getPokemonSpecies(getRandomSpeciesByStarterTier([0, 5], undefined, undefined, false, false, false)); + tries++; } let pokemon: PlayerPokemon; @@ -71,7 +72,7 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter = // If no HA mon found or you roll 1%, give shiny Magikarp species = getPokemonSpecies(Species.MAGIKARP); const hiddenIndex = species.ability2 ? 2 : 1; - pokemon = new PlayerPokemon(scene, species, 5, hiddenIndex, species.formIndex, undefined, true); + pokemon = new PlayerPokemon(scene, species, 5, hiddenIndex, species.formIndex, undefined, true, 0); } else { const hiddenIndex = species.ability2 ? 2 : 1; pokemon = new PlayerPokemon(scene, species, 5, hiddenIndex, species.formIndex);