Skip to content

Commit

Permalink
Grimoirize Yachtzee
Browse files Browse the repository at this point in the history
  • Loading branch information
pstalcup committed Oct 4, 2023
1 parent 8130c2a commit 77db00d
Show file tree
Hide file tree
Showing 17 changed files with 116 additions and 1,867 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
- [`ascend` flag](#ascend-flag)
- [`nodiet` flag](#nodiet-flag)
- [`simdiet` flag](#simdiet-flag)
- [`yachtzeechain` flag](#yachtzeechain-flag)
- [`workshed` arg](#workshed-arg)
- [`quick` flag](#quick-flag)
- [Turncount](#turncount)
Expand Down Expand Up @@ -113,10 +112,6 @@ _EXPERIMENTAL_ Garbo will not eat or drink anything as part of the run (includin

Garbo will list the optimal diet it plans to consume computed from your defined mpa and current prices, and then exit.

### `yachtzeechain` flag

_EXPERIMENTAL_ Garbo will attempt to chain the Yachtzee! NC after all the free fights are completed, just before it attempts embezzlers. This command cannot be run in conjuction with the `nodiet` flag. Refer to `help` for more info on the requirements needed to run this.

### `workshed` arg

Garbo will determine when you are done with your current workshed, and automatically swap to this workshed mid-run. This argument is used in the following manner: e.g. `garbo workshed="cold medicine cabinet" ascend`. (It will also attempt simple string matching, so `workshed=cmc`, `workshed=pizza` or `workshed=trainset` should also work)
Expand Down
5 changes: 0 additions & 5 deletions mafia/data/garbo_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
"type": "boolean",
"description": "Should a dinsey day pass be bought with FunFunds (if possible) at the end of the script?"
},
{
"name": "garbo_yachtzeechain",
"type": "boolean",
"description": "only diets after free fights, and attempts to estimate if Yachtzee! chaining is profitable for you. Requires Spring Break Beach access (it will not grab a one-day pass for you, but will make an attempt if one is used)."
},
{
"name": "garbo_skipPillCheck",
"type": "boolean",
Expand Down
3 changes: 1 addition & 2 deletions src/combat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,15 +453,14 @@ export class Macro extends StrictMacro {

kill(): Macro {
const riftId = toInt($location`Shadow Rift`);
const doingYachtzee = globalOptions.prefs.yachtzeechain && !get("_garboYachtzeeChainCompleted");
const canPinata = haveEquipped($item`Cincho de Mayo`) && CinchoDeMayo.currentCinch() >= 5;
return (
this.externalIf(
myClass() === $class`Sauceror` && have($skill`Curse of Weaksauce`),
Macro.trySkill($skill`Curse of Weaksauce`),
)
.externalIf(
!doingYachtzee && canPinata,
canPinata,
Macro.while_(
`hasskill ${
$skill`Cincho: Projectile Piñata`.id
Expand Down
7 changes: 0 additions & 7 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,6 @@ You can use multiple options in conjunction, e.g. "garbo nobarf ascend"',
help: "Set to whatever you estimate the value of a free fight/run to be for you. (Default 2000)",
default: 2000,
}),
yachtzeechain: Args.flag({
setting: "garbo_yachtzeechain",
help: "only diets after free fights, and attempts to estimate if Yachtzee! chaining is profitable for you - if so, it consumes a specific diet which uses ~0-36 spleen;\
if not it automatically continues with the regular diet. Requires Spring Break Beach access (it will not grab a one-day pass for you, but will make an attempt if one is used).\
Sweet Synthesis is strongly recommended, as with access to other meat% buffs from Source Terminal, Fortune Teller, KGB and the summoning chamber. Having access to a PYEC (on hand or in the clan stash) is a plus.",
default: false,
}),
candydish: Args.flag({
setting: "garbo_candydish",
help: "*DANGEROUS* garbo will consider using porcelain candy dishes. This could result in potentially destructive behavior in the instance that the user does not have sufficient meat (1-2 million) to purchase as many dishes as garbo desires or there is a price cliff.",
Expand Down
7 changes: 1 addition & 6 deletions src/extrovermectin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import { freeFightFamiliar } from "./familiar";
import { freeRunConstraints, getUsingFreeBunnyBanish, ltbRun, setChoice } from "./lib";
import { garboAdventure, Macro } from "./combat";
import { acquire } from "./acquire";
import { globalOptions } from "./config";

const embezzler = $monster`Knob Goblin Embezzler`;
const crate = $monster`crate`;
Expand Down Expand Up @@ -124,11 +123,7 @@ export function doingGregFight(): boolean {
have($skill`Just the Facts`) &&
(get("_monsterHabitatsRecalled") < 3 || get("_monsterHabitatsFightsLeft") > 0);

return (
extrovermectin ||
habitat ||
(globalOptions.prefs.yachtzeechain && !get("_garboYachtzeeChainCompleted"))
);
return extrovermectin || habitat;
}

export function crateStrategy(): "Sniff" | "Saber" | "Orb" | null {
Expand Down
9 changes: 2 additions & 7 deletions src/fights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1505,8 +1505,8 @@ const freeFightSources = [
return true; // Get the artifact or kill the boss immediately for free
}

// Consider forcing noncombats below:
if (globalOptions.prefs.yachtzeechain) return false; // NCs are better when yachtzeeing, probably
if (realmAvailable("sleaze")) return false;

// TODO: With the KoL update, is there a function for checking if an NC is already forced?
if (have($item`Clara's bell`) && !globalOptions.clarasBellClaimed) {
return true;
Expand Down Expand Up @@ -2159,9 +2159,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 @@ -2173,7 +2170,6 @@ export function freeRunFights(): void {
for (const priorityRunFight of priorityFreeRunFightSources) {
priorityRunFight.runAll();
}
if (onlyPriorityRuns) return;
for (const freeRunFightSource of freeRunFightSources) {
freeRunFightSource.runAll();
}
Expand Down Expand Up @@ -2740,7 +2736,6 @@ function runShadowRiftTurn(): void {
// we can probably have a better name
if (get("encountersUntilSRChoice") === 0) return;
if (
globalOptions.prefs.yachtzeechain ||
get("rufusQuestType") === "items" ||
get("rufusQuestType") === "entity" // We can't handle bosses... yet
) {
Expand Down
13 changes: 2 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ export function main(argString = ""): void {
}

Args.fill(globalOptions, argString);
globalOptions.prefs.yachtzeechain = false;
if (globalOptions.version) return; // Since we always print the version, all done!
if (globalOptions.help) {
Args.showHelp(globalOptions);
Expand Down Expand Up @@ -466,15 +465,7 @@ export function main(argString = ""): void {
withStash(stashItems, () => {
withVIPClan(() => {
// 0. diet stuff.
if (globalOptions.nodiet || get("_garboYachtzeeChainCompleted", false)) {
print("We should not be yachtzee chaining", "red");
globalOptions.prefs.yachtzeechain = false;
}

if (
!globalOptions.nodiet &&
(!globalOptions.prefs.yachtzeechain || get("_garboYachtzeeChainCompleted", false))
) {
if (!globalOptions.nodiet) {
runDiet();
} else if (!globalOptions.simdiet) {
nonOrganAdventures();
Expand All @@ -498,8 +489,8 @@ export function main(argString = ""): void {

// 2. do some embezzler stuff
freeFights();
yachtzeeChain();
dailyFights();
yachtzeeChain();

if (!globalOptions.nobarf) {
// 3. burn turns at barf
Expand Down
3 changes: 0 additions & 3 deletions src/outfit/dropsgearAccessories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
monsterManuelAvailable,
} from "../lib";
import { garboValue } from "../garboValue";
import { globalOptions } from "../config";

function mafiaThumbRing(mode: BonusEquipMode) {
if (!have($item`mafia thumb ring`) || modeIsFree(mode)) {
Expand Down Expand Up @@ -83,8 +82,6 @@ function cinchoDeMayo(mode: BonusEquipMode) {
mode === BonusEquipMode.DMT ||
// Require manuel to make sure we don't kill during stasis
!monsterManuelAvailable() ||
// Don't use Cincho if we're planning on doing yachtzees, and haven't completed them yet
(!get("_garboYachtzeeChainCompleted") && globalOptions.prefs.yachtzeechain) ||
// If we have more than 50 passive damage, we'll never be able to cast projectile pinata without risking the monster dying
maxPassiveDamage() >= 50
) {
Expand Down
29 changes: 11 additions & 18 deletions src/post/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,12 @@ function floristFriars(): void {
}

function fillPantsgivingFullness(): void {
if (
getRemainingStomach() > 0 &&
(!globalOptions.prefs.yachtzeechain || get("_garboYachtzeeChainCompleted", false))
) {
if (getRemainingStomach() > 0) {
consumeDiet(computeDiet().pantsgiving(), "PANTSGIVING");
}
}

function fillSweatyLiver(): void {
if (globalOptions.prefs.yachtzeechain && !get("_garboYachtzeeChainCompleted", false)) return;

const castsWanted = 3 - get("_sweatOutSomeBoozeUsed");
if (castsWanted <= 0 || !have($item`designer sweatpants`)) return;

Expand Down Expand Up @@ -181,18 +176,16 @@ function funguySpores() {
function refillCinch() {
if (!CinchoDeMayo.have()) return;

if (get("_garboYachtzeeChainCompleted") || !globalOptions.prefs.yachtzeechain) {
const missingCinch = () => {
return 100 - CinchoDeMayo.currentCinch();
};
// Only rest if we'll get full value out of the cinch
// If our current cinch is less than the total available, it means we have free rests left.
while (
missingCinch() > CinchoDeMayo.cinchRestoredBy() &&
CinchoDeMayo.currentCinch() < CinchoDeMayo.totalAvailableCinch()
) {
if (!freeRest()) break;
}
const missingCinch = () => {
return 100 - CinchoDeMayo.currentCinch();
};
// Only rest if we'll get full value out of the cinch
// If our current cinch is less than the total available, it means we have free rests left.
while (
missingCinch() > CinchoDeMayo.cinchRestoredBy() &&
CinchoDeMayo.currentCinch() < CinchoDeMayo.totalAvailableCinch()
) {
if (!freeRest()) break;
}
}

Expand Down
6 changes: 1 addition & 5 deletions src/potions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,7 @@ const availableItems = [

const validPawWishes: Map<Effect, string> = new Map(
wishableEffectData
.filter(
({ e, name }) =>
!invalidWishStrings.includes(name) &&
(globalOptions.prefs.yachtzeechain ? e !== $effect`Eau d' Clochard` : true), // hardcoded heuristics
)
.filter(({ name }) => !invalidWishStrings.includes(name))
.map(({ e, name, splitName }) => {
if (!name.match(INVALID_CHARS_REGEX)) return [e, name];

Expand Down
19 changes: 2 additions & 17 deletions src/turns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,6 @@ export function estimatedGarboTurns(): number {
: 0;
const thumbRingMultiplier = usingThumbRing() ? 1 / 0.96 : 1;

// We need to estimate adventures from our organs if we are only dieting after yachtzee chaining
const yachtzeeTurns = 30; // guesstimate
const adventuresAfterChaining =
globalOptions.prefs.yachtzeechain && !get("_garboYachtzeeChainCompleted")
? Math.max(
potentialFullnessAdventures() +
potentialInebrietyAdventures() +
potentialNonOrganAdventures() -
yachtzeeTurns,
0,
)
: 0;

let turns;
if (globalOptions.stopTurncount) turns = globalOptions.stopTurncount - myTurncount();
else if (globalOptions.nobarf) turns = embezzlerCount();
Expand All @@ -55,8 +42,7 @@ export function estimatedGarboTurns(): number {
(myAdventures() +
sausageAdventures +
pantsgivingAdventures +
thesisAdventures +
adventuresAfterChaining -
thesisAdventures -
globalOptions.saveTurns) *
thumbRingMultiplier;
} else {
Expand All @@ -65,8 +51,7 @@ export function estimatedGarboTurns(): number {
sausageAdventures +
pantsgivingAdventures +
nightcapAdventures +
thesisAdventures +
adventuresAfterChaining) *
thesisAdventures) *
thumbRingMultiplier;
}

Expand Down
Loading

0 comments on commit 77db00d

Please sign in to comment.