Move effects out of cubi

This commit is contained in:
2026-11-05 22:37:41 -03:00
parent 0e2d8fdcac
commit 9bc8fd992a
17 changed files with 452 additions and 70 deletions
+12
View File
@@ -398,6 +398,18 @@ Deno.test("a stonecutter cuts its input into the recipe picked with a button, on
);
});
Deno.test("resistance takes 20% off damage for each level, but not off what nothing could stop", async () => {
const t = await setup();
const alice = t.game.players()[0];
const amounts: number[] = [];
// loaded after bworld, so it sees what resistance left
t.game.mods.before.entity_damage.for_mod("test").subscribe((event) => amounts.push(event.amount));
t.game.mods.player(alice).add_effect("bworld:resistance", 100, { amplifier: 1 });
t.game.damage_player(alice, 10, "fall");
t.game.damage_player(alice, 10, "void");
assertEquals(amounts, [6, 10]);
});
Deno.test("a bucket picks up a water source but not flowing water, and a water bucket puts a source back", async () => {
const t = await setup([["bworld:bucket", 1]]);
const held = () => t.game.players()[0].held_item?.type_id;