Skip to content

Commit

Permalink
Grimoirize-more-fights (#1764)
Browse files Browse the repository at this point in the history
* grimoirize kramco fight

* route exports though index for resources

* don't make them default exports anymore

* fix imports more

* final linting problems
  • Loading branch information
horrible-little-slime authored Dec 11, 2023
1 parent ed5eb53 commit da26d6c
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 36 deletions.
4 changes: 1 addition & 3 deletions packages/garbo/src/diet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import { acquire, priceCaps } from "./acquire";
import { withVIPClan } from "./clan";
import { globalOptions } from "./config";
import { embezzlerCount } from "./embezzler";
import { expectedGregs } from "./resources/extrovermectin";
import { expectedGregs, shouldAugustCast, synthesize } from "./resources";
import {
arrayEquals,
baseMeat,
Expand All @@ -81,10 +81,8 @@ import {
} from "./lib";
import { shrugBadEffects } from "./mood";
import { Potion, PotionTier } from "./potions";
import synthesize from "./resources/synthesis";
import { estimatedGarboTurns } from "./turns";
import { garboValue } from "./garboValue";
import { shouldAugustCast } from "./resources";

const MPA = get("valueOfAdventure");
print(`Using adventure value ${MPA}.`, HIGHLIGHT);
Expand Down
4 changes: 2 additions & 2 deletions packages/garbo/src/embezzler/fights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import {
Macro,
withMacro,
} from "../combat";
import { shouldAugustCast } from "../resources";
import {
averageEmbezzlerNet,
embezzler,
Expand All @@ -67,7 +66,8 @@ import {
equipOrbIfDesired,
gregReady,
possibleGregCrystalBall,
} from "../resources/extrovermectin";
shouldAugustCast,
} from "../resources";
import { acquire } from "../acquire";
import { globalOptions } from "../config";

Expand Down
19 changes: 3 additions & 16 deletions packages/garbo/src/fights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ import {
getNextEmbezzlerFight,
} from "./embezzler";
import {
bestMidnightAvailable,
crateStrategy,
doingGregFight,
faxMonster,
gregReady,
initializeExtrovermectinZones,
saberCrateIfSafe,
} from "./resources/extrovermectin";
} from "./resources";
import {
bestFairy,
freeFightFamiliar,
Expand Down Expand Up @@ -174,10 +176,8 @@ import { garboValue } from "./garboValue";
import { wanderer } from "./garboWanderer";
import { runEmbezzlerFight } from "./embezzler/execution";
import { EmbezzlerFightRunOptions } from "./embezzler/staging";
import { faxMonster } from "./resources/fax";
import { FreeFightQuest, runGarboQuests } from "./tasks";
import { expectedFreeFights, possibleTentacleFights } from "./tasks/freeFight";
import { bestMidnightAvailable } from "./resources";
import { PostQuest } from "./tasks/post";

const firstChainMacro = () =>
Expand Down Expand Up @@ -1035,19 +1035,6 @@ const freeFightSources = [
pygmyOptions(),
),

new FreeFight(
() => get("_sausageFights") === 0 && have($item`Kramco Sausage-o-Matic™`),
() => {
propertyManager.setChoices(wanderer().getChoices("wanderer"));
adv1(wanderer().getTarget("wanderer"), -1, "");
},
true,
{
spec: { offhand: $item`Kramco Sausage-o-Matic™` },
wandererOptions: "wanderer",
},
),

new FreeFight(
() =>
get("questL11Ron") === "finished"
Expand Down
4 changes: 1 addition & 3 deletions packages/garbo/src/resources/autumnaton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ import { globalOptions } from "../config";
const locationBanlist = $locations`The Daily Dungeon`; // The Daily Dungeon has no native monsters
const badAttributes = ["LUCKY", "ULTRARARE", "BOSS"];

export default function bestAutumnatonLocation(
locations: Location[],
): Location {
export function bestAutumnatonLocation(locations: Location[]): Location {
return maxBy(bestLocationsByUpgrade(locations), averageAutumnatonValue);
}

Expand Down
5 changes: 5 additions & 0 deletions packages/garbo/src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ export * from "./scepter";
export * from "./candyMap";
export * from "./gingerbread";
export * from "./worksheds";
export * from "./autumnaton";
export * from "./extrovermectin";
export * from "./fax";
export * from "./realm";
export * from "./synthesis";
2 changes: 1 addition & 1 deletion packages/garbo/src/resources/synthesis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const blockList = new Set([
$item`vitachoconutriment capsule`,
]);

export default function synthesize(casts: number, effect: Effect): void {
export function synthesize(casts: number, effect: Effect): void {
const saveLimit = 1;
const buyableCandies = $items
.all()
Expand Down
3 changes: 1 addition & 2 deletions packages/garbo/src/tasks/barfTurn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ import { deliverThesisIfAble } from "../fights";
import { computeDiet, consumeDiet } from "../diet";

import { GarboTask } from "./engine";
import { completeBarfQuest } from "../resources/realm";
import { garboValue } from "../garboValue";
import { bestMidnightAvailable } from "../resources";
import { bestMidnightAvailable, completeBarfQuest } from "../resources";
import { acquire } from "../acquire";

const steveAdventures: Map<Location, number[]> = new Map([
Expand Down
2 changes: 1 addition & 1 deletion packages/garbo/src/tasks/daily.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ import {
attemptCompletingBarfQuest,
checkBarfQuest,
checkVolcanoQuest,
} from "../resources/realm";
} from "../resources";

const closetItems = $items`4-d camera, sand dollar, unfinished ice sculpture`;
const retrieveItems = $items`Half a Purse, seal tooth, The Jokester's gun`;
Expand Down
7 changes: 5 additions & 2 deletions packages/garbo/src/tasks/dailyItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ import { coinmasterPrice } from "../lib";
import { rufusPotion } from "../potions";
import { garboAverageValue, garboValue } from "../garboValue";
import { GarboTask } from "./engine";
import { augustSummonTasks, candyMapDailyTasks } from "../resources";
import { doingGregFight } from "../resources/extrovermectin";
import {
augustSummonTasks,
candyMapDailyTasks,
doingGregFight,
} from "../resources";

const SummonTomes = $skills`Summon Snowcones, Summon Stickers, Summon Sugar Sheets, Summon Rad Libs, Summon Smithsness`;
const Wads = $items`twinkly wad, cold wad, stench wad, hot wad, sleaze wad, spooky wad`;
Expand Down
2 changes: 1 addition & 1 deletion packages/garbo/src/tasks/embezzler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { $item, $items, $location, CrystalBall, get, set } from "libram";
import { GarboTask } from "./engine";
import { GarboStrategy, Macro } from "../combat";
import { getChangeLastAdvLocationMethod } from "../embezzler/lib";
import { doingGregFight } from "../resources/extrovermectin";
import { doingGregFight } from "../resources";
import { freeFightOutfit } from "../outfit";

export const SetupEmbezzlerQuest: Quest<GarboTask> = {
Expand Down
16 changes: 15 additions & 1 deletion packages/garbo/src/tasks/freeFight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ import { garboValue } from "../garboValue";
import { freeFightOutfit } from "../outfit";
import { GarboTask } from "./engine";
import { doCandyTrick, shouldAugustCast } from "../resources";
import { kramcoGuaranteed } from "../lib";
import { wanderer } from "../garboWanderer";

type GarboFreeFightTask = Extract<GarboTask, { combat: GarboStrategy }> & {
combatCount: () => number;
Expand Down Expand Up @@ -440,7 +442,19 @@ const FreeFightTasks: GarboFreeFightTask[] = [
combatCount: () => clamp(10 - get("_brickoFights"), 0, 10),
tentacle: false,
},
// First kramco (wanderer)
{
name: "Kramco",
ready: () => have($item`Kramco Sausage-o-Matic™`),
completed: () => !kramcoGuaranteed(),
do: () =>
wanderer().getTarget({ wanderer: "freefight", allowEquipment: false }),
outfit: () => freeFightOutfit({ offhand: $item`Kramco Sausage-o-Matic™` }),
choices: () =>
wanderer().getChoices({ wanderer: "freefight", allowEquipment: false }),
combat: new GarboStrategy(() => Macro.basicCombat()),
combatCount: () => clamp(1 - get("_sausageFights"), 0, 1),
tentacle: true,
},
// Grimacia
// Saber
// Pygmys
Expand Down
2 changes: 1 addition & 1 deletion packages/garbo/src/tasks/post/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
} from "../../lib";
import { teleportEffects } from "../../mood";
import { Quest } from "grimoire-kolmafia";
import bestAutumnatonLocation from "../../resources/autumnaton";
import { bestAutumnatonLocation } from "../../resources";
import { estimatedGarboTurns, remainingUserTurns } from "../../turns";
import { acquire } from "../../acquire";
import { garboAverageValue } from "../../garboValue";
Expand Down
8 changes: 5 additions & 3 deletions packages/garbo/src/yachtzee/diet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ import {
} from "libram";
import { acquire } from "../acquire";
import { globalOptions } from "../config";
import { hasMonsterReplacers } from "../resources/extrovermectin";
import {
hasMonsterReplacers,
shouldAugustCast,
synthesize,
} from "../resources";
import { Potion } from "../potions";
import { garboValue } from "../garboValue";
import synthesize from "../resources/synthesis";
import { estimatedGarboTurns } from "../turns";
import { yachtzeePotionProfits, yachtzeePotionSetup } from "./buffs";
import { optimizeForFishy } from "./fishy";
Expand All @@ -53,7 +56,6 @@ import {
useSpikolodonSpikes,
} from "./lib";
import { freeRest } from "../lib";
import { shouldAugustCast } from "../resources";

class YachtzeeDietEntry<T> {
name: string;
Expand Down

0 comments on commit da26d6c

Please sign in to comment.