More changes, im going to bed

This commit is contained in:
2026-11-06 00:17:27 -03:00
parent 9bec0f3718
commit 7458a2d42a
13 changed files with 35 additions and 53 deletions
-17
View File
@@ -102,23 +102,6 @@ Deno.test("items only go in the slots they fit, and fall out when the player die
assert(curios_items(t.take(1)).every((item: Msg) => item === null));
});
Deno.test("curios worn when curios was a mod of its own are still worn", async () => {
const t = await setup();
t.send(1, { type: "click", menu: 0, slot: 0, button: 0, shift: true });
t.game.on_disconnect(1);
// how a save from then kept which container is each player's curios
const save = t.game.save();
const level = JSON.parse(save.level);
level.mod_storage.curios = { containers: level.mod_storage.bworld.curios };
delete level.mod_storage.bworld.curios;
const loaded = await setup({ ...save, level: JSON.stringify(level) });
const ring = loaded.game.players()[0].inventory_menu.extra[curio_slot(loaded, "ring")];
assertEquals(ring.container.get_item(ring.index)?.to_data(), { id: "jewelry:ring", count: 1 });
assertEquals(loaded.game.mods.storage.curios, undefined);
});
Deno.test("the giant chestplate goes in the body slot and gives 20 more health while worn", async () => {
const t = await setup();
t.send(1, { type: "chat", text: "/give bworld:giant_chestplate" });
+2 -2
View File
@@ -111,7 +111,7 @@ Deno.test("a worldgen mod hooks the terrain in engine.common", async () => {
`import { engine, hook } from "cubi/engine";
// no ground anywhere, so it's all sea
export function setup() {
hook(engine.common.OverworldTerrain.prototype, "density", { replace: () => -1 });
hook(engine.common.NoiseTerrain.prototype, "density", { replace: () => -1 });
}`,
],
})
@@ -136,7 +136,7 @@ Deno.test({
"worldgen.ts",
`import { engine, hook } from "cubi/engine";
export function setup() {
hook(engine.common.OverworldTerrain.prototype, "density", { replace: () => -1 });
hook(engine.common.NoiseTerrain.prototype, "density", { replace: () => -1 });
}`,
],
})