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

2024 #13

Merged
merged 41 commits into from
Dec 23, 2024
Merged

2024 #13

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
740c830
initial commit
horrible-little-slime Dec 18, 2024
be3add7
more skeleton
horrible-little-slime Dec 18, 2024
aa2a164
create `getIsland`
horrible-little-slime Dec 18, 2024
57d6410
deleting more useless stuff; switch to orb manager (for caching? I gu…
horrible-little-slime Dec 18, 2024
af9a3d1
orb spec
horrible-little-slime Dec 18, 2024
db2aa86
shiver's suggestions
horrible-little-slime Dec 18, 2024
8bcafe2
not everyone's a king
horrible-little-slime Dec 18, 2024
333e5d6
this doesn't feel great
horrible-little-slime Dec 18, 2024
21041c4
a few random outfit stubs
horrible-little-slime Dec 18, 2024
ff12ec7
add spirit currencies
horrible-little-slime Dec 18, 2024
ccf5a89
more stuff
horrible-little-slime Dec 18, 2024
e04579a
fixes to global quest
horrible-little-slime Dec 19, 2024
1bbb39b
more misc progress
horrible-little-slime Dec 19, 2024
376a372
linting this broken code
horrible-little-slime Dec 19, 2024
1301008
more reorg
horrible-little-slime Dec 20, 2024
bf2f023
all tasks I think
horrible-little-slime Dec 20, 2024
dba701a
more stubbing
horrible-little-slime Dec 20, 2024
5601dc7
use the 2-arg `Outfit.from`
horrible-little-slime Dec 20, 2024
a861241
choices on wanderers
horrible-little-slime Dec 20, 2024
8aa76fb
linting stuff
horrible-little-slime Dec 20, 2024
c101f96
remove redundancies
horrible-little-slime Dec 21, 2024
41ea5fb
calculate plentifulmonsters nicer
horrible-little-slime Dec 21, 2024
dd5dab6
prelimi
horrible-little-slime Dec 23, 2024
0ee6b25
sketches of combat
horrible-little-slime Dec 23, 2024
ca5e9b1
type errors
horrible-little-slime Dec 23, 2024
9fefeec
final type error
horrible-little-slime Dec 23, 2024
79d4b41
glove in outfit
horrible-little-slime Dec 23, 2024
4d535b0
final islands
horrible-little-slime Dec 23, 2024
d32363d
disable all that disabling
horrible-little-slime Dec 23, 2024
5be6cd3
remove old crimbo stuff more
horrible-little-slime Dec 23, 2024
7e89b9f
rename islands
horrible-little-slime Dec 23, 2024
4d5b0fa
lint
horrible-little-slime Dec 23, 2024
0bcd18e
fix shocking lick
horrible-little-slime Dec 23, 2024
07858cd
apriling
horrible-little-slime Dec 23, 2024
002658b
outfit changes, spikolodon spikes
horrible-little-slime Dec 23, 2024
cd4e617
Christmas Island
horrible-little-slime Dec 23, 2024
22d7275
always pass island location to outfit familiar
horrible-little-slime Dec 23, 2024
c0bc6c0
only equip tearaways if they're coming up
horrible-little-slime Dec 23, 2024
c841af0
linting
horrible-little-slime Dec 23, 2024
f631345
actually tear away those pants
horrible-little-slime Dec 23, 2024
0ee5eb1
linting
horrible-little-slime Dec 23, 2024
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
6,077 changes: 0 additions & 6,077 deletions package-lock.json

This file was deleted.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
"install-mafia": "create-kolmafia-script --install"
},
"dependencies": {
"garbo-lib": "^1.0.0",
"grimoire-kolmafia": "^0.3.26",
"kolmafia": "^5.27735.0",
"libram": "^0.8.18"
"libram": "^0.9.27"
},
"devDependencies": {
"@babel/core": "^7.18.10",
Expand All @@ -33,9 +34,10 @@
"esbuild-plugin-babel": "^0.2.3",
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-libram": "^0.4.0",
"eslint-plugin-libram": "^0.4.18",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1",
"typescript": "^4.7.4"
}
},
"packageManager": "[email protected]+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
}
27 changes: 2 additions & 25 deletions src/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,20 @@ import {
equippedAmount,
haveEquipped,
itemAmount,
Location,
setAutoAttack,
} from "kolmafia";
import { $familiar, $item, CrownOfThrones, get, JuneCleaver, PropertiesManager } from "libram";

import { bestJuneCleaverOption, shouldSkip } from "./juneCleaver";
import { printd, sober, unsupportedChoices } from "./lib";
import { printd, sober } from "./lib";
import Macro from "./macro";
import * as OrbManager from "./orbmanager";

export type CrimboTask = Task & {
sobriety: "sober" | "drunk" | "either";
forced?: boolean;
};

export type CrimboQuest = Quest<CrimboTask> & {
location: Location;
};
export type CrimboQuest = Quest<CrimboTask>;

const introAdventures: string[] = [];
export class CrimboStrategy extends CombatStrategy {
Expand All @@ -33,15 +29,6 @@ export class CrimboStrategy extends CombatStrategy {
}
}

function countAvailableNcForces() {
return (get("_claraBellUsed") ? 0 : 1) + (5 - get("_spikolodonSpikeUses"));
}

let ncForced = false;
export function resetNcForced() {
printd("Reset NC forcing");
ncForced = false;
}
CrownOfThrones.createRiderMode("default", {});
const chooseRider = () => CrownOfThrones.pickRider("default");
export class CrimboEngine extends Engine<never, CrimboTask> {
Expand All @@ -56,15 +43,11 @@ export class CrimboEngine extends Engine<never, CrimboTask> {
(sober() && task.sobriety === "sober") ||
(!sober() && task.sobriety === "drunk");

if (task.forced) {
return sobriety && ncForced && super.available(task);
}
return sobriety && super.available(task);
}

initPropertiesManager(manager: PropertiesManager): void {
super.initPropertiesManager(manager);
for (const choices of unsupportedChoices.values()) manager.setChoices(choices);
}

dress(task: CrimboTask, outfit: Outfit): void {
Expand All @@ -82,13 +65,7 @@ export class CrimboEngine extends Engine<never, CrimboTask> {
}

execute(task: CrimboTask): void {
const ncBefore = countAvailableNcForces();
super.execute(task);
const ncAfter = countAvailableNcForces();

if (ncBefore > ncAfter) {
ncForced = true;
}
}

setChoices(task: CrimboTask, manager: PropertiesManager): void {
Expand Down
13 changes: 4 additions & 9 deletions src/familiar/constantValueFamiliars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
Robortender,
} from "libram";

import { garboAverageValue, garboValue } from "../garboValue";
import { garboValue } from "../value";

import { GeneralFamiliar, MenuOptions } from "./lib";

Expand All @@ -29,16 +29,14 @@ const standardFamiliars: ConstantValueFamiliar[] = [
{
familiar: $familiar`Stocking Mimic`,
value: ({ allowEquipment }) =>
(allowEquipment
? garboAverageValue(...$items`Polka Pop, BitterSweetTarts, Piddles`) / 6
: 0) +
(allowEquipment ? garboValue(...$items`Polka Pop, BitterSweetTarts, Piddles`) / 6 : 0) +
(1 / 3 + (have($effect`Jingle Jangle Jingle`) ? 0.1 : 0)) *
(familiarWeight($familiar`Stocking Mimic`) + weightAdjustment()),
},
{
familiar: $familiar`Shorter-Order Cook`,
value: ({ allowEquipment }) =>
garboAverageValue(
garboValue(
...$items`short beer, short stack of pancakes, short stick of butter, short glass of water, short white`
) / (allowEquipment ? 9 : 11),
},
Expand Down Expand Up @@ -75,10 +73,7 @@ const standardFamiliars: ConstantValueFamiliar[] = [
{
familiar: $familiar`Cookbookbat`,
value: () =>
(3 *
garboAverageValue(
...$items`Vegetable of Jarlsberg, Yeast of Boris, St. Sneaky Pete's Whey`
)) /
(3 * garboValue(...$items`Vegetable of Jarlsberg, Yeast of Boris, St. Sneaky Pete's Whey`)) /
11,
},
{
Expand Down
9 changes: 3 additions & 6 deletions src/familiar/dropFamiliars.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Familiar, Item } from "kolmafia";
import { $familiar, $item, $items, findLeprechaunMultiplier, have } from "libram";

import { garboAverageValue, garboValue } from "../garboValue";
import { garboValue } from "../value";

import { GeneralFamiliar } from "./lib";

Expand All @@ -13,7 +13,7 @@ type StandardDropFamiliar = {
};

function dropValue(drop: Item | Item[]): number {
return drop instanceof Item ? garboValue(drop) : garboAverageValue(...drop);
return drop instanceof Item ? garboValue(drop) : garboValue(...drop);
}

function valueStandardDropFamiliar({
Expand Down Expand Up @@ -146,10 +146,7 @@ const rotatingFamiliars: StandardDropFamiliar[] = [
$item`Recipe of Before Yore: St. Pete's sneaky smoothie`,
],
additionalValue: () =>
(3 *
garboAverageValue(
...$items`Vegetable of Jarlsberg, Yeast of Boris, St. Sneaky Pete's Whey`
)) /
(3 * garboValue(...$items`Vegetable of Jarlsberg, Yeast of Boris, St. Sneaky Pete's Whey`)) /
11,
},
];
Expand Down
2 changes: 1 addition & 1 deletion src/familiar/freeFightFamiliar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { canOpenRedPresent } from ".";
import { Familiar, familiarWeight } from "kolmafia";
import { $familiar, $item, $location, clamp, get, have } from "libram";

import { garboValue } from "../garboValue";
import { sober } from "../lib";
import { garboValue } from "../value";

import getConstantValueFamiliars from "./constantValueFamiliars";
import getDropFamiliars from "./dropFamiliars";
Expand Down
163 changes: 0 additions & 163 deletions src/garboValue.ts

This file was deleted.

54 changes: 54 additions & 0 deletions src/islands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { Element, Item, Location, Monster } from "kolmafia";
import { $element, $item, $location, $monster } from "libram";

export type HolidayIsland = {
location: Location;
orbTarget: Monster;
element: Element;
choice: number;
currency: Item;
};

const Easter: HolidayIsland = {
location: $location`Easter Island`,
element: $element`Stench`,
orbTarget: $monster`moai`,
choice: 1538,
currency: $item`Spirit of Easter`,
};

const StPatricksDay: HolidayIsland = {
location: $location`St. Patrick's Day Island`,
element: $element`Sleaze`,
orbTarget: $monster`giant potato`,
choice: 1539,
currency: $item`Spirit of St. Patrick's Day`,
};

const VeteransDay: HolidayIsland = {
location: $location`Veterans Day Island`,
element: $element`Hot`,
orbTarget: $monster`Section 11`,
choice: 1540,
currency: $item`Spirit of Veteran's Day`,
};

const Thanksgiving: HolidayIsland = {
location: $location`Thanksgiving Island`,
element: $element`Cold`,
orbTarget: $monster`pumpkin spice wraith`,
choice: 1541,
currency: $item`Spirit of Thanksgiving`,
};

const Christmas: HolidayIsland = {
// eslint-disable-next-line libram/verify-constants
location: $location`Christmas Island`,
element: $element`spooky`,
// eslint-disable-next-line libram/verify-constants
orbTarget: $monster`magically-animated snowman`,
choice: 1542,
currency: $item`Spirit of Christmas`,
};

export default { Easter, StPatricksDay, VeteransDay, Thanksgiving, Christmas };
Loading
Loading