diff --git a/src/lib.ts b/src/lib.ts index 3278b4c..267bbb2 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -2,6 +2,7 @@ import { Args } from "grimoire-kolmafia"; import { descToItem, + haveEquipped, inebrietyLimit, isDarkMode, Item, @@ -20,12 +21,15 @@ import { $location, $monster, Counter, + CrystalBall, flat, get, have, SourceTerminal, } from "libram"; +import * as OrbManager from "./orbmanager"; + export function shouldRedigitize(): boolean { const digitizesLeft = SourceTerminal.getDigitizeUsesRemaining(); const monsterCount = SourceTerminal.getDigitizeMonsterCount() + 1; @@ -306,6 +310,6 @@ export function digitizedMonstersRemaining(): number { ); } -export function toasterGazeIfNecessary(): void { - // nope +export function shrineGazeIfNecessary(): void { + if (getOrbTarget() && !haveEquipped(CrystalBall.orb)) OrbManager.shrineGaze(); } diff --git a/src/orbmanager.ts b/src/orbmanager.ts index c679c62..c4e96e4 100644 --- a/src/orbmanager.ts +++ b/src/orbmanager.ts @@ -1,15 +1,14 @@ import { canAdventure, + equip, Location, Monster, - retrieveItem, + print, runChoice, toUrl, visitUrl, } from "kolmafia"; -import { $item, $location, CrystalBall, have } from "libram"; - -import { printd, printh } from "./lib"; +import { $location, CrystalBall, get } from "libram"; let currentPonder = CrystalBall.ponder(); let ponderIsValid = true; @@ -27,21 +26,26 @@ export function invalidate(): void { ponderIsValid = false; } -export function toasterGaze(): void { - const shore = $location`The Shore, Inc. Travel Agency`; - const pass = $item`Desert Bus pass`; - if (!canAdventure(shore) && !have(pass)) { - retrieveItem(pass); - } +export function shrineGaze(): void { + if (get("hiddenBowlingAlleyProgress") !== 8) return; + + const shrine = $location`An Overgrown Shrine (Southeast)`; + + if (!canAdventure(shrine)) return; + try { - const store = visitUrl(toUrl(shore)); - if (!store.includes("Check out the gift shop")) { - printh("Unable to stare longingly at toast"); + print("Gazing at a shrine to reset the orb prediction"); + equip(CrystalBall.orb); + const encounter = visitUrl(toUrl(shrine)); + if (!encounter.includes("Fire When Ready")) { + print("Unable to stare longingly at a shrine ball cradle"); } - runChoice(4); + // Walk away + runChoice(6); } catch (e) { - printd(`We ran into an issue when gazing at toast: ${e}.`); - } finally { - visitUrl("main.php"); + print( + `We ran into an issue when gazing at a shrine for balls: ${e}.`, + "red" + ); } } diff --git a/src/zones/armory.ts b/src/zones/armory.ts index da0f763..c83ad6d 100644 --- a/src/zones/armory.ts +++ b/src/zones/armory.ts @@ -2,7 +2,7 @@ import { toSkill } from "kolmafia"; import { $effects, $location, have } from "libram"; import { CrimboQuest, CrimboStrategy } from "../engine"; -import { toasterGazeIfNecessary } from "../lib"; +import { shrineGazeIfNecessary } from "../lib"; import Macro from "../macro"; import { affiliationSpec, chooseQuestOutfit, drunkSpec, orbSpec } from "../outfit"; @@ -27,7 +27,7 @@ const armory: CrimboQuest = { $effects`Blood Bond, Empathy, Leash of Linguini`.filter((effect) => have(toSkill(effect))), combat: new CrimboStrategy(() => Macro.standardCombat()), sobriety: "either", - post: toasterGazeIfNecessary, + post: shrineGazeIfNecessary, }, ], }; diff --git a/src/zones/bar.ts b/src/zones/bar.ts index bad4ac2..e27adad 100644 --- a/src/zones/bar.ts +++ b/src/zones/bar.ts @@ -2,7 +2,7 @@ import { toSkill } from "kolmafia"; import { $effects, $location, have } from "libram"; import { CrimboQuest, CrimboStrategy } from "../engine"; -import { toasterGazeIfNecessary } from "../lib"; +import { shrineGazeIfNecessary } from "../lib"; import Macro from "../macro"; import { affiliationSpec, chooseQuestOutfit, drunkSpec, orbSpec } from "../outfit"; @@ -27,7 +27,7 @@ const bar: CrimboQuest = { $effects`Blood Bond, Empathy, Leash of Linguini`.filter((effect) => have(toSkill(effect))), combat: new CrimboStrategy(() => Macro.standardCombat()), sobriety: "either", - post: toasterGazeIfNecessary, + post: shrineGazeIfNecessary, }, ], }; diff --git a/src/zones/cafe.ts b/src/zones/cafe.ts index 5411c4f..1089041 100644 --- a/src/zones/cafe.ts +++ b/src/zones/cafe.ts @@ -2,7 +2,7 @@ import { toSkill } from "kolmafia"; import { $effects, $location, have } from "libram"; import { CrimboQuest, CrimboStrategy } from "../engine"; -import { toasterGazeIfNecessary } from "../lib"; +import { shrineGazeIfNecessary } from "../lib"; import Macro from "../macro"; import { affiliationSpec, chooseQuestOutfit, drunkSpec, orbSpec } from "../outfit"; @@ -27,7 +27,7 @@ const cafe: CrimboQuest = { $effects`Blood Bond, Empathy, Leash of Linguini`.filter((effect) => have(toSkill(effect))), combat: new CrimboStrategy(() => Macro.standardCombat()), sobriety: "either", - post: toasterGazeIfNecessary, + post: shrineGazeIfNecessary, }, ], }; diff --git a/src/zones/cottage.ts b/src/zones/cottage.ts index c560282..4aa3e1a 100644 --- a/src/zones/cottage.ts +++ b/src/zones/cottage.ts @@ -2,7 +2,7 @@ import { toSkill } from "kolmafia"; import { $effects, $location, have } from "libram"; import { CrimboQuest, CrimboStrategy } from "../engine"; -import { toasterGazeIfNecessary } from "../lib"; +import { shrineGazeIfNecessary } from "../lib"; import Macro from "../macro"; import { affiliationSpec, chooseQuestOutfit, drunkSpec, orbSpec } from "../outfit"; @@ -27,7 +27,7 @@ const cottage: CrimboQuest = { $effects`Blood Bond, Empathy, Leash of Linguini`.filter((effect) => have(toSkill(effect))), combat: new CrimboStrategy(() => Macro.standardCombat()), sobriety: "either", - post: toasterGazeIfNecessary, + post: shrineGazeIfNecessary, }, ], }; diff --git a/src/zones/foundry.ts b/src/zones/foundry.ts index bbc9316..0ccb65e 100644 --- a/src/zones/foundry.ts +++ b/src/zones/foundry.ts @@ -2,7 +2,7 @@ import { toSkill } from "kolmafia"; import { $effects, $location, have } from "libram"; import { CrimboQuest, CrimboStrategy } from "../engine"; -import { toasterGazeIfNecessary } from "../lib"; +import { shrineGazeIfNecessary } from "../lib"; import Macro from "../macro"; import { affiliationSpec, chooseQuestOutfit, drunkSpec, orbSpec } from "../outfit"; @@ -27,7 +27,7 @@ const foundry: CrimboQuest = { $effects`Blood Bond, Empathy, Leash of Linguini`.filter((effect) => have(toSkill(effect))), combat: new CrimboStrategy(() => Macro.standardCombat()), sobriety: "either", - post: toasterGazeIfNecessary, + post: shrineGazeIfNecessary, }, ], };