feat: Finishing polish + Audio gestion

This commit is contained in:
gauvainboiche
2026-10-25 22:12:27 +01:00
parent c55e5a2484
commit 7a525d084a
6 changed files with 189 additions and 8 deletions
+17
View File
@@ -479,6 +479,23 @@ assert.equal(E.advanceDay(s, bal).blocked, "over");
assert.equal(up.state.pendingCard, undefined);
}
// 13. scenario-only cards and the clock's catch-up cap
{
const mk = (id, extra = {}) => ({ id, category: "economy", doc: "memo", sender: "min_finance", title: { en: id, fr: id }, body: { en: "b", fr: "b" }, yes: { label: { en: "y", fr: "o" } }, no: { label: { en: "n", fr: "n" } }, ...extra });
const g = fresh(9); open(g);
assert.equal(E.drawCard(g, bal, [mk("elsewhere", { scenarios: ["other"] })]), null, "a card for another scenario is never drawn");
assert.equal(E.drawCard(g, bal, [mk("here", { scenarios: ["default"] })])?.id, "here");
assert.equal(E.drawCard(g, bal, [mk("everywhere")])?.id, "everywhere", "no scenarios field: every scenario");
const clock = E.createClock();
assert.equal(E.consumeClock(clock, 5000, 10000, 1), 0, "by default one step is capped at a second");
const wake = E.createClock();
assert.equal(E.consumeClock(wake, 45000, 10000, 1, 60000), 4, "a frozen tab catches up within the given cap");
const capped = E.createClock();
assert.equal(E.consumeClock(capped, 900000, 10000, 1, 60000), 6, "and no further than the cap");
assert.equal(E.consumeClock(E.createClock(), -50, 10000, 1, 60000), 0);
}
// M8: world cycle, growing needs, card conditions on choices, coup from neglect, v1 saves
{
// the world cycle moves, stays within bounds and is part of the saved state