Salesman odds

This commit is contained in:
AJ Fontaine 2025-04-17 10:56:26 -04:00
parent d90099dccd
commit 081b21abcf

View File

@ -104,25 +104,24 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter = MysteryEncounterBui
/**
* Mon is determined as follows:
* If you roll the 1% for Shiny Magikarp, you get Magikarp with a random variant
* If an event with more than 1 valid event encounter species is active, you have 19% chance to get one of those
* If the rolled species has no HA, you have a 5% chance to get Shiny Magikarp and a 95% chance to get an event encounter
* If an event with more than 1 valid event encounter species is active, you have 20% chance to get one of those
* If the rolled species has no HA, and there are valid event encounters, you will get one of those
* If the rolled species has no HA and there are no valid event encounters, you will get Shiny Magikarp
* Mons rolled from the event encounter pool get 2 extra shiny rolls
*/
if (
r === 0 ||
((isNullOrUndefined(species.abilityHidden) || species.abilityHidden === Abilities.NONE) &&
(validEventEncounters.length === 0 || r < SHINY_MAGIKARP_WEIGHT / EVENT_THRESHOLD))
(validEventEncounters.length === 0))
) {
// If you roll 1%, give shiny Magikarp with random variant
species = getPokemonSpecies(Species.MAGIKARP);
pokemon = new PlayerPokemon(species, 5, 2, undefined, undefined, true);
} else if (
(validEventEncounters.length > 0 && r < EVENT_THRESHOLD) ||
((isNullOrUndefined(species.abilityHidden) || species.abilityHidden === Abilities.NONE) &&
r >= SHINY_MAGIKARP_WEIGHT / EVENT_THRESHOLD)
(validEventEncounters.length > 0 && (r <= EVENT_THRESHOLD ||
(isNullOrUndefined(species.abilityHidden) || species.abilityHidden === Abilities.NONE)))
) {
// If you roll 19%, give event encounter with 2 extra shiny rolls
// If you roll 20%, give event encounter with 2 extra shiny rolls and its HA, if it has one
const enc = randSeedItem(validEventEncounters);
species = getPokemonSpecies(enc.species);
pokemon = new PlayerPokemon(species, 5, species.abilityHidden === Abilities.NONE ? undefined : 2, enc.formIndex);