feat: simulate individual active skill failures in analysis
Publish GitHub Pages output / publish (push) Successful in 45s

This commit is contained in:
dal4segno committed 2026-09-08 12:46:00 +09:00
1 parent dad8b2c53a
commit 795bf47e80
7 files changed
+126 -24

No files matched your search

+6 -4
View File
@@ -99,10 +99,11 @@ function makeProfiles(order: readonly OptimizerCard[], chart: ExactSongChart): M
return profiles;
}
function resultWindows(
export function buildExactSkillWindows(
order: readonly OptimizerCard[],
reductions: Readonly<Record<string, CooldownReduction>>,
chart: ExactSongChart
chart: ExactSongChart,
excludedActiveWindows: readonly Pick<SkillWindow, 'cardId' | 'startSeconds'>[] = []
): { activeWindows: SkillWindow[]; effectiveActiveWindows: EffectiveSkillWindow[]; specialWindows: SkillWindow[] } {
const activeWindows = order.flatMap((card) => {
const interval = effectiveCooldownSeconds(card.active.cooldownSeconds, reductions[card.id] ?? 0);
@@ -143,7 +144,8 @@ function resultWindows(
const midpoint = (startSeconds + endSeconds) / 2;
const specialSupport = specialRate(order, chart, midpoint, 'scoreUpPercent');
const active = activeWindows
.filter((window) => window.startSeconds <= midpoint && midpoint < window.endSeconds)
.filter((window) => window.startSeconds <= midpoint && midpoint < window.endSeconds &&
!excludedActiveWindows.some((excluded) => excluded.cardId === window.cardId && Math.abs(excluded.startSeconds - window.startSeconds) < 1e-9))
.map((window) => {
const cardIndex = orderIndex.get(window.cardId) ?? 0;
const card = order[cardIndex];
@@ -265,7 +267,7 @@ export function optimizeExactOrderAndCooldowns(
}
if (!bestOrder || !bestReductions) throw new Error('분석 결과를 만들지 못했습니다.');
const windows = resultWindows(bestOrder, bestReductions, chart);
const windows = buildExactSkillWindows(bestOrder, bestReductions, chart);
return {
...calculateExactScore(bestOrder, bestReductions, chart, options),
order: bestOrder.map((card) => card.id),