feat: release version 1.0.7
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import scoreCalibrations from '../../../data/score-calibrations.json' with { type: 'json' };
|
||||
import { calculateExactScore, perfectNoteScoreFromPower, scoreRatioFromNotes } from './index.ts';
|
||||
import type { ExactSongChart, OptimizerCard } from './types.ts';
|
||||
|
||||
@@ -74,3 +75,49 @@ test('액티브 발동 확률과 스페셜 스코어 서포트를 기대 점수
|
||||
assert.equal(result.expectedScore, 1_200);
|
||||
assert.equal(result.theoreticalMaxScore, 1_800);
|
||||
});
|
||||
|
||||
test('블루 보드와 스페셜의 발동률 증가 배율을 합산해 기대 점수에 반영한다', () => {
|
||||
const main: OptimizerCard = {
|
||||
id: 'main',
|
||||
name: '메인',
|
||||
active: {
|
||||
cooldownSeconds: 1,
|
||||
durationSeconds: 1,
|
||||
scoreUpPercent: 100,
|
||||
probabilityPercent: 55,
|
||||
activationRateUpPercent: 30
|
||||
},
|
||||
special: { durationSeconds: 0, scoreUpPercent: 0 }
|
||||
};
|
||||
const support: OptimizerCard = {
|
||||
id: 'support',
|
||||
name: '서포트',
|
||||
active: { cooldownSeconds: 999, durationSeconds: 0, scoreUpPercent: 0, probabilityPercent: 0 },
|
||||
special: { durationSeconds: 3, scoreUpPercent: 0, activationRateUpPercent: 40 }
|
||||
};
|
||||
const result = calculateExactScore([main, support], {}, {
|
||||
...chart([{ timeSeconds: 1, type: 'regular', isFlick: false }]),
|
||||
specialStartSeconds: [null, 0]
|
||||
}, { perfectNoteScore: 100 });
|
||||
|
||||
assert.equal(result.expectedScore, 194);
|
||||
assert.equal(result.theoreticalMaxScore, 200);
|
||||
});
|
||||
|
||||
test('등록된 실측 ratio가 모든 1노트 측정값을 재현한다', () => {
|
||||
for (const calibration of scoreCalibrations.charts) {
|
||||
for (const measurement of calibration.measurements) {
|
||||
const result = calculateExactScore([inactiveCard], {}, chart([
|
||||
{ timeSeconds: 1, type: 'regular', isFlick: false }
|
||||
]), {
|
||||
perfectNoteScore: measurement.overallPower / calibration.scoreRatio,
|
||||
directSongScoreBonusPercent: measurement.directSongScoreBonusPercent
|
||||
});
|
||||
assert.equal(
|
||||
result.baselineScore,
|
||||
measurement.normalPerfectScore,
|
||||
`${calibration.songId} ${calibration.difficulty}`
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user