From 7616b9f8485353452c303fa4d6efd4742875b575 Mon Sep 17 00:00:00 2001 From: Joe Kirchoff Date: Sat, 6 Apr 2024 16:11:24 -0700 Subject: [PATCH] can only be sure of all parts if 4 or less --- .../src/projects/monsterParts.ts | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/excavator-script/src/projects/monsterParts.ts b/packages/excavator-script/src/projects/monsterParts.ts index 3db127e..7bb210c 100644 --- a/packages/excavator-script/src/projects/monsterParts.ts +++ b/packages/excavator-script/src/projects/monsterParts.ts @@ -263,11 +263,13 @@ function spadeMonsterParts( haveEquipped($item`Everfull Dart Holster`) ) { const buttAwareness = get("everfullDartPerks").includes("Butt awareness"); + const allDartParts = [...page.matchAll(DART_REGEX)].map( + (match) => match[1], + ); + const dartParts = [ ...new Set( - [...page.matchAll(DART_REGEX)] - .map((match) => match[1]) - .filter((part) => !buttAwareness || part !== "butt"), + allDartParts.filter((part) => !buttAwareness || part !== "butt"), ), ]; @@ -282,16 +284,18 @@ function spadeMonsterParts( })), ); - data.push( - ...monsterParts - .filter((part) => !dartParts.includes(part)) - .map((part) => ({ - monster: monster, - part, - confirmation: false, - source: "Everfull Dart Holster", - })), - ); + if (allDartParts.length <= 4) { + data.push( + ...monsterParts + .filter((part) => !dartParts.includes(part)) + .map((part) => ({ + monster: monster, + part, + confirmation: false, + source: "Everfull Dart Holster", + })), + ); + } } return data;