feat: Finishing polish + Audio gestion
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user