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

Grimoire-embezzlers #2079

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9f0ebcc
genericize the engine
horrible-little-slime Sep 8, 2024
9569071
start the engine override
horrible-little-slime Sep 8, 2024
b338f73
update `getNextTask`
horrible-little-slime Sep 13, 2024
e6f3a1f
Flesh out the grimoire template (#2100)
Ignose Sep 13, 2024
4e3792e
Merge branch 'main' into grimoire-embezzlers
horrible-little-slime Sep 13, 2024
bfda625
orb is a bad strategy for free copies
horrible-little-slime Sep 13, 2024
41c1305
typing fixes
horrible-little-slime Sep 13, 2024
d3495ec
lint fixes
Rinn Sep 14, 2024
db5dbe5
lint fixes
Rinn Sep 14, 2024
d4a764c
Merge branch 'main' into grimoire-embezzlers
Rinn Sep 14, 2024
b29c131
add `createOutfit` logic
horrible-little-slime Sep 16, 2024
77f5f2b
remove now-redundant outfit handling
horrible-little-slime Sep 16, 2024
06e70cf
handle profchain
horrible-little-slime Sep 17, 2024
d56cae1
DRY during outfit customization
horrible-little-slime Sep 17, 2024
14fd9c5
null out profchain after completing a chain
horrible-little-slime Sep 17, 2024
250c5bc
move profchain resetting to `post`
horrible-little-slime Sep 17, 2024
769c046
entirely replace `customize`
horrible-little-slime Sep 17, 2024
24f327a
streamline `spendsTurn`
horrible-little-slime Sep 17, 2024
200d730
legs of underwater & angel support
horrible-little-slime Sep 17, 2024
aca8523
streamlining
horrible-little-slime Sep 17, 2024
f667d05
pass underwater code into free fight outfit
horrible-little-slime Sep 17, 2024
c319f88
remove egregiously misimplemented fights; give the wanderers a real `do`
horrible-little-slime Sep 17, 2024
22f7720
add `amount` in
horrible-little-slime Sep 17, 2024
ce5f3c0
fix typings
horrible-little-slime Sep 18, 2024
0c83069
rearrange fights; add backup musk
horrible-little-slime Sep 18, 2024
899a055
move code to its own subfolder; implement saber forcing crates
horrible-little-slime Sep 18, 2024
3215284
im helping
Rinn Sep 18, 2024
7ae8325
fix Spooky Putty & Rain-Doh
Rinn Sep 18, 2024
f188bb3
Merge branch 'main' into grimoire-embezzlers
Rinn Sep 18, 2024
48fe0de
Merge branch 'main' into grimoire-embezzlers
Rinn Sep 26, 2024
ebdbe19
Merge branch 'main' into grimoire-embezzlers
Rinn Sep 26, 2024
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
22 changes: 12 additions & 10 deletions packages/garbo/src/resources/extrovermectin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { freeFightFamiliar } from "../familiar";
import {
freeRunConstraints,
getUsingFreeBunnyBanish,
isFree,
lastAdventureWasWeird,
ltbRun,
setChoice,
Expand All @@ -63,6 +64,12 @@ type GregSource = {
extra: number;
};

export const totalReplacers = () =>
(have($skill`Meteor Lore`) ? 10 - get("_macrometeoriteUses") : 0) +
(have($item`Powerful Glove`)
? Math.floor((100 - get("_powerfulGloveBatteryPowerUsed")) / 10)
: 0);

export function expectedGregs(skillSource: "habitat" | "extro"): number[] {
const habitatCharges = have($skill`Just the Facts`)
? 3 - get("_monsterHabitatsRecalled", 0)
Expand Down Expand Up @@ -95,20 +102,13 @@ export function expectedGregs(skillSource: "habitat" | "extro"): number[] {

const orbGregs = have($item`miniature crystal ball`) ? 1 : 0;

const macrometeors = have($skill`Meteor Lore`)
? 10 - get("_macrometeoriteUses")
: 0;
const replaceEnemies = have($item`Powerful Glove`)
? Math.floor((100 - get("_powerfulGloveBatteryPowerUsed")) / 10)
: 0;

const firstReplaces = clamp(
replacementsPerGreg(baseGregs[0]),
0,
macrometeors + replaceEnemies,
totalReplacers(),
);
const initialCast: { replacesLeft: number; sources: GregSource[] } = {
replacesLeft: macrometeors + replaceEnemies - firstReplaces,
replacesLeft: totalReplacers() - firstReplaces,
sources: [
{
...baseGregs[0],
Expand Down Expand Up @@ -174,7 +174,9 @@ export function crateStrategy(): "Sniff" | "Saber" | "Orb" | null {
) {
return "Sniff";
}
if (have($item`miniature crystal ball`)) return "Orb";
if (have($item`miniature crystal ball`) && !isFree(globalOptions.target)) {
return "Orb";
}
if (have($item`Fourth of May Cosplay Saber`) && get("_saberForceUses") < 5) {
return "Saber";
}
Expand Down
3 changes: 1 addition & 2 deletions packages/garbo/src/target/fights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@ export const conditionalSources = [
options.macro,
);
changeLastAdvLocation();
if (!doingGregFight()) set("_garbo_doneGregging", true);
},
{
spec: { equip: $items`miniature crystal ball` },
Expand Down Expand Up @@ -928,7 +927,7 @@ export const fakeSources = [
),
];

function copyTargetConfirmInvocation(msg: string): boolean {
export function copyTargetConfirmInvocation(msg: string): boolean {
// If user does not have autoUserConfirm set to true
// If the incocatedCount has already reached or exceeded the default limit
if (!globalOptions.prefs.autoUserConfirm) {
Expand Down
38 changes: 38 additions & 0 deletions packages/garbo/src/target/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,41 @@ export function changeLastAdvLocationTask(): {
};
}
}

export function puttyLeft(): number {
const havePutty = have($item`Spooky Putty sheet`);
const havePuttyMonster = have($item`Spooky Putty monster`);
const haveRainDoh = have($item`Rain-Doh black box`);
const haveRainDohMonster = have($item`Rain-Doh box full of monster`);

const puttyUsed = get("spookyPuttyCopiesMade");
const rainDohUsed = get("_raindohCopiesMade");
const hardLimit = 6 - puttyUsed - rainDohUsed;
let monsterCount = 0;
let puttyLeft = 5 - puttyUsed;
let rainDohLeft = 5 - rainDohUsed;

if (!havePutty && !havePuttyMonster) {
puttyLeft = 0;
}
if (!haveRainDoh && !haveRainDohMonster) {
rainDohLeft = 0;
}

if (havePuttyMonster) {
if (get("spookyPuttyMonster") === globalOptions.target) {
monsterCount++;
} else {
puttyLeft = 0;
}
}
if (haveRainDohMonster) {
if (get("rainDohMonster") === globalOptions.target) {
monsterCount++;
} else {
rainDohLeft = 0;
}
}
const naiveLimit = Math.min(puttyLeft + rainDohLeft, hardLimit);
return naiveLimit + monsterCount;
}
Loading
Loading