Effect icons and tooltip !

This commit is contained in:
2026-10-02 13:16:50 -03:00
parent e560cb3928
commit f749f6be79
22 changed files with 131 additions and 19 deletions
+13
View File
@@ -196,3 +196,16 @@ Deno.test("under water they run out of air, shown in bubbles, then drown", async
for (let i = 0; i < 300; i++) t.game.tick();
assert(t.player.health < MAX_HEALTH);
});
Deno.test("the effects that show an icon are sent to the player when they change", async () => {
const t = await setup();
const api = t.game.mods.player(t.player);
api.add_effect("bworld:speed", 100, { amplifier: 1 });
api.add_effect("bworld:poison", 100, { show_icon: false });
t.take(1);
t.game.tick();
const sent = t.take(1).filter((m: Msg) => m.type === "effects");
assertEquals(sent.at(-1).effects, [{ id: "bworld:speed", amplifier: 1, duration: 99 }]);
t.game.tick();
assert(!t.take(1).some((m: Msg) => m.type === "effects"), "not again while they only count down");
});