fix: round base card stats up to match in-game power
Publish GitHub Pages output / publish (push) Successful in 44s
Publish GitHub Pages output / publish (push) Successful in 44s
This commit is contained in:
@@ -1,7 +1,51 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { calculateUnitPower, type UnitPowerCard } from './unit-power.ts';
|
||||
|
||||
test('실제 카드 데이터로 2026-09-06 인게임 종합력의 모든 항목을 재현한다', () => {
|
||||
const catalog = JSON.parse(readFileSync(new URL('../data/cards-summary.json', import.meta.url), 'utf8')) as {
|
||||
cards: (UnitPowerCard & { details: { costume: { name: string; description: string } } })[];
|
||||
};
|
||||
const findCard = (id: string) => {
|
||||
const found = catalog.cards.find((entry) => entry.id === id);
|
||||
assert.ok(found, id);
|
||||
return found;
|
||||
};
|
||||
// Screenshot formation: Fubuki, Matsuri, Botan, Kobo, Flare; Baelz costume.
|
||||
// Only the effective board stats are retained from the supplied backup.
|
||||
const ids = [
|
||||
'card-00006-5-uniq-0007-00', 'card-00007-5-uniq-0008-00',
|
||||
'card-00032-5-uniq-0026-00', 'card-03009-5-uniq-0041-00',
|
||||
'card-00021-5-uniq-0017-00'
|
||||
];
|
||||
const awakenings = [3, 3, 5, 3, 2];
|
||||
const flats = [[4914, 5109, 5721], [4797, 5240, 5604], [4794, 4989, 5811], [4964, 5159, 5771], [4597, 5040, 5404]];
|
||||
const result = calculateUnitPower(
|
||||
ids.map((id, index) => ({ card: findCard(id), awakening: awakenings[index] })),
|
||||
findCard('card-04012-5-uniq-0051-00').details.costume,
|
||||
{
|
||||
flatByCardId: Object.fromEntries(ids.map((id, index) => [id, {
|
||||
performance: flats[index][0], technique: flats[index][1], sense: flats[index][2]
|
||||
}])),
|
||||
rateByCardId: Object.fromEntries(ids.map((id) => [id, { performance: 28, technique: 28, sense: 28 }]))
|
||||
},
|
||||
58,
|
||||
4.13
|
||||
);
|
||||
assert.deepEqual(result, {
|
||||
overallPower: 371616,
|
||||
baseParameterTotal: 117966,
|
||||
potentialTotal: 11805,
|
||||
passiveTotal: 34087,
|
||||
outfitTotal: 71524,
|
||||
boardTotal: 114256,
|
||||
memoryTotal: 7536,
|
||||
memberPowerUpTotal: 14442,
|
||||
outfitScoreSupportPercent: 0
|
||||
});
|
||||
});
|
||||
|
||||
function card(id: string, passive: string, awakenedPassive = passive): UnitPowerCard {
|
||||
return {
|
||||
id,
|
||||
|
||||
Reference in New Issue
Block a user