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

Reorder freefight and freerunfight #1921

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 7 additions & 7 deletions packages/garbo/src/fights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1995,7 +1995,7 @@ function embezzlersInProgress(): boolean {
);
}

export function freeRunFights(): void {
export function freeRunFights(priorityOnly: boolean): void {
if (myInebriety() > inebrietyLimit()) return;
if (embezzlersInProgress()) return;

Expand All @@ -2004,10 +2004,6 @@ export function freeRunFights(): void {
1324: 5, // Fight a random partier
});

const onlyPriorityRuns =
globalOptions.prefs.yachtzeechain &&
!get("_garboYachtzeeChainCompleted", false);

const stashRun = stashAmount($item`navel ring of navel gazing`)
? $items`navel ring of navel gazing`
: stashAmount($item`Greatest American Pants`)
Expand All @@ -2019,7 +2015,7 @@ export function freeRunFights(): void {
for (const priorityRunFight of priorityFreeRunFightSources) {
priorityRunFight.runAll();
}
if (onlyPriorityRuns) return;
if (priorityOnly) return;
for (const freeRunFightSource of freeRunFightSources) {
freeRunFightSource.runAll();
}
Expand All @@ -2035,7 +2031,8 @@ export function freeFights(): void {
1324: 5, // Fight a random partier
});

freeRunFights();
// Run our priorty free runs first
freeRunFights(true);

killRobortCreaturesForFree();

Expand Down Expand Up @@ -2075,6 +2072,7 @@ export function freeFights(): void {
);
}

// Free fights before free runs, so that we have free banishes available for things like Pygmies
// TODO: Run unconverted free fights
for (const freeFightSource of freeFightSources) {
freeFightSource.runAll();
Expand All @@ -2084,6 +2082,8 @@ export function freeFights(): void {
// TODO: freeFightMood()
runGarboQuests([PostQuest(), FreeFightQuest]);

freeRunFights(false);

tryFillLatte();
postFreeFightDailySetup();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/garbo/src/yachtzee/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export function oldyachtzeeChain(): void {
runDiet();
prepRobortender(); // Recompute robo drinks' worth after diet is finally consumed
}
freeRunFights();
freeRunFights(false);
postFreeFightDailySetup();
}

Expand Down
Loading