Skip to content

Commit

Permalink
support snapper as a familiar
Browse files Browse the repository at this point in the history
  • Loading branch information
pstalcup committed Sep 19, 2023
1 parent f43e011 commit c0b26b0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
32 changes: 31 additions & 1 deletion src/familiar/freeFightFamiliar.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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 z
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();
Expand Down
5 changes: 4 additions & 1 deletion src/fights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ import {
Requirement,
Robortender,
set,
Snapper,
SourceTerminal,
sum,
tryFindFreeRun,
Expand Down Expand Up @@ -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`) &&
Expand Down
8 changes: 8 additions & 0 deletions src/tasks/dailyFamiliars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ import {
$familiars,
$item,
$items,
$phylum,
CrimboShrub,
get,
have,
Robortender,
set,
Snapper,
sum,
withProperty,
} from "libram";
Expand Down Expand Up @@ -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<GarboTask> = {
Expand Down

0 comments on commit c0b26b0

Please sign in to comment.