Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
beretBuskingEffects,
canEquip,
Effect,
getPower,
Item,
Expand All @@ -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 {
Expand All @@ -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[],
Expand Down Expand Up @@ -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 };
}
Expand Down