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 4191058
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
31 changes: 30 additions & 1 deletion src/familiar/freeFightFamiliar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
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,
} from "libram";
import { canOpenRedPresent } from ".";
import { garboValue } from "../value";
import getConstantValueFamiliars from "./constantValueFamiliars";
Expand Down Expand Up @@ -69,6 +79,25 @@ export function menu(options: MenuOptions = {}): GeneralFamiliar[] {
limit: "special",
});
}
if (
location === $location`Barf Mountain` &&
have($familiar`Red-Nosed Snapper`) &&
get("redSnapperPhylum") === $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
4 changes: 3 additions & 1 deletion src/fights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,9 @@ const freeFightSources = [
new FreeFight(
() => (wantPills() ? 5 - get("_saberForceUses") : 0),
() => {
if (have($familiar`Red-Nosed Snapper`)) cliExecute(`snapper ${$phylum`dude`}`);
if (have($familiar`Red-Nosed Snapper`) && get("redSnapperPhylum") !== $phylum`dude`) {
cliExecute(`snapper ${$phylum`dude`}`);
}
setChoice(1387, 3);
if (
have($skill`Comprehensive Cartography`) &&
Expand Down
7 changes: 7 additions & 0 deletions src/tasks/dailyFamiliars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
$familiars,
$item,
$items,
$phylum,
CrimboShrub,
get,
have,
Expand Down Expand Up @@ -227,6 +228,12 @@ const DailyFamiliarTasks: GarboTask[] = [
!!get("garbo_felizValue", 0) || today - get("garbo_felizValueDate", 0) < 24 * 60 * 60 * 1000,
do: () => felizValue,
},
{
name: "Snapper Hunts Dudes",
ready: () => have($familiar`Red-Nosed Snapper`),
completed: () => get("redSnapperPhylum") === $phylum`Dude`,
do: () => cliExecute(`snapper ${$phylum`dude`}`),
},
];

export const DailyFamiliarsQuest: Quest<GarboTask> = {
Expand Down

0 comments on commit 4191058

Please sign in to comment.