[Bug][Mystery Encounters] Use proper BST calculation (#5199)

Mystery Encounters that check the base stats of a pokemon will
no longer check modified BST and instead check the actual BST
This commit is contained in:
NightKev 2025-01-29 18:47:09 -08:00 committed by GitHub
parent 4e0b10769b
commit 0989128deb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View File

@ -449,7 +449,7 @@ function getPokemonTradeOptions(): Map<number, EnemyPokemon[]> {
});
tradeOptionsMap.set(pokemon.id, tradeOptions);
} else {
const originalBst = pokemon.calculateBaseStats().reduce((a, b) => a + b, 0);
const originalBst = pokemon.getSpeciesForm().getBaseStatTotal();
const tradeOptions: PokemonSpecies[] = [];
for (let i = 0; i < 3; i++) {

View File

@ -452,7 +452,7 @@ function getSpeciesFromPool(speciesPool: (Species | BreederSpeciesEvolution)[][]
}
function calculateEggRewardsForPokemon(pokemon: PlayerPokemon): [number, number] {
const bst = pokemon.calculateBaseStats().reduce((a, b) => a + b, 0);
const bst = pokemon.getSpeciesForm().getBaseStatTotal();
// 1 point for every 20 points below 680 BST the pokemon is, (max 18, min 1)
const pointsFromBst = Math.min(Math.max(Math.floor((680 - bst) / 20), 1), 18);

View File

@ -147,8 +147,8 @@ export const TheStrongStuffEncounter: MysteryEncounter =
// Sort party by bst
const sortedParty = globalScene.getPlayerParty().slice(0)
.sort((pokemon1, pokemon2) => {
const pokemon1Bst = pokemon1.calculateBaseStats().reduce((a, b) => a + b, 0);
const pokemon2Bst = pokemon2.calculateBaseStats().reduce((a, b) => a + b, 0);
const pokemon1Bst = pokemon1.getSpeciesForm().getBaseStatTotal();
const pokemon2Bst = pokemon2.getSpeciesForm().getBaseStatTotal();
return pokemon2Bst - pokemon1Bst;
});

View File

@ -360,7 +360,7 @@ function getTeamTransformations(): PokemonTransformation[] {
const index = pokemonTransformations.findIndex(p => p.previousPokemon.id === removed.id);
pokemonTransformations[index].heldItems = removed.getHeldItems().filter(m => !(m instanceof PokemonFormChangeItemModifier));
const bst = removed.calculateBaseStats().reduce((a, b) => a + b, 0);
const bst = removed.getSpeciesForm().getBaseStatTotal();
let newBstRange: [number, number];
if (i < 2) {
newBstRange = HIGH_BST_TRANSFORM_BASE_VALUES;