forked from phenom/healer-man
Release Healer Man 0.1.7
This commit is contained in:
1 parent
b12fb84859
commit
eca6b5db9b
99 files changed
+1931
-150
No files matched your search
@@ -14,18 +14,25 @@ function planKey(classId: ClassId, specialization: string): string {
|
||||
return `${classId}:${specialization}`;
|
||||
}
|
||||
|
||||
export function runtimePartyTalentPlan(
|
||||
classId: ClassId,
|
||||
specialization: string,
|
||||
): readonly string[] {
|
||||
const plan = snapshot.plans[planKey(classId, specialization)];
|
||||
if (!plan) throw new Error(`Unsupported party specialization: ${classId}:${specialization}`);
|
||||
return plan;
|
||||
}
|
||||
|
||||
/** Runtime-only projection of the catalog-validated 71-point party plans. */
|
||||
export function runtimePartyTalentRanksForLevel(
|
||||
classId: ClassId,
|
||||
specialization: string,
|
||||
level: number,
|
||||
): TalentRanks {
|
||||
const plan = snapshot.plans[planKey(classId, specialization)];
|
||||
if (!plan) throw new Error(`Unsupported party specialization: ${classId}:${specialization}`);
|
||||
const plan = runtimePartyTalentPlan(classId, specialization);
|
||||
const safeLevel = Number.isFinite(level) ? Math.max(1, Math.min(80, Math.trunc(level))) : 1;
|
||||
const points = Math.max(0, safeLevel - 9);
|
||||
const ranks: Record<string, number> = {};
|
||||
for (const nodeId of plan.slice(0, points)) ranks[nodeId] = (ranks[nodeId] ?? 0) + 1;
|
||||
return Object.freeze(ranks);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user