feature: multiple lock, pick min max

This commit is contained in:
Vick Scarlet
2026-08-12 17:30:28 +08:00
parent cd339c2103
commit 5a4821433a
20 changed files with 358 additions and 160 deletions
+7 -4
View File
@@ -70,10 +70,13 @@ export function pull(
)
const result = []
const map = new Map(Grades.map(g => [g, new Set(GradeMap.get(g))]))
if (profile.lockedTalent) {
result.push(profile.lockedTalent)
const { grade } = talents.get(profile.lockedTalent)!
map.get(grade)!.delete(profile.lockedTalent)
if (profile.locked) {
result.push(...profile.locked)
if (result.length >= options.count) return result
for (const talent of result) {
const { grade } = talents.get(talent)!
map.get(grade)!.delete(talent)
}
}
for (let i = options.count - result.length; i > 0; i--) {
const grade = pickWeight(rate, rng)! ?? 0