Skip to content

Commit

Permalink
cache worm check (#2133)
Browse files Browse the repository at this point in the history
  • Loading branch information
horrible-little-slime authored Sep 26, 2024
1 parent 8caffed commit ab569a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/garbo/src/tasks/freeGiantSandworm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,17 @@ export function possibleFreeGiantSandwormQuestTentacleFights(): number {
);
}

let _hasWorms: boolean;
function hasWorms(): boolean {
return (_hasWorms ??= expectedFreeGiantSandwormQuestFights() > 0);
}

// Use free fights on melanges if prices are reasonable
export const FreeGiantSandwormQuest: Quest<GarboTask> = {
name: "Free Giant Sandworm",
tasks: SandwormTasks,
ready: () =>
sober() &&
expectedFreeGiantSandwormQuestFights() > 0 &&
hasWorms() &&
mallPrice($item`drum machine`) < 0.01 * mallPrice($item`spice melange`),
};

0 comments on commit ab569a0

Please sign in to comment.