From 9bf2f39d8208fe5ce9aae429b48a9d32e2b5fd2d Mon Sep 17 00:00:00 2001 From: Ignose Date: Sun, 3 Dec 2023 02:06:07 -0500 Subject: [PATCH] Optimize gulp latte a bit better --- .gitignore | 1 + src/combat.ts | 1 + src/engine/outfit.ts | 8 +++++++- src/lib.ts | 3 ++- src/main.ts | 7 +++++-- src/relay.ts | 2 +- src/tasks/leveling.ts | 2 +- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 829e741..f574789 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ KoLmafia /scripts/ /relay/ KoLmafia/scripts/folgerCS/folgerCS.js +node_modules diff --git a/src/combat.ts b/src/combat.ts index 3d995fc..3693587 100644 --- a/src/combat.ts +++ b/src/combat.ts @@ -11,6 +11,7 @@ export default class Macro extends StrictMacro { const macroHead = this.trySkill($skill`Curse of Weaksauce`) .trySkill($skill`Micrometeorite`) .trySkill($skill`Sing Along`) + .trySkill($skill`Gulp Latte`) // eslint-disable-next-line libram/verify-constants .trySkill($skill`Surprisingly Sweet Stab`) // eslint-disable-next-line libram/verify-constants diff --git a/src/engine/outfit.ts b/src/engine/outfit.ts index 66ad2d3..dbebd08 100644 --- a/src/engine/outfit.ts +++ b/src/engine/outfit.ts @@ -5,6 +5,8 @@ import { equippedItem, Familiar, Item, + myMaxmp, + myMp, myPrimestat, numericModifier, toInt, @@ -24,6 +26,7 @@ import { } from "libram"; import { camelFightsLeft, statToMaximizerString } from "../lib"; import { args } from "../args"; +import { restoreMPEfficiently } from "../tasks/leveling"; export function garbageShirt(): void { if ( @@ -168,7 +171,10 @@ export function baseOutfit(allowAttackingFamiliars = true): OutfitSpec { ? $item`June cleaver` : undefined, hat: avoidDaylightShavingsHelm() ? undefined : $item`Daylight Shavings Helmet`, - offhand: $item`unbreakable umbrella`, + offhand: + myMaxmp() > 200 && myMp() < 75 && restoreMPEfficiently() === "Gulp" + ? $item`latte lovers member's mug` + : $item`unbreakable umbrella`, back: lovTunnelCompleted ? $item`LOV Epaulettes` : undefined, acc1: have($item`codpiece`) ? $item`codpiece` : undefined, acc2: diff --git a/src/lib.ts b/src/lib.ts index 7725e3b..271290d 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -339,7 +339,8 @@ export function computeCombatFrequency(): number { const kgb = have($item`Kremlin's Greatest Briefcase`) && !get("instant_saveKGBClicks", false) ? -5 : 0; - const accessories = sumNumbers([kgb]); + const atlas = have($item`atlas of local maps`) ? -5 : 0; + const accessories = sumNumbers([kgb, atlas]); const rose = -20; const smoothMovements = have($skill`Smooth Movement`) ? -5 : 0; diff --git a/src/main.ts b/src/main.ts index efa73ac..6b43bb5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,7 +17,7 @@ import { logTestCompletion, simpleDateDiff, } from "./lib"; -import { $item, $stat, get, have, set, sinceKolmafiaRevision } from "libram"; +import { $familiar, $item, $skill, $stat, get, have, set, sinceKolmafiaRevision } from "libram"; import { Engine } from "./engine/engine"; import { Args, getTasks } from "grimoire-kolmafia"; import { Task } from "./engine/task"; @@ -70,7 +70,10 @@ export function main(command?: string): void { cliExecute("refresh all"); const swapMainStatTest = have($item`Deck of Every Card`) && myPrimestat === $stat`Muscle`; - const swapNCandFamTest = computeCombatFrequency() === -100; + const swapNCandFamTest = + computeCombatFrequency() === -100 && + have($familiar`Comma Chameleon`) && + (have($skill`Summon Clip Art`) || have($item`box of Familiar Jacks`)); const tasks: Task[] = getTasks([ RunStartQuest, diff --git a/src/relay.ts b/src/relay.ts index 6996560..a14507c 100644 --- a/src/relay.ts +++ b/src/relay.ts @@ -56,7 +56,7 @@ function convertArgsToHtml(): RelayPage[] { return pages.filter((page) => page.components.length > 0); } -export function main() { +export function main(): void { if (handleApiRequest()) return; write(generateHTML(convertArgsToHtml())); diff --git a/src/tasks/leveling.ts b/src/tasks/leveling.ts index e452f1c..fb51e4c 100644 --- a/src/tasks/leveling.ts +++ b/src/tasks/leveling.ts @@ -127,7 +127,7 @@ const baseBoozes = $items`bottle of rum, boxed wine, bottle of gin, bottle of vo const freeFightMonsters: Monster[] = $monsters`Witchess Bishop, Witchess King, Witchess Witch, sausage goblin, Eldritch Tentacle`; const godLobsterChoice = have($item`God Lobster's Ring`) ? 2 : 3; -function restoreMPEfficiently(): string { +export function restoreMPEfficiently(): string { if (have($item`magical sausage`)) return "Sausage"; if (!get("_latteDrinkUsed", false) && have($item`latte lovers member's mug`)) return "Gulp"; if (have($item`magical sausage casing`) && myMeat() >= 3000) return "Make Sausage";