Skip to content

Commit

Permalink
actually use it
Browse files Browse the repository at this point in the history
  • Loading branch information
horrible-little-slime committed Dec 23, 2024
1 parent 1934d6a commit 7cf4196
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 292 deletions.
8 changes: 5 additions & 3 deletions packages/garbo-lib/src/resources/autumnaton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export class AutumnAtonManager {
}: Partial<AutumnAtonOptions>) {
if (averageItemValue) this.averageItemValue = averageItemValue;
if (estimatedTurns) this.estimatedTurns = estimatedTurns;
if (estimatedTurnsTomorrow)
if (estimatedTurnsTomorrow) {
this.estimatedTurnsTomorrow = estimatedTurnsTomorrow;
}
}

bestLocation(locations: Location[]): Location {
Expand Down Expand Up @@ -87,8 +88,9 @@ export class AutumnAtonManager {
acuityOverride?: number,
slotOverride?: number,
): number {
if (location === $location`Shadow Rift`)
setLocation($location`Shadow Rift`); // FIXME This bypasses a mafia bug where ingress is not updated
if (location === $location`Shadow Rift`) {
setLocation($location`Shadow Rift`);
} // FIXME This bypasses a mafia bug where ingress is not updated
const rates = appearanceRates(location);
const monsters = getMonsters(location).filter(
(m) =>
Expand Down
285 changes: 0 additions & 285 deletions packages/garbo/src/resources/autumnaton.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/garbo/src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export * from "./scepter";
export * from "./candyMap";
export * from "./gingerbread";
export * from "./worksheds";
export * from "./autumnaton";
export * from "./extrovermectin";
export * from "./realm";
export * from "./synthesis";
Expand Down
19 changes: 16 additions & 3 deletions packages/garbo/src/tasks/post/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,32 @@ import {
} from "../../lib";
import { teleportEffects } from "../../mood";
import { Quest } from "grimoire-kolmafia";
import { bestAutumnatonLocation } from "../../resources";
import { estimatedGarboTurns, remainingUserTurns } from "../../turns";
import {
estimatedGarboTurns,
estimatedTurnsTomorrow,
remainingUserTurns,
} from "../../turns";
import { acquire } from "../../acquire";
import { garboAverageValue } from "../../garboValue";
import workshedTasks from "./worksheds";
import { GarboPostTask } from "./lib";
import { GarboTask } from "../engine";
import { hotTubAvailable } from "../../resources/clanVIP";
import { lavaDogsAccessible, lavaDogsComplete } from "../../resources/doghouse";
import { AutumnAtonManager } from "garbo-lib";

const STUFF_TO_CLOSET = $items`bowling ball, funky junk key`;
const STUFF_TO_USE = $items`Armory keycard, bottle-opener keycard, SHAWARMA Initiative Keycard`;

let _autumnAtonManager: AutumnAtonManager;
const autumnAtonManager = () =>
(_autumnAtonManager ??= new AutumnAtonManager({
averageItemValue: garboAverageValue,
estimatedTurns: estimatedGarboTurns,
estimatedTurnsTomorrow: () =>
globalOptions.ascend ? 0 : estimatedTurnsTomorrow,
}));

function closetStuff(): GarboPostTask {
return {
name: "Closet Stuff",
Expand Down Expand Up @@ -214,7 +227,7 @@ function fallbot(): GarboPostTask {
globalOptions.ascend ||
AutumnAton.turnsForQuest() < estimatedGarboTurns() + remainingUserTurns(),
do: () => {
AutumnAton.sendTo(bestAutumnatonLocation);
AutumnAton.sendTo(autumnAtonManager().bestLocation);
},
available: () => AutumnAton.have(),
post: () => {
Expand Down

0 comments on commit 7cf4196

Please sign in to comment.