From 1239dc3aa73c488990a40dc356fdc1e7ba40940c Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 23 Oct 2026 15:01:29 +0200 Subject: companion: her lines and the opening monologue Fixed English lines per reaction, terse in the game's register, and the opening monologue split at its sentences so each fills one bubble. Co-Authored-By: Claude Opus 5.5 --- desktop/companion/Lines.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 desktop/companion/Lines.js (limited to 'desktop') diff --git a/desktop/companion/Lines.js b/desktop/companion/Lines.js new file mode 100644 index 0000000..6f387aa --- /dev/null +++ b/desktop/companion/Lines.js @@ -0,0 +1,45 @@ +// Copyright (C) 2026 Danilo M. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +.pragma library + +// What she says, in English, grouped by the reaction that says it. +// Companion.qml picks one at random per reaction and keeps to one line in +// 30 s, except for clicks and the self-destruct (Mood.canSpeak). + +var lines = { + shown: ["Glory to mankind.", "2B, reporting.", "...Back on duty."], + bored: ["...Operator, I'm bored.", "Nothing to report.", "Awaiting orders."], + wake: ["I'm awake.", "Systems online."], + mock: ["Typo again?", "Delete, delete, delete.", "Were you aiming for that key?"], + shoved: ["Hey.", "Rude.", "I was standing here."], + ready: ["Answer's ready.", "Your reply came in."], + click: ["...Yes?", "Can I help you?"], + blush: ["S-stop that.", "...Operator."], + dodge: ["...Fine.", "I'll move."], + destruct: ["Self-destruct sequence initiated."], + aftermath: ["...That was unpleasant."], +}; + +// The game's opening, one sentence per bubble. +var monologue = [ + "Everything that lives is designed to end.", + "We are perpetually trapped in a never-ending spiral of life and death.", + "Is this a curse?", + "Or some kind of punishment?", + "I often think about the god who blessed us with this cryptic puzzle...and wonder if we'll ever get the chance to kill him.", +]; + +// A line for kind; roll is Math.random(). "" for a kind with no lines. +function pick(kind, roll) { + const l = lines[kind] || []; + return l.length ? l[Math.min(l.length - 1, Math.floor(roll * l.length))] : ""; +} -- cgit v1.2.3