From dff8b39ac6d5b86bd778f007a15cd84bc4092aff Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Wed, 21 Jan 2026 22:34:58 +0200 Subject: [PATCH] Exclude any "combo" that contains 100dmg or more segment Follow-up/fix to 49ea49a30b5a987470de7b8a79f1d2652214d92b --- .../core/damage-combinations.test.ts | 25 ++----------------- .../comp-analyzer/core/damage-combinations.ts | 8 +++--- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/app/features/comp-analyzer/core/damage-combinations.test.ts b/app/features/comp-analyzer/core/damage-combinations.test.ts index d307097c2..dfc6ffa90 100644 --- a/app/features/comp-analyzer/core/damage-combinations.test.ts +++ b/app/features/comp-analyzer/core/damage-combinations.test.ts @@ -172,35 +172,14 @@ describe("calculateDamageCombos - threshold filtering", () => { }); describe("calculateDamageCombos - one-shot exclusion", () => { - test("excludes combos where main/special hit one-shots without sub", () => { + test("excludes all combos containing a 100+ damage hit", () => { const combos = calculateDamageCombos([SPLAT_CHARGER_ID, SPLATTERSHOT_ID]); for (const combo of combos) { - const hasNoSubWeapon = combo.segments.every((s) => !s.isSubWeapon); const hasOneShot = combo.segments.some((s) => s.damageValue >= 100); - - const isInvalidCombo = hasNoSubWeapon && hasOneShot; - expect(isInvalidCombo).toBe(false); + expect(hasOneShot).toBe(false); } }); - - test("keeps combos with 100+ damage when sub weapon is present", () => { - const combos = calculateDamageCombos([SPLAT_CHARGER_ID, SPLATTERSHOT_ID]); - - const comboWithSubAndOneShot = combos.find((combo) => { - const hasSub = combo.segments.some((s) => s.isSubWeapon); - const hasOneShot = combo.segments.some((s) => s.damageValue >= 100); - return hasSub && hasOneShot; - }); - - expect(comboWithSubAndOneShot).toBeDefined(); - expect(comboWithSubAndOneShot!.segments.some((s) => s.isSubWeapon)).toBe( - true, - ); - expect( - comboWithSubAndOneShot!.segments.some((s) => s.damageValue >= 100), - ).toBe(true); - }); }); describe("calculateDamageCombos - sorting", () => { diff --git a/app/features/comp-analyzer/core/damage-combinations.ts b/app/features/comp-analyzer/core/damage-combinations.ts index 1660e00a1..f6dfe3232 100644 --- a/app/features/comp-analyzer/core/damage-combinations.ts +++ b/app/features/comp-analyzer/core/damage-combinations.ts @@ -307,7 +307,7 @@ function filterAndSortCombos(combos: DamageCombo[]): DamageCombo[] { return false; } - if (hasOneShotWithoutSub(combo)) { + if (hasOneShot(combo)) { return false; } @@ -326,10 +326,8 @@ function filterAndSortCombos(combos: DamageCombo[]): DamageCombo[] { return filtered.slice(0, MAX_COMBOS_DISPLAYED); } -function hasOneShotWithoutSub(combo: DamageCombo): boolean { - const hasNoSubWeapon = combo.segments.every((s) => !s.isSubWeapon); - const hasOneShot = combo.segments.some((s) => s.damageValue >= 100); - return hasNoSubWeapon && hasOneShot; +function hasOneShot(combo: DamageCombo): boolean { + return combo.segments.some((s) => s.damageValue >= 100); } const SPLASH_O_MATIC_ID = 20;