mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-30 15:17:43 -05:00
Fix ink consumption grid rounding bug
This commit is contained in:
@@ -253,6 +253,36 @@ describe("Analyze build", () => {
|
||||
).toBe(roundToNDecimalPlaces((jrParams.InkConsume! * 100) / 1.1));
|
||||
});
|
||||
|
||||
test.each([
|
||||
{ why: "Sploosh 64.995", weaponSplId: 0, iss: 9, ism: 16, expected: 64.99 },
|
||||
{
|
||||
why: "Sploosh 101.998",
|
||||
weaponSplId: 0,
|
||||
iss: 15,
|
||||
ism: 57,
|
||||
expected: 101.99,
|
||||
},
|
||||
{ why: "Jr. just under 100", weaponSplId: 10, iss: 3, ism: 1, expected: 99.99 },
|
||||
] as const)(
|
||||
"Full ink tank actions are truncated, not rounded up ($why)",
|
||||
({ weaponSplId, iss, ism, expected }) => {
|
||||
const analyzed = buildStats({
|
||||
weaponSplId,
|
||||
abilityPoints: new Map([
|
||||
["ISS", iss],
|
||||
["ISM", ism],
|
||||
]),
|
||||
hasTacticooler: false,
|
||||
});
|
||||
|
||||
const oneSubOption = analyzed.stats.fullInkTankOptions.find(
|
||||
(option) => option.subsUsed === 1,
|
||||
);
|
||||
|
||||
expect(oneSubOption?.value).toBe(expected);
|
||||
},
|
||||
);
|
||||
|
||||
test("Sub Power Up Beakon AP boost matches Lean", () => {
|
||||
for (const [subPowerAp, quickSuperJumpAp] of subPowerApToQuickSuperJumpAp) {
|
||||
const analyzed = buildStats({
|
||||
|
||||
@@ -316,11 +316,10 @@ export function fullInkTankOptions(
|
||||
id: nanoid(),
|
||||
subsUsed: subsFromFullInkTank,
|
||||
type,
|
||||
value: effectToRounded(
|
||||
value: cutToNDecimalPlaces(
|
||||
(inkTankSize(args.weaponSplId) -
|
||||
subWeaponInkConsume * subsFromFullInkTank) /
|
||||
mainWeaponInkConsume,
|
||||
2,
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
5
changelog/2026-09-25-ink-tank-actions-rounding.md
Normal file
5
changelog/2026-09-25-ink-tank-actions-rounding.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
navItem: analyzer
|
||||
type: bug
|
||||
---
|
||||
Build analyzer no longer shows one extra action from a full ink tank when the true count falls just short of the next whole number
|
||||
Reference in New Issue
Block a user