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

support snapper as a familiar #1578

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
54 changes: 53 additions & 1 deletion src/familiar/freeFightFamiliar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import { Familiar, familiarWeight, inebrietyLimit, Location, myInebriety } from "kolmafia";
import { $familiar, $item, $location, clamp, findLeprechaunMultiplier, get, have } from "libram";
import {
$familiar,
$item,
$location,
$monsters,
$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 +81,46 @@ export function menu(options: MenuOptions = {}): GeneralFamiliar[] {
limit: "special",
});
}
if (
location === $location`Barf Mountain` &&
Snapper.have() &&
Snapper.getTrackedPhylum() === $phylum`dude`
) {
/*
# E stands for olfacted Garbage Tourist, A is angry toursit, F is horrible tourist family
import itertools
horrible-little-slime marked this conversation as resolved.
Show resolved Hide resolved
def rate(q):
m = ["E"] * 5 + ["A"] * 2 + ["F"] * 2
options = list(itertools.product(m, m))
dude = [m for m in options if (m[0] in ["A", "F"] and m[0] not in q) or (m[1] in ["A", "F"] and m[0] in q and m[0] != "E")]
return len(dude) / 81
*/

const dudes = $monsters`angry tourist, horrible tourist family`.filter((m) =>
$location`Barf Mountain`.combatQueue.includes(`${m}`),
).length;

// if you don't have olfaction, just assume a simple rate calculation
const noOlfactRate = 4 / (1 + 4 + (have($skill`Gallapagosian Mating Call`) ? 1 : 0));

// when you have olfaction, you
// using the above python script, dude rate for number of dudes in queue is:
const olfactRate =
[
0.44, // 0 dudes = 44% chance
0.32, // 1 dude = 32% chance
0.19, // 2 dudes = 19% chance
][dudes] ?? 0;

const dudeRate = have($skill`Transcendent Olfaction`) ? olfactRate : noOlfactRate;

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
Loading