Skip to content

Commit

Permalink
Optimize gulp latte a bit better
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignose committed Dec 3, 2023
1 parent caf92ac commit 9bf2f39
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ KoLmafia
/scripts/
/relay/
KoLmafia/scripts/folgerCS/folgerCS.js
node_modules
1 change: 1 addition & 0 deletions src/combat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion src/engine/outfit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {
equippedItem,
Familiar,
Item,
myMaxmp,
myMp,
myPrimestat,
numericModifier,
toInt,
Expand All @@ -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 (
Expand Down Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/relay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/leveling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 9bf2f39

Please sign in to comment.