From 33a24ebb647963dfa3145dcef982792900218efe Mon Sep 17 00:00:00 2001 From: Kiwi Tokoeka Date: Fri, 6 Jun 2025 09:52:13 +0100 Subject: [PATCH 1/2] check canEquip --- src/utils.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/utils.ts b/src/utils.ts index d9a7654..0055f85 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,6 @@ import { beretBuskingEffects, + canEquip, Effect, getPower, Item, @@ -89,12 +90,21 @@ 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) { + if (!canEquip(shirt)) { + continue; + } const pantsPower = have($skill`Tao of the Terrapin`) ? taoMultiplier * getPower(pants) : getPower(pants); From 929c21f41ce5e58338a68cbb3990330b583219d2 Mon Sep 17 00:00:00 2001 From: Kiwi Tokoeka Date: Fri, 6 Jun 2025 15:14:15 +0100 Subject: [PATCH 2/2] actually look at pants, and consider hammertime --- src/utils.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 0055f85..63b544d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -11,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 { @@ -29,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[], @@ -102,12 +103,12 @@ function reconstructOutfit(daRaw: number): { hat?: Item; shirt?: Item; pants?: I } const shirtPower = getPower(shirt); for (const pants of allPants) { - if (!canEquip(shirt)) { + if (!canEquip(pants)) { continue; } - const pantsPower = have($skill`Tao of the Terrapin`) - ? taoMultiplier * getPower(pants) - : getPower(pants); + 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 }; }