fix: apply event song bonus to final score
Publish GitHub Pages output / publish (push) Successful in 41s

This commit is contained in:
2026-10-04 02:54:02 +09:00
parent 2b26bbd94f
commit 4b8313c8a8
10 changed files with 135 additions and 7 deletions
+23
View File
@@ -38,6 +38,29 @@ test('기본점수의 소수점을 유지하고 가창 보너스 적용 후 노
assert.equal(result.baselineScore, 1_490);
});
test('이벤트 보너스는 가창 보너스와 따로 노트 합계에 곱하고 노트 점수는 유지한다', () => {
const song = { ...chart([
{ timeSeconds: 1, type: 'regular' as const, isFlick: false },
{ timeSeconds: 1.5, type: 'regular' as const, isFlick: true },
{ timeSeconds: 2, type: 'mid' as const, isFlick: false }
]), specialStartSeconds: [1] };
const card = { ...inactiveCard,
active: { cooldownSeconds: 1, durationSeconds: 1, scoreUpPercent: 85, probabilityPercent: 50 },
special: { durationSeconds: 2, scoreUpPercent: 120 }
};
const options = { perfectNoteScore: 1354.507, directSongScoreBonusPercent: 10 };
const ordinary = calculateExactScore([card], {}, song, options);
const event = calculateExactScore([card], {}, song, { ...options, finalScoreBonusPercent: 10 });
for (const key of ['expectedScore', 'theoreticalMaxScore', 'baselineScore', 'withoutSpecialStartBonusScore'] as const) {
assert.equal(event[key], ordinary[key]! * 1.1);
}
assert.deepEqual(event.notes, ordinary.notes);
assert.deepEqual(event.scoreBySecond, ordinary.scoreBySecond);
assert.equal(event.perfectNoteScore, ordinary.perfectNoteScore);
assert.notEqual(event.theoreticalMaxScore,
calculateExactScore([card], {}, song, { ...options, directSongScoreBonusPercent: 20 }).theoreticalMaxScore);
});
test('100콤보부터 1% 콤보 보너스를 적용한다', () => {
const notes = Array.from({ length: 100 }, (_, index) => ({ timeSeconds: index, type: 'regular' as const, isFlick: false }));
const result = calculateExactScore([inactiveCard], {}, chart(notes), { perfectNoteScore: 600 });