Effect icons and tooltip !
This commit is contained in:
@@ -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");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user