Lava fishing
This commit is contained in:
@@ -566,3 +566,39 @@ Deno.test("the chess minigame lands the fish when its screen says the mate was p
|
||||
assertEquals(t.fish().length, 1);
|
||||
}, "chess");
|
||||
});
|
||||
|
||||
Deno.test("fishing in lava catches the lava fish, from lava's own table", async () => {
|
||||
const t = await setup();
|
||||
const lava_fish = [
|
||||
"bworld:lava_eel",
|
||||
"bworld:magma_slimefish",
|
||||
"bworld:mother_moon",
|
||||
"bworld:prismfish",
|
||||
"bworld:totemfish",
|
||||
"bworld:true_goldfish",
|
||||
"bworld:vampire_squid",
|
||||
];
|
||||
// the pond is lava instead
|
||||
for (let x = -3; x <= 3; x++) {
|
||||
for (let z = -9; z <= -3; z++) t.game.set_block(x, 99, z, "bworld:lava");
|
||||
}
|
||||
await with_minigames(async () => {
|
||||
for (let i = 0; i < 5; i++) {
|
||||
t.cast();
|
||||
assertEquals(t.hooks().length, 1);
|
||||
assert(t.wait_for_bite());
|
||||
t.reel();
|
||||
t.game.tick();
|
||||
}
|
||||
// the same fish twice stacks in one slot
|
||||
const caught = t.fish().map((i: Msg) => i.id);
|
||||
assertEquals(t.fish().reduce((count: number, i: Msg) => count + i.count, 0), 5);
|
||||
assert(caught.every((id: string) => lava_fish.includes(id)), caught.join(", "));
|
||||
}, null);
|
||||
// and no lava fish in water's table
|
||||
const water = EverythingRegistry.get<{ pools: { entries: { item: string }[] }[] }>(
|
||||
"loot_tables",
|
||||
"bworld:gameplay/fishing",
|
||||
)!;
|
||||
assert(water.pools[0].entries.every((e) => !lava_fish.includes(e.item)));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user