Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grimoirize free runs #2241

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/garbo/src/tasks/runs/bander.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const UnbanderableTargets: string[] = [];
56 changes: 56 additions & 0 deletions packages/garbo/src/tasks/runs/banish.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { $item, $skill, clamp, get, getFoldGroup, have } from "libram";
import { FreeRunBanishSource } from "./lib";
import { Macro } from "../../combat";

export const BanishSources: FreeRunBanishSource[] = [
{
name: "KGB Tranquilizer Dart",
banish: $skill`KGB tranquilizer dart`,
spec: { acc1: $item`Kremlin's Greatest Briefcase` },
macro: Macro.skill($skill`KGB tranquilizer dart`),
have: () => have($item`Kremlin's Greatest Briefcase`),
available: () => get("_kgbTranquilizerDartUses") < 3,
remaining: () => clamp(3 - get("_kgbTranquilizerDartUses"), 0, 3),
},
{
name: "Latte Lovers Member's Mug",
banish: $skill`Throw Latte on Opponent`,
spec: { offhand: $item`latte lovers member's mug` },
macro: Macro.skill($skill`Throw Latte on Opponent`),
have: () => have($item`latte lovers member's mug`),
available: () => !get("_latteBanishUsed"),
remaining: () => Number(!get("_latteBanishUsed")),
},
{
name: "Mafia Middle Finger Ring",
banish: $skill`Show them your middle finger`,
spec: { acc1: $item`mafia middle finger ring` },
macro: Macro.skill($skill`Show them your middle finger`),
have: () => have($item`mafia middle finger ring`),
available: () => get("_mafiaMiddleFingerRingUsed"),
remaining: () => Number(!get("_mafiaMiddleFingerRingUsed")),
},
{
name: "Creepy Grin",
banish: $skill`Creepy Grin`,
spec: { acc1: $item`V for Vivala mask` },
macro: Macro.skill($skill`Creepy Grin`),
have: () => have($item`V for Vivala mask`),
available: () => get("_vmaskBanisherUsed"),
remaining: () => Number(!get("_vmaskBanisherUsed")),
},
{
name: "Stinky Cheese Eye",
banish: $skill`Give Your Opponent the Stinkeye`,
spec: { acc1: $item`stinky cheese eye` },
macro: Macro.skill($skill`Give Your Opponent the Stinkeye`),
have: () =>
[
$item`stinky cheese eye`,
...getFoldGroup($item`stinky cheese eye`),
].some((i) => have(i)),
available: () => !get("_stinkyCheeseBanisherUsed"),
remaining: () => Number(!get("_stinkyCheeseBanisherUsed")),
},
// et cetera
];
104 changes: 104 additions & 0 deletions packages/garbo/src/tasks/runs/itemsteal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import { OutfitSpec } from "grimoire-kolmafia";
import { Macro } from "../../combat";
import { Item, Location, Monster } from "kolmafia";
import {
$familiar,
$item,
$items,
$location,
$locations,
$monster,
$skill,
clamp,
get,
have,
} from "libram";

type ItemStealSource = {
name: string;
have: boolean;
remaining: () => number;
macro: Macro;
perFight: number;
spec: OutfitSpec;
};

type ItemStealTarget = {
location: Location;
monster: Monster;
item: Item;
requireML?: boolean;
};

const ItemStealSources: ItemStealSource[] = [
{
name: "Extinguisher",
have: have($item`industrial fire extinguisher`),
remaining: () => Math.floor(get("_fireExtinguisherCharge") / 10),
macro: Macro.trySkillRepeat($skill`Fire Extinguisher: Polar Vortex`),
perFight: 10,
spec: { equip: $items`industrial fire extinguisher` },
},
{
name: "Bat Swoop",
have: have($item`bat wings`),
remaining: () => $skill`Swoop like a Bat`.dailylimit,
macro: Macro.skill($skill`Swoop like a Bat`),
perFight: 1,
spec: { back: $item`bat wings` },
},
{
name: "Mild Evil",
have: have($skill`Perpetrate Mild Evil`),
remaining: () => $skill`Perpetrate Mild Evil`.dailylimit,
macro: Macro.skill($skill`Perpetrate Mild Evil`),
perFight: 1,
spec: {},
},
{
name: "XO Hug",
have: have($familiar`XO Skeleton`),
remaining: () => clamp(11 - get("_xoHugsUsed"), 0, 11),
macro: Macro.skill($skill`Hugs and Kisses!`),
perFight: 1,
spec: { familiar: $familiar`XO Skeleton` },
},
];

export const ItemStealTargets: ItemStealTarget[] = [
{
location: $location`The Deep Dark Jungle`,
monster: $monster`smoke monster`,
item: $item`transdermal smoke patch`,
},
{
location: $location`The Ice Hotel`,
monster: $monster`ice bartender`,
item: $item`perfect ice cube`,
},
{
location: $location`The Haunted Library`,
monster: $monster`bookbat`,
item: $item`tattered scrap of paper`,
requireML: true,
},
{
location: $location`Twin Peak`,
monster: $monster`bearpig topiary animal`, // TODO: this location specifically has multiple targets
item: $item`rusty hedge trimmers`,
requireML: true,
},
{
location: $location`The Hidden Temple`,
monster: $monster`baa-relief sheep`,
item: $item`stone wool`,
requireML: true,
},
...$locations`Shadow Rift (The Ancient Buried Pyramid), Shadow Rift (The Hidden City), Shadow Rift (The Misspelled Cemetary)`.map(
(location) => ({
location,
monster: $monster`shadow slab`,
item: $item`shadow brick`,
}),
),
];
16 changes: 16 additions & 0 deletions packages/garbo/src/tasks/runs/lib.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { OutfitSpec } from "grimoire-kolmafia";
import { Item, Skill } from "kolmafia";
import { Macro } from "../../combat";

export type FreeRunSource = {
name: string;
spec: OutfitSpec;
available: (task: string) => boolean;
have: () => boolean;
macro: Macro;
};

export type FreeRunBanishSource = FreeRunSource & {
banish: Item | Skill;
remaining: () => number;
};
35 changes: 35 additions & 0 deletions packages/garbo/src/tasks/runs/runs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { $effect, $item, $skill, get, have } from "libram";
import { Macro } from "../../combat";
import { FreeRunSource } from "./lib";
import { globalOptions } from "../../config";

export const RunSources: FreeRunSource[] = [
{
name: "Spring Runaway",
spec: { acc1: $item`spring shoes` },
macro: Macro.skill($skill`Spring Away`),
available: () => !have($effect`Everything Looks Green`),
have: () => have($item`spring shoes`),
},
{
name: "GAP Runaway",
spec: { pants: $item`Greatest American Pants` },
macro: Macro.runaway(),
available: () => get("_navelRunaways") < 3,
have: () => have($item`Greatest American Pants`),
},
{
name: "Navel Ring Runaway",
spec: { acc1: $item`navel ring of navel gazing` },
macro: Macro.runaway(),
available: () => get("_navelRunaways") < 3,
have: () => have($item`navel ring of navel gazing`),
},
{
name: "Fish Oil Smoke Bomb",
spec: {},
macro: Macro.item($item`fish oil smoke bomb`),
available: () => have($item`fish oil smoke bomb`),
have: () => globalOptions.ascend,
},
];
Loading