mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
Exclude any "combo" that contains 100dmg or more segment
Follow-up/fix to 49ea49a30b
This commit is contained in:
parent
fce481982a
commit
dff8b39ac6
|
|
@ -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", () => {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user