diff --git a/src/utils.ts b/src/utils.ts index d9a7654..63b544d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,6 @@ import { beretBuskingEffects, + canEquip, Effect, getPower, Item, @@ -10,7 +11,7 @@ import { toInt, toSlot, } from "kolmafia"; -import { $familiar, $item, $skill, $slot, clamp, get, have, sum } from "libram"; +import { $effect, $familiar, $item, $skill, $slot, clamp, get, have, sum } from "libram"; import { args } from "./main"; export interface Busk { @@ -28,6 +29,7 @@ export interface BuskResult { // eslint-disable-next-line libram/verify-constants const beret = $item`prismatic beret`; const taoMultiplier = have($skill`Tao of the Terrapin`) ? 2 : 1; +const hammerMult = have($effect`Hammertime`) ? 3 : 0; function scoreBusk( effects: Effect[], @@ -89,15 +91,24 @@ export function findTopBusksFast( function reconstructOutfit(daRaw: number): { hat?: Item; shirt?: Item; pants?: Item } { for (const hat of allHats) { + if (!canEquip(hat)) { + continue; + } const hatPower = have($skill`Tao of the Terrapin`) ? taoMultiplier * getPower(hat) : getPower(hat); for (const shirt of allShirts) { + if (!canEquip(shirt)) { + continue; + } const shirtPower = getPower(shirt); for (const pants of allPants) { - const pantsPower = have($skill`Tao of the Terrapin`) - ? taoMultiplier * getPower(pants) - : getPower(pants); + if (!canEquip(pants)) { + continue; + } + const pantsPower = + (have($skill`Tao of the Terrapin`) ? taoMultiplier * getPower(pants) : getPower(pants)) + + hammerMult * getPower(pants); if (shirtPower + hatPower + pantsPower === daRaw) { return { hat, shirt, pants }; }