From 1eeaa5f1a217a64f85f879f5ab6c86fd3e730609 Mon Sep 17 00:00:00 2001 From: Patrick Stalcup Date: Tue, 19 Sep 2023 10:59:25 -0400 Subject: [PATCH] support snapper as a familiar --- src/familiar/freeFightFamiliar.ts | 32 ++++++++++++++++++++++++++++++- src/fights.ts | 5 ++++- src/tasks/dailyFamiliars.ts | 8 ++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/familiar/freeFightFamiliar.ts b/src/familiar/freeFightFamiliar.ts index 322b35ac5..0242c2f76 100644 --- a/src/familiar/freeFightFamiliar.ts +++ b/src/familiar/freeFightFamiliar.ts @@ -1,5 +1,16 @@ import { Familiar, familiarWeight, inebrietyLimit, Location, myInebriety } from "kolmafia"; -import { $familiar, $item, $location, clamp, findLeprechaunMultiplier, get, have } from "libram"; +import { + $familiar, + $item, + $location, + $phylum, + $skill, + clamp, + findLeprechaunMultiplier, + get, + have, + Snapper, +} from "libram"; import { canOpenRedPresent } from "."; import { garboValue } from "../value"; import getConstantValueFamiliars from "./constantValueFamiliars"; @@ -69,6 +80,25 @@ export function menu(options: MenuOptions = {}): GeneralFamiliar[] { limit: "special", }); } + if ( + location === $location`Barf Mountain` && + Snapper.have() && + Snapper.getTrackedPhylum() === $phylum`dude` + ) { + // when running snapper, there are 4 dudes in the zone, and a variable number of nondudes + const dudeRate = + 4 / + (4 + // 4 dudes + 1 + // 1 garbage tourist + (have($skill`Transcendent Olfaction`) ? 3 : 0) + + (have($skill`Gallapagosian Mating Call`) ? 1 : 0)); + familiarMenu.push({ + familiar: $familiar`Red-Nosed Snapper`, + expectedValue: (dudeRate * garboValue($item`human musk`)) / 11, + leprechaunMultiplier: 0, + limit: "none", + }); + } } const meatFam = meatFamiliar(); diff --git a/src/fights.ts b/src/fights.ts index 14645fc60..5a6a171b8 100644 --- a/src/fights.ts +++ b/src/fights.ts @@ -106,6 +106,7 @@ import { Requirement, Robortender, set, + Snapper, SourceTerminal, sum, tryFindFreeRun, @@ -994,7 +995,9 @@ const freeFightSources = [ new FreeFight( () => (wantPills() ? 5 - get("_saberForceUses") : 0), () => { - if (have($familiar`Red-Nosed Snapper`)) cliExecute(`snapper ${$phylum`dude`}`); + if (Snapper.have() && Snapper.getTrackedPhylum() !== $phylum`dude`) { + Snapper.trackPhylum($phylum`dude`); + } setChoice(1387, 3); if ( have($skill`Comprehensive Cartography`) && diff --git a/src/tasks/dailyFamiliars.ts b/src/tasks/dailyFamiliars.ts index 793cfdde4..1c5a49c3c 100644 --- a/src/tasks/dailyFamiliars.ts +++ b/src/tasks/dailyFamiliars.ts @@ -18,11 +18,13 @@ import { $familiars, $item, $items, + $phylum, CrimboShrub, get, have, Robortender, set, + Snapper, sum, withProperty, } from "libram"; @@ -227,6 +229,12 @@ const DailyFamiliarTasks: GarboTask[] = [ !!get("garbo_felizValue", 0) || today - get("garbo_felizValueDate", 0) < 24 * 60 * 60 * 1000, do: () => felizValue, }, + { + name: "Snapper Hunts Dudes", + ready: () => Snapper.have(), + completed: () => Snapper.getTrackedPhylum() === $phylum`dude`, + do: () => Snapper.trackPhylum($phylum`dude`), + }, ]; export const DailyFamiliarsQuest: Quest = {