From 5e506270a8e5c891070672b60b7a397a4b1aec1e Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 23 Oct 2026 15:10:19 +0200 Subject: companion: shoved for a moment, then mad beside the balloon The shoved frame held for as long as a balloon stayed, which read as her stumbling for ten seconds. It now lasts T.shoveHold (1.2 s), then she is mad beside the balloon until it goes. shovedAt is reset to 0 when the shove ends and 0 reads as the shove's first instant, so the binding cannot show mad for a tick before the handler stamps the time. Co-Authored-By: Claude Opus 5.5 --- desktop/companion/test_mood.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'desktop/companion/test_mood.js') diff --git a/desktop/companion/test_mood.js b/desktop/companion/test_mood.js index abdb348..90ebdd6 100644 --- a/desktop/companion/test_mood.js +++ b/desktop/companion/test_mood.js @@ -24,7 +24,7 @@ const M = new Function(src + const NOW = 10000000; // A snapshot with nothing going on, overridden per case. const calm = over => Object.assign({ - now: NOW, destructAt: 0, dodging: false, shoved: false, recording: false, busy: false, + now: NOW, destructAt: 0, dodging: false, shoved: false, shovedAt: 0, recording: false, busy: false, repliedAt: 0, clicks: { count: 0, at: 0 }, mockAt: 0, typingAt: 0, wakeAt: 0, monologue: false, idle: 0, }, over); @@ -56,8 +56,11 @@ for (let i = 0; i < ladder.length; i++) { assert.strictEqual(state(all), ladder[i][0], "everything from " + ladder[i][0] + " down"); } -// Shoved has a frame of its own: knocked off balance, glaring at the balloon. -assert.deepStrictEqual(M.pick(calm({ shoved: true })), { state: "shoved", frame: "shoved" }); +// Shoved: knocked off balance for a moment, then mad beside the balloon +// for as long as it stays. +assert.deepStrictEqual(M.pick(calm({ shoved: true, shovedAt: NOW - 10 })), { state: "shoved", frame: "shoved" }); +assert.deepStrictEqual(M.pick(calm({ shoved: true, shovedAt: NOW - M.T.shoveHold })), { state: "shoved", frame: "mad" }); +assert.strictEqual(frame({ shoved: true, shovedAt: 0 }), "shoved"); // Idle levels and their frames. assert.deepStrictEqual(M.pick(calm({ idle: 1 })), { state: "bored", frame: "sleepy" }); -- cgit v1.2.3