fix error: Lock Capsule not locking rarities consistently

This commit is contained in:
xy 2025-05-07 09:24:42 +08:00
parent 39937f0cc2
commit 680a59a811

View File

@ -3287,8 +3287,6 @@ export function getModifierTypeFuncById(id: string): ModifierTypeFunc {
return modifierTypes[id]; return modifierTypes[id];
} }
let lockModifierTiers: null | boolean = null;
/** /**
* Generates modifier options for a {@linkcode SelectModifierPhase} * Generates modifier options for a {@linkcode SelectModifierPhase}
* @param count Determines the number of items to generate * @param count Determines the number of items to generate
@ -3314,7 +3312,6 @@ export function getPlayerModifierTypeOptions(
const options: ModifierTypeOption[] = []; const options: ModifierTypeOption[] = [];
const retryCount = Math.min(count * 5, 50); const retryCount = Math.min(count * 5, 50);
if (!customModifierSettings) { if (!customModifierSettings) {
lockModifierTiers = !!modifierTiers && modifierTiers.length >= count;
new Array(count).fill(0).map((_, i) => { new Array(count).fill(0).map((_, i) => {
options.push( options.push(
getModifierTypeOptionWithRetry( getModifierTypeOptionWithRetry(
@ -3325,8 +3322,6 @@ export function getPlayerModifierTypeOptions(
), ),
); );
}); });
// init lockModifierTiers
lockModifierTiers = null;
} else { } else {
// Guaranteed mod options first // Guaranteed mod options first
if ( if (
@ -3645,7 +3640,7 @@ function getNewModifierTypeOption(
} }
tier += upgradeCount; tier += upgradeCount;
} }
} else if (retryCount === 10 && tier && lockModifierTiers !== true) { } else if (retryCount >= 100 && tier) {
retryCount = 0; retryCount = 0;
tier--; tier--;
} }