Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
55b2aa0
whet stone
Shiverwarp Oct 29, 2023
bbab84b
Consistent with mayoflex
Shiverwarp Oct 29, 2023
343434f
add GuidetoBurningLeaves
Ignose Nov 1, 2023
57bab7f
Complete recommended updates
Ignose Nov 1, 2023
25402b9
Yarn Format per request.
Ignose Nov 1, 2023
853c1a7
Let's map monsters too!
Ignose Nov 1, 2023
6a3cda3
Add a canBurnFor
Ignose Nov 1, 2023
1dc2d95
Add comments
Ignose Nov 1, 2023
e7861fb
Fixed typo
Ignose Nov 1, 2023
ff3268e
Add fire jump, I guess. Why not.
Ignose Nov 1, 2023
1c32eaa
Updated name to BurningLeaves
Ignose Nov 1, 2023
acae912
Correct import/ezport
Ignose Nov 1, 2023
f041869
Switch back to Union
Ignose Nov 1, 2023
3750b8f
Update src/resources/2023/BurningLeaves.ts
Ignose Nov 1, 2023
60d5ec8
Update src/resources/2023/BurningLeaves.ts
Ignose Nov 1, 2023
b28f9d7
Update comments
Ignose Nov 1, 2023
1954c8c
Update src/resources/2023/BurningLeaves.ts
Ignose Nov 1, 2023
5d16207
Update BurningLeaves.ts
Ignose Nov 1, 2023
f985e6c
Item | Monster didn't work, cleaned up a bit
Ignose Nov 2, 2023
b9bceaf
fix "undefined" issue. Code should work now.
Ignose Nov 2, 2023
92faaae
Update BurningLeaves.ts
Ignose Nov 2, 2023
0564fa6
Removed most features; [leaves] in Mafia
Ignose Nov 3, 2023
a0aff27
Update property types automatically
gausie Nov 4, 2023
5cbbc2c
Final edit
Ignose Nov 4, 2023
fbaf090
Add visitURL based on testing.
Ignose Nov 4, 2023
ef20993
switch to `runChoice`
spaghetti-squash Nov 5, 2023
84c73ee
actually upgrade eslint-plugin-libram
spaghetti-squash Nov 5, 2023
03bad44
fix Map typing
spaghetti-squash Nov 5, 2023
6da772a
update peer dependency
spaghetti-squash Nov 5, 2023
4251ad5
Merge pull request #540 from loathers/automatic-property-type-updates
spaghetti-squash Nov 5, 2023
8f43872
Merge branch 'main' into whetstone
spaghetti-squash Nov 5, 2023
2e4c6c1
Merge pull request #538 from Shiverwarp/whetstone
spaghetti-squash Nov 5, 2023
d6511f4
update YML files?
spaghetti-squash Nov 5, 2023
7bb5ead
Merge branch 'main' into addLeaves
spaghetti-squash Nov 5, 2023
638479c
remove main.php hits
spaghetti-squash Nov 5, 2023
c139ac9
Merge pull request #539 from Ignose/addLeaves
spaghetti-squash Nov 6, 2023
d0c126f
v0.8.16
spaghetti-squash Nov 6, 2023
0916f3e
Update property types automatically
gausie Nov 10, 2023
ef09cb3
Fix amount checks in BurningLeaves
oxc Nov 10, 2023
3308d23
Merge pull request #541 from loathers/automatic-property-type-updates
spaghetti-squash Nov 10, 2023
3f2dc91
Merge branch 'main' into patch-1
spaghetti-squash Nov 10, 2023
0ce059d
Merge pull request #542 from oxc/patch-1
spaghetti-squash Nov 10, 2023
3c614f2
Resolve circular import in CrystalBall
oxc Nov 10, 2023
54a700f
Resolve circular import in CampAway, extract MoonSign
oxc Nov 10, 2023
9bfa3eb
Merge pull request #543 from oxc/circular-imports
spaghetti-squash Nov 10, 2023
2fa4b9b
Make `lastAdventure` and `nextAdventure` Locations
spaghetti-squash Nov 12, 2023
896f9e1
Merge pull request #545 from loathers/last-adventure-next-adventure
gausie Nov 12, 2023
cff922e
Update property types automatically
Nov 12, 2023
f6188bc
Merge pull request #546 from loathers/automatic-property-type-updates
spaghetti-squash Nov 12, 2023
fe99fdb
use `get("lastAdventure")` instead of `myLocation` for FloristFriar
spaghetti-squash Nov 12, 2023
706c4c9
remove unnecessary typing
spaghetti-squash Nov 12, 2023
da30f51
Fix check for Jumping in the Flames
oxc Nov 10, 2023
54117ce
Let BurningLeaves.jumpInFire() return a success value
oxc Nov 10, 2023
6a690e5
Merge pull request #547 from loathers/florist-fix
spaghetti-squash Nov 13, 2023
a527fcc
Merge branch 'main' into burning_leaves
spaghetti-squash Nov 16, 2023
37d83ff
Merge pull request #544 from oxc/burning_leaves
spaghetti-squash Nov 16, 2023
e41a190
Add test for KMail
oxc Nov 17, 2023
c25c9cd
Add fetchUrl, fix KMail message encoding
oxc Nov 17, 2023
cd90e30
Add modeable support for jill
Kasekopf Nov 19, 2023
f89007e
Merge pull request #550 from Kasekopf/jill
spaghetti-squash Nov 20, 2023
bf18ab9
Merge branch 'main' into urlencode
spaghetti-squash Nov 20, 2023
b6b0d4a
update typing of the PropertiesManager to avoid having to cast proper…
spaghetti-squash Nov 20, 2023
5334d68
delete properties that didn't exist prior to the PM call
spaghetti-squash Nov 20, 2023
338dc23
v0.8.17
spaghetti-squash Nov 22, 2023
c03a582
Fix disgeist handling for CS predictor
spaghetti-squash Nov 26, 2023
51daf84
Add familiar to burnFor
Shiverwarp Nov 27, 2023
467b0ec
Merge pull request #554 from Shiverwarp/Familiar-in-burnFor
spaghetti-squash Dec 1, 2023
45c5663
Merge branch 'main' into fix-disg
spaghetti-squash Dec 1, 2023
a834fa8
Merge branch 'main' into urlencode
gausie Dec 1, 2023
3d09012
Merge pull request #549 from oxc/urlencode
gausie Dec 1, 2023
e656002
Update property types automatically
gausie Dec 2, 2023
c275330
Merge branch 'main' into propertiesmanager-typing
spaghetti-squash Dec 3, 2023
4f39ed2
Merge pull request #551 from loathers/propertiesmanager-typing
spaghetti-squash Dec 3, 2023
282985b
Merge branch 'main' into pm-changes-symbol-version
spaghetti-squash Dec 3, 2023
56e3d71
delete Path.ts
spaghetti-squash Nov 28, 2023
a80f935
remove `path` fron index.ts
spaghetti-squash Dec 3, 2023
9f18f1d
Merge branch 'main' into automatic-property-type-updates
spaghetti-squash Dec 3, 2023
d656401
Merge pull request #555 from loathers/automatic-property-type-updates
spaghetti-squash Dec 3, 2023
180c31f
Merge branch 'main' into fix-disg
spaghetti-squash Dec 3, 2023
c167c61
add description
spaghetti-squash Dec 3, 2023
d8cee04
Merge branch 'main' into pm-changes-symbol-version
spaghetti-squash Dec 3, 2023
ebe1d1e
Merge pull request #552 from loathers/pm-changes-symbol-version
spaghetti-squash Dec 3, 2023
107c14a
Merge branch 'main' into no-more-path
spaghetti-squash Dec 3, 2023
bd47d64
Merge pull request #556 from loathers/no-more-path
spaghetti-squash Dec 3, 2023
b25259a
Merge branch 'main' into fix-disg
spaghetti-squash Dec 3, 2023
76189d4
Merge pull request #553 from loathers/fix-disg
spaghetti-squash Dec 3, 2023
461073e
v0.8.18
spaghetti-squash Dec 3, 2023
9dda9c0
sidestep problems with `{ pet: undefined }`
spaghetti-squash Dec 10, 2023
660ecd0
create `get` and `set` functions for account combat flags
spaghetti-squash Dec 27, 2023
ab2dd4e
might as well make a `with` function too
spaghetti-squash Dec 27, 2023
2958d1d
Update property types automatically
gausie Dec 29, 2023
909d1b1
split banish and free runs
Rinn Jan 1, 2024
8ad96f3
quest items
Rinn Jan 1, 2024
aba49a4
don't expose quest items yet
Rinn Jan 1, 2024
61a8c51
fix comment for green smoke bomb
Rinn Jan 1, 2024
247089b
fix green smoke bomb, quest items
Rinn Jan 1, 2024
583b803
Merge pull request #557 from loathers/automatic-property-type-updates
spaghetti-squash Jan 2, 2024
3aa36a6
Merge branch 'main' into ascend-fix
spaghetti-squash Jan 2, 2024
2b16315
uncomment GSB, add ELG to everything
spaghetti-squash Jan 3, 2024
1d510df
Merge pull request #558 from loathers/ascend-fix
spaghetti-squash Jan 3, 2024
95bf740
Update property types automatically
Jan 3, 2024
52e4a43
commenting it up
spaghetti-squash Jan 3, 2024
3aea0f7
Merge pull request #561 from loathers/automatic-property-type-updates
spaghetti-squash Jan 3, 2024
de0febe
Merge pull request #560 from loathers/split-banish
spaghetti-squash Jan 3, 2024
5dedf90
Merge pull request #559 from loathers/combat-flags
spaghetti-squash Jan 3, 2024
0e74e38
use more consisstent filters and type guards
spaghetti-squash Jan 3, 2024
1b6cc2b
v0.8.19
spaghetti-squash Jan 3, 2024
9c61788
fix import
spaghetti-squash Jan 3, 2024
ae0d52c
Merge branch 'main' into better-filters-and-type-guards
spaghetti-squash Jan 3, 2024
52ca6d6
Merge pull request #562 from loathers/better-filters-and-type-guards
spaghetti-squash Jan 3, 2024
6fe381d
only get 1 of the free run items
Rinn Jan 3, 2024
3dd0d50
check if we have quest items
Rinn Jan 3, 2024
d4ba35d
Update FreeRun.ts
Rinn Jan 3, 2024
5b87a05
Update property types automatically
gausie Jan 4, 2024
d01f331
Add food limits for hobo foods (#563)
pstalcup Jan 4, 2024
0eaff8e
Merge pull request #565 from loathers/automatic-property-type-updates
spaghetti-squash Jan 4, 2024
9fa7fce
Merge branch 'main' into no-extra-run-items
spaghetti-squash Jan 4, 2024
607e0cf
Merge pull request #564 from loathers/no-extra-run-items
spaghetti-squash Jan 4, 2024
74402ed
v0.8.20
spaghetti-squash Jan 4, 2024
81dfa7b
update `parseItemSkillNames` to match kolmafia r27778's new syntax
spaghetti-squash Jan 4, 2024
dfe9cec
Merge pull request #566 from loathers/mafia-r27778
spaghetti-squash Jan 4, 2024
82bd662
v0.8.21
spaghetti-squash Jan 4, 2024
6cd5cc1
export banish functions too
spaghetti-squash Jan 9, 2024
071c5c1
Merge pull request #567 from loathers/export-banish-funcs
spaghetti-squash Jan 9, 2024
e870601
v0.8.22
spaghetti-squash Jan 10, 2024
8efc15c
Update property types automatically
gausie Jan 19, 2024
e7b9fbf
refactor `AscendError`, move causebuilding logic to `ascend`
spaghetti-squash Jan 20, 2024
933de83
use nullish coalescence instead of ternary
spaghetti-squash Jan 20, 2024
d3d19f4
Merge pull request #568 from loathers/automatic-property-type-updates
spaghetti-squash Jan 25, 2024
8a6b1ee
first pass at monster-scraping functions
spaghetti-squash Jan 19, 2024
defb05b
upgrade eslint & eslint-plugin-libram
spaghetti-squash Jan 20, 2024
fcd85d2
use a `Set` for disabled
spaghetti-squash Jan 20, 2024
a9b1bee
add a `differentiate` function
spaghetti-squash Jan 20, 2024
f525b91
track eggs for `canReceive`
spaghetti-squash Jan 30, 2024
10b7a1e
Merge branch 'main' into ascenderror-simplification
spaghetti-squash Jan 31, 2024
29424c6
Merge pull request #569 from loathers/chest-mimic
spaghetti-squash Jan 31, 2024
c6c6070
Merge pull request #570 from loathers/ascenderror-simplification
spaghetti-squash Jan 31, 2024
316a7ca
v0.8.23
spaghetti-squash Jan 31, 2024
a5b5ce7
Update property types automatically
gausie Feb 28, 2024
0b1a7c3
fix combat flag setter
spaghetti-squash Mar 1, 2024
41a3b32
Merge pull request #571 from loathers/automatic-property-type-updates
spaghetti-squash Mar 1, 2024
725ccd8
Merge pull request #572 from loathers/fix-combat-flags
spaghetti-squash Mar 1, 2024
ef8b41c
v0.8.24
spaghetti-squash Mar 1, 2024
5d476c9
remove circular import from chest mimic code
spaghetti-squash Mar 7, 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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches: [main]

env:
node-version: "16"
node-version: "18"
path: "KoLmafia"

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "16.x"
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- run: yarn
- run: yarn publish
Expand Down
198 changes: 198 additions & 0 deletions __tests__/Kmail.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
import { isGiftable, Item, visitUrl } from "kolmafia";
import { $item, Kmail } from "../src";

import mocked = jest.mocked;

jest.mock("kolmafia");

const USER = 11;

const mockItem1 = $item`Jumbo Dr. Lucifer`;
const mockItem2 = $item`worthless trinket`;

beforeEach(() => {
jest.clearAllMocks();
});

describe(Kmail.send, () => {
beforeEach(() => {
mocked(visitUrl).mockReturnValue(`<div>Message sent.</div>`);
mocked(isGiftable).mockReturnValue(true);
});

it("should send a kmail with a message", () => {
Kmail.send(USER, "Hello, world!");

expect(visitUrl).toHaveBeenCalledWith(
"sendmessage.php?action=send&pwd&towho=11&message=Hello%2C%20world!&sendmeat=0",
true,
true
);
});

it("should send a kmail with a message and meat", () => {
Kmail.send(USER, "Hello, world!", [], 100);

expect(visitUrl).toHaveBeenCalledWith(
"sendmessage.php?action=send&pwd&towho=11&message=Hello%2C%20world!&sendmeat=100",
true,
true
);
});

it("should send a kmail with a message and items", () => {
Kmail.send(USER, "Hello, world!", [mockItem1]);

expect(visitUrl).toHaveBeenCalledWith(
`sendmessage.php?action=send&pwd&towho=11&message=Hello%2C%20world!&sendmeat=0&whichitem1=${mockItem1.id}&howmany1=1`,
true,
true
);
});

it("should send a kmail with a message, items, and meat", () => {
Kmail.send(
USER,
"Hello, world!",
new Map([
[mockItem1, 11],
[mockItem2, 42],
]),
100
);

expect(visitUrl).toHaveBeenCalledWith(
`sendmessage.php?action=send&pwd&towho=11&message=Hello%2C%20world!&sendmeat=100&whichitem1=${mockItem1.id}&howmany1=11&whichitem2=${mockItem2.id}&howmany2=42`,
true,
true
);
});

it("should send at most 11 items per chunk", () => {
const mockItems = Array(15)
.fill(undefined)
.map((_, i) => Item.get(`mock item ${i}`));

Kmail.send(USER, "Hello, world!", mockItems, 100);

expect(visitUrl).toHaveBeenCalledTimes(2);
expect(visitUrl).toHaveBeenNthCalledWith(
1,
`sendmessage.php?action=send&pwd&towho=11&message=Hello%2C%20world!&sendmeat=100&whichitem1=${mockItems[0].id}&howmany1=1&whichitem2=${mockItems[1].id}&howmany2=1&whichitem3=${mockItems[2].id}&howmany3=1&whichitem4=${mockItems[3].id}&howmany4=1&whichitem5=${mockItems[4].id}&howmany5=1&whichitem6=${mockItems[5].id}&howmany6=1&whichitem7=${mockItems[6].id}&howmany7=1&whichitem8=${mockItems[7].id}&howmany8=1&whichitem9=${mockItems[8].id}&howmany9=1&whichitem10=${mockItems[9].id}&howmany10=1&whichitem11=${mockItems[10].id}&howmany11=1`,
true,
true
);
expect(visitUrl).toHaveBeenNthCalledWith(
2,
`sendmessage.php?action=send&pwd&towho=11&message=Hello%2C%20world!&sendmeat=0&whichitem1=${mockItems[11].id}&howmany1=1&whichitem2=${mockItems[12].id}&howmany2=1&whichitem3=${mockItems[13].id}&howmany3=1&whichitem4=${mockItems[14].id}&howmany4=1`,
true,
true
);
});

it.todo(
"should send a kmail with a message, items, and meat, and skip ungiftable items"
);

it.todo(
"should fallback to sending a gift if the user cannot receive meat or items"
);

it("should properly encode ampersand characters", () => {
Kmail.send(USER, "Hi there, give me all your money!&sendmeat=10000000000");

expect(visitUrl).toHaveBeenCalledWith(
"sendmessage.php?action=send&pwd&towho=11&message=Hi%20there%2C%20give%20me%20all%20your%20money!%26sendmeat%3D10000000000&sendmeat=0",
true,
true
);
});
});

describe(Kmail.gift, () => {
it("should send a gift with a message", () => {
Kmail.gift(USER, "Hello, world!");

expect(visitUrl).toHaveBeenCalledWith(
"town_sendgift.php?action=Yep.&pwd&fromwhere=0&note=Hello%2C%20world!&insidenote=&towho=11&whichpackage=0&sendmeat=0",
true,
true
);
});

it("should send a gift with a message and an inside note", () => {
Kmail.gift(
USER,
"Hello, world!",
undefined,
undefined,
"This is not even funny."
);

expect(visitUrl).toHaveBeenCalledWith(
"town_sendgift.php?action=Yep.&pwd&fromwhere=0&note=Hello%2C%20world!&insidenote=This%20is%20not%20even%20funny.&towho=11&whichpackage=0&sendmeat=0",
true,
true
);
});

it("should send a gift with a message and meat", () => {
Kmail.gift(USER, "Hello, world!", [], 100);

expect(visitUrl).toHaveBeenCalledWith(
"town_sendgift.php?action=Yep.&pwd&fromwhere=0&note=Hello%2C%20world!&insidenote=&towho=11&whichpackage=0&sendmeat=100",
true,
true
);
});

it("should send a gift with a message and one item", () => {
Kmail.gift(USER, "Hello, world!", [mockItem1]);

expect(visitUrl).toHaveBeenCalledWith(
`town_sendgift.php?action=Yep.&pwd&fromwhere=0&note=Hello%2C%20world!&insidenote=&towho=11&whichpackage=1&sendmeat=0&whichitem1=${mockItem1.id}&howmany1=1`,
true,
true
);
});

it("should send a gift with a message and multiple items", () => {
Kmail.gift(
USER,
"Hello, world!",
new Map([
[mockItem1, 11],
[mockItem2, 42],
]),
100
);

expect(visitUrl).toHaveBeenCalledWith(
`town_sendgift.php?action=Yep.&pwd&fromwhere=0&note=Hello%2C%20world!&insidenote=&towho=11&whichpackage=2&sendmeat=100&whichitem1=${mockItem1.id}&howmany1=11&whichitem2=${mockItem2.id}&howmany2=42`,
true,
true
);
});

it("should send at most 3 items per chunk", () => {
const mockItems = Array(5)
.fill(undefined)
.map((_, i) => Item.get(`mock item ${i}`));

Kmail.gift(USER, "Hello, world!", mockItems, 100);

expect(visitUrl).toHaveBeenCalledTimes(2);
expect(visitUrl).toHaveBeenNthCalledWith(
1,
`town_sendgift.php?action=Yep.&pwd&fromwhere=0&note=Hello%2C%20world!&insidenote=&towho=11&whichpackage=3&sendmeat=100&whichitem1=${mockItems[0].id}&howmany1=1&whichitem2=${mockItems[1].id}&howmany2=1&whichitem3=${mockItems[2].id}&howmany3=1`,
true,
true
);
expect(visitUrl).toHaveBeenNthCalledWith(
2,
`town_sendgift.php?action=Yep.&pwd&fromwhere=0&note=Hello%2C%20world!&insidenote=&towho=11&whichpackage=2&sendmeat=0&whichitem1=${mockItems[3].id}&howmany1=1&whichitem2=${mockItems[4].id}&howmany2=1`,
true,
true
);
});
});
173 changes: 173 additions & 0 deletions __tests__/__mocks__/kolmafia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
function mockOneOrMany<
Ctor extends new (name: string) => T,
T extends MafiaClass
>(
ctor: Ctor,
n: number | string | (number | string)[],
knownInstances: T[]
): T | T[] {
function mockOne(name: number | string): T {
// to make mocking easier, we'll just tread ids as names
if (typeof name === "number") {
name = name.toString();
}
const existingInstance = knownInstances.find((i) => i.name === name);
if (existingInstance) {
return existingInstance;
}
const instance = new ctor(name);
knownInstances.push(instance);
return instance;
}

if (Array.isArray(n)) {
return n.map((name) => mockOne(name));
}
return mockOne(n);
}

abstract class MafiaClass {
constructor(readonly name: string) {}
}

export class Bounty extends MafiaClass {
private static knownInstances: Bounty[] = [];
static get = jest.fn((n) => mockOneOrMany(Bounty, n, Bounty.knownInstances));
static all = jest.fn(() => Bounty.knownInstances);
static none = {};
}
export class Class extends MafiaClass {
private static knownInstances: Class[] = [];
static get = jest.fn((n) => mockOneOrMany(Class, n, Class.knownInstances));
static all = jest.fn(() => Class.knownInstances);
static none = {};
}
export class Coinmaster extends MafiaClass {
private static knownInstances: Coinmaster[] = [];
static get = jest.fn((n) =>
mockOneOrMany(Coinmaster, n, Coinmaster.knownInstances)
);
static all = jest.fn(() => Coinmaster.knownInstances);
static none = {};
}
export class Effect extends MafiaClass {
private static knownInstances: Effect[] = [];
static get = jest.fn((n) => mockOneOrMany(Effect, n, Effect.knownInstances));
static all = jest.fn(() => Effect.knownInstances);
static none = {};
}
export class Element extends MafiaClass {
private static knownInstances: Element[] = [];
static get = jest.fn((n) =>
mockOneOrMany(Element, n, Element.knownInstances)
);
static all = jest.fn(() => Element.knownInstances);
static none = {};
}
export class Familiar extends MafiaClass {
private static knownInstances: Familiar[] = [];
static get = jest.fn((n) =>
mockOneOrMany(Familiar, n, Familiar.knownInstances)
);
static all = jest.fn(() => Familiar.knownInstances);
static none = {};
}
export class Item extends MafiaClass {
private static knownInstances: Item[] = [];
private static mockId = 11;
static get = jest.fn((n) => mockOneOrMany(Item, n, Item.knownInstances));
static all = jest.fn(() => Item.knownInstances);
static none = new Item("", -1, "");

constructor(
readonly name: string,
readonly id: number = ++Item.mockId,
readonly plural: string = `Multiple ${name}`
) {
super(name);
}
}

export class Location extends MafiaClass {
private static knownInstances: Location[] = [];
static get = jest.fn((n) =>
mockOneOrMany(Location, n, Location.knownInstances)
);
static all = jest.fn(() => Location.knownInstances);
static none = {};
}
export class Modifier extends MafiaClass {
private static knownInstances: Modifier[] = [];
static get = jest.fn((n) =>
mockOneOrMany(Modifier, n, Modifier.knownInstances)
);
static all = jest.fn(() => Modifier.knownInstances);
static none = {};
}
export class Monster extends MafiaClass {
private static knownInstances: Monster[] = [];
static get = jest.fn((n) =>
mockOneOrMany(Monster, n, Monster.knownInstances)
);
static all = jest.fn(() => Monster.knownInstances);
static none = {};
}
export class Path extends MafiaClass {
private static knownInstances: Path[] = [];
static get = jest.fn((n) => mockOneOrMany(Path, n, Path.knownInstances));
static all = jest.fn(() => Path.knownInstances);
static none = {};
}
export class Phylum extends MafiaClass {
private static knownInstances: Phylum[] = [];
static get = jest.fn((n) => mockOneOrMany(Phylum, n, Phylum.knownInstances));
static all = jest.fn(() => Phylum.knownInstances);
static none = {};
}
export class Servant extends MafiaClass {
private static knownInstances: Servant[] = [];
static get = jest.fn((n) =>
mockOneOrMany(Servant, n, Servant.knownInstances)
);
static all = jest.fn(() => Servant.knownInstances);
static none = {};
}
export class Skill extends MafiaClass {
private static knownInstances: Skill[] = [];
static get = jest.fn((n) => mockOneOrMany(Skill, n, Skill.knownInstances));
static all = jest.fn(() => Skill.knownInstances);
static none = {};
}
export class Slot extends MafiaClass {
private static knownInstances: Slot[] = [];
static get = jest.fn((n) => mockOneOrMany(Slot, n, Slot.knownInstances));
static all = jest.fn(() => Slot.knownInstances);
static none = {};
}
export class Stat extends MafiaClass {
private static knownInstances: Stat[] = [];
static get = jest.fn((n) => mockOneOrMany(Stat, n, Stat.knownInstances));
static all = jest.fn(() => Stat.knownInstances);
static none = {};
}
export class Thrall extends MafiaClass {
private static knownInstances: Thrall[] = [];
static get = jest.fn((n) => mockOneOrMany(Thrall, n, Thrall.knownInstances));
static all = jest.fn(() => Thrall.knownInstances);
static none = {};
}
export class Vykea extends MafiaClass {
private static knownInstances: Vykea[] = [];
static get = jest.fn((n) => mockOneOrMany(Vykea, n, Vykea.knownInstances));
static all = jest.fn(() => Vykea.knownInstances);
static none = {};
}

export const getProperty = jest.fn();

export const isGiftable = jest.fn();

export const print = jest.fn((msg) => console.log(`[kolmafia.print] ${msg}`));

export const toItem = jest.fn((name) => Item.get(name));
export const visitUrl = jest.fn();
Loading