Skip to content

Commit

Permalink
can only be sure of all parts if 4 or less
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinn committed Apr 6, 2024
1 parent 26b7732 commit 7616b9f
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions packages/excavator-script/src/projects/monsterParts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
),
];

Expand All @@ -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;
Expand Down

0 comments on commit 7616b9f

Please sign in to comment.