[Bug] Fix tier weights and remove unnecessary `Math.min()` (#3359)

This commit is contained in:
NightKev 2024-08-06 12:34:43 -07:00 committed by GitHub
parent 06ed89ef13
commit 9eadce80c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 5 deletions

View File

@ -1809,7 +1809,7 @@ export function getModifierPoolForType(poolType: ModifierPoolType): ModifierPool
return pool;
}
const tierWeights = [ 769 / 1024, 192 / 1024, 48 / 1024, 12 / 1024, 1 / 1024 ];
const tierWeights = [ 768 / 1024, 195 / 1024, 48 / 1024, 12 / 1024, 1 / 1024 ];
export function regenerateModifierPoolThresholds(party: Pokemon[], poolType: ModifierPoolType, rerollCount: integer = 0) {
const pool = getModifierPoolForType(poolType);
@ -2023,10 +2023,6 @@ function getNewModifierTypeOption(party: Pokemon[], poolType: ModifierPoolType,
} while (upgraded);
}
tier = tierValue > 255 ? ModifierTier.COMMON : tierValue > 60 ? ModifierTier.GREAT : tierValue > 12 ? ModifierTier.ULTRA : tierValue ? ModifierTier.ROGUE : ModifierTier.MASTER;
// Does this actually do anything?
if (!upgradeCount) {
upgradeCount = Math.min(upgradeCount, ModifierTier.MASTER - tier);
}
tier += upgradeCount;
while (tier && (!modifierPool.hasOwnProperty(tier) || !modifierPool[tier].length)) {
tier--;