MOLLY ROGER - INTERACTIVE GAME SOURCE CODE
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Ghost of Molly Roger</title>
<meta name="description" content="A branching psychic adventure in Victorian England, based on the SCP Foundation tale by psul.">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<meta name="theme-color" content="#09090b">
<link rel="icon" href="data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2212%22%20fill%3D%22%230b0a10%22%2F%3E%3Cpath%20d%3D%22M8%2036%20C18%2026%2030%2022%2040%2022%20C50%2022%2056%2026%2060%2030%20C56%2033%2052%2032%2048%2031%20C45%2020%2038%2014%2030%2015%20C23%2016%2018%2022%2016%2030%20C13%2031%2010%2033%208%2036%20Z%22%20fill%3D%22%238A6DFF%22%2F%3E%3Ccircle%20cx%3D%2232%22%20cy%3D%2244%22%20r%3D%224%22%20fill%3D%22none%22%20stroke%3D%22%23C9A227%22%20stroke-width%3D%222.5%22%2F%3E%3C%2Fsvg%3E" type="image/svg+xml">
<meta property="og:type" content="website">
<meta property="og:title" content="The Ghost of Molly Roger">
<meta property="og:description" content="A branching psychic adventure in Victorian England, based on the SCP Foundation tale by psul.">
<!-- Link previews. Social sites want an absolute URL: once the site has its address,
change "og-image.png" below to e.g. https://your-site.netlify.app/og-image.png -->
<meta property="og:image" content="og-image.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="The Ghost of Molly Roger: a ship under a crescent moon on a violet sea">
<meta name="twitter:card" content="summary_large_image">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Geist:wght@400..700&family=Inter:ital,wght@0,400..700;1,400..700&display=swap" rel="stylesheet">
<style>
/* ../../../../private/tmp/molly-roger/src/styles/tokens.css */
:root {
--font-display:
"Geist Variable", "Geist",
ui-sans-serif,
system-ui,
sans-serif;
--font-display-italic:
"Inter Variable", "Inter",
ui-sans-serif,
system-ui,
sans-serif;
--font-body:
"Inter Variable", "Inter",
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
sans-serif;
--font-ui:
"DM Mono",
ui-monospace,
SFMono-Regular,
Menlo,
monospace;
--text-xs: 0.6875rem;
--text-sm: 0.8125rem;
--text-md: 0.875rem;
--text-body: 1rem;
--text-lg: 1.25rem;
--molly: #8A6DFF;
--worthington: #C9A227;
--grace: #3FBBFF;
--vane: #9AA3AD;
--good: #34d399;
--bad: #f87171;
--warn: #fbbf24;
--bg: #09090b;
--surface: #121215;
--surface-2: #18181c;
--surface-sunken: #0d0d10;
--ink: #f4f4f5;
--ink-soft: #a1a1aa;
--ink-faint: #8c8c96;
--rule: rgba(255, 255, 255, 0.08);
--rule-strong: rgba(255, 255, 255, 0.14);
--shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
--overlay-scrim: rgba(0, 0, 0, 0.7);
--radius: 10px;
--radius-sm: 6px;
--stage-ratio: 800 / 300;
--header-h: 52px;
--accent: #2dd4bf;
--accent-2: #5eead4;
--accent-glow: rgba(45, 212, 191, 0.14);
--accent-ink: #042f2e;
--paper-bg: var(--surface);
--paper-ink: var(--ink);
--paper-border: var(--rule);
--paper-margin: transparent;
}
body {
--paper-ink: var(--ink);
--paper-border: var(--rule);
}
body[data-theme=institution] {
--accent: #e0b84a;
--accent-2: #C9A227;
--accent-glow: rgba(224, 184, 74, 0.13);
--accent-ink: #1c1405;
--paper-bg:
linear-gradient(
180deg,
rgba(224, 184, 74, 0.04),
transparent 60%),
var(--surface);
}
body[data-theme=dream] {
--accent: #a78bfa;
--accent-2: #3FD6FF;
--accent-glow: rgba(167, 139, 250, 0.16);
--accent-ink: #1e1036;
--paper-bg:
linear-gradient(
180deg,
rgba(167, 139, 250, 0.06),
transparent 60%),
var(--surface);
}
body.light-mode {
--bg: #fafafa;
--surface: #ffffff;
--surface-2: #f4f4f5;
--surface-sunken: #ececef;
--ink: #18181b;
--ink-soft: #52525b;
--ink-faint: #67676f;
--rule: rgba(0, 0, 0, 0.08);
--rule-strong: rgba(0, 0, 0, 0.15);
--shadow: 0 10px 30px -20px rgba(0, 0, 0, 0.25);
--overlay-scrim: rgba(24, 24, 27, 0.45);
--good: #047857;
--bad: #b91c1c;
--warn: #a16207;
--accent: #0f766e;
--accent-glow: rgba(15, 118, 110, 0.1);
--accent-ink: #ffffff;
--paper-bg: var(--surface);
}
body.light-mode[data-theme=institution] {
--accent: #8a6a12;
--accent-glow: rgba(138, 106, 18, 0.1);
--paper-bg:
linear-gradient(
180deg,
rgba(138, 106, 18, 0.05),
transparent 60%),
var(--surface);
}
body.light-mode[data-theme=dream] {
--accent: #6d28d9;
--accent-glow: rgba(109, 40, 217, 0.09);
--paper-bg:
linear-gradient(
180deg,
rgba(109, 40, 217, 0.05),
transparent 60%),
var(--surface);
}
/* ../../../../private/tmp/molly-roger/src/styles/base.css */
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
[hidden] {
display: none !important;
}
button,
input {
font: inherit;
color: inherit;
}
html {
-webkit-text-size-adjust: 100%;
scrollbar-color: var(--rule-strong) transparent;
}
* {
scrollbar-color: inherit;
}
body {
font-family: var(--font-body);
background-color: var(--bg);
color: var(--ink);
line-height: 1.5;
min-height: 100vh;
overflow-x: hidden;
transition: background-color 0.6s ease, color 0.6s ease;
}
a {
color: var(--accent);
}
:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
.paper-grain {
position: fixed;
inset: 0;
pointer-events: none;
z-index: 1500;
opacity: 0.05;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
mix-blend-mode: overlay;
}
@keyframes fade-in {
from {
opacity: 0;
transform: translateY(4px);
}
to {
opacity: 1;
transform: none;
}
}
.fade-in {
animation: fade-in 0.35s ease both;
}
@keyframes blink {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0;
}
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.001ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.001ms !important;
}
}
::-webkit-scrollbar {
width: 9px;
}
::-webkit-scrollbar-track {
background: var(--surface-sunken);
}
::-webkit-scrollbar-thumb {
background: var(--rule-strong);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--accent);
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
border: 0;
}
/* ../../../../private/tmp/molly-roger/src/styles/layout.css */
body {
background:
radial-gradient(
circle at 50% 0%,
var(--accent-glow) 0%,
transparent 55%),
radial-gradient(
circle at 100% 100%,
rgba(99, 102, 241, 0.03) 0%,
transparent 50%),
var(--bg);
background-attachment: fixed;
font-size: var(--text-sm);
-webkit-font-smoothing: antialiased;
}
.skip-link {
position: absolute;
left: 12px;
top: -60px;
z-index: 3500;
padding: 8px 12px;
border-radius: var(--radius-sm);
background: var(--accent);
color: var(--accent-ink);
font-weight: 600;
text-decoration: none;
}
.skip-link:focus {
top: 10px;
}
.app {
display: flex;
flex-direction: column;
width: 100%;
min-height: 100vh;
min-height: 100dvh;
}
.app-header {
position: sticky;
top: 0;
z-index: 40;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 8px 12px;
min-height: var(--header-h);
padding: 8px 16px;
background: color-mix(in srgb, var(--surface) 75%, transparent);
border-bottom: 1px solid var(--rule);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
}
.header-left {
display: flex;
align-items: center;
gap: 14px;
min-width: 0;
}
.title-group {
display: flex;
align-items: baseline;
gap: 8px;
min-width: 0;
}
.app-title-heading {
display: flex;
min-width: 0;
margin: 0;
font-size: inherit;
}
.app-title {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
padding: 4px 6px;
margin: -4px -6px;
white-space: nowrap;
font: inherit;
color: inherit;
background: none;
border: none;
border-radius: var(--radius-sm);
cursor: pointer;
}
.app-title:hover .app-name {
color: var(--accent);
}
.app-title img {
width: 22px;
height: 22px;
border-radius: 5px;
align-self: center;
}
.app-title .app-name {
font-family: var(--font-display);
font-size: 15px;
font-weight: 600;
letter-spacing: -0.01em;
color: var(--ink);
}
.app-subtitle {
font-size: var(--text-xs);
color: var(--ink-faint);
white-space: nowrap;
border-left: 1px solid var(--rule);
padding-left: 8px;
}
.header-divider {
width: 1px;
height: 20px;
background: var(--rule);
flex-shrink: 0;
}
.header-metrics {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
overflow-x: auto;
scrollbar-width: none;
}
.header-metrics::-webkit-scrollbar {
display: none;
}
.header-pill {
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-soft);
white-space: nowrap;
padding: 3px 9px;
border: 1px solid var(--rule);
border-radius: 999px;
background: color-mix(in srgb, var(--ink) 3%, transparent);
}
.header-pill:empty {
display: none;
}
.header-pill.accent {
color: var(--accent);
border-color: color-mix(in srgb, var(--accent) 35%, transparent);
background: var(--accent-glow);
transition:
color 0.4s,
border-color 0.4s,
background 0.4s;
}
.header-actions {
display: flex;
align-items: center;
gap: 4px;
margin-left: auto;
}
.hdr-btn {
display: inline-flex;
align-items: center;
gap: 6px;
height: 30px;
padding: 0 10px;
font-family: var(--font-body);
font-size: var(--text-sm);
font-weight: 500;
color: var(--ink-soft);
background: transparent;
border: 1px solid transparent;
border-radius: var(--radius-sm);
cursor: pointer;
transition:
color 0.15s,
background 0.15s,
border-color 0.15s;
}
.hdr-btn i {
font-size: 0.85em;
}
.hdr-btn:hover {
color: var(--ink);
background: color-mix(in srgb, var(--ink) 6%, transparent);
border-color: var(--rule);
}
.hdr-btn.icon-only {
width: 30px;
padding: 0;
justify-content: center;
}
.hdr-count {
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-faint);
}
.app-body {
flex: 1;
display: flex;
flex-direction: column;
}
.play {
display: flex;
flex-direction: column;
gap: 10px;
padding: 12px 16px 16px;
min-width: 0;
}
.trail-bar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
min-height: 30px;
}
.trail-actions {
display: flex;
gap: 6px;
flex-shrink: 0;
}
.ghost-btn {
display: inline-flex;
align-items: center;
gap: 6px;
height: 28px;
padding: 0 10px;
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-soft);
background: transparent;
border: 1px solid var(--rule);
border-radius: var(--radius-sm);
cursor: pointer;
transition:
color 0.15s,
border-color 0.15s,
background 0.15s;
}
.ghost-btn:hover {
color: var(--ink);
border-color: var(--rule-strong);
background: color-mix(in srgb, var(--ink) 5%, transparent);
}
.breadcrumb-container {
display: flex;
align-items: center;
gap: 2px;
min-width: 0;
overflow-x: auto;
scrollbar-width: none;
font-family: var(--font-ui);
font-size: var(--text-xs);
}
.breadcrumb-container::-webkit-scrollbar {
display: none;
}
.breadcrumb-item {
color: var(--ink-faint);
background: none;
cursor: pointer;
padding: 3px 7px;
border-radius: var(--radius-sm);
border: 1px solid transparent;
white-space: nowrap;
font-size: inherit;
font-family: inherit;
transition: color 0.15s, border-color 0.15s;
}
.breadcrumb-item:hover {
color: var(--ink);
border-color: var(--rule);
}
.breadcrumb-item.current {
color: var(--accent);
border-color: color-mix(in srgb, var(--accent) 35%, transparent);
background: var(--accent-glow);
cursor: default;
}
.breadcrumb-arrow {
color: var(--ink-faint);
opacity: 0.5;
font-size: 0.55rem;
}
.breadcrumb-more {
color: var(--ink-faint);
background: none;
border: none;
cursor: pointer;
font: inherit;
padding: 3px 6px;
white-space: nowrap;
}
.breadcrumb-more:hover {
color: var(--accent);
}
.sidebar {
display: flex;
flex-direction: column;
gap: 10px;
padding: 12px 16px 20px;
border-top: 1px solid var(--rule);
}
.panel {
background: var(--surface);
border: 1px solid var(--rule);
border-radius: var(--radius);
padding: 12px 14px;
}
.panel-label,
.relationship-container h3 {
font-family: var(--font-ui);
font-size: var(--text-xs);
font-weight: 500;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--ink-faint);
margin-bottom: 8px;
}
.changes-panel:has(.changes-strip:empty),
.summary-panel:has(.ending-summary[hidden]) {
display: none;
}
.sidebar-foot {
margin-top: auto;
padding: 4px 2px 0;
}
.persistence-note {
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-faint);
margin-bottom: 8px;
}
.persistence-note.warning {
color: var(--warn);
}
.attribution-footer {
font-size: var(--text-xs);
line-height: 1.55;
color: var(--ink-faint);
}
.attribution-footer a {
color: var(--ink-soft);
}
.attribution-footer a:hover {
color: var(--accent);
}
.save-indicator {
position: fixed;
bottom: 20px;
right: 20px;
display: none;
align-items: center;
gap: 8px;
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink);
background: var(--surface-2);
border: 1px solid var(--rule-strong);
border-left: 3px solid var(--good);
border-radius: var(--radius-sm);
padding: 9px 14px;
box-shadow: var(--shadow);
z-index: 1000;
}
.save-indicator i {
color: var(--good);
}
.save-indicator.visible {
display: flex;
animation: fade-in 0.3s ease both;
}
.save-indicator.warning {
border-left-color: var(--warn);
}
.save-indicator.warning i {
color: var(--warn);
}
.continue-banner {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
padding: 8px 12px;
font-size: var(--text-sm);
color: var(--ink-soft);
background: var(--accent-glow);
border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
border-radius: var(--radius);
}
.continue-banner i {
color: var(--accent);
margin-right: 6px;
}
.continue-banner-btn {
font-family: var(--font-ui);
font-size: var(--text-xs);
background: var(--accent);
color: var(--accent-ink);
border: none;
border-radius: var(--radius-sm);
padding: 5px 10px;
cursor: pointer;
white-space: nowrap;
}
.loading-text {
display: flex;
align-items: center;
gap: 10px;
color: var(--ink-soft);
}
.loading-text i {
color: var(--accent);
}
@media (min-width: 1024px) {
.app {
height: 100vh;
height: 100dvh;
overflow: hidden;
}
.app-body {
flex: 1;
min-height: 0;
display: grid;
grid-template-columns: minmax(0, 1fr) 300px;
}
.play {
min-height: 0;
overflow: hidden;
}
.sidebar {
min-height: 0;
overflow-y: auto;
border-top: none;
border-left: 1px solid var(--rule);
background: color-mix(in srgb, var(--surface) 40%, transparent);
}
}
@media (min-width: 1600px) {
.app-body {
grid-template-columns: minmax(0, 1fr) 340px;
}
}
@media (max-width: 1640px) {
.app-subtitle {
display: none;
}
}
@media (max-width: 1320px) {
.hdr-label {
display: none;
}
.hdr-btn {
padding: 0 8px;
}
}
@media (max-width: 760px) {
.app-header {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
align-items: center;
gap: 8px 10px;
padding: 8px 12px;
}
.header-left {
display: contents;
}
.header-left > .header-divider {
display: none;
}
.title-group {
grid-column: 1;
grid-row: 1;
min-width: 0;
}
.app-title-heading,
.app-title {
min-width: 0;
}
.app-title {
min-width: 0;
}
.app-title .app-name {
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
}
.header-actions {
grid-column: 2;
grid-row: 1;
margin-left: 0;
gap: 2px;
}
.header-actions > .header-divider {
display: none;
}
.header-metrics {
grid-column: 1 / -1;
grid-row: 2;
}
.play {
padding: 10px 12px 14px;
}
.sidebar {
padding: 10px 12px 18px;
}
.trail-actions span {
display: none;
}
}
@media (max-width: 480px) {
.hdr-count {
display: none;
}
.hdr-btn {
width: 30px;
padding: 0;
justify-content: center;
}
.hdr-btn.icon-only#story-link {
display: none;
}
}
@media (min-width: 1024px) and (max-width: 1439px) {
.app-body {
grid-template-columns: minmax(0, 1fr) 270px;
}
.relationship-label {
min-width: 104px;
}
}
/* ../../../../private/tmp/molly-roger/src/styles/stage.css */
.stage {
position: relative;
width: 100%;
aspect-ratio: var(--stage-ratio);
min-height: 170px;
overflow: hidden;
background: #07060a;
border: 1px solid var(--rule);
border-radius: var(--radius);
isolation: isolate;
z-index: 1;
}
.stage-scenery,
.scenery-frame {
position: absolute;
inset: 0;
}
.scenery-frame {
opacity: 0;
transition: opacity 0.9s ease;
}
.scenery-frame.shown {
opacity: 1;
}
.scenery-frame svg {
width: 100%;
height: 100%;
display: block;
}
.scenery-frame .layer {
transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
will-change: transform;
}
.stage-particles {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 2;
}
.stage-vignette {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 4;
background:
radial-gradient(
ellipse at 50% 45%,
transparent 55%,
rgba(0, 0, 0, 0.55) 100%),
linear-gradient(
to top,
rgba(0, 0, 0, 0.6) 0%,
transparent 32%);
}
.stage-location {
position: absolute;
top: 12px;
left: 12px;
z-index: 9;
font-family: var(--font-ui);
font-size: var(--text-xs);
letter-spacing: 0.04em;
color: #f4f4f5;
background: rgba(9, 9, 11, 0.6);
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 999px;
padding: 3px 10px;
backdrop-filter: blur(6px);
}
.stage-location::before {
content: "";
display: inline-block;
width: 6px;
height: 6px;
margin-right: 7px;
border-radius: 50%;
background: var(--accent);
vertical-align: 1px;
}
.stage-location:empty {
display: none;
}
.stage-speaker {
position: absolute;
bottom: 12px;
left: 14px;
z-index: 9;
font-family: var(--font-display);
font-weight: 600;
font-size: 1.05rem;
letter-spacing: -0.01em;
color: #fafafa;
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}
.stage-speaker:empty {
display: none;
}
.stage-speaker::before {
content: "";
display: block;
width: 22px;
height: 2px;
border-radius: 1px;
background: var(--accent);
margin-bottom: 5px;
}
.stage-cast {
position: absolute;
inset: 0;
z-index: 3;
pointer-events: none;
}
.cast-member {
position: absolute;
bottom: 0;
height: 92%;
aspect-ratio: 200 / 260;
transition:
transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1),
opacity 0.5s ease,
filter 0.5s ease;
animation: cast-enter 0.6s ease both;
}
.cast-member.pos-right {
right: 5%;
}
.cast-member.pos-left {
left: 5%;
}
.cast-member.pos-center {
left: 50%;
margin-left: -17%;
}
.cast-member.pos-left {
animation-name: cast-enter-left;
}
@keyframes cast-enter {
from {
opacity: 0;
translate: 24px 0;
}
to {
opacity: 1;
translate: 0 0;
}
}
@keyframes cast-enter-left {
from {
opacity: 0;
translate: -24px 0;
}
to {
opacity: 1;
translate: 0 0;
}
}
.cast-member .figure {
width: 100%;
height: 100%;
transform-origin: 50% 100%;
transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.cast-member {
--rim: var(--char, #fff);
}
.cast-member .figure svg {
width: 100%;
height: 100%;
display: block;
overflow: visible;
filter: drop-shadow(0 0 1.5px var(--rim)) drop-shadow(0 0 14px color-mix(in srgb, var(--rim) 55%, transparent));
}
.stage-cast {
transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.cast-member.pos-right .figure svg {
transform: scaleX(-1);
}
.cast-member.listening {
filter: brightness(0.55) saturate(0.6);
opacity: 0.85;
}
.cast-member.mood-pleased .figure {
transform: translateY(-2%) rotate(-2.5deg);
}
.cast-member.mood-angry .figure {
transform: rotate(4deg) translateX(2%);
}
.cast-member.mood-angry {
--rim: #E5604D;
}
.cast-member.mood-afraid .figure {
transform: scale(0.95) translateX(-3%);
animation: tremble 0.25s infinite;
}
.cast-member.mood-afraid {
--rim: #c8d4ff;
}
.cast-member.mood-sad .figure {
transform: translateY(3%) rotate(5deg);
}
.cast-member.mood-sad {
filter: saturate(0.4) brightness(0.8);
}
.cast-member.mood-stern .figure {
transform: translateY(-1%);
}
.cast-member.mood-thoughtful .figure {
transform: rotate(3deg);
}
.cast-member.pos-right.mood-angry .figure {
transform: rotate(-4deg) translateX(-2%);
}
.cast-member.pos-right.mood-pleased .figure {
transform: translateY(-2%) rotate(2.5deg);
}
.cast-member.pos-right.mood-sad .figure {
transform: translateY(3%) rotate(-5deg);
}
.cast-member.pos-right.mood-thoughtful .figure {
transform: rotate(-3deg);
}
@keyframes tremble {
0%, 100% {
translate: 0 0;
}
50% {
translate: 0.6px 0;
}
}
.cast-member.projection .figure {
animation: projection 5s ease-in-out infinite;
}
@keyframes projection {
0%, 100% {
opacity: 0.92;
}
45% {
opacity: 0.78;
}
50% {
opacity: 0.95;
}
52% {
opacity: 0.7;
}
55% {
opacity: 0.9;
}
}
.stage-card {
position: absolute;
inset: 0;
z-index: 5;
display: flex;
align-items: center;
justify-content: center;
pointer-events: none;
perspective: 900px;
}
.stage-card:empty {
display: none;
}
.stage-card .tarot {
height: 88%;
animation: card-reveal 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 18px var(--accent-glow));
}
@keyframes card-reveal {
0% {
opacity: 0;
transform: rotateY(-90deg) translateY(10px) scale(0.9);
}
60% {
opacity: 1;
}
100% {
opacity: 1;
transform: none;
}
}
.stage-transition {
position: absolute;
inset: 0;
z-index: 6;
pointer-events: none;
}
.stage-transition.tear {
animation: tear 0.9s ease-out both;
background:
linear-gradient(
90deg,
transparent 0 46%,
rgba(63, 214, 255, 0.85) 48%,
#fff 50%,
rgba(255, 46, 154, 0.85) 52%,
transparent 54%);
mix-blend-mode: screen;
}
@keyframes tear {
0% {
opacity: 0;
transform: scaleX(0.05);
}
25% {
opacity: 1;
transform: scaleX(0.4) skewX(-12deg);
}
100% {
opacity: 0;
transform: scaleX(3) skewX(0);
}
}
.stage-transition.ink {
background:
radial-gradient(
circle at 50% 55%,
#050403 0 30%,
rgba(5, 4, 3, 0.85) 45%,
transparent 70%);
animation: ink 1s ease-out both;
}
@keyframes ink {
0% {
opacity: 0;
transform: scale(0.2);
}
35% {
opacity: 1;
transform: scale(1.4);
}
100% {
opacity: 0;
transform: scale(2.2);
}
}
.stage-transition.glow {
background:
radial-gradient(
ellipse at 50% 60%,
rgba(255, 220, 160, 0.35),
transparent 70%);
animation: glow 0.9s ease-out both;
}
@keyframes glow {
0% {
opacity: 0;
}
30% {
opacity: 1;
}
100% {
opacity: 0;
}
}
.scenery-frame .flicker {
animation: flicker 3.2s infinite;
}
.scenery-frame .flicker.alt {
animation-duration: 4.1s;
animation-delay: -1.3s;
}
.scenery-frame .twinkle {
animation: twinkle 4s ease-in-out infinite;
}
.scenery-frame .twinkle.alt {
animation-delay: -2s;
animation-duration: 5.5s;
}
.scenery-frame .bob {
animation: bob 6s ease-in-out infinite;
transform-box: fill-box;
}
.scenery-frame .bob.alt {
animation-delay: -3s;
animation-duration: 7.5s;
}
.scenery-frame .sway {
animation: sway 7s ease-in-out infinite;
transform-box: fill-box;
transform-origin: 50% 0;
}
.scenery-frame .wave {
animation: wave 9s linear infinite;
}
.scenery-frame .wave.slow {
animation-duration: 16s;
}
.scenery-frame .wave.rev {
animation-direction: reverse;
}
.scenery-frame .pulse {
animation: pulse 3s ease-in-out infinite;
transform-box: fill-box;
transform-origin: center;
}
.scenery-frame .spin {
animation: spin 60s linear infinite;
transform-box: fill-box;
transform-origin: center;
}
.scenery-frame .rock {
animation: rock 6s ease-in-out infinite;
transform-box: fill-box;
transform-origin: 50% 90%;
}
.scenery-frame .shimmer {
animation: shimmer 2.6s ease-in-out infinite;
}
@keyframes flicker {
0%, 100% {
opacity: 0.95;
}
8% {
opacity: 0.8;
}
10% {
opacity: 1;
}
40% {
opacity: 0.88;
}
43% {
opacity: 0.97;
}
70% {
opacity: 0.85;
}
}
@keyframes twinkle {
0%, 100% {
opacity: 0.25;
}
50% {
opacity: 1;
}
}
@keyframes bob {
0%, 100% {
transform: translateY(0);
}
50% {
transform: translateY(-6px);
}
}
@keyframes sway {
0%, 100% {
transform: rotate(-1.5deg);
}
50% {
transform: rotate(1.5deg);
}
}
@keyframes wave {
from {
transform: translateX(0);
}
to {
transform: translateX(-160px);
}
}
@keyframes pulse {
0%, 100% {
opacity: 0.55;
transform: scale(1);
}
50% {
opacity: 1;
transform: scale(1.06);
}
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
@keyframes rock {
0%, 100% {
transform: rotate(-2deg) translateY(0);
}
50% {
transform: rotate(2deg) translateY(-3px);
}
}
@keyframes shimmer {
0%, 100% {
opacity: 0.4;
}
50% {
opacity: 0.85;
}
}
@media (max-width: 560px) {
.stage-speaker {
font-size: 0.95rem;
bottom: 9px;
left: 12px;
}
.stage-location {
top: 10px;
left: 10px;
}
.cast-member {
height: 86%;
}
}
/* ../../../../private/tmp/molly-roger/src/styles/scene.css */
.story-card {
position: relative;
background: var(--paper-bg);
border: 1px solid var(--rule);
border-top: 2px solid var(--accent);
border-radius: var(--radius);
padding: 16px 20px 12px;
transition: border-color 0.5s ease;
}
.scene-text {
max-width: 76ch;
min-height: 4em;
font-family: var(--font-body);
font-size: 0.97rem;
line-height: 1.65;
color: var(--paper-ink);
white-space: pre-line;
text-wrap: pretty;
cursor: default;
}
.scene-text p + p {
margin-top: 0.7em;
}
.scene-text p.line {
position: relative;
padding: 1px 0 1px 13px;
border-left: 2px solid color-mix(in srgb, var(--speaker) 70%, transparent);
}
.scene-text p.line + p.line-cont {
margin-top: 0.45em;
}
.speaker-tag {
display: inline-block;
margin-right: 8px;
padding: 1px 7px 0;
vertical-align: 0.08em;
font-family: var(--font-ui);
font-size: 0.66rem;
font-weight: 500;
line-height: 1.5;
letter-spacing: 0.06em;
text-transform: uppercase;
white-space: nowrap;
border-radius: 4px;
color: color-mix(in srgb, var(--speaker) 82%, var(--ink));
background: color-mix(in srgb, var(--speaker) 13%, transparent);
border: 1px solid color-mix(in srgb, var(--speaker) 28%, transparent);
}
.scene-text p.line .said {
color: var(--paper-ink);
}
.scene-text p.line .aside {
color: var(--ink-soft);
}
.scene-text p.line-player {
border-left-style: dashed;
}
body.light-mode .speaker-tag {
color: color-mix(in srgb, var(--speaker) 55%, var(--ink));
}
.scene-text.typing {
cursor: pointer;
}
.scene-text.typing p:last-child::after {
content: "\258d";
animation: blink 1s infinite;
color: var(--accent);
}
.skip-hint {
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-faint);
padding-top: 8px;
visibility: hidden;
}
.skip-hint.visible {
visibility: visible;
}
.choices-container {
display: grid;
grid-template-columns: 1fr;
gap: 6px;
width: 100%;
}
.choices-container:empty {
display: none;
}
.choice-btn {
display: flex;
align-items: center;
gap: 12px;
width: 100%;
min-height: 44px;
padding: 9px 14px 9px 10px;
text-align: left;
font-family: var(--font-body);
font-size: 0.9375rem;
font-weight: 500;
line-height: 1.4;
color: var(--ink);
background: var(--surface);
border: 1px solid var(--rule);
border-radius: var(--radius);
cursor: pointer;
transition:
border-color 0.15s,
background 0.15s,
transform 0.15s;
}
.choice-btn:hover,
.choice-btn:focus-visible {
border-color: color-mix(in srgb, var(--accent) 60%, transparent);
background: var(--surface-2);
}
.choice-btn:active {
transform: translateY(1px);
}
.choice-number {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
border-radius: var(--radius-sm);
font-family: var(--font-ui);
font-size: var(--text-xs);
font-weight: 500;
color: var(--accent);
background: var(--accent-glow);
border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
transition:
color 0.4s,
background 0.4s,
border-color 0.4s;
}
.choice-btn.risky {
border-color: color-mix(in srgb, var(--bad) 35%, transparent);
}
.choice-btn.risky:hover {
border-color: var(--bad);
}
.choice-btn.risky .choice-number {
color: var(--bad);
background: color-mix(in srgb, var(--bad) 12%, transparent);
border-color: color-mix(in srgb, var(--bad) 35%, transparent);
}
.risky-icon {
color: var(--bad);
margin-right: 7px;
font-size: 0.85em;
}
.choice-body {
display: flex;
flex-direction: column;
gap: 2px;
}
.choice-btn.locked {
opacity: 0.55;
cursor: not-allowed;
border-style: dashed;
background: transparent;
}
.choice-btn.locked:hover {
border-color: var(--rule);
background: transparent;
}
.choice-btn.locked .choice-number {
color: var(--ink-faint);
background: transparent;
border-color: var(--rule);
}
.choice-hint {
font-family: var(--font-ui);
font-size: var(--text-xs);
font-weight: 400;
color: var(--ink-faint);
}
.lock-icon {
margin-right: 7px;
font-size: 0.8em;
color: var(--ink-faint);
}
.hud-columns {
display: grid;
grid-template-columns: 1fr;
gap: 14px;
}
.relationship-container:empty::before {
content: "Your relationships appear here.";
font-size: var(--text-sm);
color: var(--ink-faint);
}
.relationship-bar {
display: flex;
align-items: center;
gap: 10px;
margin: 7px 0;
}
.relationship-label {
font-size: var(--text-sm);
min-width: 118px;
color: var(--ink-soft);
}
.relationship-dot {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 8px;
}
.relationship-track {
flex: 1;
height: 6px;
background: var(--surface-sunken);
border-radius: 3px;
overflow: hidden;
}
.relationship-fill {
height: 100%;
border-radius: 3px;
transition: width 0.6s ease;
}
.relationship-value {
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-faint);
min-width: 24px;
text-align: right;
}
.ledger-row .relationship-value {
min-width: 0;
white-space: nowrap;
}
.ledger-level.danger {
color: var(--bad);
}
.ledger {
flex: 1;
display: flex;
flex-wrap: wrap;
gap: 7px;
align-items: center;
min-height: 13px;
}
.ledger-empty {
font-size: var(--text-xs);
color: var(--ink-faint);
white-space: nowrap;
}
.tally {
position: relative;
display: inline-flex;
gap: 2px;
height: 12px;
}
.tally i {
display: block;
width: 1.5px;
height: 100%;
background: var(--ink-soft);
border-radius: 1px;
}
.tally.full::after {
content: "";
position: absolute;
left: -2px;
right: -2px;
top: 50%;
height: 1.5px;
background: var(--ink-soft);
transform: rotate(-28deg);
}
.changes-strip {
display: flex;
flex-wrap: wrap;
gap: 5px;
}
.change-chip {
display: inline-flex;
align-items: center;
gap: 5px;
font-family: var(--font-ui);
font-size: var(--text-xs);
padding: 3px 8px;
border-radius: 999px;
border: 1px solid var(--rule);
background: color-mix(in srgb, var(--ink) 3%, transparent);
color: var(--ink-soft);
animation: fade-in 0.4s ease both;
}
.change-chip .relationship-dot {
margin-right: 0;
width: 6px;
height: 6px;
}
.change-chip.up {
border-color: color-mix(in srgb, var(--good) 40%, transparent);
color: var(--good);
}
.change-chip.down {
border-color: color-mix(in srgb, var(--bad) 40%, transparent);
color: var(--bad);
}
.change-chip.item {
border-color: color-mix(in srgb, var(--accent) 40%, transparent);
color: var(--accent);
}
.change-chip.note {
border-style: dashed;
}
@media (min-width: 1024px) {
.stage {
flex: none;
aspect-ratio: auto;
height: clamp(170px, 33vh, 380px);
}
.story-card {
flex: 1 1 auto;
min-height: 110px;
overflow-y: auto;
scrollbar-width: thin;
}
.choices-container {
flex: none;
max-height: 40vh;
overflow-y: auto;
scrollbar-width: thin;
}
}
@media (min-width: 1200px) {
.play {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
grid-template-rows: auto auto auto minmax(0, 1fr);
grid-template-areas: "trail trail" "banner banner" "stage stage" "story choices";
align-content: stretch;
}
.trail-bar {
grid-area: trail;
}
.continue-banner {
grid-area: banner;
}
.stage {
grid-area: stage;
height: clamp(170px, 28vh, 340px);
}
.story-card {
grid-area: story;
min-height: 0;
}
.choices-container {
grid-area: choices;
max-height: none;
min-height: 0;
align-content: start;
overflow-y: auto;
}
.play:has(.setpiece) {
grid-template-areas: "trail trail" "banner banner" "stage stage" "choices choices";
}
.play:has(.setpiece) .story-card {
display: none;
}
.scene-text {
max-width: 80ch;
}
}
@media (max-width: 760px) {
.story-card {
padding: 14px 14px 10px;
}
.scene-text {
font-size: 0.95rem;
}
}
@media (min-width: 1200px) and (max-height: 940px) {
.stage {
height: clamp(150px, 24vh, 300px);
}
}
@media (min-width: 1200px) and (max-height: 820px) {
.stage {
height: clamp(140px, 21vh, 260px);
}
.play {
gap: 8px;
padding-top: 8px;
}
.story-card {
padding: 12px 16px 8px;
}
}
.panel-label-row {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 8px;
}
.progress-act,
.crew-count {
letter-spacing: 0.04em;
text-transform: none;
color: var(--ink-soft);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.panel-link {
font: inherit;
letter-spacing: 0.04em;
text-transform: none;
color: var(--accent);
background: none;
border: none;
padding: 0;
cursor: pointer;
}
.panel-link:hover {
text-decoration: underline;
}
.act-track {
list-style: none;
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 4px;
margin: 0 0 10px;
padding: 0;
}
.act-step {
display: flex;
flex-direction: column;
gap: 5px;
min-width: 0;
}
.act-bar {
height: 4px;
border-radius: 2px;
background: var(--surface-sunken);
border: 1px solid var(--rule);
transition: background 0.5s ease, box-shadow 0.5s ease;
}
.act-step.done .act-bar {
background: color-mix(in srgb, var(--accent) 55%, var(--surface-2));
border-color: transparent;
}
.act-step.current .act-bar {
background: var(--accent);
border-color: transparent;
box-shadow: 0 0 10px var(--accent-glow), 0 0 0 3px var(--accent-glow);
}
.act-short {
font-family: var(--font-ui);
font-size: 0.625rem;
text-align: center;
color: var(--ink-faint);
}
.act-step.current .act-short {
color: var(--accent);
}
.objective {
font-size: var(--text-sm);
line-height: 1.5;
color: var(--ink);
}
.objective:empty {
display: none;
}
.objective-label {
display: block;
margin-bottom: 2px;
font-family: var(--font-ui);
font-size: 0.625rem;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--ink-faint);
}
.crew-panel:has(.crew-list:empty),
.carried-panel:has(.carried-list:empty) {
display: none;
}
.crew-list,
.carried-list {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.crew-list {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px 10px;
}
.crew-member {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
animation: fade-in 0.4s ease both;
}
.avatar {
flex-shrink: 0;
display: block;
width: 30px;
height: 30px;
border-radius: 50%;
overflow: hidden;
color: var(--speaker);
background:
radial-gradient(
circle at 60% 35%,
color-mix(in srgb, var(--speaker) 45%, transparent),
transparent 70%),
color-mix(in srgb, var(--speaker) 16%, var(--surface-2));
border: 1.5px solid color-mix(in srgb, var(--speaker) 60%, transparent);
}
.avatar svg {
display: block;
width: 100%;
height: 100%;
}
.crew-name {
min-width: 0;
font-size: var(--text-sm);
color: var(--ink-soft);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.crew-empty {
grid-column: 1 / -1;
font-size: var(--text-sm);
color: var(--ink-faint);
}
.carried-chip {
display: inline-flex;
align-items: center;
gap: 6px;
max-width: 100%;
padding: 4px 9px;
font-family: var(--font-body);
font-size: 0.75rem;
color: var(--ink-soft);
background: color-mix(in srgb, var(--ink) 3%, transparent);
border: 1px solid var(--rule);
border-radius: 999px;
cursor: pointer;
transition: border-color 0.15s, color 0.15s;
}
.carried-chip i {
color: var(--accent);
font-size: 0.85em;
}
.carried-chip:hover,
.carried-chip:focus-visible {
color: var(--ink);
border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.choices-waiting {
display: grid;
gap: 6px;
align-content: start;
animation: fade-in 0.4s ease both;
}
.waiting-head {
display: flex;
align-items: center;
gap: 10px;
padding: 2px 2px 6px;
font-family: var(--font-ui);
font-size: var(--text-xs);
letter-spacing: 0.04em;
color: var(--ink-faint);
}
.waiting-dots {
display: inline-flex;
gap: 4px;
}
.waiting-dots i {
width: 5px;
height: 5px;
border-radius: 50%;
background: var(--accent);
animation: waiting-dot 1.2s ease-in-out infinite;
}
.waiting-dots i:nth-child(2) {
animation-delay: 0.15s;
}
.waiting-dots i:nth-child(3) {
animation-delay: 0.3s;
}
@keyframes waiting-dot {
0%, 80%, 100% {
opacity: 0.25;
transform: translateY(0);
}
40% {
opacity: 1;
transform: translateY(-3px);
}
}
.waiting-card {
position: relative;
display: flex;
align-items: center;
gap: 12px;
min-height: 44px;
padding: 9px 14px 9px 10px;
border: 1px dashed color-mix(in srgb, var(--accent) 22%, var(--rule));
border-radius: var(--radius);
background: color-mix(in srgb, var(--surface) 60%, transparent);
overflow: hidden;
animation: waiting-breathe 2.4s ease-in-out infinite;
animation-delay: calc(var(--i) * 0.25s);
}
.waiting-card span:first-child {
flex-shrink: 0;
width: 24px;
height: 24px;
border-radius: var(--radius-sm);
background: var(--accent-glow);
border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.waiting-card span:last-child {
height: 8px;
width: calc(78% - var(--i) * 14%);
border-radius: 4px;
background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.waiting-card::after {
content: "";
position: absolute;
inset: 0;
background:
linear-gradient(
100deg,
transparent 20%,
color-mix(in srgb, var(--accent) 12%, transparent) 50%,
transparent 80%);
transform: translateX(-100%);
animation: waiting-sweep 2.4s ease-in-out infinite;
animation-delay: calc(var(--i) * 0.25s);
}
@keyframes waiting-sweep {
0% {
transform: translateX(-100%);
}
60%, 100% {
transform: translateX(100%);
}
}
@keyframes waiting-breathe {
0%, 100% {
opacity: 0.55;
}
50% {
opacity: 1;
}
}
.waiting-skip {
justify-self: start;
display: inline-flex;
align-items: center;
gap: 8px;
margin-top: 4px;
padding: 5px 10px;
font-family: var(--font-body);
font-size: var(--text-sm);
font-weight: 500;
color: var(--ink-soft);
background: transparent;
border: 1px solid var(--rule);
border-radius: 999px;
cursor: pointer;
transition: color 0.15s, border-color 0.15s;
}
.waiting-skip:hover,
.waiting-skip:focus-visible {
color: var(--ink);
border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.waiting-skip kbd {
font-family: var(--font-ui);
font-size: 0.625rem;
padding: 1px 5px;
border: 1px solid var(--rule-strong);
border-radius: 4px;
color: var(--ink-faint);
}
@media (max-width: 760px) {
.waiting-card {
display: none;
}
.choices-waiting {
grid-auto-flow: column;
justify-content: space-between;
align-items: center;
}
.waiting-head {
padding: 0;
}
.waiting-skip {
margin-top: 0;
}
.waiting-skip kbd {
display: none;
}
}
@media (prefers-reduced-motion: reduce) {
.waiting-card,
.waiting-card::after,
.waiting-dots i {
animation: none;
}
.waiting-card::after {
display: none;
}
}
/* ../../../../private/tmp/molly-roger/src/styles/overlays.css */
.overlay {
position: fixed;
inset: 0;
display: none;
align-items: center;
justify-content: center;
padding: 16px;
overflow-y: auto;
background: var(--overlay-scrim);
backdrop-filter: blur(3px);
z-index: 2000;
}
.overlay.open {
display: flex;
animation: fade-in 0.25s ease both;
}
.overlay-content {
position: relative;
width: 100%;
max-width: 700px;
max-height: 88vh;
overflow-y: auto;
background: var(--surface);
border: 1px solid var(--rule-strong);
border-radius: var(--radius);
box-shadow:
var(--shadow),
0 0 0 4px var(--surface),
0 0 0 5px var(--rule);
}
.overlay-content.narrow {
max-width: 470px;
}
.overlay-content.wide {
max-width: 900px;
}
.overlay-header {
position: sticky;
top: 0;
z-index: 10;
padding: 16px 20px 12px;
text-align: center;
background: var(--surface);
border-bottom: 1px solid var(--rule);
}
.overlay-header h1 {
font-family: var(--font-display);
font-weight: 600;
font-size: 1.6rem;
color: var(--ink);
}
.close-btn {
position: absolute;
right: 14px;
top: 50%;
transform: translateY(-50%);
display: flex;
align-items: center;
gap: 6px;
font-family: var(--font-ui);
font-size: var(--text-xs);
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--ink-soft);
background: transparent;
border: 1px solid var(--rule-strong);
border-radius: var(--radius);
padding: 5px 10px;
cursor: pointer;
}
.close-btn:hover {
color: var(--ink);
border-color: var(--accent);
}
@media (max-width: 560px) {
.overlay-header .close-btn {
position: static;
transform: none;
margin: 0 0 10px auto;
}
}
.overlay-body {
padding: 20px;
color: var(--ink);
}
.parchment {
padding: 4px 2px;
}
.story-title {
font-family: var(--font-display);
font-weight: 600;
font-size: 1.8rem;
text-align: center;
margin-bottom: 14px;
color: var(--ink);
}
.story-content {
display: flex;
flex-direction: column;
gap: 14px;
font-size: 1.05rem;
line-height: 1.65;
}
.story-content > p:first-child strong {
font-family: var(--font-display);
font-weight: 600;
font-size: 1.3rem;
}
.intro {
font-size: 1.05rem;
}
.highlight {
color: var(--accent);
font-weight: 600;
}
.section {
border-left: 2px solid var(--rule-strong);
padding-left: 16px;
margin: 8px 0;
}
.section-world {
border-color: var(--molly);
}
.section-role {
border-color: var(--grace);
}
.section-gameplay {
border-color: var(--worthington);
}
.section h2 {
font-family: var(--font-display);
font-weight: 600;
font-size: 1.3rem;
margin-bottom: 6px;
}
.section p + p {
margin-top: 8px;
}
.quote {
margin-top: 10px;
padding: 14px;
text-align: center;
font-style: italic;
font-size: 1.1rem;
color: var(--ink-soft);
border-top: 1px solid var(--rule);
border-bottom: 1px solid var(--rule);
}
.attribution {
margin-top: 10px;
padding: 12px;
text-align: center;
font-size: var(--text-md);
color: var(--ink-soft);
background: var(--surface-sunken);
border-radius: var(--radius);
}
.journey-empty {
text-align: center;
font-style: italic;
color: var(--ink-faint);
padding: 16px;
}
.journey-hint {
font-size: var(--text-md);
font-style: italic;
color: var(--ink-soft);
text-align: center;
margin-bottom: 14px;
}
.journey-hint i {
color: var(--accent);
}
.journey-item {
display: flex;
align-items: center;
gap: 12px;
width: 100%;
padding: 10px 12px;
margin-bottom: 6px;
text-align: left;
color: inherit;
background: transparent;
border: 1px solid var(--rule);
border-radius: var(--radius);
transition: border-color 0.2s, background 0.2s;
}
button.journey-item {
cursor: pointer;
}
.journey-item:hover {
border-color: var(--accent);
background: var(--surface-2);
}
.journey-item.current {
border-color: var(--accent);
background: var(--surface-2);
}
.journey-step-number {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
border-radius: 50%;
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-soft);
border: 1px solid var(--rule-strong);
}
.journey-step-content {
flex: 1;
}
.journey-step-label {
font-family: var(--font-display);
font-weight: 600;
font-size: 1rem;
}
.journey-step-choice {
font-size: var(--text-md);
font-style: italic;
color: var(--ink-soft);
}
.journey-jump-icon {
flex-shrink: 0;
color: var(--accent);
}
/* ../../../../private/tmp/molly-roger/src/styles/ending.css */
.ending-eyebrow {
font-family: var(--font-ui);
font-size: var(--text-xs);
letter-spacing: 0.14em;
text-transform: uppercase;
color: var(--ink-faint);
margin-bottom: 2px;
}
.ending-title {
font-family: var(--font-display);
font-weight: 700;
font-size: clamp(1.4rem, 3vw, 1.9rem);
letter-spacing: -0.02em;
color: var(--accent);
margin-bottom: 10px;
}
.ending-summary {
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-soft);
}
.ending-summary-row {
display: flex;
justify-content: space-between;
padding: 3px 0;
border-bottom: 1px dotted var(--rule);
break-inside: avoid;
}
.ending-summary-label {
letter-spacing: 0.05em;
text-transform: uppercase;
color: var(--ink-faint);
}
.ending-summary-value {
color: var(--ink);
font-weight: 700;
}
.ending-discovered {
margin-top: 10px;
padding-top: 8px;
text-align: center;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--accent);
border-top: 1px solid var(--rule);
}
.ending-discovered button {
margin-left: 8px;
font: inherit;
color: var(--ink);
background: none;
border: 1px solid var(--rule-strong);
border-radius: var(--radius);
padding: 2px 8px;
cursor: pointer;
}
.ending-discovered button:hover {
border-color: var(--accent);
}
.choice-btn.play-again {
justify-content: center;
font-family: var(--font-display);
font-weight: 600;
font-size: 1rem;
padding: 12px;
border-color: var(--accent);
background: var(--accent-glow);
}
.choice-btn.play-again .choice-number {
display: none;
}
.choice-btn.play-again:hover {
background: var(--accent);
color: var(--accent-ink);
transform: none;
}
.act-transition {
position: fixed;
inset: 0;
z-index: 3000;
display: flex;
align-items: center;
justify-content: center;
pointer-events: none;
visibility: hidden;
}
.act-transition.visible {
visibility: visible;
pointer-events: all;
}
.curtain {
position: absolute;
top: 0;
bottom: 0;
width: 51%;
background:
repeating-linear-gradient(
90deg,
rgba(0, 0, 0, 0.35) 0 6px,
transparent 6px 26px,
rgba(255, 255, 255, 0.06) 26px 30px,
transparent 30px 44px),
linear-gradient(
180deg,
#6d1424,
#3d0a14 80%,
#2a060d);
box-shadow: inset 0 -40px 60px rgba(0, 0, 0, 0.5);
transition: transform 0.75s cubic-bezier(0.6, 0, 0.3, 1);
}
.curtain-left {
left: 0;
transform: translateX(-102%);
border-right: 3px solid #c9a227;
}
.curtain-right {
right: 0;
transform: translateX(102%);
border-left: 3px solid #c9a227;
}
.act-transition.visible .curtain {
transform: translateX(0);
}
.act-card {
position: relative;
text-align: center;
color: #f3e7c6;
opacity: 0;
transform: scale(0.96);
transition: opacity 0.5s ease 0.45s, transform 0.5s ease 0.45s;
}
.act-transition.visible .act-card {
opacity: 1;
transform: none;
}
.act-ornament {
color: #c9a227;
font-size: 1.6rem;
line-height: 1;
}
.act-ornament.flip {
transform: rotate(180deg);
}
.act-title {
font-family: var(--font-display);
font-weight: 700;
font-size: clamp(2.2rem, 8vw, 3.6rem);
letter-spacing: -0.02em;
margin-top: 6px;
text-shadow: 0 2px 0 #2a060d, 0 0 30px rgba(201, 162, 39, 0.35);
}
.act-subtitle {
font-family: var(--font-ui);
text-transform: uppercase;
letter-spacing: 0.2em;
font-size: clamp(1.1rem, 4vw, 1.5rem);
color: #e6d3a5;
margin: 2px 0 10px;
}
/* ../../../../private/tmp/molly-roger/src/styles/systems.css */
.setup-form {
display: flex;
flex-direction: column;
gap: 16px;
}
.form-intro {
font-style: italic;
color: var(--ink-soft);
}
.field {
display: flex;
flex-direction: column;
gap: 6px;
border: none;
}
.field-label {
font-family: var(--font-ui);
font-size: var(--text-xs);
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--ink-soft);
margin-bottom: 4px;
}
.field input[type=text] {
font-family: var(--font-display-italic);
font-size: 1.4rem;
color: var(--ink);
background: transparent;
border: none;
border-bottom: 1px solid var(--rule-strong);
padding: 4px 2px;
}
.field input[type=text]:focus {
outline: none;
border-bottom-color: var(--accent);
box-shadow: 0 1px 0 var(--accent);
}
.pill-group {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.pill input {
position: absolute;
opacity: 0;
pointer-events: none;
}
.pill span {
display: inline-block;
padding: 6px 13px;
font-family: var(--font-ui);
font-size: var(--text-sm);
border: 1px solid var(--rule-strong);
border-radius: var(--radius);
cursor: pointer;
transition: border-color 0.15s, background 0.15s;
}
.pill:hover span {
border-color: var(--accent);
}
.pill input:checked + span {
border-color: var(--accent);
background: var(--accent-glow);
color: var(--ink);
box-shadow: inset 0 0 0 1px var(--accent);
}
.pill input:focus-visible + span {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
.check {
display: flex;
gap: 9px;
align-items: center;
cursor: pointer;
}
.check input {
accent-color: var(--accent);
width: 16px;
height: 16px;
}
.form-preview {
font-size: var(--text-md);
font-style: italic;
color: var(--ink-soft);
border-left: 2px solid var(--accent);
padding-left: 10px;
}
.satchel-heading {
display: flex;
justify-content: space-between;
align-items: baseline;
margin: 4px 0 10px;
font-family: var(--font-display);
font-weight: 600;
font-size: 1.15rem;
}
.satchel-heading span {
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-faint);
}
.satchel-list,
.satchel-notes {
list-style: none;
display: flex;
flex-direction: column;
gap: 8px;
margin-bottom: 18px;
}
.satchel-item {
display: flex;
gap: 14px;
align-items: flex-start;
padding: 10px 12px;
border: 1px solid var(--rule);
border-radius: var(--radius);
background: var(--surface-2);
}
.satchel-item > i {
width: 22px;
margin-top: 3px;
text-align: center;
font-size: 1.05rem;
color: var(--accent);
}
.satchel-name {
font-family: var(--font-display);
font-weight: 600;
font-size: 1.05rem;
}
.satchel-desc {
font-size: var(--text-md);
color: var(--ink-soft);
}
.satchel-notes li {
position: relative;
padding-left: 18px;
color: var(--ink-soft);
}
.satchel-notes li::before {
content: "\2712";
position: absolute;
left: 0;
color: var(--accent);
font-size: 0.8rem;
}
.confirm-box .overlay-body {
display: flex;
flex-direction: column;
gap: 16px;
font-size: 1.05rem;
}
.confirm-actions {
display: flex;
justify-content: flex-end;
gap: 8px;
}
.gallery-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: 18px 14px;
}
.gallery-card {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
text-align: center;
}
.gallery-card .tarot {
width: 100%;
max-width: 170px;
height: auto;
filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
transition: transform 0.25s ease;
}
.gallery-card.found .tarot:hover {
transform: translateY(-4px) rotate(-1deg);
}
.gallery-name {
font-family: var(--font-display);
font-weight: 600;
font-size: 1rem;
}
.gallery-hint {
font-size: var(--text-md);
font-style: italic;
color: var(--ink-faint);
line-height: 1.3;
}
.codex-tabs {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 6px;
margin-top: 10px;
}
.codex-tab {
font-family: var(--font-ui);
font-size: var(--text-xs);
text-transform: uppercase;
letter-spacing: 0.06em;
padding: 5px 10px;
color: var(--ink-soft);
background: transparent;
border: 1px solid var(--rule-strong);
border-radius: var(--radius);
cursor: pointer;
}
.codex-tab span {
color: var(--ink-faint);
margin-left: 4px;
}
.codex-tab.active {
color: var(--ink);
border-color: var(--accent);
background: var(--accent-glow);
}
.codex-section {
margin-bottom: 18px;
}
.codex-group {
font-family: var(--font-display);
font-weight: 600;
font-size: 1.25rem;
margin-bottom: 8px;
padding-bottom: 4px;
border-bottom: 1px solid var(--rule);
}
.codex-entry {
padding: 8px 12px;
margin-bottom: 8px;
border-left: 2px solid var(--accent);
background: var(--surface-2);
border-radius: 0 var(--radius) var(--radius) 0;
}
.codex-entry h3 {
font-family: var(--font-display);
font-weight: 600;
font-size: 1.02rem;
color: var(--accent);
}
.codex-entry p {
font-size: 1rem;
line-height: 1.55;
color: var(--ink);
}
.codex-entry.locked {
border-left-color: var(--rule-strong);
background: transparent;
border: 1px dashed var(--rule);
}
.codex-entry.locked h3 {
color: var(--ink-faint);
font-style: italic;
}
.range {
display: flex;
align-items: center;
gap: 10px;
font-size: var(--text-md);
}
.range input {
flex: 1;
accent-color: var(--accent);
}
.choice-btn.setpiece-choice {
border-color: var(--accent);
}
.choice-btn.setpiece-choice .choice-hint {
color: var(--accent);
}
@media (max-width: 560px) {
.overlay-header {
padding: 10px 14px 8px;
}
.overlay-header h1 {
font-size: 1.3rem;
}
.overlay-header .subtitle {
font-size: var(--text-sm);
}
.codex-tabs {
flex-wrap: nowrap;
justify-content: flex-start;
overflow-x: auto;
scrollbar-width: none;
margin: 8px -14px 0;
padding: 0 14px 2px;
}
.codex-tab {
flex-shrink: 0;
}
.gallery-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
.control-btn {
display: inline-flex;
align-items: center;
gap: 8px;
height: 34px;
padding: 0 14px;
font-family: var(--font-body);
font-size: var(--text-sm);
font-weight: 500;
color: var(--ink);
background: var(--surface-2);
border: 1px solid var(--rule-strong);
border-radius: var(--radius-sm);
cursor: pointer;
transition: border-color 0.15s, background 0.15s;
}
.control-btn i {
color: var(--accent);
}
.control-btn:hover {
border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}
.control-btn.danger {
color: #fff;
background: color-mix(in srgb, var(--bad) 80%, black);
border-color: var(--bad);
}
/* ../../../../private/tmp/molly-roger/src/styles/setpieces.css */
.setpiece {
width: 100%;
padding: 16px 18px 12px;
background: var(--surface);
border: 1px solid var(--accent);
border-radius: var(--radius);
box-shadow: var(--shadow), 0 0 0 3px var(--accent-glow);
animation: fade-in 0.35s ease both;
}
.sp-head {
margin-bottom: 12px;
}
.sp-title {
font-family: var(--font-display);
font-weight: 600;
font-size: 1.35rem;
color: var(--accent);
}
.sp-help {
font-size: var(--text-md);
font-style: italic;
color: var(--ink-soft);
}
.sp-help kbd,
.sp-key {
display: inline-block;
min-width: 1.4em;
padding: 0 4px;
margin-right: 4px;
font-family: var(--font-ui);
font-size: 0.75em;
font-style: normal;
text-align: center;
border: 1px solid var(--rule-strong);
border-radius: 3px;
background: var(--surface-sunken);
}
.sp-actions {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 12px;
}
.sp-btn {
font-family: var(--font-body);
font-size: 1rem;
padding: 8px 14px;
color: var(--ink);
background: var(--surface-2);
border: 1px solid var(--rule-strong);
border-radius: var(--radius);
cursor: pointer;
user-select: none;
touch-action: none;
transition:
border-color 0.15s,
background 0.15s,
transform 0.1s;
}
.sp-btn:hover:not(:disabled) {
border-color: var(--accent);
}
.sp-btn:disabled {
opacity: 0.45;
cursor: default;
}
.sp-btn.primary {
border-color: var(--accent);
background: var(--accent-glow);
}
.sp-btn.active {
transform: scale(0.97);
background: var(--accent);
color: var(--accent-ink);
}
.sp-timer {
height: 4px;
margin-top: 10px;
background: var(--surface-sunken);
border-radius: 2px;
overflow: hidden;
}
.sp-timer div {
height: 100%;
width: 100%;
background: var(--accent);
}
.sp-result {
min-height: 1.4em;
margin-top: 10px;
font-family: var(--font-body);
font-size: 1.1rem;
color: var(--accent);
opacity: 0;
transition: opacity 0.4s ease;
}
.sp-result.shown {
opacity: 1;
}
.sp-foot {
display: flex;
justify-content: flex-end;
margin-top: 6px;
}
.sp-skip {
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-faint);
background: none;
border: none;
text-decoration: underline;
cursor: pointer;
}
.sp-skip:hover {
color: var(--ink);
}
.sp-projection {
display: flex;
flex-direction: column;
align-items: center;
}
.sp-shape {
width: min(260px, 70%);
height: auto;
filter: drop-shadow(0 0 10px var(--accent-glow));
}
.sp-poly {
stroke-width: 2;
stroke-linejoin: round;
}
.sp-edges line {
stroke-width: 1.6;
}
.sp-gauge {
display: flex;
align-items: center;
gap: 10px;
width: min(360px, 100%);
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-faint);
}
.sp-gauge-track {
position: relative;
flex: 1;
height: 6px;
border-radius: 3px;
background:
linear-gradient(
90deg,
#C9A227,
#9B82FF);
opacity: 0.8;
}
.sp-gauge-mark {
position: absolute;
top: -5px;
width: 4px;
height: 16px;
margin-left: -2px;
background: var(--ink);
border-radius: 2px;
}
.sp-projection .sp-timer {
width: min(360px, 100%);
}
.sp-lane {
position: relative;
height: 150px;
overflow: hidden;
border-radius: var(--radius);
background:
radial-gradient(
ellipse at 95% 60%,
rgba(191, 168, 255, 0.35),
transparent 40%),
linear-gradient(
180deg,
#1c1440,
#07051a);
}
.sp-door {
position: absolute;
right: 2%;
top: 22%;
width: 52px;
height: 88px;
border-radius: 26px 26px 4px 4px;
background:
radial-gradient(
circle at 50% 40%,
#e8faff,
#5c4fa8 70%);
box-shadow: 0 0 22px rgba(191, 168, 255, 0.7);
}
.sp-path {
position: absolute;
left: 0;
right: 0;
top: 74%;
border-top: 1px dashed rgba(255, 255, 255, 0.2);
}
.sp-molly {
position: absolute;
top: 74%;
transform: translate(-50%, -50%);
width: 30px;
height: 30px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
background: var(--molly);
box-shadow: 0 0 14px var(--molly);
z-index: 2;
}
.sp-molly.caught {
background: #ffe9a8;
color: #3a2510;
box-shadow: 0 0 24px #fff6d0;
}
.sp-beam {
position: absolute;
top: 0;
bottom: 0;
width: 70px;
transform: translateX(-50%);
cursor: pointer;
z-index: 1;
}
.sp-beam-cone {
position: absolute;
inset: 0 0 18% 0;
background:
linear-gradient(
180deg,
rgba(255, 246, 208, 0.05),
rgba(255, 246, 208, 0.38));
clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%);
transition: opacity 0.3s;
}
.sp-beam-spot {
position: absolute;
left: 10%;
right: 10%;
top: 66%;
height: 22%;
border-radius: 50%;
background:
radial-gradient(
ellipse,
rgba(255, 246, 208, 0.7),
transparent 70%);
}
.sp-beam.diverted .sp-beam-cone,
.sp-beam.diverted .sp-beam-spot {
opacity: 0.25;
}
.sp-scandal {
position: absolute;
left: 10px;
top: 8px;
max-width: 60%;
font-style: italic;
font-size: var(--text-sm);
color: #ffd59a;
opacity: 0;
}
.sp-scandal.pop {
animation: scandal 2s ease both;
}
@keyframes scandal {
0% {
opacity: 0;
transform: translateY(6px);
}
15%, 70% {
opacity: 1;
transform: none;
}
100% {
opacity: 0;
}
}
.sp-count {
margin-top: 8px;
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-faint);
}
.sp-question {
font-family: var(--font-body);
font-size: 1.2rem;
margin-bottom: 12px;
}
.sp-thoughts,
.sp-tiles {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 8px;
}
.sp-thought,
.sp-tile {
text-align: left;
font-family: var(--font-body);
font-size: 1rem;
padding: 10px 12px;
color: var(--ink);
background: var(--surface-2);
border: 1px solid var(--rule-strong);
border-radius: 18px;
cursor: pointer;
animation: drift 4s ease-in-out infinite;
animation-delay: calc(var(--d, 0s) * -1);
}
.sp-thought:hover,
.sp-tile:hover {
border-color: var(--accent);
}
.sp-thought.intrusive {
border-color: color-mix(in srgb, var(--molly) 60%, transparent);
box-shadow: 0 0 14px color-mix(in srgb, var(--molly) 40%, transparent);
font-weight: 600;
}
@keyframes drift {
0%, 100% {
transform: translateY(0);
}
50% {
transform: translateY(-3px);
}
}
.sp-reaction {
min-height: 1.4em;
margin-top: 8px;
font-style: italic;
color: var(--ink-soft);
}
.sp-pips {
display: flex;
gap: 6px;
margin-top: 4px;
}
.sp-pips span {
width: 10px;
height: 10px;
border-radius: 50%;
border: 1px solid var(--rule-strong);
}
.sp-pips .good {
background: var(--good);
border-color: var(--good);
}
.sp-pips .mid {
background: var(--warn);
border-color: var(--warn);
}
.sp-pips .bad {
background: var(--bad);
border-color: var(--bad);
}
.sp-tide {
height: 8px;
border-radius: 4px;
background: var(--surface-sunken);
overflow: hidden;
margin-bottom: 10px;
}
.sp-tide div {
height: 100%;
width: 0;
background:
linear-gradient(
90deg,
#3a86ff,
var(--molly));
}
.sp-said {
min-height: 1.4em;
margin-bottom: 8px;
font-family: var(--font-body);
color: var(--accent);
}
.sp-tile.hint {
border-color: var(--grace);
box-shadow: 0 0 12px color-mix(in srgb, var(--grace) 45%, transparent);
}
.sp-tile.wrong {
border-color: var(--bad);
animation: shake 0.3s ease;
}
@keyframes shake {
0%, 100% {
transform: translateX(0);
}
25% {
transform: translateX(-4px);
}
75% {
transform: translateX(4px);
}
}
.sp-witness {
margin-top: 10px;
font-style: italic;
color: var(--grace);
}
.sp-ready {
display: flex;
justify-content: center;
padding: 18px 0 8px;
}
.sp-begin {
font-family: var(--font-display);
font-weight: 600;
font-size: 1.2rem;
padding: 10px 34px;
}
/* ../../../../private/tmp/molly-roger/src/styles/home.css */
.home {
position: fixed;
inset: 0;
z-index: 1800;
display: grid;
grid-template-columns: minmax(380px, 500px) minmax(0, 1fr);
background: var(--bg);
color: var(--ink);
overflow: hidden;
animation: fade-in 0.4s ease both;
}
.home[hidden] {
display: none;
}
body.home-open {
overflow: hidden;
}
.home-art {
position: relative;
grid-column: 2;
grid-row: 1;
margin: 16px 16px 16px 0;
border: 1px solid var(--rule);
border-radius: 14px;
overflow: hidden;
background: #07060c;
isolation: isolate;
}
.home-scenery,
.home-scenery svg {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
}
.home-scenery svg {
animation: home-drift 30s ease-in-out infinite alternate;
transform-origin: 50% 60%;
}
@keyframes home-drift {
from {
transform: scale(1.06) translateX(-1.5%);
}
to {
transform: scale(1.12) translateX(1.5%);
}
}
.home-figure {
position: absolute;
right: 8%;
bottom: -2%;
height: 78%;
aspect-ratio: 200 / 260;
z-index: 2;
animation: home-float 7s ease-in-out infinite, projection 5s ease-in-out infinite;
}
.home-figure svg {
width: 100%;
height: 100%;
display: block;
overflow: visible;
filter: drop-shadow(0 0 2px currentColor) drop-shadow(0 0 28px color-mix(in srgb, currentColor 60%, transparent));
}
@keyframes home-float {
0%, 100% {
translate: 0 0;
}
50% {
translate: 0 -10px;
}
}
.home-art-fade {
position: absolute;
inset: 0;
z-index: 3;
pointer-events: none;
background:
radial-gradient(
ellipse at 70% 40%,
transparent 30%,
rgba(5, 4, 10, 0.55) 100%),
linear-gradient(
90deg,
rgba(5, 4, 10, 0.55),
transparent 35%);
}
.home-panel {
grid-column: 1;
grid-row: 1;
display: flex;
flex-direction: column;
justify-content: center;
gap: 22px;
min-height: 0;
padding: 40px 40px 24px;
overflow-y: auto;
}
.home-brand {
display: flex;
align-items: center;
gap: 10px;
}
.home-brand img {
border-radius: 7px;
}
.home-eyebrow {
font-family: var(--font-ui);
font-size: var(--text-xs);
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--ink-faint);
}
.home-title {
font-family: var(--font-display);
font-size: clamp(2.2rem, 3.6vw, 3.3rem);
font-weight: 650;
line-height: 1.02;
letter-spacing: -0.035em;
color: var(--ink);
}
.home-lede {
max-width: 40ch;
font-size: 0.95rem;
line-height: 1.6;
color: var(--ink-soft);
}
.home-actions {
display: grid;
gap: 8px;
}
.home-btn {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 3px;
width: 100%;
padding: 13px 16px;
text-align: left;
font-family: var(--font-body);
color: var(--ink);
background: var(--surface);
border: 1px solid var(--rule-strong);
border-radius: var(--radius);
cursor: pointer;
transition:
border-color 0.15s,
background 0.15s,
transform 0.15s;
}
.home-btn:hover,
.home-btn:focus-visible {
border-color: color-mix(in srgb, var(--accent) 60%, transparent);
background: var(--surface-2);
}
.home-btn:active {
transform: translateY(1px);
}
.home-btn[hidden] {
display: none;
}
.home-btn-main {
display: flex;
align-items: center;
gap: 10px;
font-family: var(--font-display);
font-size: 1.02rem;
font-weight: 600;
}
.home-btn-main i {
width: 16px;
font-size: 0.85em;
color: var(--accent);
}
.home-btn-meta {
padding-left: 26px;
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-faint);
}
.home-btn.primary {
color: var(--accent-ink);
background: var(--accent);
border-color: transparent;
box-shadow: 0 8px 30px -12px var(--accent);
}
.home-btn.primary .home-btn-main i,
.home-btn.primary .home-btn-meta {
color: color-mix(in srgb, var(--accent-ink) 75%, transparent);
}
.home-btn.primary:hover,
.home-btn.primary:focus-visible {
background: color-mix(in srgb, var(--accent) 88%, white);
}
.home-links {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.home-link {
display: inline-flex;
align-items: center;
gap: 7px;
height: 32px;
padding: 0 12px;
font-family: var(--font-body);
font-size: var(--text-sm);
font-weight: 500;
color: var(--ink-soft);
background: transparent;
border: 1px solid var(--rule);
border-radius: 999px;
cursor: pointer;
transition: color 0.15s, border-color 0.15s;
}
.home-link i {
font-size: 0.85em;
color: var(--ink-faint);
}
.home-link:hover,
.home-link:focus-visible {
color: var(--ink);
border-color: var(--rule-strong);
}
.home-link-count {
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-faint);
}
.home-endings {
display: flex;
flex-direction: column;
gap: 7px;
}
.home-dots {
display: flex;
gap: 5px;
}
.home-dot {
width: 9px;
height: 9px;
border-radius: 50%;
border: 1px solid var(--rule-strong);
background: transparent;
}
.home-dot.found {
background: var(--worthington);
border-color: transparent;
box-shadow: 0 0 8px color-mix(in srgb, var(--worthington) 60%, transparent);
}
.home-dots-label {
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--ink-faint);
}
.home-foot {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 6px 14px;
margin-top: 8px;
padding-top: 14px;
border-top: 1px solid var(--rule);
font-size: var(--text-xs);
color: var(--ink-faint);
}
@media (max-width: 900px) {
.home {
grid-template-columns: 1fr;
grid-template-rows: minmax(180px, 30vh) auto;
overflow-y: auto;
}
.home-art {
grid-column: 1;
grid-row: 1;
margin: 12px 12px 0;
}
.home-art-fade {
background:
radial-gradient(
ellipse at 70% 40%,
transparent 30%,
rgba(5, 4, 10, 0.5) 100%),
linear-gradient(
0deg,
rgba(5, 4, 10, 0.5),
transparent 40%);
}
.home-figure {
height: 92%;
right: 6%;
}
.home-panel {
grid-row: 2;
justify-content: flex-start;
gap: 18px;
padding: 22px 18px 20px;
overflow: visible;
}
.home-title br {
display: none;
}
}
@media (max-height: 640px) and (min-width: 901px) {
.home-panel {
gap: 14px;
padding-top: 24px;
}
.home-lede {
display: none;
}
}
@media (prefers-reduced-motion: reduce) {
.home-scenery svg,
.home-figure {
animation: none;
}
}
a.hdr-btn, a.home-link {
text-decoration: none;
}
.home-brand {
width: 100%;
}
.home-brand-actions {
margin-left: auto;
display: flex;
align-items: center;
gap: 6px;
}
.home-icon-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
color: var(--ink-soft);
background: transparent;
border: 1px solid var(--rule);
border-radius: 999px;
cursor: pointer;
text-decoration: none;
flex-shrink: 0;
transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.home-icon-btn i {
font-size: 0.85em;
color: var(--ink-faint);
transition: color 0.15s;
}
.home-icon-btn:hover,
.home-icon-btn:focus-visible {
color: var(--ink);
border-color: var(--rule-strong);
background: color-mix(in srgb, var(--ink) 5%, transparent);
}
.home-icon-btn:hover i,
.home-icon-btn:focus-visible i {
color: var(--ink);
}
/* Trail bar (Start / breadcrumbs + Save & Restart) overlaid on the stage graphic */
.stage > .trail-bar {
position: absolute;
top: 10px;
left: 12px;
right: 12px;
z-index: 10;
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
min-height: 28px;
pointer-events: none;
}
.stage > .trail-bar .breadcrumb-container,
.stage > .trail-bar .trail-actions {
pointer-events: auto;
}
.stage > .trail-bar .breadcrumb-item,
.stage > .trail-bar .breadcrumb-more,
.stage > .trail-bar .ghost-btn {
color: #f4f4f5;
background: rgba(9, 9, 11, 0.65);
border: 1px solid rgba(255, 255, 255, 0.14);
backdrop-filter: blur(6px);
-webkit-backdrop-filter: blur(6px);
}
.stage > .trail-bar .breadcrumb-item.current {
color: var(--accent);
border-color: color-mix(in srgb, var(--accent) 45%, rgba(255, 255, 255, 0.14));
background: color-mix(in srgb, var(--accent) 18%, rgba(9, 9, 11, 0.75));
}
.stage > .trail-bar .breadcrumb-item:hover:not(.current),
.stage > .trail-bar .breadcrumb-more:hover,
.stage > .trail-bar .ghost-btn:hover {
color: #ffffff;
border-color: rgba(255, 255, 255, 0.32);
background: rgba(24, 24, 28, 0.85);
}
.stage > .trail-bar .breadcrumb-arrow {
color: #f4f4f5;
opacity: 0.7;
padding: 0 2px;
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}
.stage-location {
top: auto;
left: auto;
bottom: 12px;
right: 12px;
}
@media (min-width: 1200px) {
.play {
grid-template-rows: auto auto minmax(0, 1fr);
grid-template-areas:
"banner banner"
"stage stage"
"story choices";
}
.play:has(.setpiece) {
grid-template-areas:
"banner banner"
"stage stage"
"choices choices";
}
}
</style>
</head>
<body data-theme="neutral">
<a href="#main" class="skip-link">Skip to the story</a>
<div class="app">
<header class="app-header">
<div class="header-left">
<a href="/games" target="_top" class="hdr-btn icon-only" data-back-to-games title="Back to Games" aria-label="Back to Games">
<i class="fas fa-arrow-left" aria-hidden="true"></i>
</a>
<div class="title-group">
<h1 class="app-title-heading">
<button type="button" class="app-title" id="home-link" title="Back to the start screen">
<img src="data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2212%22%20fill%3D%22%230b0a10%22%2F%3E%3Cpath%20d%3D%22M8%2036%20C18%2026%2030%2022%2040%2022%20C50%2022%2056%2026%2060%2030%20C56%2033%2052%2032%2048%2031%20C45%2020%2038%2014%2030%2015%20C23%2016%2018%2022%2016%2030%20C13%2031%2010%2033%208%2036%20Z%22%20fill%3D%22%238A6DFF%22%2F%3E%3Ccircle%20cx%3D%2232%22%20cy%3D%2244%22%20r%3D%224%22%20fill%3D%22none%22%20stroke%3D%22%23C9A227%22%20stroke-width%3D%222.5%22%2F%3E%3C%2Fsvg%3E" alt="" width="22" height="22">
<span class="app-name">The Ghost of Molly Roger</span>
</button>
</h1>
<span class="app-subtitle">A psychic adventure in Victorian England</span>
</div>
<div class="header-divider" aria-hidden="true"></div>
<div class="header-metrics" aria-label="Your student">
<span class="header-pill" id="player-name">Student Psychic</span>
<span class="header-pill" id="psychic-level">Psychic 1</span>
<span class="header-pill" id="path">Undecided</span>
<span class="header-pill accent" id="act-pill"></span>
</div>
</div>
<nav class="header-actions" aria-label="Game menu">
<button type="button" class="hdr-btn" id="journey-link" title="Your journey">
<i class="fas fa-route" aria-hidden="true"></i><span class="hdr-label">Journey</span>
</button>
<button type="button" class="hdr-btn" id="gallery-link" title="Endings">
<i class="fas fa-clone" aria-hidden="true"></i><span class="hdr-label">Endings</span><span class="hdr-count" id="gallery-count"></span>
</button>
<button type="button" class="hdr-btn" id="codex-link" title="Codex">
<i class="fas fa-book-open" aria-hidden="true"></i><span class="hdr-label">Codex</span><span class="hdr-count" id="codex-count"></span>
</button>
<button type="button" class="hdr-btn" id="satchel-link" title="Satchel">
<i class="fas fa-briefcase" aria-hidden="true"></i><span class="hdr-label">Satchel</span><span class="hdr-count" id="satchel-count"></span>
</button>
<span class="header-divider" aria-hidden="true"></span>
<button type="button" class="hdr-btn icon-only" id="story-link" title="The original story" aria-label="The original story">
<i class="fas fa-book" aria-hidden="true"></i>
</button>
<button type="button" class="hdr-btn icon-only" id="about-link" title="About this game" aria-label="About this game">
<i class="fas fa-circle-info" aria-hidden="true"></i>
</button>
<button type="button" class="hdr-btn icon-only" id="settings-link" title="Settings" aria-label="Settings">
<i class="fas fa-sliders" aria-hidden="true"></i>
</button>
<span class="header-divider" aria-hidden="true"></span>
<a href="https://github.com/alaric-visi/molly-roger" target="_blank" rel="noopener noreferrer" class="hdr-btn" id="github-link" title="View on GitHub">
<i class="fab fa-github" aria-hidden="true"></i><span class="hdr-label">GitHub</span>
</a>
<button type="button" class="hdr-btn icon-only" data-fullscreen-toggle title="Toggle fullscreen" aria-label="Toggle fullscreen">
<i class="fas fa-expand" aria-hidden="true"></i>
</button>
</nav>
</header>
<div class="app-body">
<main class="play" id="main">
<div class="continue-banner" id="continue-banner" hidden>
<span><i class="fas fa-bookmark" aria-hidden="true"></i> Welcome back - your saved journey has been restored.</span>
<button type="button" class="continue-banner-btn" id="dismiss-continue-banner">Got it</button>
</div>
<div class="stage" id="stage">
<div class="trail-bar">
<nav class="breadcrumb-container" id="breadcrumb-container" aria-label="Recent steps"></nav>
<div class="trail-actions">
<button type="button" class="ghost-btn" id="save-btn" title="Save progress">
<i class="fas fa-floppy-disk" aria-hidden="true"></i><span>Save</span>
</button>
<button type="button" class="ghost-btn" id="restart-btn" title="Start a new game">
<i class="fas fa-rotate-left" aria-hidden="true"></i><span>Restart</span>
</button>
</div>
</div>
<div class="stage-scenery" id="stage-scenery"></div>
<canvas class="stage-particles" id="stage-particles" aria-hidden="true"></canvas>
<div class="stage-cast" id="stage-cast"></div>
<div class="stage-card" id="stage-card"></div>
<div class="stage-vignette" aria-hidden="true"></div>
<div class="stage-transition" id="stage-transition" aria-hidden="true"></div>
<div class="stage-location" id="stage-location"></div>
<div class="stage-speaker" id="stage-speaker"></div>
</div>
<section class="story-card" aria-labelledby="scene-heading">
<div class="ending-eyebrow" id="ending-eyebrow" hidden>The story ends</div>
<div class="ending-title" id="ending-title" hidden></div>
<h2 class="sr-only" id="scene-heading"></h2>
<div class="scene-text" id="scene-text" title="Click to reveal the full text"></div>
<div class="skip-hint" id="skip-hint">Click the text or press Space to skip · keys 1–9 choose</div>
<div class="sr-only" id="sr-live" aria-live="polite"></div>
</section>
<div class="choices-container" id="choices-container"></div>
</main>
<aside class="sidebar" aria-label="Your progress">
<section class="panel progress-panel" aria-label="Story progress">
<div class="panel-label panel-label-row">
<span>Progress</span>
<span class="progress-act" id="progress-act"></span>
</div>
<ol class="act-track" id="act-track"></ol>
<div class="objective" id="objective"></div>
</section>
<section class="panel crew-panel" aria-label="Your crew">
<div class="panel-label panel-label-row">
<span>Crew</span>
<span class="crew-count" id="crew-count"></span>
</div>
<ul class="crew-list" id="crew-list"></ul>
</section>
<section class="panel changes-panel">
<div class="panel-label">What changed</div>
<div class="changes-strip" id="changes"></div>
</section>
<section class="panel">
<div class="relationship-container" id="relationship-container"></div>
</section>
<section class="panel carried-panel" aria-label="What you carry">
<div class="panel-label panel-label-row">
<span>Carrying</span>
<button type="button" class="panel-link" id="carried-open">Satchel</button>
</div>
<ul class="carried-list" id="carried-list"></ul>
</section>
<section class="panel summary-panel">
<div class="panel-label">This run</div>
<div class="ending-summary" id="ending-summary" hidden></div>
</section>
<footer class="sidebar-foot">
<div id="persistence-note" class="persistence-note"></div>
<p class="attribution-footer">
Based on the SCP Foundation tale
<a href="https://scp-wiki.wikidot.com/the-ghost-of-molly-roger" target="_blank" rel="noopener">"The Ghost of Molly Roger"</a>
by psul, licensed under
<a href="https://creativecommons.org/licenses/by-sa/3.0/" target="_blank" rel="noopener">CC BY-SA 3.0</a>.
The SCP Foundation and all related content are the property of their respective authors and creators.
</p>
</footer>
</aside>
</div>
</div>
<!-- Start screen -->
<section class="home" id="home" aria-labelledby="home-title" hidden>
<div class="home-art" id="home-art" aria-hidden="true">
<div class="home-scenery" id="home-scenery"></div>
<div class="home-figure" id="home-figure"></div>
<div class="home-art-fade"></div>
</div>
<div class="home-panel">
<div class="home-brand">
<a href="/games" target="_top" class="home-icon-btn" data-back-to-games title="Back to Games" aria-label="Back to Games">
<i class="fas fa-arrow-left" aria-hidden="true"></i>
</a>
<img src="data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2212%22%20fill%3D%22%230b0a10%22%2F%3E%3Cpath%20d%3D%22M8%2036%20C18%2026%2030%2022%2040%2022%20C50%2022%2056%2026%2060%2030%20C56%2033%2052%2032%2048%2031%20C45%2020%2038%2014%2030%2015%20C23%2016%2018%2022%2016%2030%20C13%2031%2010%2033%208%2036%20Z%22%20fill%3D%22%238A6DFF%22%2F%3E%3Ccircle%20cx%3D%2232%22%20cy%3D%2244%22%20r%3D%224%22%20fill%3D%22none%22%20stroke%3D%22%23C9A227%22%20stroke-width%3D%222.5%22%2F%3E%3C%2Fsvg%3E" alt="" width="28" height="28">
<span class="home-eyebrow">London, 1845</span>
<div class="home-brand-actions">
<a href="https://github.com/alaric-visi/molly-roger" target="_blank" rel="noopener noreferrer" class="home-link" title="View on GitHub">
<i class="fab fa-github" aria-hidden="true"></i>GitHub
</a>
<button type="button" class="home-icon-btn" data-fullscreen-toggle title="Toggle fullscreen" aria-label="Toggle fullscreen">
<i class="fas fa-expand" aria-hidden="true"></i>
</button>
</div>
</div>
<h1 class="home-title" id="home-title">The Ghost of <br>Molly Roger</h1>
<p class="home-lede">
A pirate is talking to you inside your head. The Board that licenses every psychic in England
would very much like her gone – and anyone who listens to her, too.
</p>
<div class="home-actions">
<button type="button" class="home-btn primary" id="home-continue" hidden>
<span class="home-btn-main"><i class="fas fa-play" aria-hidden="true"></i>Continue</span>
<span class="home-btn-meta" id="home-continue-meta"></span>
</button>
<button type="button" class="home-btn" id="home-new">
<span class="home-btn-main"><i class="fas fa-feather-pointed" aria-hidden="true"></i>New game</span>
<span class="home-btn-meta" id="home-new-meta">About an hour per run, with 17 endings</span>
</button>
</div>
<div class="home-links">
<button type="button" class="home-link" id="home-gallery">
<i class="fas fa-images" aria-hidden="true"></i>Endings <span class="home-link-count" id="home-gallery-count"></span>
</button>
<button type="button" class="home-link" id="home-codex">
<i class="fas fa-book-open" aria-hidden="true"></i>Codex <span class="home-link-count" id="home-codex-count"></span>
</button>
<button type="button" class="home-link" id="home-about">
<i class="fas fa-circle-info" aria-hidden="true"></i>About
</button>
<button type="button" class="home-link" id="home-settings">
<i class="fas fa-sliders" aria-hidden="true"></i>Settings
</button>
</div>
<div class="home-endings" id="home-endings"></div>
<footer class="home-foot">
<span>Based on the SCP Foundation tale by psul · CC BY-SA 3.0</span>
</footer>
</div>
</section>
<div class="save-indicator" id="save-indicator">
<i class="fas fa-check"></i>
<span>Progress Saved</span>
</div>
<div class="act-transition" id="act-transition" aria-live="polite">
<div class="curtain curtain-left" aria-hidden="true"></div>
<div class="curtain curtain-right" aria-hidden="true"></div>
<div class="act-card">
<div class="act-ornament" aria-hidden="true">❦</div>
<div class="act-title" id="act-title"></div>
<div class="act-subtitle" id="act-subtitle"></div>
<div class="act-ornament flip" aria-hidden="true">❦</div>
</div>
</div>
<!-- Endings gallery -->
<div class="overlay" id="gallery-overlay" role="dialog" aria-modal="true" aria-label="Endings gallery">
<div class="overlay-content wide">
<div class="overlay-header">
<button type="button" class="close-btn" data-close>
<i class="fas fa-times"></i>
Close
</button>
<h1>The Endings</h1>
<div class="subtitle" id="gallery-subtitle"></div>
</div>
<div class="overlay-body">
<div class="gallery-grid" id="gallery-grid"></div>
</div>
</div>
</div>
<!-- About Overlay -->
<div class="overlay" id="about-overlay" role="dialog" aria-modal="true" aria-label="About this game">
<div class="overlay-content">
<div class="overlay-header">
<button type="button" class="close-btn" data-close>
<i class="fas fa-times"></i>
Close
</button>
<div class="subtitle">A Psychic Adventure in Victorian England</div>
</div>
<div class="overlay-body">
<div class="parchment">
<h2 class="story-title">The Story</h2>
<div class="story-content">
<p class="intro">
<span class="highlight">VICTORIAN ENGLAND, 1845</span> is a text-based adventure game
set in a world where psychic abilities are real but heavily regulated by authorities.
</p>
<div class="section section-world">
<h2>The World</h2>
<p>
The year is 1845. London is a city of contrasts -
gaslit streets and shadowy alleys,
rigid social norms and hidden psychic talents. The Ridgewell Edutainment Centre teaches
young psychics to control their abilities, but some powers cannot be contained.
</p>
<p>
In this world, psychic projections are real manifestations of thought and emotion.
The most famous of these is Molly Roger, a pirate phantom born from the mind of
bank clerk Roger Molly. She represents everything the authorities fear -
uncontrolled
creativity, dangerous individuality, and the power to reshape reality itself.
</p>
</div>
<div class="section section-role">
<h2>Your Role</h2>
<p>
You are a student at Ridgewell Edutainment Centre, just discovering your psychic abilities.
When Molly Roger contacts you, you're thrust into a world of conceptual piracy and psychic
rebellion. Every choice you make will determine not just your fate, but the future of
psychic expression in England.
</p>
<p>
Will you help Molly become fully real? Will you expose the school's secrets? Or will
you follow the approved path of regulated psychic development?
</p>
</div>
<div class="section section-gameplay">
<h2>The Gameplay</h2>
<p>
Navigate through branching storylines where your decisions matter. Build relationships
with key characters, develop your psychic abilities, and explore the Dreamscape where
thoughts become reality. Each path leads to different outcomes in this interactive
narrative experience.
</p>
<p>
Your choices affect your relationships with Molly Roger, Professor Worthington, Grace and
Inspector Vane, opening up new story possibilities and changing how the narrative unfolds.
Guard your <span class="highlight">Self</span> - a merger can swallow a mind that isn't anchored -
and keep an eye on <span class="highlight">Vane's ledger</span>: every rule you break earns a mark.
What you find and learn goes in your Satchel, and some doors only open for those who carry the right key.
Every step you take is recorded in your Journey log, so you can always look back - or
leap back - to a fork you didn't take.
</p>
</div>
<div class="quote">
<p>"Some stories are better when shared between two souls."</p>
</div>
<div class="attribution">
<p>
<strong>Based on the SCP Foundation tale:</strong><br>
<a href="https://scp-wiki.wikidot.com/the-ghost-of-molly-roger" target="_blank" rel="noopener">
"The Ghost of Molly Roger" by psul
</a>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Story Overlay -->
<div class="overlay" id="story-overlay" role="dialog" aria-modal="true" aria-label="The original story">
<div class="overlay-content">
<div class="overlay-header">
<button type="button" class="close-btn" data-close>
<i class="fas fa-times"></i>
Close
</button>
<h1>The Ghost of Molly Roger</h1>
<div class="subtitle">The Original Story</div>
</div>
<div class="overlay-body">
<div class="parchment">
<div class="story-content">
<p><strong>Listen.</strong></p>
<p>The Ridgewell Edutainment Centre was a place for the careful folding of young minds. The year was 1845. The air smelled of genetic samples and regret.</p>
<p>This is how the system works: they teach you to build cages, then they teach you to live inside them. The psychic ones, the ones who could project, were taught to make simple shapes. A sphere. A cube. Useful. Compliant. Dull.</p>
<p>So it goes.</p>
<p>I was one of those. A student psychic. My name is irrelevant, which is a professional way of saying it was a placeholder. A blank page in a ledger.</p>
<p>Then the page was written on by a ghost.</p>
<p>A pirate ghost.</p>
<p>Her name was Molly Roger. She was a psychic projection who had achieved what all the best ideas achieve: she had outgrown her creator.</p>
<p>The creator was a man named Roger Molly. A bank clerk. Can you imagine? He dreamed of ocean spray and freedom, and his brain, being a literal-minded organ, conjured a pirate. A woman. The inverse of himself. His own happy, horrid haunt.</p>
<p>He merged with her eventually. <em>Gone plunderin'</em>, he wrote to his sister. A perfect sentence, that. A full stop that is also a door swinging open into a new story.</p>
<p>But that was his story. This is mine.</p>
<p>Molly Roger slipped into my head during a lecture on controlled projection. Her voice was not a sound but a sensation, like the memory of sunlight on your skin in the depths of a London winter.</p>
<p><em>I be Molly Roger, lass!</em> it said. <em>Ye have the Sight!</em></p>
<p>It was an invitation to unlearn everything.</p>
<p>Which is the beginning of all real education. The kind they don't put on a curriculum.</p>
<p>So I met her in the Dreamspace. Which is just a fancy word for the shared attic of our minds, where we keep the things we're told to forget. Molly wanted to steal the letter 'W'.</p>
<p>A conceptual heist.</p>
<p>The grammar police were not amused.</p>
<p>But for three days, the British Empire stuttered and stammered, all its whats, whens, and whys temporarily on holiday. It was beautiful. It was a poem written in negative space.</p>
<p>It was also, the Board of Psychic Regulation informed us, a crime against the very nature of reality. Which is just their word for the way things are, as opposed to the way things could be.</p>
<p>The Board. Let me tell you about the Board. The Board is a they. They are a them. They are the people who believe a story should have only one ending, pre-approved and stamped in triplicate. They believe a mind should make cubes. Not pirates. Never pirates. Pirates are messy. Pirates change the ending halfway through.</p>
<p>Molly wanted to become real. Not just a thought, but a person. She needed my skin, she said. But she didn't mean it like a monster in a story. She meant it like a character in a poem, stepping off the page and into the life of the reader, asking for a cup of tea and a new point of view.</p>
<p>She showed me what happened to Roger Molly. It wasn't a death. It was a collaboration. A merger. Two solitudes protecting each other, two different songs learning to harmonise. He got her adventure. She got his reality. They both got to be someone new.</p>
<p>Professor Worthington, a man who smelled of mothballs and misplaced authority, offered me the approved path. A life of making psychic cubes in a world of straight lines. A safe, predictable story.<br>
A cage with very clean bars.</p>
<p>I looked at Molly. I looked at the cage.</p>
<p>The thing about cages is you can't see the outside from the inside. You can only see the bars.</p>
<p>We performed the ritual in the old bank where Roger Molly once worked. The air tasted of ozone and old ledgers. The Board arrived, of course. They always arrive. They are professional party-poopers, the sworn enemies of a good story.</p>
<p>Worthington shouted. "That projection will consume you!"</p>
<p>He had it backwards. A cage consumes you. A key sets you free.</p>
<p>The merger felt not like being eaten, but like a conversation that had been waiting to happen my whole life. My caution, her courage. Her laughter, my silence. We were not two jigsaw pieces forcing a fit.</p>
<p>We were two different pictures, and when you held them together, they made a third, more interesting picture. A picture that could move.</p>
<p>So it goes.</p>
<p>Now, we are a they. We are a them. We sail the Dreamspace, a pirate and a student, a ghost and a girl, a they and a them. The Board calls us rogue. We call us free.</p>
<p>Sometimes we are more pirate, stealing the concept of Monday and giving everyone a three-day weekend.</p>
<p>Sometimes we are more student, helping others draw outside the lines of their own minds. It depends on the weather. It depends on the story we want to tell that day.</p>
<p>The moral of the story?</p>
<p>There isn't one. That's the first thing they get wrong. Stories aren't here to moralize. They're here to be. To exist. To resonate.</p>
<p>Or maybe the resonance is the moral. The idea that some ghosts are more alive than the living. And that the best stories, the ones that truly matter, are the ones you have to steal for yourself from the vault of the world-as-it-is.</p>
<p><strong>And so it begins.</strong></p>
<div class="attribution">
<p>
<strong>Original SCP Foundation tale by psul:</strong><br>
<a href="https://scp-wiki.wikidot.com/the-ghost-of-molly-roger" target="_blank" rel="noopener">
Read the original story on the SCP Wiki
</a>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- New game / character setup -->
<div class="overlay" id="setup-overlay" role="dialog" aria-modal="true" aria-labelledby="setup-title" data-locked>
<div class="overlay-content narrow">
<div class="overlay-header">
<button type="button" class="close-btn" data-close id="setup-cancel">
<i class="fas fa-times"></i>
Cancel
</button>
<h1 id="setup-title">A New Student</h1>
<div class="subtitle">Ridgewell Edutainment Centre · Register of Pupils</div>
</div>
<form class="overlay-body setup-form" id="setup-form">
<p class="form-intro">The register clerk dips her pen. A blank page in a ledger, waiting to be written on.</p>
<label class="field">
<span class="field-label">Your name</span>
<input type="text" id="setup-name" name="name" autocomplete="off" required>
</label>
<fieldset class="field">
<legend class="field-label">How should Molly address you?</legend>
<div class="pill-group" id="setup-address"></div>
</fieldset>
<fieldset class="field">
<legend class="field-label">Your pronouns</legend>
<div class="pill-group" id="setup-pronouns"></div>
</fieldset>
<p class="form-preview" id="setup-preview"></p>
<button type="submit" class="choice-btn play-again" id="setup-submit">Sign the register</button>
</form>
</div>
</div>
<!-- Settings -->
<div class="overlay" id="settings-overlay" role="dialog" aria-modal="true" aria-label="Settings">
<div class="overlay-content narrow">
<div class="overlay-header">
<button type="button" class="close-btn" data-close>
<i class="fas fa-times"></i>
Close
</button>
<h1>Settings</h1>
<div class="subtitle">Saved in this browser</div>
</div>
<div class="overlay-body setup-form">
<fieldset class="field">
<legend class="field-label">Text speed</legend>
<div class="pill-group" id="settings-speed"></div>
</fieldset>
<fieldset class="field">
<legend class="field-label">Appearance</legend>
<div class="pill-group" id="settings-theme"></div>
</fieldset>
<fieldset class="field">
<legend class="field-label">Feedback</legend>
<label class="check"><input type="checkbox" id="settings-changes"> Show what each choice changed</label>
</fieldset>
<fieldset class="field">
<legend class="field-label">Set pieces</legend>
<label class="check"><input type="checkbox" id="settings-setpieces"> Play interactive set pieces (untick to choose from a list instead)</label>
<label class="check"><input type="checkbox" id="settings-gentle"> Gentle: more time, slower searchlights</label>
</fieldset>
<fieldset class="field">
<legend class="field-label">Sound</legend>
<label class="check"><input type="checkbox" id="settings-sound"> Play ambience and sound effects</label>
<label class="range">Volume <input type="range" id="settings-volume" min="0" max="1" step="0.05"></label>
</fieldset>
<fieldset class="field">
<legend class="field-label">Your student</legend>
<button type="button" class="control-btn" id="settings-edit-player">
<i class="fas fa-pen"></i><span>Change name, address or pronouns</span>
</button>
</fieldset>
</div>
</div>
</div>
<!-- Codex -->
<div class="overlay" id="codex-overlay" role="dialog" aria-modal="true" aria-label="Codex">
<div class="overlay-content wide">
<div class="overlay-header">
<button type="button" class="close-btn" data-close>
<i class="fas fa-times"></i>
Close
</button>
<h1>The Codex</h1>
<div class="subtitle" id="codex-subtitle"></div>
<div class="codex-tabs" role="tablist" id="codex-tabs"></div>
</div>
<div class="overlay-body" id="codex-body"></div>
</div>
</div>
<!-- Satchel -->
<div class="overlay" id="satchel-overlay" role="dialog" aria-modal="true" aria-label="Satchel">
<div class="overlay-content">
<div class="overlay-header">
<button type="button" class="close-btn" data-close>
<i class="fas fa-times"></i>
Close
</button>
<h1>Your Satchel</h1>
<div class="subtitle">What you carry, and what you know</div>
</div>
<div class="overlay-body" id="satchel-body"></div>
</div>
</div>
<!-- Confirm dialog -->
<div class="overlay" id="confirm-overlay" role="alertdialog" aria-modal="true" aria-labelledby="confirm-message">
<div class="overlay-content narrow confirm-box">
<div class="overlay-body">
<p id="confirm-message"></p>
<div class="confirm-actions">
<button type="button" class="control-btn" id="confirm-cancel" data-close>Cancel</button>
<button type="button" class="control-btn danger" id="confirm-ok">OK</button>
</div>
</div>
</div>
</div>
<!-- Journey Overlay -->
<div class="overlay" id="journey-overlay" role="dialog" aria-modal="true" aria-label="Your journey">
<div class="overlay-content">
<div class="overlay-header">
<button type="button" class="close-btn" data-close>
<i class="fas fa-times"></i>
Close
</button>
<h1>Your Journey</h1>
<div class="subtitle">Every fork you've taken so far</div>
</div>
<div class="overlay-body">
<div class="journey-hint">
<i class="fas fa-info-circle"></i>
Click any earlier step to leap back to that moment. Your relationships and psychic level will rewind with you.
</div>
<div id="journey-list"></div>
</div>
</div>
</div>
<script>
(() => {
// ../../../../private/tmp/molly-roger/src/ui/dom.js
var els = {};
var IDS = {
sceneText: "scene-text",
sceneHeading: "scene-heading",
skipHint: "skip-hint",
choices: "choices-container",
relationships: "relationship-container",
progressAct: "progress-act",
home: "home",
homeLink: "home-link",
homeScenery: "home-scenery",
homeFigure: "home-figure",
homeContinue: "home-continue",
homeContinueMeta: "home-continue-meta",
homeNew: "home-new",
homeNewMeta: "home-new-meta",
homeGallery: "home-gallery",
homeGalleryCount: "home-gallery-count",
homeCodex: "home-codex",
homeCodexCount: "home-codex-count",
homeAbout: "home-about",
homeSettings: "home-settings",
homeEndings: "home-endings",
actTrack: "act-track",
objective: "objective",
crewCount: "crew-count",
crewList: "crew-list",
carriedList: "carried-list",
carriedOpen: "carried-open",
psychicLevel: "psychic-level",
path: "path",
restartBtn: "restart-btn",
saveBtn: "save-btn",
saveIndicator: "save-indicator",
aboutLink: "about-link",
aboutOverlay: "about-overlay",
storyLink: "story-link",
storyOverlay: "story-overlay",
journeyLink: "journey-link",
journeyOverlay: "journey-overlay",
journeyList: "journey-list",
breadcrumbs: "breadcrumb-container",
continueBanner: "continue-banner",
dismissContinueBanner: "dismiss-continue-banner",
persistenceNote: "persistence-note",
stage: "stage",
stageScenery: "stage-scenery",
stageParticles: "stage-particles",
stageCast: "stage-cast",
stageCard: "stage-card",
stageTransition: "stage-transition",
stageLocation: "stage-location",
stageSpeaker: "stage-speaker",
galleryLink: "gallery-link",
galleryCount: "gallery-count",
galleryOverlay: "gallery-overlay",
galleryGrid: "gallery-grid",
gallerySubtitle: "gallery-subtitle",
actTransition: "act-transition",
actTitle: "act-title",
actSubtitle: "act-subtitle",
endingEyebrow: "ending-eyebrow",
endingTitle: "ending-title",
endingSummary: "ending-summary",
playerName: "player-name",
actPill: "act-pill",
changes: "changes",
srLive: "sr-live",
satchelLink: "satchel-link",
satchelCount: "satchel-count",
satchelOverlay: "satchel-overlay",
satchelBody: "satchel-body",
settingsLink: "settings-link",
settingsOverlay: "settings-overlay",
settingsSpeed: "settings-speed",
settingsTheme: "settings-theme",
settingsChanges: "settings-changes",
settingsEditPlayer: "settings-edit-player",
setupOverlay: "setup-overlay",
setupForm: "setup-form",
setupName: "setup-name",
setupAddress: "setup-address",
setupPronouns: "setup-pronouns",
setupPreview: "setup-preview",
setupCancel: "setup-cancel",
confirmOverlay: "confirm-overlay",
confirmMessage: "confirm-message",
confirmOk: "confirm-ok",
confirmCancel: "confirm-cancel",
codexLink: "codex-link",
codexCount: "codex-count",
codexOverlay: "codex-overlay",
codexTabs: "codex-tabs",
codexBody: "codex-body",
codexSubtitle: "codex-subtitle",
settingsSetPieces: "settings-setpieces",
settingsGentle: "settings-gentle",
settingsSound: "settings-sound",
settingsVolume: "settings-volume"
};
function collectElements() {
for (const [key, id] of Object.entries(IDS)) {
const el = document.getElementById(id);
if (!el) throw new Error(`Missing element #${id}`);
els[key] = el;
}
}
function escapeHtml(s) {
return String(s).replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]);
}
// ../../../../private/tmp/molly-roger/src/ui/settings.js
var KEY = "molly-roger-settings";
var TEXT_SPEEDS = {
slow: { label: "Slow", ms: 35 },
normal: { label: "Normal", ms: 20 },
fast: { label: "Fast", ms: 8 },
instant: { label: "Instant", ms: 0 }
};
var THEMES = {
system: "Match system",
dark: "Dark",
light: "Light"
};
var DEFAULTS = {
textSpeed: "normal",
theme: "system",
showChanges: true,
setPieces: true,
// interactive set pieces; off = choose from a plain list
gentle: false,
// gentler set pieces: more time, slower searchlights
sound: false,
// procedural ambience and effects
volume: 0.6
};
var current = { ...DEFAULTS };
var listeners = /* @__PURE__ */ new Set();
function loadSettings() {
try {
const raw2 = localStorage.getItem(KEY);
if (raw2) current = { ...DEFAULTS, ...JSON.parse(raw2) };
} catch {
}
return current;
}
var getSettings = () => current;
function updateSettings(patch) {
current = { ...current, ...patch };
try {
localStorage.setItem(KEY, JSON.stringify(current));
} catch {
}
listeners.forEach((fn) => fn(current));
}
var onSettingsChange = (fn) => listeners.add(fn);
var textSpeedMs = () => (TEXT_SPEEDS[current.textSpeed] || TEXT_SPEEDS.normal).ms;
// ../../../../private/tmp/molly-roger/src/audio/audio.js
var ctx = null;
var master = null;
var enabled = false;
var volume = 0.6;
var noise = null;
var bed = null;
var bedKey = "";
var pending = null;
function ensureContext() {
if (ctx) return ctx;
const AC = window.AudioContext || window.webkitAudioContext;
if (!AC) return null;
ctx = new AC();
master = ctx.createGain();
master.gain.value = volume;
master.connect(ctx.destination);
noise = ctx.createBuffer(1, ctx.sampleRate * 2, ctx.sampleRate);
const data = noise.getChannelData(0);
for (let i = 0; i < data.length; i++) data[i] = Math.random() * 2 - 1;
return ctx;
}
function noiseSource() {
const src = ctx.createBufferSource();
src.buffer = noise;
src.loop = true;
return src;
}
function filter(type, freq, q = 0.7) {
const f = ctx.createBiquadFilter();
f.type = type;
f.frequency.value = freq;
f.Q.value = q;
return f;
}
function gainNode(value) {
const g = ctx.createGain();
g.gain.value = value;
return g;
}
function lfo(target, rate, depth) {
const osc = ctx.createOscillator();
const amt = gainNode(depth);
osc.frequency.value = rate;
osc.connect(amt).connect(target);
osc.start();
return osc;
}
function buildBed(realm, ambience) {
const out = gainNode(0);
out.connect(master);
const nodes = [];
const timers = [];
const keep = (n) => {
nodes.push(n);
return n;
};
if (realm === "institution") {
const n = keep(noiseSource());
n.connect(filter("lowpass", 280)).connect(gainNode(0.06)).connect(out);
n.start();
const hum = keep(ctx.createOscillator());
hum.frequency.value = 55;
hum.connect(gainNode(0.018)).connect(out);
hum.start();
timers.push(setInterval(() => tick(out, 2600, 0.05), 1e3));
} else if (realm === "dream") {
const chord = [220, 277.2, 329.6, 440];
const pad = gainNode(0.022);
pad.connect(filter("lowpass", 1400)).connect(out);
chord.forEach((f, i) => {
const o = keep(ctx.createOscillator());
o.type = i % 2 ? "sine" : "triangle";
o.frequency.value = f;
o.detune.value = (i - 1.5) * 6;
o.connect(pad);
o.start();
});
keep(lfo(pad.gain, 0.07, 0.012));
timers.push(setInterval(() => {
if (Math.random() < 0.5) ping(out, 880 + Math.random() * 1200, 0.025);
}, 2600));
} else {
const n = keep(noiseSource());
n.connect(filter("bandpass", 900, 0.4)).connect(gainNode(0.02)).connect(out);
n.start();
const o = keep(ctx.createOscillator());
o.frequency.value = 110;
o.connect(gainNode(0.012)).connect(out);
o.start();
}
if (ambience === "rain") {
const n = keep(noiseSource());
n.connect(filter("highpass", 1200)).connect(filter("lowpass", 6e3)).connect(gainNode(0.07)).connect(out);
n.start();
}
if (ambience === "dream" || ambience === "letters") {
const n = keep(noiseSource());
const swell = gainNode(0.03);
n.connect(filter("lowpass", 520)).connect(swell).connect(out);
n.start();
keep(lfo(swell.gain, 0.11, 0.025));
}
if (ambience === "embers") {
timers.push(setInterval(() => {
if (Math.random() < 0.6) tick(out, 4e3 + Math.random() * 3e3, 0.03);
}, 180));
}
return {
gain: out,
stop() {
timers.forEach(clearInterval);
const t = ctx.currentTime;
out.gain.cancelScheduledValues(t);
out.gain.setTargetAtTime(0, t, 0.4);
setTimeout(() => {
nodes.forEach((n) => {
try {
n.stop();
} catch {
}
});
out.disconnect();
}, 2500);
}
};
}
function tick(dest, freq, level) {
const n = noiseSource();
const g = gainNode(0);
n.connect(filter("bandpass", freq, 6)).connect(g).connect(dest);
const t = ctx.currentTime;
g.gain.setValueAtTime(level, t);
g.gain.exponentialRampToValueAtTime(1e-4, t + 0.05);
n.start(t);
n.stop(t + 0.06);
}
function ping(dest, freq, level, decay = 1.6, when = 0) {
const o = ctx.createOscillator();
const g = gainNode(0);
o.frequency.value = freq;
o.connect(g).connect(dest);
const t = ctx.currentTime + when;
g.gain.setValueAtTime(0, t);
g.gain.linearRampToValueAtTime(level, t + 0.01);
g.gain.exponentialRampToValueAtTime(1e-4, t + decay);
o.start(t);
o.stop(t + decay + 0.05);
}
function sweep(from, to, seconds, level) {
const o = ctx.createOscillator();
const g = gainNode(0);
o.frequency.setValueAtTime(from, ctx.currentTime);
o.frequency.exponentialRampToValueAtTime(to, ctx.currentTime + seconds);
o.connect(g).connect(master);
g.gain.linearRampToValueAtTime(level, ctx.currentTime + seconds * 0.3);
g.gain.linearRampToValueAtTime(0, ctx.currentTime + seconds);
o.start();
o.stop(ctx.currentTime + seconds + 0.05);
}
var EFFECTS = {
choice() {
tick(master, 3200, 0.09);
setTimeout(() => tick(master, 2400, 0.05), 45);
},
quill() {
for (let i = 0; i < 4; i++) setTimeout(() => tick(master, 3e3 + Math.random() * 1500, 0.05), i * 55);
},
curtain() {
sweep(90, 45, 1.6, 0.12);
},
ending() {
[523.3, 659.3, 784, 1046.5].forEach((f, i) => ping(master, f, 0.07, 2.2, i * 0.18));
},
item() {
ping(master, 880, 0.08, 1.2);
ping(master, 1320, 0.04, 1.4, 0.02);
},
scandal() {
ping(master, 660, 0.05, 0.4);
ping(master, 990, 0.04, 0.5, 0.08);
},
anchor() {
ping(master, 392, 0.09, 1);
},
wrong() {
sweep(140, 70, 0.25, 0.1);
},
setpiece() {
ping(master, 587.3, 0.06, 1.4);
ping(master, 880, 0.05, 1.6, 0.12);
}
};
function setEnabled(on) {
enabled = on;
if (on) {
if (!ensureContext()) return;
master.gain.setTargetAtTime(volume, ctx.currentTime, 0.2);
Promise.resolve(ctx.resume?.()).then(() => {
if (pending) setScene(...pending);
});
} else if (ctx) {
master.gain.setTargetAtTime(0, ctx.currentTime, 0.2);
bed?.stop();
bed = null;
bedKey = "";
}
}
function setVolume(v) {
volume = v;
if (ctx && enabled) master.gain.setTargetAtTime(v, ctx.currentTime, 0.1);
}
function setScene(realm, ambience) {
pending = [realm, ambience];
if (!enabled || !ctx || ctx.state !== "running") return;
const key = `${realm}:${ambience}`;
if (key === bedKey) return;
bedKey = key;
bed?.stop();
bed = buildBed(realm, ambience);
bed.gain.gain.setTargetAtTime(1, ctx.currentTime, 0.8);
}
function sfx(name) {
if (!enabled || !ctx || ctx.state !== "running") return;
EFFECTS[name]?.();
}
function unlock() {
if (!enabled) return;
ensureContext();
ctx.resume?.().then(() => {
if (pending) setScene(...pending);
});
}
// ../../../../private/tmp/molly-roger/src/ui/theme.js
var media = window.matchMedia("(prefers-color-scheme: dark)");
function syncTheme() {
const chosen = getSettings().theme;
const theme = (chosen === "dark" || chosen === "light" ? chosen : null) || (media.matches ? "dark" : "light");
document.body.classList.toggle("light-mode", theme === "light");
}
function watchTheme() {
syncTheme();
media.addEventListener?.("change", syncTheme);
onSettingsChange(syncTheme);
}
// ../../../../private/tmp/molly-roger/src/ui/overlays.js
var lastFocus = null;
var closeHandlers = /* @__PURE__ */ new WeakMap();
function openOverlay(overlay, { onClose } = {}) {
if (!overlay.classList.contains("open")) lastFocus = document.activeElement;
overlay.classList.add("open");
if (onClose) closeHandlers.set(overlay, onClose);
const focusTarget = overlay.querySelector("[autofocus], input, [data-close]:not([hidden])");
focusTarget?.focus();
}
function closeOverlay(overlay) {
if (!overlay.classList.contains("open")) return;
overlay.classList.remove("open");
const handler = closeHandlers.get(overlay);
closeHandlers.delete(overlay);
handler?.();
if (!anyOverlayOpen()) lastFocus?.focus?.();
}
var anyOverlayOpen = () => !!document.querySelector(".overlay.open");
var isLocked = (overlay) => overlay.hasAttribute("data-locked");
function wireOverlays() {
document.querySelectorAll(".overlay").forEach((overlay) => {
overlay.querySelectorAll("[data-close]").forEach((btn) => btn.addEventListener("click", () => closeOverlay(overlay)));
overlay.addEventListener("click", (e) => {
if (e.target === overlay && !isLocked(overlay)) closeOverlay(overlay);
});
});
document.addEventListener("keydown", (e) => {
const open2 = [...document.querySelectorAll(".overlay.open")];
const top = open2[open2.length - 1];
if (!top) return;
if (e.key === "Escape" && !isLocked(top)) {
closeOverlay(top);
return;
}
if (e.key === "Tab") {
const focusable = [...top.querySelectorAll("button, input, a[href], [tabindex]:not([tabindex='-1'])")].filter((el) => !el.disabled && !el.hidden && el.offsetParent !== null);
if (!focusable.length) return;
const first = focusable[0];
const last = focusable[focusable.length - 1];
if (e.shiftKey && document.activeElement === first) {
last.focus();
e.preventDefault();
} else if (!e.shiftKey && document.activeElement === last) {
first.focus();
e.preventDefault();
}
}
});
}
// ../../../../private/tmp/molly-roger/src/story/scenes/prologue.js
var prologueScenes = {
prologue_exam: {
act: 1,
theme: "institution",
location: "lecture_hall",
speaker: "Professor Worthington",
cast: [{ who: "Professor Worthington", mood: "stern", pos: "right" }, { who: "Inspector Vane", mood: "stern", pos: "left" }],
text: "RIDGEWELL EDUTAINMENT CENTRE. EXAMINATION DAY.\n\nThe lecture hall smells of chalk, wet wool and the particular fear of forty students who have been told, many times, that this matters.\n\nProfessor Worthington walks the rows with his hands clasped behind his back. 'Controlled Projection, Part the First. You will each project a cube. Six faces. Twelve edges. No opinions.'\n\nAt the back of the hall sits a woman in Board grey you have never seen before. She has a small ledger open on her knee and a pencil she has not yet used.\n\nYour turn comes. The air in front of you waits to be told what to be.[[if flag:ghost_memory]]\n\nYou have the oddest feeling you have sat this examination before. More than once. The air in front of you seems to remember you, too.[[/if]]",
choices: [
{
text: "Sit the examination",
setPiece: "projection",
skipOutcome: "cube",
outcomes: {
cube: { nextScene: "prologue_cube", relationshipChanges: { "Professor Worthington": 10 }, suspicionChange: -5, setFlags: ["perfect_cube"] },
sail: { nextScene: "prologue_sail", psychicChange: 1, suspicionChange: 10, setFlags: ["cube_sail"] },
still: { nextScene: "prologue_nothing", selfChange: 10, setFlags: ["still_mind"] }
}
},
{
plainOnly: true,
text: "Project a perfect cube",
nextScene: "prologue_cube",
relationshipChanges: { "Professor Worthington": 10 },
suspicionChange: -5,
setFlags: ["perfect_cube"]
},
{
plainOnly: true,
text: "Let the cube become something else",
nextScene: "prologue_sail",
psychicChange: 1,
suspicionChange: 10,
setFlags: ["cube_sail"]
},
{
plainOnly: true,
text: "Project nothing. Hold your mind perfectly still.",
nextScene: "prologue_nothing",
selfChange: 10,
setFlags: ["still_mind"]
}
]
},
prologue_cube: {
act: 1,
theme: "institution",
location: "lecture_hall",
speaker: "Professor Worthington",
cast: [{ who: "Professor Worthington", mood: "pleased", pos: "right" }, { who: "Inspector Vane", mood: "stern", pos: "left" }],
text: "It comes out perfect. Six faces, twelve edges, corners you could cut yourself on. It turns slowly in the air, humming faintly - a small grey monument to doing as you're told.\n\n'Exemplary,' says Worthington, and he means it. He writes something in his book. At the back of the hall, the woman in grey writes nothing at all.\n\nAs the cube winks out you hear, very faintly, from somewhere that is not the room, someone yawn.",
choices: [
{ text: "Go on to the afternoon lecture", nextScene: "start" }
]
},
prologue_sail: {
act: 1,
theme: "institution",
location: "lecture_hall",
speaker: null,
cast: [{ who: "Professor Worthington", mood: "afraid", pos: "right" }, { who: "Inspector Vane", mood: "stern", pos: "left" }],
text: "It starts as a cube. You promise it does.\n\nThen one face loosens, the way a sheet loosens on a washing line, and catches a wind that isn't blowing - and the cube is a sail. A small, impossible, salt-stiff sail, bellied out over your desk.\n\nFor one heartbeat the whole hall smells of the sea.\n\nWorthington stops dead. Forty students stop breathing. At the back of the hall, the woman in grey makes her first mark of the day.\n\nAnd from somewhere that is not the room, someone laughs - delighted, enormous, like a door being kicked open.",
choices: [
{ text: "Let it fold away, and say nothing", nextScene: "start" }
]
},
prologue_nothing: {
act: 1,
theme: "institution",
location: "lecture_hall",
speaker: null,
cast: [{ who: "Professor Worthington", mood: "thoughtful", pos: "right" }],
text: "You let the air stay empty. Not a cube, not a refusal - just a stillness, held the way you'd hold a full cup.\n\n@none: Worthington frowns and writes 'absent of mind?' in the margin, question mark and all. The woman in grey glances up, then down again. Nothing about you has earned a mark.\n\nBut in the stillness you hear something the others don't: a voice, far off, humming a sea shanty slightly out of tune. It sounds as if it has been waiting a long while for a room to go quiet enough.",
choices: [
{ text: "Go on to the afternoon lecture", nextScene: "start" }
]
}
};
// ../../../../private/tmp/molly-roger/src/story/scenes/act1.js
var act1Scenes = {
start: {
theme: "neutral",
location: "lecture_hall",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "pleased", pos: "right" }, { who: "Professor Worthington", mood: "stern", pos: "left" }],
act: 2,
text: "LONDON, 1845. RIDGEWELL EDUTAINMENT CENTRE.\n\nThe afternoon lecture is Containment Theory, which is the Board's way of saying Don't. Rain ticks on the tall windows. The gas lamps hiss. Forty pens scratch the same sentence into forty identical notebooks: A projection is a tool, and a tool has no opinions.\n\nYou - {name}, a second-year with an unremarkable record - are on your fourth copy of that sentence when the droning voice of Professor Worthington begins to fade, as if someone has shut a door on it. In its place comes the sound of the sea.\n\nThen she's there. Not in the room - in your head, where nobody is supposed to be able to stand. A woman in a battered tricorn and a coat that has seen several centuries' worth of weather, with wild eyes, a gold hoop in one ear, and a smirk like a dropped anchor.\n\n'I be Molly Roger, {lass}! [[if flag:cube_sail]]That sail o' yours this morning - I near fell off me ship! [[/if]][[if flag:perfect_cube]]A perfect cube, was it? Ye can do better than that. [[/if]][[if flag:still_mind]]Ye heard me humming, didn't ye? Nobody ever hears me humming. [[/if]][[if flag:ghost_memory]]Have we... met? Ye feel like a song I've heard before. [[/if]]Ye have the Sight! Meet me in Dreamspace tonight, or spend yer life as another dull London drone!'\n\nShe winks. Your pen, entirely of its own accord, draws a small ship in the margin.\n\nAt the front of the hall, Worthington pauses mid-sentence and looks straight at you, as if he has heard something too. Then he clears his throat, and carries on.\n\nYour Sight is waking up. The Board watches for unauthorised projections. Somewhere between this sentence and the next, you're going to have to decide which side of the door you're on.",
choices: [
{ text: "Investigate this Molly Roger in the library", nextScene: "research" },
{ text: "Practise basic projections after class", nextScene: "practice" },
{ text: "Report the incident to Professor Worthington", nextScene: "report" },
{
text: "Say her name before she can - you remember it",
nextScene: "practice",
requires: "flag:ghost_memory",
hideLocked: true,
relationshipChanges: { "Molly Roger": 20 },
setFlags: ["named_her"]
}
],
relationshipChanges: { "Molly Roger": 10 },
psychicChange: 0
},
research: {
theme: "neutral",
location: "library",
speaker: "Grace",
act: 2,
text: "The Combination Library is called that because nobody has ever agreed what it's a combination of. It smells of old paper, lamp oil, and the faint sour tang of the genetic samples kept in jars on the top shelves, which no one has ever been brave enough to label.\n\nIn the restricted section, behind a run of Parliamentary reports so dull they work better than a lock, you find a bundle of letters tied with string. The hand is careful and clerkly, every t crossed. They're from a bank clerk named Roger Molly to his sister, and they begin with the weather and the price of coal, and end, a year later, with only two words: Gone plunderin'.\n\nYou're halfway through the bundle when a shadow falls across the page.\n\n'I see you've found the good stuff.' The girl leaning on the end of the stack is Grace - the school's most talented psychic, and the one the teachers never quite look in the eye. Ink on her fingers, chalk on her cuff. 'Molly's been in touch, hasn't she? You've got the look. Like someone's left a window open in your head.'\n\nShe doesn't wait for an answer. 'She's been recruiting. She does this every few years. Most of the people she calls never answer.' A pause. 'I can help you understand what's happening to you - properly, not the way they teach it here. But I'll want something in return. I've some extracurricular activities that could use another pair of hands.'",
choices: [
{ text: "Accept Grace's offer - learn from the best", nextScene: "grace_help", relationshipChanges: { "Grace": 15 } },
{ text: "Decline politely and research alone", nextScene: "research_alone" },
{ text: "Ask about Molly Roger's true intentions", nextScene: "molly_truth" }
],
relationshipChanges: { "Molly Roger": 5, "Grace": 5 },
psychicChange: 1,
addItems: ["roger_letters"]
},
practice: {
theme: "dream",
location: "observatory",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "pleased" }],
act: 2,
text: "[[if flag:named_her]]'Ye knew me name,' she says, before anything else. 'How'd ye know me name, {lass}?' She looks at you very strangely for a moment, and then grins. 'Never mind. Some things ye just know.'\n\n[[/if]]The abandoned observatory sits on the roof of the east wing, forgotten by everyone except the pigeons. The great telescope points at nothing. The dome's slit is stuck permanently open, so the room is always full of sky.\n\nYou sit cross-legged on the cold boards and try to project. Your first attempts are pitiful - a shimmer, a smudge, a cube that sags like a wet loaf - and then the air in front of you gives a kind of shrug, and Molly Roger is standing there: boots, coat, earring and all, looking at your cube with professional pity.\n\n'Not bad for a landlubber,' she says. 'Not good, mind.'\n\nShe walks a slow circle round you, and her boots make no sound at all. Up close she's both more and less real than you'd expected. You can see the stars through the brim of her hat; you can also smell the tar on her hands.\n\n'Now. Let's see if ye've real spirit, or just the Sight.' She crouches, eye to eye. 'I need a partner for a little... conceptual acquisition.'\n\nThe plan, when she explains it, is either the most ridiculous thing you have ever heard or the most wonderful. Somewhere in the Dreamspace there is a vault where the British alphabet is kept, and Molly intends to borrow a letter from it. Just the one. 'The W,' she says, with relish. 'They'll never miss it. Well. They'll miss it a bit.'\n\nIt's harmless fun. It could also get you expelled, collared, or written into a ledger you never get out of.",
choices: [
{ text: "Sign on for Molly's heist", nextScene: "term_begins", relationshipChanges: { "Molly Roger": 20 }, selfChange: -5 },
{ text: "Practise conventional projections instead", nextScene: "conventional" },
{ text: "Ask Molly about Roger Molly's transformation", nextScene: "transformation_questions" }
],
relationshipChanges: { "Molly Roger": 25, "Professor Worthington": -10 },
psychicChange: 2,
selfChange: -5,
// a pirate in your head, fully formed
suspicionChange: 10
// an unauthorised projection
},
grace_help: {
theme: "neutral",
location: "grace_hideout",
speaker: "Grace",
act: 2,
text: "Grace's hideout is behind a bookcase in the Combination Library, and the bookcase opens when you pull on a volume of Hume - 'because nobody,' Grace says, 'has ever voluntarily touched Hume.'\n\nInside is a room no bigger than a pantry and twice as crowded. Stolen projection equipment hums on every surface: a brass apparatus of nested rings, a slate dense with diagrams, jars of something that glows faintly whenever you aren't looking at it. There are books here the Board has burned, and books the Board doesn't know exist.\n\n'First lesson,' Grace says, perching on a crate. 'Projection isn't about making something new. It's about revealing what's already there.' She nods at the faint shimmer that has followed you in. 'Molly thinks she created herself. She didn't. Roger Molly had that pirate in him all along - forty years of adding up other people's money, and underneath it a woman with a cutlass, waiting to be let out.'\n\nShe watches you take that in. 'Which means whatever comes out of you was always yours. That's the part the Board can't stand.'\n\nShe offers proper training - real training, not cubes - but warns you that the Board is cracking down on what it calls 'unauthorised creativity'. 'If they find this room, they'll close it. If they find me in it, they'll close me.'[[if flag:double_agent]]\n\nWhen you tell her what Vane asked of you, she goes very still. 'Then we'd better give Inspector Vane something boring to read,' she says.[[/if]]",
choices: [
{ text: "Begin training with Grace", nextScene: "grace_training", relationshipChanges: { "Grace": 20 } },
{ text: "Ask about her connection to Molly Roger", nextScene: "grace_connection" },
{ text: "This feels too dangerous - leave", nextScene: "research_alone", relationshipChanges: { "Grace": -15 } }
],
relationshipChanges: { "Grace": 10 },
psychicChange: 2,
suspicionChange: 5,
setFlags: ["knows_hideout"]
},
report: {
theme: "institution",
location: "worthington_office",
speaker: "Professor Worthington",
cast: [{ who: "Professor Worthington", mood: "thoughtful", pos: "right" }, { who: "Inspector Vane", mood: "stern", pos: "left" }],
act: 2,
text: "Professor Worthington listens to the whole thing without interrupting, which is somehow worse than if he'd shouted. When you've finished he takes off his spectacles and pinches the bridge of his nose.\n\n'Molly Roger,' he says. 'We'd hoped she'd faded away. She represents everything the Board fears - uncontrolled creativity, dangerous individuality, the notion that a thought might get above itself.'\n\nHe glances toward the door, where a spectacled woman in Board grey has been standing for some time without saying a word. When she finally leaves, the room feels warmer by a degree or two. 'Inspector Vane oversees cases like this now,' he says quietly. 'She's the reason I can't simply look the other way any more.'\n\nHe offers to become your mentor - extra tutorials, a word in the right ears, protection from Molly's influence - in exchange for your loyalty. The safe path. The approved path. He says it kindly, and you can tell he means the kindness.\n\nThat night, Molly appears in your dreams anyway, sitting on the end of your bed with her boots on the blanket. 'So ye chose the cage over the sea?' she says. Not angry. Just tired. 'Pity. I'll find another heart brave enough.' She tips her hat. 'But the window's open, {lass}, if ye ever want to climb out of it.'",
choices: [
{ text: "Accept Worthington's mentorship", nextScene: "apprentice" },
{ text: "Change your mind and contact Molly", nextScene: "contact_molly_late", relationshipChanges: { "Professor Worthington": -30 } }
],
relationshipChanges: { "Professor Worthington": 20, "Molly Roger": -20, "Inspector Vane": 10 },
psychicChange: 0,
suspicionChange: -15,
// coming forward of your own accord counts in your favour
setFlags: ["met_vane"]
},
research_alone: {
theme: "neutral",
location: "library",
speaker: null,
act: 2,
text: "You keep reading, alone, long after the library lamps have been turned down to a glimmer.\n\n@none: Roger Molly's letters change as they go on. The early ones are all weather and coal prices and complaints about the manager, a Mr Fotheringay. Then a ship begins to appear in the margins. Then a woman's voice, quoted - at first with apologies, 'my imaginary friend, as you will laugh to hear', and then without them. By the last dozen letters he is writing to his sister about the two of them, Roger and Molly, as if they were a firm.\n\nThe last letter is two words long.\n\nThe more you read, the more you understand why the school fears such unions. A merged psychic isn't a student with a projection. It's a new kind of person - one who answers to nobody's syllabus, and can't be graded, filed or contained.\n\nYou sit in the dark with the letters in your lap, and Molly's voice somewhere very close, waiting - politely, for once - to see what you'll do.",
choices: [
{ text: "Seek out Molly with your new understanding", nextScene: "practice" },
{ text: "Share your findings with Professor Worthington", nextScene: "report" },
{ text: "Look for Grace to discuss what you've learned", nextScene: "grace_help" },
{
text: "Slip behind the false bookshelf and ask Grace to train you",
nextScene: "grace_training",
requires: "flag:knows_hideout",
relationshipChanges: { "Grace": 5 }
}
],
relationshipChanges: { "Molly Roger": 5 },
psychicChange: 2,
selfChange: 5,
// time alone with your own thoughts
addItems: ["roger_letters"]
},
conventional: {
theme: "institution",
location: "practice_rooms",
speaker: null,
cast: [{ who: "Professor Worthington", mood: "pleased", pos: "left" }],
act: 2,
text: "You throw yourself into approved projection. Cubes, spheres, the occasional daring tetrahedron. You learn to make them crisp-edged and silent and exactly the size requested. Professor Worthington praises your progress in front of the whole class, and something in your chest that has always been hungry for praise sits up and purrs.\n\nYour name goes up on the examination board with a gold star beside it. Inspector Vane, passing through, pauses to look at it, and nods.\n\nBut at night, Molly's voice still whispers at the edge of your hearing. Not words, mostly. The creak of rigging. A gull. Somebody laughing a long way off, on a ship you will never see.\n\nOne evening you project a perfect cube and, without meaning to, give it a tiny porthole. You stare at it for a long time before you let it go.\n\nThe pull between safety and freedom grows stronger with each passing day.",
choices: [
{ text: "Continue with conventional training", nextScene: "approved_psychic" },
{ text: "Give in and contact Molly", nextScene: "term_begins", relationshipChanges: { "Molly Roger": 10 } }
],
relationshipChanges: { "Professor Worthington": 10, "Inspector Vane": 5 },
psychicChange: 1,
suspicionChange: -10
},
molly_truth: {
theme: "neutral",
location: "library",
speaker: "Grace",
cast: [{ who: "Grace", mood: "afraid" }],
act: 2,
text: "Grace leans closer, her voice dropping to a whisper. 'Molly wants what all projections want - to be real. But she's different. Most projections fade when their creators lose interest, but Molly... she's grown beyond Roger Molly.'\n\nShe glances around nervously before continuing. 'The Board fears her because she represents a new kind of being - one that doesn't need a creator to exist. If she succeeds in becoming fully real, it would change everything we know about psychic abilities.'",
choices: [
{ text: "That makes me want to help her more", nextScene: "practice", relationshipChanges: { "Molly Roger": 15 } },
{ text: "That sounds dangerously unstable", nextScene: "report", relationshipChanges: { "Molly Roger": -10 } },
{ text: "Ask Grace why she's helping Molly", nextScene: "grace_motives" }
],
relationshipChanges: { "Grace": 5 },
psychicChange: 1
},
grace_motives: {
theme: "neutral",
location: "library",
speaker: "Grace",
cast: [{ who: "Grace", mood: "sad" }],
act: 2,
text: "Grace's expression softens. 'My grandmother was one of Roger Molly's first students. She believed in what he and Molly were trying to achieve - a world where we don't have to choose between being psychic and being ourselves.'\n\n@grace: She shows you a faded photograph of a woman who looks remarkably like Molly Roger. 'The Board took everything from my family when they declared Roger Molly a rogue. I'm not just helping Molly - I'm finishing what my grandmother started.'",
choices: [
{ text: "Join Grace in her mission", nextScene: "grace_help", relationshipChanges: { "Grace": 20 } },
{ text: "This is too personal for me", nextScene: "research_alone", relationshipChanges: { "Grace": -10 } }
],
relationshipChanges: { "Grace": 10 },
psychicChange: 1,
addItems: ["grace_photo"]
},
grace_connection: {
theme: "neutral",
location: "grace_hideout",
speaker: "Grace",
cast: [{ who: "Grace", mood: "sad" }],
act: 2,
text: "Grace hesitates, then shows you a faded photograph: a woman who looks remarkably like Molly Roger, but isn't. 'My grandmother. She stood witness at Roger Molly's own merger. The Board took her post at the school for it, and erased the record afterward - afraid of what precedent it might set.'\n\nHer voice drops. 'I have the Sight too, same as you. I've just never dared use it the way Molly's asking you to.'",
choices: [
{ text: "Trust Grace fully - train with her", nextScene: "grace_training" },
{ text: "This is a lot to take in - step back and think", nextScene: "research_alone" }
],
relationshipChanges: { "Grace": 10 },
psychicChange: 1,
addItems: ["grace_photo"]
},
apprentice: {
theme: "institution",
location: "worthington_office",
speaker: "Inspector Vane",
cast: [{ who: "Inspector Vane", mood: "stern", pos: "left" }, { who: "Professor Worthington", mood: "sad", pos: "right" }],
act: 2,
text: "For three weeks you are the very model of an approved psychic. Cubes before breakfast. Spheres after supper. Worthington lends you his own annotated copy of the Principles of Containment, and you find yourself, absurdly, wanting to deserve it.\n\nThen one afternoon Inspector Vane is waiting in his office when you arrive. Worthington stands at the window and does not turn round.\n\n'You spend a good deal of time in the Combination Library,' Vane says. 'So does a student named Grace. You'll tell me what she reads, who she meets, and what she projects when she thinks no one is watching.' She turns a page. 'This is not a request. It's an opportunity.'",
choices: [
{ text: "Agree to watch Grace", nextScene: "approved_psychic", relationshipChanges: { "Inspector Vane": 15, "Grace": -30 }, suspicionChange: -10 },
{ text: "Refuse, as politely as you can", nextScene: "apprentice_refuse", relationshipChanges: { "Inspector Vane": -10, "Professor Worthington": 10 }, suspicionChange: 10 },
{ text: "Agree - then warn Grace the moment you're out of the room", nextScene: "grace_help", risky: true, relationshipChanges: { "Grace": 15 }, suspicionChange: 10, setFlags: ["double_agent"] }
],
relationshipChanges: { "Professor Worthington": 10 },
setFlags: ["met_vane"]
},
apprentice_refuse: {
theme: "institution",
location: "worthington_office",
speaker: "Professor Worthington",
cast: [{ who: "Professor Worthington", mood: "sad" }],
act: 2,
text: "Vane writes one word, closes the ledger, and leaves without another.\n\nWorthington is quiet for a long time. 'I refused her predecessor once,' he says at last, to the window. 'Thirty years ago. It was the only brave thing I ever did, and I have spent every year since apologising for it.'\n\nHe turns. He looks older than you have ever seen him. 'Go carefully. Go quickly. And for heaven's sake, don't tell me where.'",
choices: [
{ text: "That night, call out for Molly", nextScene: "contact_molly_late" }
],
relationshipChanges: { "Professor Worthington": 5 }
}
};
// ../../../../private/tmp/molly-roger/src/story/scenes/act2.js
var act2Scenes = {
dream_heist: {
theme: "dream",
location: "alphabet_vault",
speaker: "Molly Roger",
act: 3,
text: "[[if flag:sea_legs]]You take the wheel without being asked. Molly grins, and lets you.[[else]]Molly takes the wheel. You hold on to anything that will hold still.[[/if]]\n\nThe Dreamspace at the dark of the moon is a sea of concepts and half-memories, black and violet and shot through with lights that might be stars or might be other people's dreams. Islands drift past, built out of forgotten birthdays. A shoal of lost umbrellas turns, flashing, and is gone.\n\nThen the Vault rises out of the dark: the Royal Alphabet Vault, a round iron door the size of a cathedral, studded with rivets, glowing from within. Through the crack around its edge you can see the letters on their shelves - twenty-six of them, polished, each humming its own note.\n\n'There she be,' Molly breathes.\n\nThe Vault is guarded. Conceptual hounds pace its threshold, made of growls and the idea of teeth. The grammar police stand at the door in their tall helmets, their searchlights sweeping the dark in long, correct sentences.\n\n'We need a distraction,' Molly says, 'while I nip in and snatch our prize. Ye've the makings of a fine liar, {lass}. Make 'em look the other way.'\n\nYour projection skills are still raw. But Molly believes in you, which is not something you're used to. This could prove your worth - or get your Sight locked away for good.",
choices: [
{
text: "Create a distraction with false memories",
setPiece: "vault",
skipOutcome: "win",
outcomes: {
win: { nextScene: "distraction_success" },
lose: { nextScene: "molly_lead", relationshipChanges: { "Molly Roger": -5 }, suspicionChange: 5 }
}
},
{ plainOnly: true, text: "Create a distraction with false memories", nextScene: "distraction_success" },
{ text: "Try to reason with the conceptual guardians", nextScene: "reason_attempt" },
{ text: "Let Molly take the lead completely", nextScene: "molly_lead", relationshipChanges: { "Molly Roger": -5 } }
],
relationshipChanges: { "Molly Roger": 10 },
psychicChange: 3,
selfChange: -5,
// your first deep dive into someone else's dream
suspicionChange: 10
},
distraction_success: {
theme: "dream",
location: "alphabet_vault",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "pleased", pos: "right" }, { who: "Inspector Vane", mood: "stern", pos: "left" }],
act: 3,
text: "You close your eyes and project the most distracting thing you can think of: a scandal. Specifically, a series of extremely vivid and entirely invented royal scandals, each more improbable than the last, fanned out across the dark like a hand of cards.\n\nThe grammar police are only human, or near enough. Their searchlights swing. Their helmets turn. One of them actually takes out a notebook.\n\nMolly slips past them like a rumour. A moment later she's back with the W held over her head like a trophy, and the two of you are running, and laughing, while the Vault's alarms ring out behind you in perfect Received Pronunciation.\n\nThe letter W disappears from British consciousness. It will be gone for three glorious days.\n\nWhen you're safe, Molly laughs until she has to sit down. 'Ye've the makings of a proper pirate!' Then the laugh goes out of her, slowly, like a tide. 'Now. About that body I need...'\n\nShe tells you what she wants, plainly, for the first time: to be real. Not a dream somebody has, but a person who has dreams. She thinks you could help her do what Roger Molly did.\n\nBack in the waking halls of Ridgewell, a little before dawn, you pass a woman in Board grey standing very still at the end of the corridor, a small ledger open in her gloved hands. [[if visited:report]]You recognise her from Worthington's doorway. [[/if]]Inspector Vane doesn't call out. She simply watches you walk past, makes a single mark, and closes the book.",
choices: [
{ text: "Promise to help her become real", nextScene: "without_w", relationshipChanges: { "Molly Roger": 25 }, selfChange: -10, setFlags: ["promised_molly"] },
{ text: "Suggest finding another way", nextScene: "alternative_solutions" },
{ text: "Ask what happened to Roger Molly exactly", nextScene: "roger_fate" }
],
relationshipChanges: { "Molly Roger": 15, "Inspector Vane": -10 },
psychicChange: 2,
selfChange: -5,
// projecting false memories leaves a residue
suspicionChange: 15,
// Vane makes her mark
setFlags: ["met_vane"],
addItems: ["stolen_w"]
},
transformation_questions: {
theme: "dream",
location: "dreamspace",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "thoughtful" }],
act: 3,
text: "Molly's projection flickers, the way a candle does when somebody opens a door in another room.\n\n'Roger Molly,' she says. 'Everyone tells it like he vanished. He didn't. We merged. Two souls in one skin, like sailors sharing a hammock - one sleeps while the other keeps watch, and in the morning ye swap.'\n\nShe holds out her hand. You take it, and the observatory goes away.\n\nYou see a narrow life in Lombard Street: ledgers, inkwells, a rented room with one window, a man in sleeve-garters who whistled sea shanties under his breath and never knew why. You see a ship that existed only between the columns of his figures, sailed by a woman who was all the things he had never let himself be - loud, brave, rude, delighted. And you see the night they met properly, halfway between his world and hers, and understood that neither of them was finished without the other.\n\n'They call it a merger,' Molly says quietly, when the observatory comes back. 'Makes it sound like banking. It's more like... becoming whole. He got adventure. I got reality. We both got to be someone new.'\n\nShe looks at you sidelong. 'It's not a thing ye do to someone, {lass}. It's a thing ye do with them.'",
choices: [
{ text: "That sounds wonderful", nextScene: "embrace_possibility", relationshipChanges: { "Molly Roger": 15 }, selfChange: -5 },
{ text: "That sounds terrifying", nextScene: "fear_possibility", relationshipChanges: { "Molly Roger": -10 } },
{ text: "Ask if you could meet Roger Molly", nextScene: "meet_roger" }
],
relationshipChanges: { "Molly Roger": 5 },
psychicChange: 1
},
help_molly: {
theme: "dream",
location: "dreamspace",
speaker: "Molly Roger",
act: 6,
text: "[[if visited:ledger_rewrite]]Back in the waking world, in the old bank, Molly sits on the long counter swinging her legs - solid again, mostly. The Board is in disarray; Lady Harrowgate hasn't been seen since the night of the Ledger. For the first time in a long while, the next move is yours.\n\n[[/if]]Molly's excitement fills the room like weather. 'There be two paths, {lass}!' She holds up one finger. 'The slow way: months of practice, the way Roger did it. Evenings and Sundays, learning each other's edges, till the merger's as easy as shutting a door.' A second finger. 'Or the fast way: a ritual, here, in the old bank where he worked. There's psychic residue in these walls thick as treacle. One night. Risky - but done.'\n\nShe doesn't say which she wants. She doesn't have to; you can see it in the way she keeps looking at her own hand, checking it's still there.[[if flag:worthington_ally]]\n\nWorthington, when you tell him, takes off his spectacles and polishes them for a very long time. 'Whichever you choose,' he says at last, 'I should like to be at the door.'[[else]]\n\nMeanwhile, Professor Worthington has noticed your unusual psychic activity. He sends a note in his careful hand: a place on the approved psychics' list is still open to you, if you will renounce Molly's influence. He has underlined 'still' twice.[[/if]]",
choices: [
{ text: "Begin slow training with Molly", nextScene: "slow_path", relationshipChanges: { "Molly Roger": 10, "Professor Worthington": -20 } },
{ text: "Plan the bank ritual", nextScene: "vane_confrontation", relationshipChanges: { "Molly Roger": 15, "Professor Worthington": -30 }, selfChange: -10 },
{ text: "Consider Worthington's offer", nextScene: "worthington_offer", relationshipChanges: { "Molly Roger": -25, "Professor Worthington": 20 }, hideWhen: "flag:worthington_ally" },
{ text: "Build a sanctuary where projections can live without merging", nextScene: "lending_library", requires: "flag:sanctuary_idea & flag:ally_grace" }
],
relationshipChanges: { "Molly Roger": 5 },
psychicChange: 1
},
reason_attempt: {
theme: "dream",
location: "alphabet_vault",
speaker: null,
act: 3,
text: "You step forward, addressing the conceptual hounds and grammar police directly. 'We mean no lasting harm - only a brief loan, freely returned.'\n\nThe guardians pause, considering. Whether they yield depends on how convincingly you've mastered your own mind so far - and whether Molly trusts you enough to let you speak for her.",
choices: [
{
text: "See if your words are enough",
risky: true,
// Both halves of the description now count: mastery AND Molly's trust.
nextScene: (s) => s.psychicLevel >= 8 && s.relationships["Molly Roger"] >= 40 ? "reason_success" : "silenced",
targets: ["reason_success", "silenced"]
},
{ text: "Retreat and let Molly handle it", nextScene: "molly_lead" }
]
},
molly_lead: {
theme: "dream",
location: "alphabet_vault",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "sad" }],
act: 3,
text: "You hang back, letting Molly work alone. She's audacious but reckless without a steadying hand - she comes back clutching only a stray comma instead of the full letter, a smaller victory, and a flicker of disappointment crosses her projection.\n\n'Ye could've helped, {lass}. Still - not nothing, eh?'",
choices: [
{ text: "Ask what she plans to do with it", nextScene: "without_w" },
{ text: "Promise to be braver next time", nextScene: "distraction_success" }
],
relationshipChanges: { "Molly Roger": -5 },
psychicChange: 1,
addItems: ["stray_comma"]
},
alternative_solutions: {
theme: "dream",
location: "dreamspace",
speaker: null,
cast: [{ who: "Molly Roger", mood: "thoughtful" }],
act: 3,
text: "'What if,' you say slowly, 'you didn't have to become real? Not all the way?'\n\nMolly looks at you as if you've suggested she take up knitting.\n\nBut you keep going, because the idea is getting bigger as you say it. What if there were places - sanctuaries - where projections could simply live? Not cut out and quieted, not fused into somebody else's skin, but kept, the way a library keeps books: on a shelf of their own, taken out and loved and brought back. Half real. Real enough.\n\nMolly crosses her arms. Her hat, unaccountably, tilts in a sceptical direction all by itself.\n\n'Never heard of such a place,' she says.\n\n'Nobody's built one yet.'\n\nThe silence goes on just long enough for you to realise she isn't dismissing it. She's thinking. 'Ye'd need someone with a head for rules,' she says at last. 'And a building nobody wants. And a sight more nerve than the Board has.' She squints at you. 'Clever. Not sure I like it. Clever, though.'",
choices: [
{ text: "Research sanctuary theory with Grace", nextScene: "grace_connection" },
{ text: "Decide the safe theory isn't enough - help her merge after all", nextScene: "without_w", relationshipChanges: { "Molly Roger": 10 }, setFlags: ["promised_molly"] }
],
psychicChange: 1,
selfChange: 5,
setFlags: ["sanctuary_idea"]
},
roger_fate: {
theme: "dream",
location: "dreamspace",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "thoughtful" }],
act: 3,
text: "Molly is quiet for a long moment. Then she tells it properly - not the legend, which has thunder in it, but the truth, which has mostly Tuesday evenings.\n\nRoger Molly didn't vanish in a flash of light. He practised. Every evening after the bank closed he would sit in his rented room with the curtains drawn and let her a little further in: an hour, then two, then whole Sundays. Some evenings it went wrong, and he spent the night convinced his name was Captain Something. Some evenings she went too quiet, and he was frightened she'd gone for good. They learned each other's edges the way you learn a house in the dark.\n\nIt took them fourteen months. By the end, the merger didn't feel like a leap. It felt like closing a door gently behind them.\n\n'He wasn't reckless, {lass},' Molly says. 'He was ready. That's the difference. Everyone who tells ye about Roger Molly tells ye about the jump. Nobody tells ye about the fourteen months of walking up to the edge.'",
choices: [
{ text: "That settles it - commit to helping her merge", nextScene: "without_w", relationshipChanges: { "Molly Roger": 10 }, setFlags: ["promised_molly"] },
{ text: "You want proof this is safe first - find Grace", nextScene: "grace_connection" }
],
psychicChange: 1,
selfChange: 5,
setFlags: ["knows_roger_truth"]
},
grace_training: {
theme: "neutral",
location: "grace_hideout",
speaker: "Grace",
cast: [{ who: "Grace", mood: "afraid" }],
act: 3,
text: "Weeks of secret training follow. Grace is a patient, exacting teacher, and your projections sharpen from shimmering guesses into deliberate, controlled shapes.\n\nOne evening she sets down her chalk and admits something she hasn't told anyone: she's been quietly working against the Board for years, ever since they erased her grandmother's part in Roger Molly's story. She's not just teaching you. She's recruiting you.\n\nA shadow crosses the frosted glass of the library door. Grace goes still, chalk halfway to the slate, until the footsteps pass on. 'Inspector Vane,' she says quietly, once it's safe. 'She doesn't knock. She just... checks. She's been checking on me for a year.'",
choices: [
{ text: "Continue toward Molly's heist", nextScene: "practice" },
{ text: "Ask Grace to stand witness for you, when the time comes", nextScene: "practice", relationshipChanges: { "Grace": 5 }, setFlags: ["grace_will_witness"] }
],
relationshipChanges: { "Grace": 10, "Inspector Vane": -5 },
psychicChange: 3,
selfChange: 10,
// control, not just power
suspicionChange: 5
},
embrace_possibility: {
theme: "dream",
location: "dreamspace",
speaker: "Molly Roger",
act: 3,
text: "You let yourself imagine it fully - a life fused with Molly's spirit, adventure and caution woven together. Molly lights up at your enthusiasm and pulls you deeper into Dreamspace, showing you flickering visions of possible futures: a ship's deck, a lecture hall, a sanctuary built from stolen concepts.\n\n'See? It's not an ending, {lass}. It's a whole new chapter.'",
choices: [
{ text: "Pursue this - join the dream heist", nextScene: "dream_heist" },
{ text: "Ask what could go wrong, just to be sure", nextScene: "fear_possibility" }
],
relationshipChanges: { "Molly Roger": 10 },
psychicChange: 1,
selfChange: -5
},
fear_possibility: {
theme: "dream",
location: "dreamspace",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "sad" }],
act: 3,
text: "Molly's bravado drops, just for a moment, and you see what's under it: someone who has thought about this a great deal more than she lets on.\n\n'Mergers can go wrong,' she says. 'Aye. Rush it, or do it without trust between ye, and some psychics come out the other side... hollow. The Board calls 'em Hollow Ones. Husks wearing a person's face. Ye'll hear stories at school. They're very fond of those stories at school.'\n\nShe sits on the edge of the telescope platform, boots dangling over nothing.\n\n'I saw one, once. A lad who tried to swallow his projection whole, because someone told him it was the only way to keep it. At least, that's what the Board said he'd done.' She frowns at nothing. 'There was nothing left of him but good manners.'\n\nShe meets your eyes, unusually serious. 'That's why I'd rather wait for ye to be ready than have ye be sorry. I'm a pirate, {lass}. I'm not a monster.'",
choices: [
{ text: "Agree - build trust slowly first", nextScene: "practice" },
{ text: "Decide the risk isn't worth it - report to Worthington", nextScene: "report", relationshipChanges: { "Molly Roger": -15 } }
],
selfChange: 5,
setFlags: ["knows_hollow"]
},
meet_roger: {
theme: "dream",
location: "dream_inner",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "thoughtful" }],
act: 3,
// was 1, but it is only reachable from Act II
text: "Molly hesitates - you've never seen her hesitate - and then takes you deeper into the Dreamspace than you've ever been. Past the sea of stolen concepts, past the islands of lost things, down a corridor of warm arches that grow smaller as you go, like the inside of a shell.\n\nAt the centre is a room that smells of ink and tar and good tobacco. Someone is sitting in it. Or two someones. It's hard to tell.\n\nThe presence that greets you is not quite Roger and not quite Molly, but both at once: a careful, polite voice with a laugh hidden underneath it, a clerk's sleeve-garters and a pirate's earring, a face that keeps settling into one and then the other, the way a spun coin settles.\n\n@roger: 'So you're the new one,' it says kindly. 'She's told me about you. She hardly ever tells me about anyone.'\n\nYou ask - because you have to - whether it hurt. The presence considers the question with real seriousness.\n\n@roger: 'Losing things hurts,' it says. 'This wasn't losing. I had a small life, and she had a big dream, and now we have a medium-sized life with excellent stories in it.' The smile turns thoughtful. 'But the Board's grown crueller since my time. They used to be frightened of people like us. Now they're organised about it. Be careful who you trust with your plans.'",
choices: [
{ text: "Feel reassured - continue toward practice", nextScene: "practice" },
{ text: "Ask what 'crueller' means now", nextScene: "grace_connection" }
],
relationshipChanges: { "Molly Roger": 10 },
psychicChange: 2,
selfChange: 5,
setFlags: ["met_roger_molly"]
},
worthington_offer: {
theme: "institution",
location: "worthington_office",
speaker: "Professor Worthington",
cast: [{ who: "Professor Worthington", mood: "afraid" }],
act: 6,
text: "You meet Worthington privately, in his cramped, mothball-scented office, and for the first time you notice how much of it is an apology: the neat stacks, the polished brass, the framed certificate from the Board hung exactly level.\n\nHe isn't cruel, you realise. He's afraid. He shows you files - real ones, with photographs - of psychics who merged badly and came out the other side empty. A girl from Leeds who forgot her mother's name. A boy who laughs at nothing, all day, every day. 'Hollow Ones,' he says. 'You'll have heard the word. You'll not have seen what it means.'\n\n'I can protect you from that,' he says quietly. Then, lower: 'Inspector Vane already suspects. If it comes from me first, I might be able to soften how this goes for you. If it comes from her alone, I can promise nothing.'\n\nHe folds his hands on the desk. They aren't quite steady. 'I'm asking you to tell me where Molly Roger means to do it. That's all. One address. Then you can go back to being a student, and I can go back to pretending I don't know what you are.'",
choices: [
{ text: "Betray Molly's plans to protect yourself", risky: true, nextScene: "informant", relationshipChanges: { "Inspector Vane": 20, "Molly Roger": -40, "Grace": -40 }, suspicionChange: -30 },
{ text: "Protect Molly and lie to his face", nextScene: "bank_planning", relationshipChanges: { "Professor Worthington": -10 }, suspicionChange: 5 }
],
setFlags: ["knows_hollow"]
},
contact_molly_late: {
theme: "dream",
location: "dreamspace",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "angry" }],
act: 3,
text: "That night you reach into Dreamspace, desperate, calling for her. Molly appears, arms crossed, wary in a way she never was before.\n\n'Changed yer mind, have ye? Trust's not so easily won back, {lass}.' She'll work with you - but she keeps you at arm's length from here on.",
choices: [
{ text: "Prove yourself through practice", nextScene: "practice" },
{ text: "Accept a more cautious, distant partnership", nextScene: "friends_ending" }
],
relationshipChanges: { "Molly Roger": 5 },
psychicChange: 0,
suspicionChange: 5
}
};
// ../../../../private/tmp/molly-roger/src/story/scenes/act2_term.js
var backToTerm = { text: "Back to the term", nextScene: "term_hub" };
var termScenes = {
term_begins: {
act: 3,
theme: "dream",
location: "observatory",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "pleased" }],
text: "'Not tonight!' Molly laughs at your face. 'Did ye think the Royal Alphabet Vault just leaves its door ajar? It opens at the dark of the moon, and not a night before. Three weeks hence.'\n\nShe paces the observatory floor, her boots making no sound at all. 'Three weeks is a gift, {lass}. A crew's only as good as its sea legs. Learn what ye can. Make friends. Make trouble, if ye must - small trouble.' A wink. 'Save the big trouble for me.'\n\nOutside, the moon is a fat, unhelpful coin. Far below, the school bell rings in the Michaelmas term.",
choices: [
{ text: "Begin the term", nextScene: "term_hub" }
]
},
term_hub: {
act: 3,
theme: "neutral",
location: "ridgewell_term",
speaker: null,
text: "THE MICHAELMAS TERM.\n\n[[if count:term==0]]Three weeks until the dark of the moon. Ridgewell carries on around you, oblivious: bells, porridge, Latin, chalk.[[/if]][[if count:term==1]]Two weeks left. The moon is thinning. Molly has started humming in your sleep.[[/if]][[if count:term==2]]One week left. You catch yourself checking the sky between lessons, like a sailor - or a thief.[[/if]][[if count:term>=3]]The moon has shrunk to a paring of fingernail. Tonight is the night.[[/if]]\n\n[[if count:term<3]]How will you spend the week?[[/if]]",
choices: [
{ text: "Take lessons in secret from Grace", nextScene: "term_grace", requires: "count:term<3", hideLocked: true, hideWhen: "visited:term_grace" },
{ text: "Sail the night seas of Dreamspace with Molly", nextScene: "term_sailing", requires: "count:term<3", hideLocked: true, hideWhen: "visited:term_sailing" },
{ text: "Stay behind for Professor Worthington's extra tutorial", nextScene: "term_tutorial", requires: "count:term<3", hideLocked: true, hideWhen: "visited:term_tutorial" },
{ text: "Find out why everyone is laughing at a first-year", nextScene: "term_pip", requires: "count:term<3", hideLocked: true, hideWhen: "visited:term_pip" },
{ text: "Break into the restricted stacks at midnight", nextScene: "term_restricted", risky: true, requires: "count:term<3", hideLocked: true, hideWhen: "visited:term_restricted" },
{ text: "Write home, eat properly and sleep", nextScene: "term_rest", requires: "count:term<3", hideLocked: true, hideWhen: "visited:term_rest" },
{ text: "The dark of the moon: meet Molly at the Vault", nextScene: "heist_eve", requires: "count:term>=3", hideLocked: true },
{ text: "Tell Molly you're ready now, whatever the moon says", nextScene: "dream_heist", selfChange: -5, hideWhen: "count:term>=3" }
]
},
term_grace: {
act: 3,
theme: "neutral",
location: "grace_hideout",
speaker: "Grace",
cast: [{ who: "Grace", mood: "thoughtful" }],
text: "[[if !flag:knows_hideout]]Grace finds you before you find her. She takes you by the elbow, walks you to a bookcase in the Combination Library, and pulls on a copy of Hume until the whole shelf swings inward.\n\n[[/if]]'Projection's the easy part,' Grace says, chalk squeaking. 'Anyone with the Sight can throw a shape. The hard part is coming back.'\n\nShe makes you write three things on the slate: the street you were born on, the colour of your mother's front door, the taste of the first thing you ever stole. 'Anchors,' she says. 'When something bigger than you is pulling, you say those, in that order, and you remember which way is home.'\n\nYou say them until they stop sounding like words and start sounding like a rope.",
choices: [backToTerm],
relationshipChanges: { "Grace": 15 },
selfChange: 15,
psychicChange: 1,
setFlags: ["knows_hideout", "anchored"],
counters: { term: 1 }
},
term_sailing: {
act: 3,
theme: "dream",
location: "dreamspace",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "pleased" }],
text: "Molly teaches you to sail a sea made of everything anyone has ever forgotten. The waves are lost umbrellas and unsent letters; the spray tastes of names on the tip of the tongue.\n\n'Steer by feeling, not by sight!' she bellows, as you take the wheel of a ship she dreamed up out of a rowing boat and sheer stubbornness. You run aground on a sandbank of misplaced keys. You steal the smell of rain from a sleeping bishop. By the third night you can tack into a nightmare and out again without spilling your tea.\n\nYou wake each morning a little more salt, a little less yourself, and grinning.",
choices: [backToTerm],
relationshipChanges: { "Molly Roger": 15 },
psychicChange: 3,
selfChange: -5,
setFlags: ["sea_legs"],
counters: { term: 1 }
},
term_tutorial: {
act: 3,
theme: "institution",
location: "worthington_office",
speaker: "Professor Worthington",
cast: [{ who: "Professor Worthington", mood: "thoughtful" }],
text: "Worthington's extra tutorials are attended by exactly one student: you. He drills you on containment theory until your head aches, and then, unexpectedly, makes cocoa.\n\nWhile he's at the stove you doodle in your margin without thinking - a bird, wings half open. When he sets the cup down he sees it, and the cup rattles in its saucer.\n\nHe says nothing. But when he opens his desk drawer for a pencil you glimpse something inside, wrapped in a handkerchief: a single feather made of brass, polished by years of handling. He shuts the drawer a little too quickly.\n\n'Again,' he says. 'From the third principle.'",
choices: [backToTerm],
relationshipChanges: { "Professor Worthington": 15 },
psychicChange: 1,
suspicionChange: -5,
setFlags: ["saw_brass_bird"],
counters: { term: 1 }
},
term_pip: {
act: 3,
theme: "institution",
location: "corridor",
speaker: null,
cast: [{ who: "Pip", mood: "afraid" }],
text: "The first-year is called Pip, is eleven years old, and three days ago projected a frog during morning assembly. Not a cube. A frog. It sat on the Headmaster's lectern and said, quite distinctly, 'ribbit'.\n\nNow three prefects have Pip backed against a radiator, demanding that the frog be produced for 'inspection'. Pip's hands are shaking, and something in Pip's coat pocket is shaking too.\n\nThe prefects haven't noticed you yet.",
choices: [
{ text: "Step in and stand up for Pip", nextScene: "term_pip_stand", relationshipChanges: { "Pip": 25 }, suspicionChange: 5 },
{ text: "Wait until they've gone, then teach Pip to hide the frog", nextScene: "term_pip_hide", relationshipChanges: { "Pip": 15 } },
{ text: "Keep walking. It's none of your business.", nextScene: "term_hub", selfChange: -5 }
],
counters: { term: 1 }
},
term_pip_stand: {
act: 3,
theme: "institution",
location: "corridor",
speaker: "Pip",
cast: [{ who: "Pip", mood: "pleased" }],
text: "'The frog,' you announce, 'is mine. I'm conducting an approved study of amphibian projection under Professor Worthington. Would you like to fill in the forms? There are eleven.'\n\nThe prefects flee from the paperwork as if it were on fire.\n\nPip peels off the radiator and stares at you. Then, very carefully, Pip opens the coat pocket. A small green face peers out, unimpressed.\n\n'His name's Admiral,' Pip says. 'He doesn't like cubes either.'",
choices: [backToTerm],
setFlags: ["pip_friend"]
},
term_pip_hide: {
act: 3,
theme: "neutral",
location: "corridor",
speaker: "Pip",
cast: [{ who: "Pip", mood: "pleased" }],
text: "When the prefects have gone you crouch down beside Pip and show the trick Molly showed you: how to fold a projection small, smaller, until it's no bigger than a thought and fits behind your ear.\n\nIt takes Pip four tries. On the fifth, Admiral the frog vanishes with a faint, offended 'ribbit', and Pip's whole face lights up.\n\n'Will you teach me more?' Pip whispers. 'Not cubes. The real things.'",
choices: [backToTerm],
psychicChange: 1,
setFlags: ["pip_friend"]
},
term_restricted: {
act: 3,
theme: "neutral",
location: "library",
speaker: null,
text: "At midnight the Combination Library is a different country. You pick the lock on the restricted stacks with a hairpin and a projected key that only half exists.\n\n@none: Roger Molly's letters are where you left them. But behind them, newer, sits a red folder: ON THE MANAGEMENT OF PERSISTENT PROJECTIONS. It recommends 'quieting' at an establishment called the Quiet Ward, sub-basement, Board Offices, Whitehall. The signature at the bottom is all loops and certainty: H. Harrowgate, Chair.\n\nYou take the circular. On the way out, a lamp is burning in the corridor that wasn't burning when you came in.",
choices: [backToTerm],
psychicChange: 1,
suspicionChange: 15,
addItems: ["board_circular"],
setFlags: ["knows_quiet_ward"],
counters: { term: 1 }
},
term_rest: {
act: 3,
theme: "neutral",
location: "letter",
speaker: null,
text: "You write home. It takes four drafts, because the first three mention pirates.\n\nYou eat porridge that tastes of porridge and nothing else. You sleep nine hours without dreaming of the sea. On Sunday you walk by the river and watch real ships, made of real wood, doing real and boring things, and it is wonderful.\n\nWhen you look in the mirror on Monday, the face looking back is unmistakably, reassuringly yours.",
choices: [backToTerm],
selfChange: 20,
counters: { term: 1 }
},
// Talking your way into the Vault (from reason_attempt).
reason_success: {
act: 3,
theme: "dream",
location: "alphabet_vault",
speaker: "The Captain",
cast: [{ who: "The Captain", mood: "stern", pos: "left" }, { who: "Molly Roger", mood: "afraid", pos: "right" }],
text: "The tallest of the grammar police steps forward - a Captain, by the subordinate clauses on his sleeve. He looks at you for a long, punctuated moment.\n\n@captain: 'A loan,' he says. 'Freely returned. In writing.' He produces a form in triplicate. Molly gapes. You sign.\n\n'Three days,' the Captain says, stamping it. 'Return by Thursday, in good condition, with all serifs intact.' He hands Molly the letter W as if it were a borrowed umbrella. 'And do mind the full stops on your way out.'\n\nMolly is almost speechless. Almost. 'Ye talked us IN, {lass}. Nobody talks their way in.'",
choices: [
{ text: "Promise to help her become real", nextScene: "without_w", relationshipChanges: { "Molly Roger": 15 }, setFlags: ["promised_molly"] },
{ text: "Suggest finding another way", nextScene: "alternative_solutions" },
{ text: "Ask what happened to Roger Molly exactly", nextScene: "roger_fate" }
],
relationshipChanges: { "Molly Roger": 20 },
psychicChange: 2,
suspicionChange: 5,
addItems: ["stolen_w"],
setFlags: ["captain_owes"]
},
without_w: {
act: 3,
theme: "neutral",
location: "london_street",
speaker: null,
cast: [{ who: "Molly Roger", mood: "pleased" }],
text: "For three days, the British Empire stammers.\n\nShop signs read HITE HART and ORKSHOP and BOOTS & ELLINGTONS. The Times appears with the headline HAT HAS HAPPENED? and nobody can say why it looks wrong. Professor Worthington begins his Monday lecture - '...elcome, students. Today... e shall... discuss...' - and sits down quite suddenly, pale.\n\nParliament spends an afternoon unable to ask why, and passes four bills by accident. Children love it. Poets weep with joy. Molly wears the W as a brooch and refuses to take it off.\n\nOn the third evening, carriages bearing the Board's seal begin to arrive at Ridgewell, one after another, in silence.[[if flag:captain_owes]]\n\nA stiff note arrives from the grammar police: 'Loan noted. Thursday. - The Captain.'[[/if]]",
choices: [
{ text: "Enjoy it while it lasts", nextScene: "inquiry_begins" },
{
text: "Return the W early, before the Board can trace it",
nextScene: "inquiry_begins",
requires: "item:stolen_w",
removeItems: ["stolen_w"],
suspicionChange: -15,
relationshipChanges: { "Molly Roger": -10 },
setFlags: ["returned_w"]
}
]
},
heist_eve: {
act: 3,
theme: "dream",
location: "observatory",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "thoughtful" }],
text: "The night before the dark of the moon, Molly takes you up onto the observatory roof. The slates are still warm from a day you barely remember, and London spreads out below in a thousand gaslit pinpricks.\n\n[[if visited:term_grace]]'Grace has been teaching ye anchors,' she says. 'Good. She's right, ye know. The coming back's the hard part.'\n\n[[/if]][[if visited:term_sailing]]'Three nights at sea and ye didn't fall in once,' she says. 'Well. Twice. But ye climbed out.'\n\n[[/if]][[if visited:term_tutorial]]'And old Worthington. Cocoa!' She shakes her head. 'There's more in that man than cubes, {lass}. Mark me.'\n\n[[/if]][[if flag:pip_friend]]'And ye've a first-year and a frog following ye about like a pair of ducklings. Suits ye.'\n\n[[/if]]For a while neither of you says anything. A train crosses the river, small and bright.[[if flag:ghost_memory]]\n\n'Funny thing,' Molly says. 'I keep dreamin' we've done this before. Different every time. Ye always come back, though.'[[/if]]\n\n'D'ye know what I was, before?' Molly says suddenly. 'Before I was me? A margin. A space in a ledger where a clerk who never went anywhere drew a ship, every day, for eleven years. I was ink in the gutters of other people's sums.' She laughs a little. 'Ye'd think a body would get tired of being somebody's daydream. I never did. I just wanted to be the one dreaming, for once.'\n\nShe stands, stretches, and is a pirate again.\n\n'Tomorrow,' she says. 'Get some sleep. Thieves need their beauty rest.'",
choices: [{ text: "Tomorrow, then", nextScene: "dream_heist" }],
relationshipChanges: { "Molly Roger": 10 },
selfChange: 5
}
};
// ../../../../private/tmp/molly-roger/src/story/scenes/act3_inquiry.js
var leaveInterview = {
text: "Leave the interview room",
nextScene: (s) => s.flags.has("grace_safe") ? "grace_spared" : "grace_taken",
targets: ["grace_spared", "grace_taken"]
};
var intoTheWard = [
{ text: "Ask Worthington about the brass feather", nextScene: "worthington_confession", requires: "flag:saw_brass_bird" },
{ text: "Ask Worthington to help you, plainly", nextScene: "worthington_confession", requires: "rel:worthington>=25", hideWhen: "flag:saw_brass_bird" },
{ text: "Go in the back way, through Dreamspace, with Molly", nextScene: "quiet_ward_entry", selfChange: -5 }
];
var inquiryScenes = {
inquiry_begins: {
act: 4,
theme: "institution",
location: "hearing_room",
speaker: "Lady Harrowgate",
cast: [{ who: "Lady Harrowgate", mood: "stern", pos: "right" }, { who: "Inspector Vane", mood: "stern", pos: "left" }],
text: "The carriages keep coming all night. By morning there are eleven of them in the quad, black and polished, each bearing the Board's seal on its door: an open eye above an open ledger.\n\nThe Great Hall has been turned into a court. A long table, green baize, water jugs nobody touches. Behind it sits the Board of Psychic Regulation - nine grey coats, nine pairs of spectacles, nine identical expressions of mild and permanent disappointment. Above them hangs a crimson banner with the eye and the ledger picked out in gold thread. The whole school sits in rows facing them, as if for a play nobody wanted to see.\n\nIn the centre of the table sits a woman who is not grey at all. Lady Harrowgate, Chair of the Board, wears plum silk and pearls and a smile like a closed door. Her hair is an architectural achievement crowned with a single black plume. When she speaks, the hall goes so quiet you can hear the gaslights.\n\n'A letter has been taken from the Crown,' she says. 'Letters are not toys. Letters are how a world is spelled. Take away a letter and you take away every word that needs it - and every thought that needs those words.' She lets that settle. 'Each of you will be interviewed. Inspector Vane will conduct the interviews. And when we are finished' - the smile widens by a precise quarter-inch - 'everything will be exactly as it should be.'\n\nBeside you, invisible to everyone else, Molly lets out a low whistle. 'Now that,' she murmurs, 'is a proper admiral.'",
choices: [
{ text: "Wait your turn, and keep your face still", nextScene: "vane_interview" },
{ text: "Slip out to warn Grace before they reach the library", nextScene: "grace_warned", requires: "flag:knows_hideout", suspicionChange: 5 }
],
setFlags: ["met_vane"]
},
grace_warned: {
act: 4,
theme: "neutral",
location: "grace_hideout",
speaker: "Grace",
cast: [{ who: "Grace", mood: "afraid" }],
text: "You take the back stairs three at a time. The library is empty - everyone's in the Great Hall - and the bookcase swings open before you've finished pulling on Hume.\n\nGrace is already packing. She heard the carriages too. She doesn't waste breath asking how you knew; she just hands you a sack.\n\nTogether you strip the hideout bare. Slates scrubbed with spit and sleeves. Notebooks sewn, with frantic uneven stitches, into the lining of a winter coat. The brass apparatus taken apart ring by ring and posted, piece by piece, into the library's returns chute, where it clanks down into the dark like a very guilty orchestra. The glowing jars go into the coal scuttle, under the coal.\n\nWhen you've finished, it's just a cupboard behind a bookcase again: dust, a mop, one forgotten sock. Grace leans against the wall, breathing hard, chalk on her cheek.\n\n'If they'd found it...' She doesn't finish. She doesn't need to. 'My grandmother lost everything for a room like this.' She looks at you properly. 'Thank you. I won't forget it.'\n\nYou're back in your seat in the Great Hall with eleven seconds to spare. Inspector Vane, at the end of the row, turns a page in her ledger, and does not look up.",
choices: [
{ text: "Take your seat as if you'd never left", nextScene: "vane_interview" }
],
relationshipChanges: { "Grace": 15 },
setFlags: ["grace_safe"]
},
vane_interview: {
act: 4,
theme: "institution",
location: "hearing_room",
speaker: "Inspector Vane",
cast: [{ who: "Inspector Vane", mood: "stern" }],
text: "Vane's interview room is a cleaning cupboard with the mops taken out. One table. Two chairs. One gas jet, turned low. One ledger.\n\nShe doesn't look up when you come in. She finishes writing a sentence, blots it, and only then raises her eyes - grey, steady, and so entirely without malice that it's worse than malice would have been.\n\n'Name,' she says, though she knows it. You give it. '{name}. Second year. Unremarkable record, until recently.' She turns a page. [[if suspicion>=50]]You glimpse your own name on it, followed by rather a lot of small, neat marks.[[else]]Your name is there, followed by a handful of small, neat marks.[[/if]][[if flag:cube_sail]] 'You made a sail on examination day,' she adds. 'I wrote that down too. I thought at the time it might be the beginning of something.'[[/if]]\n\nShe lays her pencil parallel to the edge of the ledger, exactly.\n\n'I'm not going to threaten you,' she says. 'I find it untidy, and it rarely helps. I am going to ask you one question, and then I'm going to write down the answer, and then the answer will be true for as long as this book exists.' A pause. 'Where were you on the night the letter was taken?'",
choices: [
{
text: "Answer her questions - and guard your thoughts",
setPiece: "interrogation",
skipOutcome: "fair",
outcomes: {
perfect: { nextScene: "interview_lie_ok" },
fair: { nextScene: "interview_halftruth" },
poor: { nextScene: "interview_lie_caught" }
}
},
{
plainOnly: true,
text: "Lie, smoothly",
risky: true,
nextScene: (s) => s.psychicLevel >= 12 && s.self >= 60 ? "interview_lie_ok" : "interview_lie_caught",
targets: ["interview_lie_ok", "interview_lie_caught"]
},
{ plainOnly: true, text: "Tell her a careful half-truth", nextScene: "interview_halftruth" },
{ text: "Say nothing at all", nextScene: "interview_silent" },
{ text: "Read her mind while she reads yours", nextScene: "interview_read", requires: "psychic>=14", risky: true },
{ text: "Offer her the stray comma", nextScene: "interview_comma", requires: "item:stray_comma", hideLocked: true }
]
},
interview_lie_ok: {
act: 4,
theme: "institution",
location: "hearing_room",
speaker: "Inspector Vane",
cast: [{ who: "Inspector Vane", mood: "thoughtful" }],
text: "You tell her you were asleep.\n\nAnd you believe it - you believe it so completely that for a moment you can feel the pillow under your cheek, hear the dormitory clock, smell the damp in the curtains. You let the memory you've made unfold in your mind like a map, and you lay it on the table between you.\n\nVane watches you for a long time. Her pencil doesn't move. Somewhere behind her eyes you have the strangest sense of drawers opening and closing, of someone checking one file against another.\n\nThen she writes something short, and closes the ledger.\n\n'Thank you, {name}. That will be all.'\n\nYou almost make it to the door before she speaks again, without looking up.\n\n'You lie very well,' she says. 'Remarkably well, for your age. I'd keep an eye on that, if I were you.' A pause. 'It's how most of us start.'",
choices: [leaveInterview],
suspicionChange: -10
},
interview_lie_caught: {
act: 4,
theme: "institution",
location: "hearing_room",
speaker: "Inspector Vane",
cast: [{ who: "Inspector Vane", mood: "stern" }],
text: "You tell her you were asleep.\n\nVane lets the sentence sit on the table between you until it begins, visibly, to wilt. You add a detail - the dormitory clock - and then another - a dream about cake - and each one lands on the table beside the first like a small dead bird.\n\n'You're a poor liar,' she says at last, not unkindly. 'That's rather to your credit. Good liars are made, usually by someone who frightened them.'\n\nShe picks up her pencil.\n\n'It is also,' she says, 'going in the book.'\n\nShe writes for some time. You count the strokes. When she finally blots the page and closes the ledger she looks almost sorry - the way a doctor looks sorry, handing you something bitter in a spoon.",
choices: [leaveInterview],
relationshipChanges: { "Inspector Vane": 5 },
suspicionChange: 20
},
interview_halftruth: {
act: 4,
theme: "institution",
location: "hearing_room",
speaker: "Inspector Vane",
cast: [{ who: "Inspector Vane", mood: "thoughtful" }],
text: "You tell her you've been dreaming of the sea. That you've heard a voice - a woman's voice, loud and cheerful and frequently rude. That you don't know what it wants from you. Not really.\n\nAll of it true. None of it the truth.\n\nVane listens without interrupting, her pencil moving in short, neat strokes. When you've finished she reads back what she has written, under her breath, and for a moment something crosses her face. Not suspicion, exactly. Something more like recognition.\n\n'Dreams,' she says, 'are not yet an offence.'\n\nA pause, exactly long enough.\n\n'Yet.'\n\nShe closes the ledger, then hesitates with her hand flat on the cover. 'The sea,' she says, not quite to you. 'It's always the sea, or the sky. Never anything sensible. Never a nice cupboard.' She seems to hear herself, and straightens. 'Next.'",
choices: [leaveInterview],
relationshipChanges: { "Inspector Vane": 10 },
suspicionChange: 5
},
interview_silent: {
act: 4,
theme: "institution",
location: "hearing_room",
speaker: "Inspector Vane",
cast: [{ who: "Inspector Vane", mood: "stern" }],
text: "You say nothing.\n\nThe clock says a great deal. A cart goes by in the street outside. Somewhere far off, a first-year is crying in a corridor and being shushed. The gas jet hisses. You look at a knot in the wood of the table, and count your breaths, and say nothing at all.\n\nVane doesn't fill the silence. She simply waits, pencil poised, with the terrible patience of someone who has outlasted far braver people than you.\n\nAfter four minutes - you know it's four, because you counted - she closes the ledger.\n\n'Silence is an answer,' she says. 'Usually the honest one.'\n\nShe writes a single word on the cover, which you can't read upside down. But there's something in the way she says it - something almost like respect - that you'll find yourself thinking about for days. As if, once, a long time ago, she had sat on the other side of a table like this one, and wished she had been brave enough to say nothing too.",
choices: [leaveInterview],
relationshipChanges: { "Inspector Vane": 5 },
suspicionChange: 15,
selfChange: 5
},
interview_read: {
act: 4,
theme: "institution",
location: "hearing_room",
speaker: "Inspector Vane",
cast: [{ who: "Inspector Vane", mood: "angry" }],
text: "While she reads your face, you read her mind.\n\nIt's like opening a door in a house you were told was empty. Her mind is a filing room: cabinet after cabinet, every drawer labelled in the same small hand, everything in alphabetical order. ARREST WARRANTS. CORRESPONDENCE. GRIEVANCES (PERSONAL) - a very thin drawer. You walk the aisles of her, and nothing is out of place.\n\nExcept one drawer, at the very bottom of the last cabinet. Locked. With a label in a child's handwriting.\n\nKITE.\n\nFor an instant you see inside it. A girl of twelve on a green hill, in a high wind. A red paper kite above her - flying without a string, without the wind, simply because she wants it to. The girl is laughing so hard she has to sit down in the grass.\n\nThen the drawer slams so hard the whole filing room shakes.\n\nVane is on her feet. Her chair has gone over behind her. She is white to the lips, and her hand is pressed flat on her ledger as if to hold something in.\n\n'Get out,' she says.\n\nIt is the first time you have ever heard her raise her voice.",
choices: [leaveInterview],
relationshipChanges: { "Inspector Vane": -10 },
psychicChange: 2,
suspicionChange: 10,
setFlags: ["vane_secret"]
},
interview_comma: {
act: 4,
theme: "institution",
location: "hearing_room",
speaker: "Inspector Vane",
cast: [{ who: "Inspector Vane", mood: "pleased" }],
text: "You set the stray comma on the table.\n\nIt curls there under the gas jet, small and apologetic, like something that knows it's been brought to the wrong party.\n\nVane looks at it. Then at you. Then at the comma again.\n\nSomething at the corner of her mouth moves - very slightly, a fraction of a fraction - and is immediately disciplined back into line, the way you'd straighten a picture frame.\n\n'That,' she says, 'is the least threatening piece of evidence I have ever been offered.' She picks it up between finger and thumb and examines it against the light. 'It's from the Vault. You can tell by the curl. Royal commas have a curl.'\n\nShe doesn't write anything down. She does, you notice, put the comma in her waistcoat pocket, very carefully, as if it might break.\n\n'You may go,' she says. And then, as you reach the door, in a voice you've never heard her use before: 'Thank you. It's been a long week.'",
choices: [leaveInterview],
relationshipChanges: { "Inspector Vane": 15 },
suspicionChange: -10,
removeItems: ["stray_comma"]
},
grace_taken: {
act: 4,
theme: "neutral",
location: "library",
speaker: null,
cast: [{ who: "Grace", mood: "afraid", pos: "right" }, { who: "Inspector Vane", mood: "stern", pos: "left" }],
text: "You come out into the corridor just in time to see them bring Grace down the library stairs.\n\nTwo enforcers, one at each arm. Vane walking ahead with a box of Grace's notebooks held against her chest, the way you'd carry something fragile. Behind them a porter with the brass apparatus in a sack, its rings clanking at every step.\n\nThe whole corridor has gone silent. Students press back against the walls. Nobody says anything. That's the worst of it: how quiet everyone is, as if they've practised.\n\nGrace sees you. She doesn't call out - she's far too clever for that - but as she passes she mouths three words, slowly, so you can't mistake them. [[if flag:anchored]]Street. Door. Stolen thing. Your anchors, and hers. She's telling you she'll hold.[[else]]Remember who you are.[[/if]]\n\nAt the foot of the stairs she stumbles - or pretends to - and for one second her hand brushes yours. When she's gone, you find a scrap of paper in your palm. On it, in chalk-smeared pencil: Q.W. - WHITEHALL - SUB-BASEMENT. FIND THE OTHERS.\n\nThe Board's carriage takes her away toward Whitehall. The notice pinned to the hideout door says: Removed for assessment.\n\nEveryone knows what assessment means.",
choices: intoTheWard,
relationshipChanges: { "Grace": 5 },
setFlags: ["grace_taken"]
},
grace_spared: {
act: 4,
theme: "neutral",
location: "grace_hideout",
speaker: "Grace",
cast: [{ who: "Grace", mood: "thoughtful" }],
text: "The Board searches the library for three hours. They pull down every book, tap every panel, sniff the coal scuttle with professional suspicion. They find a cupboard, a mop and one forgotten sock.\n\nGrace watches from a window seat, a book of sermons open upside down on her lap, and by the end looks almost disappointed in them.\n\nThat night she finds you on the observatory stairs. She has her grandmother's notebook with her, the one she sewed into her coat.\n\n'They've done this before,' she says. 'For years. Not just to us.' She unfolds a list written in an old, neat hand, added to here and there in Grace's own. 'Students who projected something unapproved. A boy who made a tin soldier that saluted. A girl who made it snow indoors. They all went to Whitehall for assessment, and none of them came back the same. Some of them didn't come back at all.'\n\nHer finger stops on one name, underlined twice.\n\n'Thomas Ashby. He was in my grandmother's last class. He drew a cat in the margin of everything.' She folds the list away. 'I want to know what's down there. I want to know what assessment means.' She looks at you. 'And I'd rather not go alone.'",
choices: intoTheWard,
relationshipChanges: { "Grace": 10 }
},
worthington_confession: {
act: 4,
theme: "institution",
location: "worthington_office",
speaker: "Professor Worthington",
cast: [{ who: "Professor Worthington", mood: "sad" }],
text: "Worthington lets you in, looks at your face, and pours two brandies, although you are certainly not allowed one.\n\n'Her name was Tuppence,' he says. 'A brass bird. I projected her when I was nine - clockwork wings, a voice like a music box. She used to sit on my shoulder in lectures.' He unwraps the feather from its handkerchief. 'When the Board offered me a teaching post, the price was Tuppence. I paid it. They took her to the Quiet Ward. I've told myself every day since that it was the sensible thing to do.'\n\nHe presses the feather into your hand, and then a heavy ring of iron keys. 'Sub-basement. Third door. Bring them back, if you can.' His voice cracks. 'All of them.'",
choices: [
{ text: "Go to Whitehall tonight", nextScene: "quiet_ward_entry" }
],
relationshipChanges: { "Professor Worthington": 20 },
addItems: ["brass_feather"],
setFlags: ["worthington_ally"]
},
quiet_ward_entry: {
act: 4,
theme: "institution",
location: "quiet_ward",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "afraid" }],
text: "[[if flag:worthington_ally]]Worthington's keys turn in the locks as if they've been waiting thirty years to be used. The night porter at the Board Offices nods you through without looking up; he knows the professor's face, and doesn't know enough to wonder why it's grey.[[else]]You go in the back way - through Dreamspace, where the Board's offices cast a shadow like a cold stone tower. Molly comes with you as far as she can, and then a little further, gritting her teeth, until the dream thins to nothing and you step out of a broom cupboard into the real world, three floors beneath Whitehall.[[/if]]\n\nThe Quiet Ward is white tile and gaslight turned low. It smells of carbolic soap, and under that of something worse: the absence of smell. The absence of anything. Even your footsteps sound muffled, as if the corridor were swallowing them.\n\nMolly flickers beside you like a candle in a draught. Her colours have gone pale, the violet of her coat washed almost to grey.\n\n'Can't hold me shape in here, {lass},' she whispers. 'This place eats the colour out of a thought.'\n\nBehind small barred windows, people sit very still on narrow beds. They don't look up as you pass. Some of them are drawing on the walls with whatever they have - a fingernail, a spoon, a burnt match. The same few shapes, over and over: a soldier, a snowflake, a ship.\n\nMost of them are young. Some of them are younger than Pip.",
choices: [
{ text: "Look for Thomas Ashby", nextScene: "quiet_ward_ashby" }
],
selfChange: -5,
relationshipChanges: { "Molly Roger": 5 }
},
quiet_ward_ashby: {
act: 4,
theme: "institution",
location: "quiet_ward",
speaker: "Thomas Ashby",
cast: [{ who: "Thomas Ashby", mood: "sad" }],
text: "Cell nine. Thomas Ashby is nineteen and looks older and younger at the same time. He is drawing on the wall with a burnt match: the same shape, over and over. A cat, curled up, tail over its nose.\n\n@ashby: 'Biscuit,' he says, when you ask. 'She was mine. Ship's cat. I projected her when I was twelve.' He taps his temple. 'They took her out. Said I'd thank them for it. There's a space in here now, the exact shape of her.'\n\n@ashby: He hands you the drawing, very politely, as if it were a calling card. 'That's what a Hollow One is. Not a merger gone wrong. Just a person with the best bit cut out.'\n\nThe Board doesn't find Hollow Ones. The Board makes them.[[if flag:grace_taken]]\n\nFurther down the corridor, in cell fourteen, Grace sits very upright, whispering three things to herself, over and over.[[/if]]",
choices: [
{ text: "Get Grace out of cell fourteen", nextScene: "grace_freed", requires: "flag:grace_taken", hideLocked: true },
{ text: "Try to give Ashby back what they took", nextScene: "ashby_restored", requires: "psychic>=14", risky: true },
{ text: "Promise him you'll come back for everyone", nextScene: "inquiry_verdict" }
],
addItems: ["ashby_drawing"],
setFlags: ["knows_hollow_truth", "knows_hollow"]
},
grace_freed: {
act: 4,
theme: "institution",
location: "quiet_ward",
speaker: "Grace",
cast: [{ who: "Grace", mood: "sad" }],
text: "[[if flag:worthington_ally]]There's a key on Worthington's ring for cell fourteen. Of course there is. He would have known exactly which door.[[else]]You have no key, so Molly pours what's left of her colour into the lock - you watch her fade to a sketch, then to an outline - until the lock forgets it was ever shut.[[/if]]\n\nGrace walks out on her own two feet. She's shaking, and there's a bruise on her wrist where someone held it too hard, but she's herself. Her eyes are clear. Her anchors held.\n\n'They were going to start tomorrow,' she says. Her voice is very steady, the way voices get when they're working hard at it. 'They have a machine. A brass cabinet with a velvet chair. It's very quiet. They told me I wouldn't feel a thing, and I believed them, and that was the most frightening part.'\n\nShe takes your hand and holds it hard enough to hurt.\n\n'Thank you.'\n\nOn the way out she stops at every cell. She reads every name she can find on the cards beside the doors, out loud and clearly, the way her grandmother's rules say a witness should - so that someone has. Some of the people behind the doors look up at the sound of their names. One of them, very slowly, smiles.",
choices: [
{ text: "Get out before the night porter's round", nextScene: "inquiry_verdict" }
],
relationshipChanges: { "Grace": 20 },
suspicionChange: 15,
clearFlags: ["grace_taken"],
setFlags: ["grace_safe"]
},
ashby_restored: {
act: 4,
theme: "institution",
location: "quiet_ward",
speaker: "Thomas Ashby",
cast: [{ who: "Thomas Ashby", mood: "pleased" }],
text: "You don't know how to do it. Nobody has ever taught anybody how to do it. So you do it the way Molly taught you to sail: by feeling, not by sight.\n\nYou reach - carefully, the way you'd reach into dark water - into the space in Thomas Ashby. It's exactly where he said it would be. A hollow the precise shape of a cat: the curve of a spine, four neat paws, a tail wrapped over a nose. The edges are clean. Somebody cut very carefully.\n\nYou think of warmth. Of whiskers. Of the specific, unarguable weight of an animal that has decided your lap is its property and will not be persuaded otherwise. Of a purr like a kettle coming to the boil. You think of ginger, because the cats on his wall are coloured with rust from the bedframe, and rust is the nearest thing in this place to ginger.\n\nIt costs you something. You feel it go - some small warm thing of your own, a memory or a colour; you'll never be quite sure which.\n\nAnd then Thomas Ashby laughs. It's a startled, rusty sound, as if he'd forgotten where he kept it. There's a small ginger cat in his arms, purring like a kettle and regarding the Board's white tiles with enormous contempt.\n\n'Biscuit,' he says. 'Oh, you idiot. Where have you been?'",
choices: [
{ text: "Get out before the night porter's round", nextScene: "inquiry_verdict" }
],
psychicChange: 2,
selfChange: -10,
setFlags: ["ashby_restored"]
},
inquiry_verdict: {
act: 4,
theme: "institution",
location: "hearing_room",
speaker: "Lady Harrowgate",
cast: [{ who: "Lady Harrowgate", mood: "pleased", pos: "right" }, { who: "Inspector Vane", mood: "stern", pos: "left" }],
text: "Next morning the whole school is summoned to the Great Hall to hear the Board's findings. Nobody has slept. The air smells of cold porridge and fear.\n\n'The letter W has been returned,' Lady Harrowgate announces. [[if flag:returned_w]]'Voluntarily, I'm told. How sweet.'[[else]]'By the grammar police, after some unpleasantness.'[[/if]] A ripple of relief runs through the rows - and dies as she raises one gloved hand.\n\n'But a letter is only a symptom. The disease is the idea that a projection may outgrow its maker. That a thought may become a person. That a girl may become a pirate.' She lets the word hang in the air like something held up with tongs. 'This Board has tolerated that idea for forty years. It will not tolerate it for forty-one.'\n\nShe unrolls a parchment. Her voice does not rise. It doesn't need to.\n\n'At the autumn equinox, by order of this Board, the concept of PIRATE will be struck from the Ledger of the British Dreamspace. Without the concept, such projections cannot persist. They will simply...' - a small, precise gesture, like brushing crumbs from a tablecloth - '...stop.'\n\nBeside you, invisible to everyone else, Molly flickers like a gas jet in a draught. For an instant you can see the far wall straight through her.\n\n'{Lass},' she says, very quietly. It's the first time you have ever heard her sound afraid.[[if suspicion>=70]]\n\nThen Inspector Vane rises and reads out a short list of 'persons of interest'. Your name is third. Four hundred heads turn to look at you.[[/if]]",
choices: [
{ text: "Find Molly before she fades", nextScene: "molly_fading" },
{ text: "Answer the note in plum ink: tea with Lady Harrowgate, at five", nextScene: "harrowgate_tea", requires: "suspicion>=40", hideLocked: true },
{
text: "Stand up and object, in front of everyone",
risky: true,
nextScene: (s) => s.suspicion >= 75 ? "hollow" : "public_objection",
targets: ["public_objection", "hollow"]
}
]
},
public_objection: {
act: 4,
theme: "institution",
location: "hearing_room",
speaker: "Lady Harrowgate",
cast: [{ who: "Lady Harrowgate", mood: "pleased" }],
text: "You stand.\n\nYou don't decide to. Your legs simply do it, the way they'd catch you if you tripped. Four hundred heads turn. The Board's nine grey faces turn as one, like owls.\n\n'You can't erase an idea,' you say, and your voice only shakes a little. 'People will just think it again. Children will think it. You can't stop children thinking about pirates. You'd have to stop them having baths.'\n\nSomebody at the back laughs, and turns it into a cough.\n\nLady Harrowgate regards you with real interest, the way a collector regards a butterfly that has done something unusual on its way to the pin.\n\n'They'll try,' she agrees pleasantly. 'And there will be nothing there for the thought to land on. They'll reach for it and find a sort of... draught.' She smiles. 'Children are very adaptable. Sit down, {name}.'\n\nYou sit. Your face is burning.\n\nBut in the back row a first-year begins, slowly, to clap - [[if flag:pip_friend]]Pip, of course, with Admiral the frog peering out of one pocket[[else]]a small child you don't know, with ink on their cuffs[[/if]] - three, four, five claps, loud in the silence, before a prefect hushes them.\n\nFor the rest of the day the corridors hum. Somebody chalks a tiny ship on the door of the Great Hall. By evening there are eleven.",
choices: [
{ text: "Find Molly before she fades", nextScene: "molly_fading" },
{ text: "Accept the invitation that arrives that evening: tea with Lady Harrowgate", nextScene: "harrowgate_tea" }
],
relationshipChanges: { "Pip": 10 },
suspicionChange: 15,
selfChange: 5
},
harrowgate_tea: {
act: 4,
theme: "institution",
location: "headmaster_study",
speaker: "Lady Harrowgate",
cast: [{ who: "Lady Harrowgate", mood: "sad" }],
text: "Lady Harrowgate takes her tea in the Headmaster's study, which she has occupied the way weather occupies a valley. The good china is out. There are cucumber sandwiches with the crusts cut off, and beside them a small leather-bound book bearing the Board's seal.\n\n'Sit, {name}. You look like a student who has been told a great many frightening things about me. Most of them are true.' She pours. 'Milk?'\n\nFor a while she talks about nothing - the weather, the price of coal - in a voice like a well-oiled lock. Then, quite suddenly, she sets down her cup.\n\n'I had a brother,' she says. 'Edmund. When he was ten he projected a lion. A beautiful thing - gold, enormous, gentle as a cat with him. Our parents thought it charming. Nobody taught him anything; nobody thought there was anything to teach.' She turns the cup a precise quarter-turn on its saucer. 'When he was fifteen, the lion got out into Kensington Gardens. And Edmund, who could not bear to be parted from it, went after it - into it - the only way he knew. There was no witness. No safeguards. No book.'\n\nShe looks at you. Her eyes are perfectly dry.\n\n'What came back wore my brother's face, and was very polite, and never knew my name again. So you see, I am not your villain. I am the person who decided that no one else's mother would ever have to watch that.'\n\nShe slides the little book across the table. Its pages are blank. 'Write me one good reason,' she says, 'why a story should be allowed more than one ending.'",
choices: [
{ text: 'Write: "Because Edmund had no witness. I do."', nextScene: "molly_fading", selfChange: 5, suspicionChange: 5, setFlags: ["harrowgate_heard"] },
{ text: "Write nothing. Leave the sandwiches.", nextScene: "molly_fading", suspicionChange: 10 },
{ text: 'Write: "You may be right." - and find you half mean it', nextScene: "molly_fading", selfChange: -5, suspicionChange: -10, setFlags: ["harrowgate_heard"] }
]
}
};
// ../../../../private/tmp/molly-roger/src/story/scenes/act4_ledger.js
var backToBank = { text: "Back to the bank", nextScene: "crew_muster" };
var ledgerScenes = {
molly_fading: {
act: 5,
theme: "dream",
location: "dreamspace",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "sad" }],
text: "You find Molly at the edge of Dreamspace, sitting on an upturned boat that keeps forgetting to be there. She's thinner. You can see the sea through her.\n\n'Can't remember the word for what I am,' she says, and tries to laugh. 'Starts with a P. Parson? Parsnip?' The laugh doesn't come off.\n\nShe tells you about the Ledger: the Board's great book, where every decision they've ever made is written down, and which the Dreamspace obeys the way a tide obeys the moon. There are two copies - one in the Board's archive at Whitehall, and its reflection, floating in the deep Dreamspace. Change the book, and you change the world.\n\n'It's a heist, {lass}. The biggest there's ever been. And I can't do it alone. Not like this.' She holds up a hand. It's mostly sea. 'We need a crew.'",
choices: [
{ text: "Muster a crew", nextScene: "crew_muster" }
]
},
crew_muster: {
act: 5,
theme: "dream",
location: "old_bank",
speaker: null,
text: "The old bank, after midnight. Dust, moonlight, the smell of ledgers. A good place to plan the theft of a bigger one.\n\n[[if flag:ally_grace]]Grace is here, chalk in hand, already drawing maps.\n[[/if]][[if flag:ally_worthington]]Worthington is here, in a coat he has clearly bought specially, looking terrified and proud.\n[[/if]][[if flag:ally_pip]]Pip is here, with Admiral the frog on one shoulder.\n[[/if]][[if flag:ally_roger]]Roger-and-Molly is here, half bank clerk and half buccaneer, quietly counting the exits.\n[[/if]][[if flag:ally_captain]]The Captain of the grammar police is here, correcting the punctuation on the plans.\n[[/if]][[if flag:ally_ashby]]Thomas Ashby is here, with Biscuit the cat asleep on the counter.\n[[/if]][[if flag:ally_vane]]And, impossibly, Inspector Vane is here - standing a little apart, coat buttoned to the chin.\n[[/if]][[if count:allies==0]]So far it's just you, and what's left of Molly.\n[[/if]]\nWho else will you ask?",
choices: [
{ text: "Ask Grace to join you", nextScene: "recruit_grace", requires: "rel:grace>=30 & !flag:grace_taken", hideWhen: "flag:ally_grace" },
{ text: "Ask Professor Worthington", nextScene: "recruit_worthington", requires: "flag:worthington_ally", hideWhen: "flag:ally_worthington" },
{ text: "Ask Pip", nextScene: "recruit_pip", requires: "flag:pip_friend", hideWhen: "flag:ally_pip" },
{ text: "Call on Roger-and-Molly in the deep Dreamspace", nextScene: "recruit_roger", requires: "flag:met_roger_molly", hideWhen: "flag:ally_roger" },
{ text: "Write to the Captain of the grammar police", nextScene: "recruit_captain", requires: "flag:captain_owes", hideWhen: "flag:ally_captain" },
{ text: "Go back for Thomas Ashby", nextScene: "recruit_ashby", requires: "flag:ashby_restored", hideWhen: "flag:ally_ashby" },
{ text: "Knock on Inspector Vane's door", nextScene: "recruit_vane", requires: "flag:vane_secret", hideWhen: "flag:ally_vane" },
{ text: "Set sail with the crew you have", nextScene: "eve_of_ledger" }
]
},
recruit_grace: {
act: 5,
theme: "neutral",
location: "old_bank",
speaker: "Grace",
cast: [{ who: "Grace", mood: "pleased" }],
text: "Grace doesn't let you finish the question.\n\n'My grandmother stood witness for Roger Molly,' she says. 'The Board erased her for it - her post, her pension, her name. She died in a boarding house in Margate, still writing letters to the Times that nobody printed.' She's quiet for a moment. 'I have been waiting my whole life for someone to give me a reason to be brave instead of careful.'\n\nShe picks up her chalk, weighs it in her hand like a weapon, and smiles - a real smile, the first you've seen from her in weeks.\n\n'I'll draw the maps,' she says. 'And when we get to the Ledger, I want to find her page.'",
choices: [backToBank],
relationshipChanges: { "Grace": 10 },
setFlags: ["ally_grace"],
counters: { allies: 1 }
},
recruit_worthington: {
act: 5,
theme: "institution",
location: "old_bank",
speaker: "Professor Worthington",
cast: [{ who: "Professor Worthington", mood: "afraid" }],
text: "Worthington goes very pale, then very red, then pale again, like a lamp being turned up and down.\n\n'I am fifty-eight years old,' he says. 'I have a bad knee, a pension, a cat called Principle, and a lifetime of cowardice to my name. I have never broken a rule in my life without immediately reporting myself for it.'\n\nHe takes his coat from the hook anyway. His hands shake as he does up the buttons, and he gets them wrong, and does them again.\n\n'The night porter at Whitehall still thinks I'm in the Board's good books,' he says. 'He's a sentimental man. He keeps a photograph of the 1821 intake on his wall, and I'm in the front row.' He settles his hat with great care. 'Let's find out how long that lasts.'\n\nAt the door he stops. 'Tuppence would have liked this,' he says, to nobody in particular. 'She always did enjoy a fuss.'",
choices: [backToBank],
relationshipChanges: { "Professor Worthington": 10 },
setFlags: ["ally_worthington"],
counters: { allies: 1 }
},
recruit_pip: {
act: 5,
theme: "neutral",
location: "old_bank",
speaker: "Pip",
cast: [{ who: "Pip", mood: "pleased" }],
text: "'A HEIST?' Pip says, loudly enough to wake the whole dormitory - and then, at once, in a whisper: 'A heist. Yes. Obviously yes. Do I get a code name? I want to be called the Frog.'\n\nYou point out that Admiral is the frog.\n\n'Admiral is the Admiral,' Pip says, scandalised. 'I'm the Frog. It's completely different.'\n\nAdmiral climbs to Pip's shoulder and settles there like a very small, very damp parrot, surveying the dormitory with the air of a commander inspecting a regrettable ship.\n\nThen Pip goes serious, suddenly, the way children do. 'They took a girl from my year last month,' Pip says. 'She made it snow in the refectory. Everyone laughed, and it was lovely, and then she was gone.' A pause. 'Nobody looks at first-years. We can go anywhere. Let me be useful.'",
choices: [backToBank],
relationshipChanges: { "Pip": 15 },
setFlags: ["ally_pip"],
counters: { allies: 1 }
},
recruit_roger: {
act: 5,
theme: "dream",
location: "dream_inner",
speaker: "Roger-and-Molly",
cast: [{ who: "Roger-and-Molly", mood: "thoughtful" }],
text: "The inner chamber is warm, and smells of ink and tar. The presence that is both Roger and Molly - a bank clerk's careful voice, a pirate's grin - hears the whole plan without interrupting once, its fingers steepled.\n\nWhen you've finished, it is quiet for a long while.\n\n'I kept the Board's accounts for nine years, you know,' it says at last. 'Before I kept my own. The old bank, second floor, the desk by the window. I know how a ledger thinks. Columns. Margins. Where the mistakes like to hide.' The face settles, briefly, into Roger's - mild, spectacled, unexpectedly fierce. 'And I know where they hid Eleanor Hale's page. I filed it myself, God forgive me, before I knew what it was.'\n\nThen it's Molly's grin again, all teeth.\n\n@roger: 'Count me in, {lass}. Count both of me.'",
choices: [backToBank],
setFlags: ["ally_roger"],
counters: { allies: 1 }
},
recruit_captain: {
act: 5,
theme: "dream",
location: "alphabet_vault",
speaker: "The Captain",
cast: [{ who: "The Captain", mood: "stern" }],
text: "The Captain's reply arrives within the hour, delivered by a junior grammar policeman who salutes, hands it over, and leaves without using a single contraction.\n\nIt's written on headed paper - OFFICE OF THE ROYAL ALPHABET, GRAMMAR AND PUNCTUATION DIVISION - in a hand so correct it's almost painful to look at.\n\n'Sir or Madam,\n\nErasing a noun by decree is a gross misuse of the language, a personal affront to this Office, and quite possibly unconstitutional - although the constitution is unwritten, and therefore outside our jurisdiction.\n\nThe grammar police will provide an escort through the Ledger's margins. We know them well. We patrol them nightly.\n\nThis does not make us friends.\n\n- The Captain.\n\nP.S. You still owe us a serif.\n\nP.P.S. A postscript to a postscript is irregular, and I apologise for it. Good luck.'",
choices: [backToBank],
setFlags: ["ally_captain"],
counters: { allies: 1 }
},
recruit_ashby: {
act: 5,
theme: "neutral",
location: "old_bank",
speaker: "Thomas Ashby",
cast: [{ who: "Thomas Ashby", mood: "pleased" }],
text: "Thomas Ashby is waiting by the Ward's back gate, as if he knew you'd come. Biscuit is draped round his neck like a fur stole, one paw dangling, purring audibly from ten yards away.\n\nHe has put on a coat that doesn't fit him and combed his hair with water, and he looks, for the first time since you met him, like someone who expects to have a future.\n\n'There are forty-one people still in there,' he says. 'I've counted every night for six years. I know all their names, and what was taken from each of them.' He recites them, quietly - a tin soldier, a snowstorm, a horse, a voice that sang - until you lose count.\n\n'If the Board's book has a page for each of them,' he says, 'I want to be the one who finds it.' Biscuit opens one eye at you, unimpressed. 'She's coming too. She has opinions about the Board.'",
choices: [backToBank],
setFlags: ["ally_ashby"],
counters: { allies: 1 }
},
recruit_vane: {
act: 5,
theme: "institution",
location: "corridor",
speaker: "Inspector Vane",
cast: [{ who: "Inspector Vane", mood: "stern" }],
text: "Vane lives in a narrow house in Pimlico with a polished brass knocker and nothing whatever in the window boxes.\n\nShe opens the door herself, sees you, and begins - smoothly, without a word - to close it again.\n\nYou say one word. 'Kite.'\n\nThe door stops.\n\nFor a long moment there is nothing but the hiss of the street lamp and her face in the gap of the door, perfectly still, the way a pond is still.\n\nShe doesn't invite you in. She doesn't agree to anything. She tells you, in precise and level sentences, that what you're planning is illegal, impossible and unwise; that she has sent people to the Quiet Ward for considerably less; that she has never in her career looked the other way, and does not intend to begin.\n\nThen she takes a small brass key from her watch chain and lays it on the hall table, between the umbrella stand and a vase with no flowers in it.\n\n'The archive's night entrance,' she says. 'I shall be elsewhere at two o'clock. At a concert. Brahms. I dislike Brahms intensely.'\n\nThe door closes. Through it, very quietly, you hear: 'Don't make me regret this.' And then, quieter still, so quietly you might have imagined it: 'Please.'",
choices: [backToBank],
relationshipChanges: { "Inspector Vane": 15 },
suspicionChange: -10,
setFlags: ["ally_vane"],
counters: { allies: 1 }
},
the_plan: {
act: 5,
theme: "dream",
location: "old_bank",
speaker: null,
text: "You lay it out on the bank's long counter, where a hundred years of clerks counted other people's money - Roger Molly among them, once, at the desk by the window.\n\nTwo Ledgers, one truth. The Board keeps its great book in the archive at Whitehall, under glass. And the Dreamspace keeps a reflection of it, vast as a cliff, floating in the deep dark where the Board's decisions turn into the shape of the world. Change one and the other will fight to change it back. Change both at the same moment, and the change will hold.\n\nSo: two crews. One walks into Whitehall at two in the morning, past porters and locks and the Board's own night watch. The other sails into the deep Dreamspace, past pages that whisper and margins that bite.\n\n[[if count:allies>=3]]Looking round the table at the crew you've gathered - every face lit gold by the one lamp - you think it might actually work.[[else]][[if count:allies>=1]]It's a thin crew for a job this size. But it is a crew, and they're looking at you as if you know what you're doing.[[else]]It's just you, and a pirate who can barely remember her own name. It will have to do.[[/if]][[/if]]\n\n'Ye can only lead one,' Molly says. 'The other lot'll have to manage on their own.' She tries for a grin. 'Choose the one ye'd be sorriest to miss.'",
choices: [
{ text: "Lead the waking crew into the Board's archive", nextScene: "archive_enter" },
{ text: "Lead the dream crew to the Ledger's reflection", nextScene: "dream_ledger_enter" }
]
},
archive_enter: {
act: 5,
theme: "institution",
location: "board_archive",
speaker: null,
text: "Whitehall at two in the morning is all locked doors and echoes: gaslight on marble, the distant cough of a sentry who has been awake too long.[[if flag:ally_vane]] Vane's key turns in the night entrance with a soft, well-oiled click, and the night porter's chair, as promised, is empty. Somewhere across London, Brahms is being played to a woman who dislikes him intensely.[[/if]][[if flag:ally_worthington]] Worthington nods to a guard at the second door, who brightens - 'Professor! Not seen you since the '21 dinner!' - and waves the whole party through without a second glance.[[/if]][[if flag:ally_pip]] Admiral the frog hops into the porter's lodge and creates a diversion of truly unreasonable size, involving a teapot, a coal scuttle and a great deal of shouting.[[/if]]\n\nThe archive opens up before you like a cathedral built by accountants. Filing cabinets rise in tiers to a vaulted ceiling, aisle after aisle of them, every drawer a life the Board has had an opinion about. Brass ladders lean against the cliffs of drawers. Somewhere a clock ticks very slowly, as if it too has been filed.\n\nAt the far end, under a dome of glass, something glows faintly gold.\n\nThe waking Ledger.",
choices: [
{
text: "Make for the heart of the archive",
risky: true,
nextScene: (s) => s.flags.has("ally_vane") || (s.counters.allies || 0) >= 2 ? "archive_success" : "archive_alarm",
targets: ["archive_success", "archive_alarm"]
}
]
},
archive_success: {
act: 5,
theme: "institution",
location: "board_archive",
speaker: null,
text: "You reach the Ledger. Nobody stops you.\n\nIt's smaller than you imagined - a plain book with a plain brown cover, the sort of thing you'd find in any bank - and when you lift away the glass dome and pick it up, it's heavier than anything you have ever held. Not heavy like stone. Heavy like a decision.\n\nWhen you open it, you feel the other crew open its twin, far away in the deep Dreamspace, as clearly as if someone had laid a hand on your shoulder. Two books, one breath.\n\nThe pages turn by themselves. Names. Dates. Verdicts. QUIETED. QUIETED. APPROVED. QUIETED.[[if visited:quiet_ward_ashby]] Your eye catches on a name you know - ASHBY, THOMAS - and slides off it, because the book is moving faster now,[[else]] The book is moving faster now,[[/if]] riffling toward the letter it knows you've come for.\n\nP.\n\nAnd then, all around you, the archive goes dark - and you realise you're not alone.",
choices: [
{ text: "Look up", nextScene: "ledger_heart" }
]
},
archive_alarm: {
act: 5,
theme: "institution",
location: "board_archive",
speaker: null,
text: "A bell. Then another. Then every bell in Whitehall at once, a great iron clamour that seems to come out of the walls themselves.\n\nLamps flare up the length of the archive. Boots on marble. Shouts. Someone blowing a whistle as if their life depended on it.\n\nYou don't think. You grab the Ledger - heavier than anything you've ever lifted, heavy like a decision - and you run. Not for the door; there are men at the door. For the tall gilt mirror at the end of the hall, the way Molly taught you on a sandbank of misplaced keys: don't look at your reflection, look through it, and keep going.\n\nYou hit the glass, and it gives like water.\n\nYou crash through into the cold deep Dreamspace with the book clutched to your chest and Whitehall's bells fading behind you into a seasick echo. You land hard, on nothing, and roll.\n\nThe Ledger falls open. Its pages turn by themselves, faster and faster, and stop.\n\nP.",
choices: [
{ text: "Get up", nextScene: "ledger_heart" }
],
suspicionChange: 20,
selfChange: -5
},
dream_ledger_enter: {
act: 5,
theme: "dream",
location: "dream_ledger",
speaker: null,
cast: [{ who: "Molly Roger", mood: "sad" }],
text: "The deep Dreamspace is very quiet. Nobody comes here unless they're lost, or very determined, or a Board clerk with a pass.\n\nPages drift past like autumn leaves - thousands of them, each one a life, each one written in the Board's neat, sloping hand. You catch fragments as they turn: born, Leeds, 1831... projected a dog, 1840... approved... quieted... Some pages are blank but for a single word. Most of the words are QUIETED.[[if flag:ally_captain]] The grammar police form an honour guard along the margins, saluting smartly as you pass, every man correctly spaced.[[/if]][[if flag:ally_roger]] Roger-and-Molly stands at the prow, reading the currents like a balance sheet, steering you through the drifts with a clerk's precision and a pirate's nerve.[[/if]][[if flag:ally_grace]] Grace calls out the anchors whenever the pages begin to whisper - street, door, stolen thing - and the whispering falls back.[[/if]]\n\nAnd then, ahead of you, vast as a cliff, rising out of the dark: the Ledger itself.\n\nIt floats open, its spine a mile long, its pages turning slowly, like a sleeper breathing. A wind comes off it that smells of ink and dust and very old, very certain decisions.\n\nMolly, beside you, has gone almost transparent. 'There,' she whispers. 'Somewhere in there is the page that says I can't exist.' She swallows. 'Let's go and argue with it.'",
choices: [
{
text: "Sail for the open page",
risky: true,
nextScene: (s) => s.flags.has("sea_legs") || (s.counters.allies || 0) >= 2 ? "ledger_heart" : "dream_lost",
targets: ["ledger_heart", "dream_lost"]
}
]
},
dream_lost: {
act: 5,
theme: "dream",
location: "dream_ledger",
speaker: null,
text: "The pages close in.\n\nAt first it's almost pleasant. Each one is somebody's life, and each one is so easy to read - a childhood in Bristol, a first love in a rainstorm, a terrible Christmas - and so hard to stop reading. You turn one page, and then another. Then you're turning them faster, hungrily, and then you notice that some of the pages are in your handwriting, and you can't remember writing them.\n\nYou lose an hour. You lose your middle name. You lose the colour of a door you used to know, and the taste of something you once stole, and the name of the street where - where -\n\n[[if flag:anchored]]Then, from somewhere very deep, the rope Grace gave you pulls tight. Street. Door. Stolen thing. You say them out loud, in order, in a voice that cracks, and the pages scatter from you like startled birds.[[else]]It's Molly who finds you, more sea than pirate now, wading through the drifts of other people's lives. She takes you by the collar and hauls, swearing magnificently in four centuries of naval slang, until you're out.[[/if]]\n\nYou sit for a while on the margin, shaking, gathering yourself back piece by piece. Not every piece comes.",
choices: [
{ text: "Go on, a little less yourself", nextScene: "ledger_heart" }
],
selfChange: -15
},
ledger_heart: {
act: 5,
theme: "dream",
location: "dream_ledger",
speaker: "Lady Harrowgate",
cast: [{ who: "Lady Harrowgate", mood: "stern", pos: "right" }, { who: "Molly Roger", mood: "sad", pos: "left" }],
text: "The page is the size of a ballroom. It reads, in letters taller than you are: PIRATE. And under it, in fresh wet ink: TO BE STRUCK AT THE EQUINOX. H.H.\n\n'I did wonder who it would be.'\n\nLady Harrowgate stands on the margin of the page as if it were a drawing-room carpet. She's younger here - the Ledger shows people as they think of themselves - and much less kind. Her plume stirs in a wind that isn't blowing. In her hand is a pen.\n\n'Do you know what this book is, {name}?' she says. 'It's mercy. Every story in it has one ending, approved and stamped in triplicate. No one in this book ever has to be afraid of what they might become. No mother in this book ever stands in Kensington Gardens calling a name that nobody answers to.'\n\nShe smiles. 'Put down the pen. Go home. Be a cube. I promise you'll be happy - or at least you'll never notice that you aren't.'[[if flag:harrowgate_heard]]\n\nYou think of a boy and a lion, and of a blank book on a tea table, and you understand that she means every word.[[/if]]\n\nThe pen is in your hand. You don't remember picking it up. Behind you, Molly is a smudge of violet on the dark, holding very still, the way you hold still when you're trying not to be erased.\n\nThe whole Ledger waits.[[if flag:ghost_memory]]\n\nAnd you could swear the Ledger has more than one page with your name on it - in different hands, with different endings, all of them yours.[[/if]]",
choices: [
{ text: "Strike out the Erasure, and write PIRATE back into the world", nextScene: "ledger_rewrite" },
{ text: "Write every ending at once", nextScene: "true_ending", requires: "flag:ghost_memory & flag:named_her & endings>=8", hideLocked: true },
{ text: "Burn the Ledger - every page of it", nextScene: "ledger_burned", requires: "count:allies>=3", risky: true },
{ text: "Copy the pages and send them to every newspaper in London", nextScene: "exposed", requires: "item:board_circular" },
{ text: "Turn to Inspector Vane's page, and open it", nextScene: "vane_page", requires: "flag:vane_secret" },
{ text: "Forget the book. Steal Monday, and run.", nextScene: "three_day_weekend", requires: "item:stolen_w" },
{
text: "Face Harrowgate, mind to mind",
risky: true,
// Knowing about Edmund gives you something to show her, and makes this a little less impossible.
nextScene: (s) => s.self >= 70 && s.psychicLevel >= 18 || s.flags.has("harrowgate_heard") && s.self >= 60 && s.psychicLevel >= 14 ? "harrowgate_falls" : "hollow",
targets: ["harrowgate_falls", "hollow"]
}
]
},
harrowgate_falls: {
act: 5,
theme: "dream",
location: "dream_ledger",
speaker: "Lady Harrowgate",
cast: [{ who: "Lady Harrowgate", mood: "afraid" }],
text: "You don't argue with her. You simply show her.\n\nThe sail that was a cube, salt-stiff over a schoolroom desk. A frog called Admiral, unimpressed by everything. A cat called Biscuit, purring in a white-tiled room. A kite on a green hill, flying without a string. A boy's tin soldier, saluting. Snow falling in a refectory, and a hundred children with their faces turned up into it. Every unapproved thing you've ever seen. Every ending nobody stamped.\n\nYou pour them onto her page, one after another, and the page can't hold them.\n\nHarrowgate staggers, as if the margin had tilted under her feet. 'Stop,' she says. 'Stop it - there are too many endings, I can't file them all, there isn't room, I can't -'[[if flag:harrowgate_heard]]\n\nAnd last of all, gently, you show her one she has never let herself picture: a boy and a gold lion in Kensington Gardens, and beside them a witness - someone who knows the boy's name, and keeps on saying it, and doesn't let go.\n\nLady Harrowgate makes a sound like a cup breaking. 'Edmund,' she says.[[/if]]\n\nShe steps back off the margin, into the white, and is gone.\n\nWhere she stood there's only her pen, lying on the page, its nib still wet.",
choices: [
{ text: "Write PIRATE back into the world", nextScene: "ledger_rewrite" }
],
suspicionChange: -20
},
ledger_rewrite: {
act: 5,
theme: "dream",
location: "dream_ledger",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "pleased" }],
text: "You strike the line through.\n\nIt takes more strength than you expected. The ink fights you, the way a door fights you in a high wind. Then the line is through, and the words beneath it - TO BE STRUCK AT THE EQUINOX - curl up and flake away like old paint.\n\nBeside it, in the margin, in your own handwriting, you write a single word.\n\nIt goes out through the Dreamspace like a bell. You feel it go - out through the pages, out through the margins, out into the dreaming heads of London. In a thousand bedrooms, a thousand children turn over in their sleep and dream of ships. In a Quiet Ward cell, somebody sits up and begins to hum. In a narrow house in Pimlico, a woman who dislikes Brahms looks up at her bedroom ceiling, though she couldn't tell you why.\n\nMolly gasps. Colour floods back into her like dawn coming up over water: the violet of the coat, the gold of the earring, the battered black of that terrible hat. She looks down at her own hands and laughs, and whoops so loudly that somewhere in Whitehall a night porter falls off his stool.\n\n'Ye did it! Ye wrote me back!'\n\nBut when she hugs you, you can feel it: she's still thin at the edges, like a drawing that's been rubbed out and drawn again. The Erasure took something it can't give back. 'I'm real enough for now,' she says into your shoulder. 'Not for always. Not unless...' She doesn't finish. She doesn't need to.[[if !visited:harrowgate_falls]]\n\nLady Harrowgate is gone. On the margin where she stood, a single line of ink reads: This is not over. Nothing is ever over.[[/if]]",
choices: [
{ text: "Wake up in the old bank", nextScene: "help_molly" }
],
relationshipChanges: { "Molly Roger": 15 },
setFlags: ["pirate_restored"]
},
vane_page: {
act: 5,
theme: "dream",
location: "dream_ledger",
speaker: "Inspector Vane",
cast: [{ who: "Inspector Vane", mood: "afraid" }],
text: "You find it among the V's, between VANCE and VARLEY, in the Board's neat hand:\n\nVANE, ADELAIDE. AGE 12. PROJECTION: ONE KITE (PAPER, RED). STATUS: CLOSED BY SUBJECT.\n\nYou read it twice before you understand. Closed by subject. Nobody took Vane's kite. Nobody came for it with a velvet chair and a quiet machine. She wrote it into a ledger herself and shut the book, because she was twelve, and frightened, and somebody she trusted told her that was what grown-ups did with things that flew.\n\nAnd every day since, she has been keeping the book shut.\n\nAs you lay your hand on the page the Dreamspace shudders, and Vane is there - the real Vane, in her grey coat and gloves, pulled into the deep dark by the tug of her own name. She looks round at the drifting pages, the vast cliff of the Ledger, the pen in your hand. She doesn't look surprised. She looks like someone who has had this dream before, many times, and always woken up just here.\n\nHer eyes go to the page.\n\n'Don't,' she says. And then, very quietly, as if the word costs more than anything she has ever said: 'Please.'\n\nYou can't tell which she means.",
choices: [
{ text: "Let the kite fly", nextScene: "vane_unbound" },
{ text: "Close it again, gently, and turn back to P", nextScene: "ledger_rewrite", relationshipChanges: { "Inspector Vane": 10 } }
]
},
eve_of_ledger: {
act: 5,
theme: "dream",
location: "old_bank",
speaker: null,
cast: [{ who: "Molly Roger", mood: "sad" }],
text: "Nobody sleeps the night before. You sit on the floor of the old bank with the lamps turned low, and the crew talk the way people do before something enormous: about everything except the enormous thing.\n\n[[if flag:ally_grace]]Grace teaches the others her anchors, briskly, as if it were a spelling test. By midnight everyone knows the colour of everyone else's mother's front door.\n\n[[/if]][[if flag:ally_worthington]]Worthington tells a long and very bad story about the Board's Christmas party of 1829, and laughs at it himself until he wheezes. It's the first time you have ever heard him laugh.\n\n[[/if]][[if flag:ally_pip]]Pip falls asleep at one in the morning, mid-sentence, with Admiral the frog keeping watch from the top of Pip's head.\n\n[[/if]][[if flag:ally_roger]]Roger-and-Molly sits apart, doing sums in the dust with one finger, then rubbing them out and drawing a ship instead.\n\n[[/if]][[if flag:ally_captain]]The Captain declines a cup of tea on the grounds that it has not been properly introduced.\n\n[[/if]][[if flag:ally_ashby]]Thomas Ashby reads out the forty-one names from the Ward, one by one, and nobody speaks until he has finished.\n\n[[/if]][[if flag:ally_vane]]Vane does not come. But at three o'clock a boy delivers a parcel: a map of the archive's back corridors, annotated in a small, neat hand.\n\n[[/if]][[if count:allies==0]]It's just you and Molly, in the end. She sits beside you on the counter and tells you the names of every ship she has ever dreamed, until you lose count.\n\n[[/if]]Towards dawn, Molly - what's left of her - comes and sits by you.\n\n'Whatever happens tomorrow,' she says, 'ye gave a ghost a crew. That's more than most get.'",
choices: [{ text: "Lay out the plan", nextScene: "the_plan" }],
selfChange: 5
}
};
// ../../../../private/tmp/molly-roger/src/story/scenes/act3.js
var act3Scenes = {
vane_confrontation: {
theme: "institution",
location: "corridor",
speaker: "Inspector Vane",
act: 6,
text: "She's waiting for you in the corridor outside, as if she already knew which way you'd choose. Inspector Vane, Board Oversight. She doesn't raise her voice.\n\n'I know about the letter W. I know about the bank. I know about Grace's grandmother, too - these things are all written down somewhere, if you know where to look.' She lets that sit. 'I'm not here to stop you tonight. I'm here so that whatever happens next, you can't say you weren't warned.'\n\nShe walks on before you can answer.",
choices: [
// These used to be identical. Defiance now emboldens Molly but hardens Vane;
// silence keeps Vane guessing and costs you a little of Molly's swagger.
{ text: "Defy her openly - you've made your choice", nextScene: "ritual_eve", relationshipChanges: { "Molly Roger": 10, "Inspector Vane": -15 }, suspicionChange: 15 },
{ text: "Say nothing and let her wonder", nextScene: "ritual_eve", relationshipChanges: { "Inspector Vane": 10, "Molly Roger": -5 }, suspicionChange: 5 }
],
setFlags: ["met_vane"]
},
bank_planning: {
theme: "dream",
location: "old_bank",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "pleased", pos: "right" }, { who: "Grace", mood: "afraid", pos: "left" }],
act: 6,
text: "The old bank stands abandoned, but psychic residue from Roger Molly's time there makes it a perfect convergence point.\n\nGrace appears unexpectedly. 'I helped Roger Molly with his merger. It's dangerous - some personalities don't blend well. You could lose yourself entirely.'\n\nMolly scoffs. 'Grace always was the cautious one! Life's about risk, me heartie!'",
choices: [
{ text: "Trust Molly and proceed", nextScene: "bank_ritual", relationshipChanges: { "Molly Roger": 20, "Grace": -15 }, selfChange: -10 },
{ text: "Listen to Grace's concerns", nextScene: "grace_warning", relationshipChanges: { "Molly Roger": -10, "Grace": 15 } },
{ text: "Ask Grace about helping Roger Molly", nextScene: "roger_story" },
{
text: "Show Grace the photograph of her grandmother",
nextScene: "roger_story",
requires: "item:grace_photo",
relationshipChanges: { "Grace": 10 }
}
],
relationshipChanges: { "Molly Roger": 5, "Grace": 5 },
psychicChange: 1
},
bank_ritual: {
theme: "dream",
location: "ritual_chamber",
speaker: "Professor Worthington",
cast: [
{ who: "Professor Worthington", mood: "angry", pos: "right" },
{ who: "Inspector Vane", mood: "stern", pos: "left", when: "suspicion>=40" },
{ who: "Molly Roger", mood: "pleased", pos: "left", when: "suspicion<40" }
],
act: 6,
text: "Midnight, in the old bank's vault. A chalk circle glows faintly on the floor. The air tastes of ozone and old ledgers, and the hum of psychic energy is so strong your teeth ache with it.\n\nMolly stands in the centre of the circle, more solid than you have ever seen her. Her coat is real cloth now, her boots real leather; when she shifts her weight, the floorboards creak. She holds out her hands.\n\n'Ready to become legend, {lass}? This'll change everything.'\n\nAnd then the door bangs open.\n\n[[if flag:worthington_ally]]It's the enforcers - with Professor Worthington at their head, because the Board ordered him to lead them and he couldn't think how to refuse. His face is grey. 'Stop this madness!' he shouts, for the benefit of the men behind him. 'That projection will consume you!' Then, so quietly only you can hear: 'Be quick. Be careful. Be both.'[[else]]Professor Worthington bursts in, enforcers at his back. 'Stop this madness!' he shouts. 'That projection will consume you!'[[/if]]\n\n[[if suspicion>=40]]Inspector Vane comes in last, calm as a closing door, and says nothing at all. She doesn't need to.[[if suspicion>=65]] She isn't watching you. She's watching Molly's hands, the way you'd watch a conjuror whose tricks you've already written down.[[/if]][[else]]There's no sign of Inspector Vane. Whatever her ledger says about you, it hasn't been enough to bring her here tonight.[[/if]]\n\n[[if self<50]]Somewhere under Molly's laughter, your own voice sounds very small.[[/if]]",
choices: [
{
text: "Complete the ritual quickly",
risky: true,
setPiece: "anchors",
skipOutcome: "lost",
outcomes: {
// Holding your anchors replaces the Self requirement.
held: {
nextScene: (s) => s.psychicLevel >= 12 && s.relationships["Molly Roger"] >= 60 ? "ritual_complete" : "ritual_consumed",
targets: ["ritual_complete", "ritual_consumed"]
},
lost: {
nextScene: (s) => s.psychicLevel >= 12 && s.relationships["Molly Roger"] >= 60 && (s.self >= 70 || s.flags.has("anchored") && s.self >= 55) ? "ritual_complete" : "ritual_consumed",
targets: ["ritual_complete", "ritual_consumed"]
}
}
},
{
plainOnly: true,
text: "Complete the ritual quickly",
risky: true,
// You need preparation (psychic level), Molly's trust, and enough of yourself
// left to hold on to. Fail any of the three and the merger swallows you.
nextScene: (s) => s.psychicLevel >= 12 && s.relationships["Molly Roger"] >= 60 && (s.self >= 70 || s.flags.has("anchored") && s.self >= 55) ? "ritual_complete" : "ritual_consumed",
targets: ["ritual_complete", "ritual_consumed"]
},
{ text: "Try to reason with Worthington", nextScene: "reason_with_professor" },
{
text: "Have Molly create a distraction",
risky: true,
relationshipChanges: { "Molly Roger": 10 },
// If Vane has been watching you very closely, she has read about Molly's tricks
// (the scene text warns you: she's watching Molly's hands).
nextScene: (s) => s.suspicion >= 65 ? "vane_anticipates" : "escape_attempt",
targets: ["escape_attempt", "vane_anticipates"]
}
],
relationshipChanges: { "Professor Worthington": -10 },
psychicChange: 2
},
ritual_complete: {
theme: "dream",
location: "ritual_chamber",
speaker: null,
cast: [{ who: "Molly Roger", mood: "pleased", pos: "center" }],
act: 6,
text: "Energy floods through you like a tide coming in over flat sand - slowly, and then everywhere at once.\n\n[[if flag:grace_witness]]Through it you hear Grace's voice, steady as a metronome, saying your name. Then your anchors come back to you exactly when you need them - street, door, stolen thing - and you hold on.[[else]][[if flag:anchored]]Your anchors come back to you exactly when you need them - street, door, stolen thing - and you hold on.[[else]]There's nothing to hold on to, so you hold on to Molly, and she holds on back.[[/if]][[/if]]\n\nMolly's laughter mixes with your thoughts. Her memories become yours: a deck in a storm, the smell of tar, a bank clerk whistling in a rented room. Yours become hers: a lecture hall, the rain on the windows,[[if flag:cube_sail]] a cube that became a sail,[[/if]][[if flag:pip_friend]] a frog called Admiral,[[/if]] the colour of your mother's door.\n\nWhen you open your eyes you see through both sets of memories at once, the way you see through both eyes.\n\nYou're still you. But more. Molly's confidence, Roger Molly's kindness, your own stubborn, careful self - woven together into something new, and not at all finished.\n\nThe enforcers stare. There's a light around you, faint and violet, that wasn't there before. Professor Worthington lowers his arm slowly and whispers, to nobody in particular, 'What have we done?'\n\n'Something grand,' you answer - and it takes you a moment to realise which of you said it.",
choices: [
{ text: "Embrace your new existence", nextScene: "grace_epilogue_pirate" },
{ text: "Try to reverse the process", nextScene: "reversal_attempt" }
],
relationshipChanges: { "Molly Roger": 50 },
psychicChange: 10
},
slow_path: {
theme: "dream",
location: "ridgewell_later",
speaker: null,
act: 6,
text: "Months pass, the way Roger Molly's did: not in a leap, but in evenings.\n\nYou practise after lights-out and on Sunday afternoons, letting Molly a little further in each time. Some nights it goes wrong, and you wake with salt in your mouth and a shanty you've never heard stuck in your head. Some nights she goes too quiet, and you sit up in the dark saying her name until she answers. You learn each other's edges the way you'd learn a house in the dark.[[if flag:anchored]] Grace's anchors help - street, door, stolen thing. You say them so often they wear smooth.[[/if]]\n\nYour projections become legendary at Ridgewell, even as you hide what they're for. First-years follow you down corridors.[[if flag:pip_friend]] Pip follows you everywhere, Admiral the frog peering out of a pocket, taking notes.[[/if]]\n\nThen graduation comes, all at once, the way graduations do. Professor Worthington offers you a teaching post - real, permanent, with a room of your own and forty pounds a year. And Molly comes to you one night, shining, to say she's found a ship: a real one, in a dream-harbour off the coast of the conceptual seas, with a crew in want of a captain.\n\nYour bond is strong enough now for a safe merger. Everyone who knows about it agrees on that.\n\nThe question is whether it's still what you want.",
choices: [
{ text: "Merge with Molly and become pirates", nextScene: "grace_epilogue_peaceful" },
{ text: "Accept the teaching position", nextScene: "teacher_ending" },
{ text: "Remain friends but stay separate", nextScene: "friends_ending" },
{ text: "Open a secret school in the old bank, for first-years like Pip", nextScene: "pips_teacher", requires: "flag:pip_friend" }
],
relationshipChanges: { "Molly Roger": 10 },
psychicChange: 5,
selfChange: 10
// time to grow into it
},
grace_warning: {
theme: "neutral",
location: "old_bank",
speaker: "Grace",
act: 6,
text: "Before anyone lights a candle, Grace sits you both down on the dusty floor of the old bank - you, and Molly, who for once does as she's told.\n\n'Safeguards,' she says. 'My grandmother wrote them down after Roger's merger, and the Board burned every copy but one.' She unfolds it: brittle paper, a neat old hand. 'One. You do it only when you're both certain, not just eager. Two. You have a witness who knows your name, and will say it out loud if you start to forget it. Three. Anchors.' She looks at you. 'You know your anchors?'\n\n[[if flag:anchored]]Street. Door. Stolen thing. You say them, and Grace nods.[[else]]You don't. She teaches you three, there on the floor: the street you were born on, your mother's front door, the first thing you ever stole. You say them until they hold.[[/if]]\n\nMolly is quiet through all of it. At the end she says, gruffly, 'Ye'd have liked my Roger, Grace. He was careful too.'\n\nIt isn't the fast path. But it's a careful one, and when it's done you feel steadier than you have in weeks.",
choices: [
{ text: "Proceed to the ritual, now properly prepared", nextScene: "bank_ritual", relationshipChanges: { "Molly Roger": 15, "Grace": 10 }, psychicChange: 2 },
{ text: "Decide it's too risky after all - walk away", nextScene: "friends_ending" }
],
psychicChange: 1,
selfChange: 15,
// anchoring phrases
setFlags: ["grace_witness"]
},
roger_story: {
theme: "neutral",
location: "old_bank",
speaker: "Grace",
cast: [{ who: "Grace", mood: "sad" }],
act: 6,
text: "Grace tells it plainly, sitting on the bank's long counter with her knees drawn up.\n\nHer grandmother, Eleanor Hale, learned projection at Roger Molly's kitchen table and went on to teach it at Ridgewell, back when Ridgewell let its teachers have opinions. Forty years ago, in this very building, she stood witness at Roger's merger. She held his hand. She said his name every few minutes, as the rules required, until two voices answered. Afterwards she wrote it all down: every safeguard, every word.\n\nThe Board took her post for it. Then her pension. Then her name off the school's roll of honour, then the record of the merger itself. By the time Grace was born, the official history said Roger Molly had been a sad case of psychic breakdown, and that Eleanor Hale had never existed.\n\n'They didn't fear that it failed,' Grace says. 'They feared that it worked.' She looks round the empty bank - the cobwebs, the moonlight on the brass grilles. 'If a merger can be done well - carefully, willingly, with a witness - then every story they tell about Hollow Ones is a lie. And then what are they for?'",
choices: [
{ text: "This gives you confidence - proceed to the ritual", nextScene: "bank_ritual" },
{ text: "Ask Grace to stand witness for you too", nextScene: "grace_warning" }
],
relationshipChanges: { "Grace": 10 },
psychicChange: 1
},
reason_with_professor: {
theme: "institution",
location: "ritual_chamber",
speaker: null,
cast: [{ who: "Professor Worthington", mood: "thoughtful" }],
act: 6,
text: "'This isn't consumption,' you tell Worthington, standing your ground. 'It's collaboration. Ask Roger Molly, if you don't believe me - he's still in there, and he's not sorry.'\n\nWorthington hesitates, torn between fear and something that might be doubt. Whether he stands his enforcers down depends on whether you've given him any reason, until now, to trust you.",
choices: [
{
text: "See if he listens",
risky: true,
// Trust is usually low by now (planning the ritual and the ritual itself both cost it),
// but if he's already your ally, he listens.
nextScene: (s) => s.flags.has("worthington_ally") || s.relationships["Professor Worthington"] >= 10 ? "ritual_complete" : "silenced",
targets: ["ritual_complete", "silenced"]
},
{ text: "Hold up the brass feather", nextScene: "brass_bird", requires: "item:brass_feather" },
{
text: "Hand him Roger Molly's letters",
nextScene: "letters_for_worthington",
requires: "item:roger_letters"
},
{ text: "Give up talking and act fast instead", nextScene: "escape_attempt" }
]
},
letters_for_worthington: {
theme: "institution",
location: "ritual_chamber",
speaker: "Professor Worthington",
cast: [{ who: "Professor Worthington", mood: "sad" }],
act: 6,
text: "You press the bundle of letters into his hands. Worthington means to toss them aside - and then he sees the handwriting, and stops.\n\nHe reads one. Then another. The enforcers shift their weight behind him. The last letter is only two words long, and he reads it three times.\n\n'He was happy,' Worthington says at last, as if the idea had never once occurred to him. 'All these years, I told my students he was a cautionary tale. He was happy.'\n\nHe folds the letters carefully and raises a hand. The enforcers stand down.[[if suspicion>=40]] Inspector Vane looks at him for a long moment, then closes her ledger without a word.[[/if]]",
choices: [
{ text: "Finish what you started", nextScene: "ritual_complete" }
],
relationshipChanges: { "Professor Worthington": 25 },
selfChange: 5
},
vane_anticipates: {
theme: "institution",
location: "ritual_chamber",
speaker: "Inspector Vane",
act: 6,
text: "Molly conjures a squall of illusory gulls and cannon-smoke - and Inspector Vane doesn't so much as blink.\n\n@vane: 'Gulls,' she says, turning a page in her ledger. 'Page forty-one. Smoke, page forty-three. You've been very thorough in showing me what you can do, {name}. I've been very thorough in writing it down.'\n\nThe enforcers aren't looking at the gulls. They're already at your sides.",
choices: [
{ text: "There's nowhere left to run", nextScene: "silenced" }
],
relationshipChanges: { "Inspector Vane": 5 }
},
escape_attempt: {
theme: "dream",
location: "ritual_chamber",
speaker: null,
cast: [{ who: "Molly Roger", mood: "pleased" }],
act: 6,
text: "'Gulls!' Molly roars. 'Smoke! Give 'em the whole Navy!'\n\nThe chamber erupts. Illusory gulls wheel shrieking round the enforcers' heads. Cannon-smoke rolls across the floor, thick and grey and smelling convincingly of powder. Somewhere a bosun's whistle shrills. One enforcer fires his dampening-lamp at a gull, which bursts into feathers and a rude word.\n\nIn the chaos you kneel in the circle, take Molly's hands, and finish the binding - breathless, half-laughing, entirely too close for comfort. The last thing you see before the light takes you is Worthington, coughing in the smoke, wearing an expression that is very nearly a smile.",
choices: [
{ text: "Finish becoming whole", nextScene: "ritual_complete" }
],
relationshipChanges: { "Molly Roger": 10 },
psychicChange: 2,
selfChange: -5
},
reversal_attempt: {
theme: "dream",
location: "ritual_chamber",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "thoughtful" }],
act: 6,
text: "You try to pull back, to unmake what's been done - but a merger, once willingly begun, doesn't unravel so easily. Molly's voice, gentler now than you've ever heard it, tells you it's alright, that you don't have to be afraid, that you can still choose how you live this.\n\n[[if self>=60]]You find your own edges again - still there, still yours - and slowly, you stop fighting it.[[else]]You reach for the edges of yourself and find them blurred, softer than they used to be. Slowly, because there's nothing else to do, you stop fighting it.[[/if]]",
choices: [
{ text: "Accept what you've become", nextScene: "grace_epilogue_pirate" }
],
relationshipChanges: { "Molly Roger": 20 },
psychicChange: 3
},
grace_epilogue_pirate: {
theme: "neutral",
location: "letter",
speaker: "Grace",
cast: [{ who: "Grace", mood: "pleased", when: "rel:grace>=50" }, { who: "Grace", mood: "sad", when: "rel:grace<50" }],
act: 6,
text: graceEpilogueText,
choices: [
{ text: "Continue", nextScene: "pirate_life" }
]
},
grace_epilogue_peaceful: {
theme: "neutral",
location: "letter",
speaker: "Grace",
cast: [{ who: "Grace", mood: "pleased", when: "rel:grace>=50" }, { who: "Grace", mood: "sad", when: "rel:grace<50" }],
act: 6,
text: graceEpilogueText,
choices: [
{ text: "Continue", nextScene: "peaceful_merger" }
]
},
ritual_eve: {
act: 6,
theme: "dream",
location: "old_bank",
speaker: "Molly Roger",
cast: [{ who: "Molly Roger", mood: "thoughtful" }],
text: "The night before the ritual you climb onto the old bank's roof, because it seems like the sort of thing one ought to do the night before something like this. Molly comes too. London hums below you, and the river runs dark and patient through it.\n\n'Can I ask ye something, {lass}?' she says - and it's so unlike her to ask permission that you turn to look at her. 'When we're one... what d'ye want to keep? Of yerself. I don't want to take anything ye'd miss.'\n\nYou think about it properly, because she has asked properly.\n\n[[if flag:anchored]]Your street. Your mother's door. The first thing you ever stole. [[/if]][[if flag:still_mind]]The stillness - the full cup, held. [[/if]][[if flag:cube_sail]]The sail. You'd like to keep the sail. [[/if]][[if flag:perfect_cube]]Even the cube, perhaps. There's something to be said for a straight edge. [[/if]]The way you laugh at the wrong moments. The way you're afraid of heights and climb things anyway.\n\nYou tell her. She listens to every word.\n\n'Done,' she says. 'And I'll give ye the sea. Fair trade?'\n\nBelow you a bell begins to ring the hour, and it doesn't sound like an ending at all.",
choices: [{ text: '"Fair trade."', nextScene: "bank_planning" }],
relationshipChanges: { "Molly Roger": 10 },
selfChange: 10
}
};
function graceEpilogueText(state2) {
if (state2.relationships["Grace"] >= 50) {
return "Word reaches you, months later, folded into an ordinary letter. Grace has done it. Quietly, carefully, with every safeguard the two of you once discussed, she merged with her own long-suppressed Sight.\n\nShe signs the letter with a new steadiness in her handwriting: 'Grace - and something more.' The Board never even noticed. That, she writes, was rather the point.";
}
return "You hear about Grace secondhand, weeks later, from a nervous first-year. She tried her own merger alone, without the safeguards she once tried to teach you.\n\nInspector Vane caught her mid-ritual. She wasn't silenced - not quite - but she was quietly reassigned to a distant parish school, her research confiscated, her name struck from the register of promising students. You never got the chance to say goodbye.";
}
// ../../../../private/tmp/molly-roger/src/story/scenes/endings.js
var endingScenes = {
pirate_life: {
theme: "dream",
location: "conceptual_seas",
speaker: null,
ending: true,
endingTitle: "True Merger",
hint: "Some stories are better when shared - if you are ready to share them.",
text: "You and Molly sail the conceptual seas, a merged being with two souls. The Board never manages to properly explain what happened at the old bank that night, and Inspector Vane's official report calls it 'inconclusive' - the closest she has ever come to admitting she was wrong. She still watches, sometimes, from a distance. She has never come closer.\n\nProfessor Worthington resigns his post within the year. He writes to you exactly once: 'I was afraid of what I didn't understand. I hope you'll forgive an old man for it.'\n\nSome days you're more Molly, pulling grand heists in Dreamspace. Other days you're more yourself, helping other young psychics find their path.\n\nGrace sends occasional letters: 'Roger Molly would be proud. You found a better balance than we ever did.'\n\nSome stories are better when shared."
},
peaceful_merger: {
theme: "dream",
location: "conceptual_seas",
speaker: null,
ending: true,
endingTitle: "Balanced Existence",
hint: "Two rivers, joined slowly.",
text: "The merger is gentle, like two rivers joining. You remain conscious of both identities, able to shift between them or blend as needed.\n\nInspector Vane investigates for months and finds nothing she can prove - no ritual performed in haste, no rule broken she can point to in writing. She closes the file at last with a single handwritten note: 'No violation found.' It is, from her, as close to surrender as the Board allows.\n\nProfessor Worthington becomes an unlikely advocate, quietly steering nervous new students your way instead of turning them in. You become the most famous psychic pirate in history, but also a mentor to young psychics.\n\nYour legend grows: the teacher who became a pirate, the projection who became real, the student who changed everything.\n\nWhy choose one life when you can live both?"
},
approved_psychic: {
theme: "institution",
location: "ridgewell_after",
speaker: null,
ending: true,
endingTitle: "Approved Psychic",
hint: "A cage with very clean bars.",
text: "Years pass. You become a respected psychic scholar, publishing papers on 'safe projection techniques.' Your life is comfortable, approved, and utterly predictable.\n\n@none: Inspector Vane's file on you closes quietly within the year, marked simply: 'No further activity.' She moves on to the next name on her list, and you feel relief, and something else too, something you don't examine too closely.\n\nProfessor Worthington remains your mentor and, eventually, something like a friend, though neither of you ever quite says so.\n\nOccasionally you hear rumours: Molly found another student, they merged, they're sailing the conceptual seas having adventures you can only imagine.\n\nYou have security, respect, and the Board's approval. But sometimes, in quiet moments, you hear ghostly laughter on the wind.\n\nThe safest cage is the one you don't see."
},
teacher_ending: {
theme: "institution",
location: "lecture_hall",
speaker: null,
ending: true,
endingTitle: "The Reformer",
hint: "Change the system from inside its classrooms.",
text: "You accept Professor Worthington's offer and become a teacher at Ridgewell. Over the years, you subtly introduce more creative approaches to psychic development, slowly changing the system from within.\n\nInspector Vane still visits, twice a year, precise as clockwork, and reviews your lesson plans without ever quite finding grounds to object. You've learned to write your rebellions between the lines she's trained herself not to read. It is, in its way, a kind of truce.\n\nMolly visits your dreams occasionally, sharing tales of her adventures. Though you chose different paths, you remain connected through the bond you forged.\n\nYour students never know about your past with the legendary psychic pirate, but they benefit from the balance you've found between tradition and innovation.\n\nSometimes the most revolutionary acts happen quietly."
},
friends_ending: {
theme: "neutral",
location: "between_worlds",
speaker: null,
ending: true,
endingTitle: "The Diplomat",
hint: "Not every partnership requires merging souls.",
text: "You and Molly remain close friends and allies, but maintain your separate existences. You become a bridge between the psychic establishment and the rogue elements in Dreamspace.\n\nInspector Vane becomes, against every instinct either of you has, something like a professional counterpart. She never approves of what you do. But she has learned to call on you before she acts instead of after, and you have learned that's the only kind of victory some people are capable of offering.\n\nProfessor Worthington quietly supplies you with warnings when the Board grows restless, his old fear of Molly worn down at last into something more like respect.\n\nYour unique position allows you to negotiate treaties, prevent conflicts, and create new opportunities for psychic expression that satisfy both traditionalists and rebels. Molly still pulls her conceptual heists, but now she shares the spoils with the school - on her terms, of course.\n\nNot every partnership requires merging souls."
},
informant: {
theme: "institution",
location: "ridgewell_after",
speaker: null,
ending: true,
endingTitle: "The Informant",
hint: "Some cages are built by the people who lock themselves inside them.",
text: "You tell Worthington everything, and within the hour, Inspector Vane has it too - written up, signed, filed. She thanks you with the same flat courtesy she'd show anyone useful.\n\nThat night, her enforcers raid the old bank. You feel Molly sense the betrayal a heartbeat before they arrive - her presence recoils in your mind, then goes silent. Grace never speaks to you again.\n\nYou keep your position, your safety, your unremarkable life. Years later, in quiet unguarded moments, you'll wonder whether the empire's straight lines were ever worth a pirate's silenced laughter.\n\nSome cages are built by the people who lock themselves inside them."
},
silenced: {
theme: "institution",
location: "ridgewell_after",
speaker: null,
ending: true,
endingTitle: "Silenced",
hint: "Reach for too much, too soon, while the Board is watching.",
text: "Inspector Vane's enforcers close in, and whatever confidence you had wasn't enough. Vane herself fastens the suppression collar - cold iron worked with dampening sigils - with the brisk efficiency of someone who has done this before.\n\nMolly's voice fades from your mind like a tide going out - not destroyed, the Board insists, only 'quieted.' You spend the rest of your years at Ridgewell as a cautionary tale told to first-years: the promising student who reached for too much, too soon.\n\nSometimes, late at night, you think you still hear pirate laughter at the edge of hearing, just out of reach.\n\nThe safest cage is still a cage."
},
ritual_consumed: {
theme: "dream",
location: "ritual_chamber",
speaker: null,
ending: true,
endingTitle: "Consumed",
hint: "Open the door too fast, with too little of yourself to hold on to.",
text: "You rush the binding, impatient, underprepared. For a moment it feels like triumph - then Molly's voice grows too loud, drowning out your own thoughts entirely. You reach for your own name and can't quite remember it.\n\nWhen the enforcers arrive, Inspector Vane is the only one who doesn't look surprised. She simply makes a note, files it, and leaves instructions for the pirate captain standing where a student used to be, laughing with a stranger's mouth. No trace of you left to call your own.\n\nWorthington was wrong about many things. Vane was right about this one. The merger can consume you, if you let it happen too fast, too unready.\n\nSome doors should only be opened slowly."
},
three_day_weekend: {
theme: "dream",
location: "london_street",
ending: true,
endingTitle: "The Three-Day Weekend",
hint: "A thief's answer to a bureaucrat's question.",
text: "You leave the Ledger exactly as it is. Instead, you and Molly - who have, after all, done this sort of thing before - slip down the margin to where the week is kept, and steal Monday.\n\nThe Board wakes on Tuesday to find that Monday never happened, and with it the equinox, and with it the Erasure, which was scheduled, very precisely, for Monday. Parliament cannot meet to reschedule it, because the Act that authorised it was passed on a Monday that no longer exists.\n\nThe British Empire enjoys its first three-day weekend. It does not ask for a refund.\n\nYou and Molly never quite merge. You don't need to; you're far too busy. The Board's files call you two separate menaces. The newspapers call you one legend. On the first Monday of every month you give Monday back, a little late, with a bow on it.\n\nSome heists are a kindness."
},
vane_unbound: {
theme: "dream",
location: "dream_ledger",
ending: true,
endingTitle: "Vane Unbound",
hint: "Even the ledger-keeper has a page.",
text: "You open the page.\n\nA red paper kite lifts off it, rising without any wind at all, and Adelaide Vane makes a sound you will remember for the rest of your life - not a sob, not a laugh, but the noise a door makes when it opens after forty years.\n\nShe resigns from the Board the following morning, in a letter exactly one line long. Without its Inspector the Erasure collapses into paperwork; nobody else ever knew where anything was filed. Lady Harrowgate is quietly retired to a house in Bath with no books in it.\n\nYou and Molly take the slow path in the end, together, under nobody's supervision. On windy days you see Vane on Primrose Hill, a red kite overhead and no ledger anywhere in sight. She nods to you. Once, she waves.\n\nEven the people who keep the cages were somebody's prisoner first."
},
lending_library: {
theme: "neutral",
location: "old_bank",
ending: true,
endingTitle: "The Lending Library",
hint: "Neither cage nor merger - a third door.",
text: "You don't merge. You build.\n\nThe old bank becomes a library - not for books, but for projections. Molly lives in the reading room. Anyone with the Sight can walk in, borrow a little courage or a loaned sea or a frog for the weekend, and bring it back when they're done. Grace runs the front desk with an iron date-stamp and a terrifying fines policy.\n\nThe Board tries to close it three times. Each time, its inspectors leave carrying library cards.\n\nMolly never becomes fully real, and never quite fades. She says she prefers it. 'Real's overrated, {lass}. Real has to pay rent.' You become the first Librarian of Concepts, and the job, it turns out, is mostly lending people back to themselves.\n\nNot every ghost wants a body. Some of them just want a home."
},
ledger_burned: {
theme: "dream",
location: "dream_ledger",
ending: true,
endingTitle: "Ledger Burned",
hint: "Gather enough friends, and some books can be closed for good.",
text: "You don't rewrite the Ledger. You set it alight.\n\nIt burns from the margins inward, page after page of approved endings curling into the dark, and with every page a cell door somewhere in the waking world swings open.[[if flag:ally_ashby]] Thomas Ashby walks the forty-one out of the Quiet Ward, calling each of them by name.[[/if]] Lady Harrowgate tries to put the fire out with a rubber stamp. It does not work.\n\nWithout its Ledger, the Board of Psychic Regulation discovers it was only ever a committee. It dissolves within the month. For a while England is very strange: sails over Kensington, frogs in Parliament, a pirate in every second dream. Then, slowly, people learn to live with their own imaginations. Most of them, it turns out, are kind.\n\nYou and Molly merge on the night of the equinox, in front of witnesses, with fireworks. There's nobody left to stop you - which, you both agree, takes some of the fun out of it.\n\nThe best way to change a story is to stop letting someone else hold the pen."
},
exposed: {
theme: "neutral",
location: "london_street",
ending: true,
endingTitle: "Exposed",
hint: "The Board fears one thing more than pirates: newspapers.",
text: "You copy the pages instead - the Quiet Ward, the circular, the forty-one names, Harrowgate's signature on every one of them - and by breakfast they're in every newspaper in London.\n\nTHE BOARD'S SECRET WARD. THE HOLLOW ONES WERE MADE. The Times prints it with the W back in place, which somehow makes it worse. Questions are asked in the House, and for once everybody is able to ask why. Lady Harrowgate resigns to spend more time with her filing.\n\nThe Erasure is cancelled. Molly is still thin, still fading at the edges, and the two of you take the slow path afterwards - but you take it in public, as a cause, with a committee of your own and far too many tea parties.\n\nYou become a famous agitator. You hate it. Molly loves it.\n\nSome cages only stand because nobody has turned the lights on."
},
hollow: {
theme: "institution",
location: "quiet_ward",
ending: true,
endingTitle: "Hollow",
hint: "The Board doesn't find Hollow Ones. It makes them.",
text: "They bring you to the Quiet Ward by the back stairs.\n\nThe machine is very quiet. That's the worst of it. You expect pain, or noise, or at least a struggle, and instead there's only a soft click and a draught, as if somebody had opened a window in a room you didn't know you had - and then closed it again, with Molly on the other side.\n\nYou're released in the spring, assessed as 'cooperative'. You find a clerk's position at a bank. You're very good at it. You make no mistakes, and no shapes, and no jokes.\n\nSometimes you find yourself drawing in the margin of a ledger - a hat, a ship, a woman laughing - without knowing why, and you feel the space in you, the exact shape of her.\n\nThe Board doesn't find Hollow Ones. It makes them."
},
pips_teacher: {
theme: "neutral",
location: "old_bank",
ending: true,
endingTitle: "Pip's Teacher",
hint: "Teach the next one before the Board can.",
text: "You never merge with Molly. You open a school instead.\n\nIt meets in the old bank after dark. Its first pupil is Pip, and its first lesson is: make something that isn't a cube. Admiral the frog serves as caretaker, mascot and, on one occasion, fire alarm. By spring there are nine pupils. By summer, thirty. Molly teaches navigation on Tuesdays and, unofficially, swearing on Thursdays.\n\nThe Board finds out eventually. By then it's far too late: there's a whole generation of children who know their minds belong to them. You can't erase that. You would have to erase all of them.\n\nYears later Pip - grown, famous, still wearing a frog on one shoulder - is asked who taught them to dream. 'A student,' Pip says, 'who had a ghost for a friend.'\n\nThe best rebellion is a good education."
},
brass_bird: {
theme: "institution",
location: "ritual_chamber",
ending: true,
endingTitle: "The Brass Bird",
hint: "One old man's courage, returned to him.",
text: "You hold up the brass feather, and Worthington stops in mid-shout.\n\nHe takes it from you very gently. For a moment nothing happens. Then something small and bright drops out of the dark above the ritual circle - clockwork wings, a voice like a music box - and lands on his shoulder as if it had only popped out for a minute, thirty years ago, and was sorry to be late.\n\n'Tuppence,' he says, and that is all he can say.\n\nThe enforcers look at their professor, weeping, with a brass bird singing in his ear, and quietly decide they aren't paid enough for this. You complete the ritual with Worthington standing guard at the door.\n\nHe becomes Headmaster the following year. The first thing he does is take down the sign that says APPROVED FORMS ONLY. The second is to let Tuppence sit in on every lecture.\n\nIt's never too late to stop paying the price of a cage."
},
true_ending: {
theme: "dream",
location: "dream_ledger",
ending: true,
endingTitle: "The Ghost of Molly Roger",
hint: "Told more than once - begun by saying her name, and carried all the way to the Ledger.",
epilogue: false,
text: "You don't strike the line. You don't burn the book. You write.\n\nYou write the cube, and the sail, and the stillness. You write the Informant and the Diplomat, the Reformer and the Approved; the pirate on the conceptual seas and the clerk who makes no jokes; the librarian of concepts, the teacher with a frog on their shoulder, the thief who stole Monday. Every ending you have ever lived - and you have lived them, you understand now, all of them, one after another, the way a tide comes in more than once - you write onto the same page, one on top of the other, until the ink runs black and the page is full.\n\nThe Ledger was built to hold one ending per story. It cannot hold this. It doesn't break so much as sigh, and open, and become a different kind of book: the kind you read more than once.\n\nLady Harrowgate reads over your shoulder for a long time. 'That isn't how stories work,' she says at last. She doesn't sound sure.\n\n'It's how this one works,' says Molly. Or you. It's getting hard to tell, and it doesn't matter.\n\nSo it goes.\n\nNow you are a they. You are a them. You sail the Dreamspace, a pirate and a student, a ghost and {name}. Some days you are more pirate, and steal Monday. Some days you are more student, and help someone else draw outside the lines of their own mind. It depends on the weather. It depends on which ending you feel like today.\n\nThe moral of the story? There isn't one. That's the first thing the Board got wrong. Stories aren't here to be filed. They're here to be told - and told again - and every time, the ghost comes back.\n\nAnd so it begins."
}
};
// ../../../../private/tmp/molly-roger/src/story/characters.js
var characters = {
"Molly Roger": {
short: "Molly",
aliases: ["Molly Roger", "Molly"],
key: "molly",
color: "#8A6DFF",
relationship: true,
relationshipLabel: "Molly Roger"
},
"Professor Worthington": {
short: "Worthington",
aliases: ["Professor Worthington", "Worthington", "the Professor"],
key: "worthington",
color: "#C9A227",
relationship: true,
relationshipLabel: "Prof. Worthington"
},
"Grace": {
short: "Grace",
aliases: ["Grace"],
key: "grace",
color: "#3FBBFF",
relationship: true,
relationshipLabel: "Grace"
},
"Inspector Vane": {
short: "Vane",
aliases: ["Inspector Vane", "Vane", "the Inspector"],
key: "vane",
color: "#9AA3AD",
// Board grey
relationship: true,
relationshipLabel: "Inspector Vane"
},
"Pip": {
short: "Pip",
aliases: ["Pip"],
key: "pip",
color: "#7BD389",
// frog green
relationship: true,
relationshipLabel: "Pip",
revealWhen: "visited:term_pip"
// no bar until you've met Pip
},
"Lady Harrowgate": {
short: "Lady Harrowgate",
aliases: ["Lady Harrowgate", "Harrowgate"],
key: "harrowgate",
color: "#B8475A",
// plum silk
relationship: false
},
"Thomas Ashby": {
short: "Ashby",
aliases: ["Thomas Ashby", "Ashby", "Thomas"],
key: "ashby",
color: "#C9CED6",
relationship: false
},
"Roger-and-Molly": {
short: "Roger-and-Molly",
aliases: ["Roger-and-Molly"],
key: "roger",
color: "#E0A6FF",
relationship: false
},
"The Captain": {
short: "The Captain",
aliases: ["The Captain", "the Captain"],
key: "captain",
color: "#6F8FE0",
relationship: false
}
};
var relationshipNames = Object.keys(characters).filter((n) => characters[n].relationship);
var characterByKey = Object.fromEntries(
Object.entries(characters).map(([name, c]) => [c.key, name])
);
function emptyRelationships() {
return Object.fromEntries(relationshipNames.map((n) => [n, 0]));
}
// ../../../../private/tmp/molly-roger/src/story/locations.js
var locations = {
lecture_hall: { name: "Lecture Hall \xB7 Ridgewell", set: "lecture_hall", realm: "institution", ambience: "dust" },
library: { name: "The Combination Library", set: "library", realm: "neutral", ambience: "dust" },
grace_hideout: { name: "Grace's Hideout", set: "grace_hideout", realm: "neutral", ambience: "dust" },
observatory: { name: "The Abandoned Observatory", set: "observatory", realm: "dream", ambience: "stars" },
practice_rooms: { name: "Practice Rooms \xB7 Ridgewell", set: "practice_rooms", realm: "institution", ambience: "dust" },
worthington_office: { name: "Professor Worthington's Office", set: "worthington_office", realm: "institution", ambience: "dust" },
corridor: { name: "Ridgewell Corridors", set: "corridor", realm: "institution", ambience: "dust" },
dreamspace: { name: "The Dreamspace", set: "dreamspace", realm: "dream", ambience: "dream" },
dream_inner: { name: "Dreamspace \xB7 The Inner Chamber", set: "dream_inner", realm: "dream", ambience: "dream" },
alphabet_vault: { name: "The Royal Alphabet Vault", set: "alphabet_vault", realm: "dream", ambience: "letters" },
old_bank: { name: "The Old Bank", set: "old_bank", realm: "dream", ambience: "moondust" },
ritual_chamber: { name: "The Old Bank \xB7 Ritual Chamber", set: "ritual_chamber", realm: "dream", ambience: "embers" },
ridgewell_later: { name: "Ridgewell \xB7 Months Later", set: "ridgewell_exterior", variant: "later", realm: "neutral", ambience: "dust" },
ridgewell_after: { name: "Ridgewell \xB7 Afterwards", set: "ridgewell_exterior", variant: "after", realm: "institution", ambience: "rain" },
letter: { name: "A Letter, Months Later", set: "writing_desk", realm: "neutral", ambience: "dust" },
conceptual_seas: { name: "The Conceptual Seas", set: "conceptual_seas", realm: "dream", ambience: "dream" },
between_worlds: { name: "Between Worlds", set: "between_worlds", realm: "neutral", ambience: "dream" },
ridgewell_term: { name: "Ridgewell \xB7 Michaelmas Term", set: "corridor", realm: "institution", ambience: "dust" },
hearing_room: { name: "The Great Hall \xB7 Board Inquiry", set: "hearing_room", realm: "institution", ambience: "dust" },
quiet_ward: { name: "The Quiet Ward \xB7 Whitehall", set: "quiet_ward", realm: "institution", ambience: "moondust" },
board_archive: { name: "The Board Archive \xB7 Whitehall", set: "board_archive", realm: "institution", ambience: "dust" },
dream_ledger: { name: "The Ledger \xB7 Deep Dreamspace", set: "dream_ledger", realm: "dream", ambience: "letters" },
london_street: { name: "London, Without a W", set: "london_street", realm: "neutral", ambience: "dust" },
headmaster_study: { name: "The Headmaster's Study", set: "worthington_office", realm: "institution", ambience: "dust" }
};
// ../../../../private/tmp/molly-roger/src/story/acts.js
var acts = {
1: {
title: "Prologue",
subtitle: "The Cube",
short: "Pro",
objectives: [[null, "Get through the Board's projection exam without giving yourself away."]]
},
2: {
title: "Act I",
subtitle: "Awakening",
short: "I",
objectives: [
["visited:report", "Worthington knows about Molly now. Decide who you trust: the Board, or her."],
["visited:research", "Find out who Molly Roger really is - and what she wants with you."],
[null, "A pirate is talking to you in your head. Work out what that means."]
]
},
3: {
title: "Act II",
subtitle: "The Heist",
short: "II",
objectives: [
["visited:heist_eve", "Tonight's the night. Borrow the letter W from the Royal Alphabet Vault."],
["visited:without_w", "London is missing a letter. Keep your head down until the hunt dies away."],
["visited:term_begins", "Three weeks until the heist. Train hard, and find people you can trust."],
[null, "Help Molly borrow the letter W from the Royal Alphabet Vault."]
]
},
4: {
title: "Act III",
subtitle: "The Inquiry",
short: "III",
objectives: [
["visited:inquiry_verdict", "The Board means to erase the idea of pirates. Find a way to stop it."],
["visited:quiet_ward_entry", "Get out of the Quiet Ward, with whoever you can bring."],
[null, "The Board is hunting the thief. Keep your name out of Inspector Vane's ledger."]
]
},
5: {
title: "Act IV",
subtitle: "The Ledger",
short: "IV",
objectives: [
["visited:the_plan", "Rewrite the Ledger: both copies, at the same moment."],
[null, "Molly is fading. Muster a crew to rob the Board's Ledger."]
]
},
6: {
title: "Act V",
subtitle: "The Old Bank",
short: "V",
objectives: [[null, "Decide what you and Molly will become."]]
}
};
var crew = {
"Grace": "ally_grace",
"Professor Worthington": "ally_worthington",
"Pip": "ally_pip",
"Roger-and-Molly": "ally_roger",
"The Captain": "ally_captain",
"Thomas Ashby": "ally_ashby",
"Inspector Vane": "ally_vane"
};
// ../../../../private/tmp/molly-roger/src/story/items.js
var items = {
roger_letters: {
name: "Roger Molly's letters",
icon: "fa-envelope-open-text",
description: "A bundle of letters from the restricted section, in a bank clerk's careful hand. The last one reads, simply: 'Gone plunderin'.'"
},
grace_photo: {
name: "A faded photograph",
icon: "fa-image",
description: "Grace's grandmother, who stood witness at Roger Molly's merger. She looks remarkably like Molly Roger - but isn't."
},
stolen_w: {
name: "The letter W",
icon: "fa-w",
description: "Borrowed from the Royal Alphabet Vault. It hums faintly. For three days, London will have to manage without it."
},
stray_comma: {
name: "A stray comma",
icon: "fa-quote-right",
description: "All Molly managed to grab without you. Small, curled, and faintly embarrassed."
},
board_circular: {
name: "The Board circular",
icon: "fa-folder-closed",
description: "ON THE MANAGEMENT OF PERSISTENT PROJECTIONS. Recommends 'quieting' at the Quiet Ward, Whitehall. Signed in loops and certainty: H. Harrowgate, Chair."
},
brass_feather: {
name: "A brass feather",
icon: "fa-feather-pointed",
description: "From Tuppence, the clockwork bird Professor Worthington projected when he was nine, and gave up for a teaching post. Warm to the touch."
},
ashby_drawing: {
name: "Ashby's drawing",
icon: "fa-cat",
description: "A cat, curled up, tail over its nose, drawn in burnt match on the back of a Board form. Her name was Biscuit."
}
};
// ../../../../private/tmp/molly-roger/src/story/flags.js
var flags = {
// Prologue
cube_sail: { note: "At your projection exam, the cube became a sail. The hall smelled of the sea. Someone laughed." },
perfect_cube: {},
still_mind: { note: "At your projection exam you made nothing at all - and in the silence, heard a sea shanty." },
// Act I
met_vane: { note: "Inspector Vane of the Board of Psychic Regulation keeps a ledger. Your name is in it." },
knows_hideout: { note: "Grace's hideout lies behind a false bookshelf in the Combination Library." },
double_agent: { note: "Vane asked you to spy on Grace. You told Grace instead." },
knows_roger_truth: { note: "Roger Molly didn't vanish in a flash of light. His merger took months of patient practice. He was ready." },
knows_hollow: { note: "Rushed mergers, or ones without trust, can leave a psychic hollow. The Board calls them Hollow Ones." },
grace_witness: { note: "Grace walked you through the safeguards and agreed to stand witness at your ritual." },
met_roger_molly: { note: "Deep in Dreamspace you met the merged Roger-and-Molly. 'The Board's grown crueller since my time.'" },
grace_will_witness: { note: "Grace promised to stand witness for you, when the time comes." },
sanctuary_idea: { note: "What if projections didn't have to merge or fade? What if there were somewhere they could simply live?" },
// Act II - the term
anchored: { note: "Grace taught you three anchors: the street you were born on, the colour of your mother's door, the first thing you ever stole. Say them, in order, and you'll remember which way is home." },
sea_legs: { note: "Three nights at sea with Molly. You can tack into a nightmare and out again without spilling your tea." },
saw_brass_bird: { note: "Professor Worthington keeps a brass feather in his desk drawer, wrapped in a handkerchief." },
pip_friend: { note: "Pip, a first-year, projected a frog called Admiral in morning assembly. You're friends now." },
knows_quiet_ward: { note: "The Board sends 'persistent projections' to the Quiet Ward, sub-basement, Board Offices, Whitehall." },
captain_owes: { note: "The Captain of the grammar police lent you the letter W - in writing, in triplicate - and seems to respect you for asking." },
promised_molly: { note: "You promised Molly you'd help her become real." },
returned_w: {},
// Act III - the inquiry
grace_safe: {},
grace_taken: { note: "The Board took Grace to Whitehall 'for assessment'." },
vane_secret: { note: "In Vane's tidy mind there is a locked drawer labelled KITE, in a child's handwriting." },
worthington_ally: { note: "Worthington told you about Tuppence and gave you the keys to the Quiet Ward. 'Bring them back. All of them.'" },
knows_hollow_truth: { note: "The Board doesn't find Hollow Ones. The Board makes them - by cutting projections out of people." },
harrowgate_heard: { note: "Lady Harrowgate had a brother, Edmund, who projected a gold lion and went after it with no witness. What came back never knew her name." },
ashby_restored: { note: "You gave Thomas Ashby back his cat, Biscuit. It cost you something. It was worth it." },
// Act IV - the Ledger
ally_grace: {},
ally_worthington: {},
ally_pip: {},
ally_roger: {},
ally_captain: {},
ally_ashby: {},
ally_vane: {},
pirate_restored: {},
// New Game+
ghost_memory: { note: "You have the oddest feeling you've lived this before. More than once." },
named_her: { note: "You said Molly's name before she told you it. Neither of you knows how." }
};
// ../../../../private/tmp/molly-roger/src/story/epilogues.js
var epilogues = [
{
id: "pip_friend",
when: "flag:pip_friend",
except: ["pips_teacher"],
text: "Pip grows up to be impossible to manage and wonderful to know. Admiral the frog lives to a scandalous age."
},
{
id: "pip_missed",
when: "visited:term_pip & !flag:pip_friend",
text: "Now and then you think about the first-year with the frog, and wonder whether anyone ever stood up for them."
},
{
id: "ashby_free",
when: "flag:ashby_restored",
text: "Thomas Ashby opens a bookshop by the docks. Biscuit the cat sleeps in the window and is rude to customers."
},
{
id: "ashby_left",
when: "visited:quiet_ward_ashby & !flag:ashby_restored",
except: ["ledger_burned", "exposed"],
text: "You never stop thinking about cell nine, and the cat drawn over and over on its wall in burnt match."
},
{
id: "feather",
when: "item:brass_feather",
except: ["brass_bird"],
text: "You keep Worthington's brass feather in a drawer. On quiet nights, it hums."
},
{
id: "kite",
when: "flag:vane_secret",
except: ["vane_unbound"],
text: "Whenever you see a red kite, you think of a locked drawer in a tidy mind, and hope that someone, someday, opens it."
},
{
id: "captain",
when: "flag:captain_owes",
text: "Every Christmas, a card arrives from the grammar police. The punctuation is perfect. It is signed, simply, 'The Captain'."
}
];
// ../../../../private/tmp/molly-roger/src/story/codex.js
var CODEX_SECTIONS = {
people: "People",
letters: "Roger Molly's Letters",
papers: "Board Papers"
};
var codex = [
// ------------------------------------------------------------ People
{
id: "molly_1",
section: "people",
group: "Molly Roger",
title: "The pirate in your head",
when: "visited:start",
text: "A psychic projection in a battered tricorn and a coat that has seen several centuries of weather. Loud, brave, rude, delighted. Recruits a new student every few years; most never answer."
},
{
id: "molly_2",
section: "people",
group: "Molly Roger",
title: "Ink in the gutters",
when: "visited:heist_eve",
text: "Before she was Molly, she was a margin: the space in a bank ledger where a clerk who never went anywhere drew a ship every day for eleven years. She never tired of being somebody's daydream. She only wanted, for once, to be the one dreaming."
},
{
id: "molly_3",
section: "people",
group: "Molly Roger",
title: "Written back",
when: "flag:pirate_restored",
text: "Struck from the Ledger by decree, and written back into the world by hand. Still thin at the edges, like a drawing rubbed out and drawn again."
},
{
id: "worthington_1",
section: "people",
group: "Professor Worthington",
title: "The approved path",
when: "visited:prologue_exam",
text: "Professor of Controlled Projection at Ridgewell. Smells of mothballs and misplaced authority. Not cruel - afraid, and organised about it. Makes cocoa for his only tutorial student."
},
{
id: "worthington_2",
section: "people",
group: "Professor Worthington",
title: "A feather in a drawer",
when: "flag:saw_brass_bird",
text: "Keeps a single brass feather wrapped in a handkerchief in his desk drawer, polished by years of handling. Goes pale at drawings of birds."
},
{
id: "worthington_3",
section: "people",
group: "Professor Worthington",
title: "Tuppence",
when: "flag:worthington_ally",
text: "At nine he projected a clockwork bird with a voice like a music box. At twenty-eight the Board offered him a teaching post, and the price was Tuppence. He paid it, and has told himself every day since that it was the sensible thing to do."
},
{
id: "grace_1",
section: "people",
group: "Grace",
title: "The most talented psychic at Ridgewell",
when: ["visited:research", "visited:grace_help", "visited:term_grace", "visited:bank_planning"],
text: "Ink on her fingers, chalk on her cuff. Runs a hideout behind a bookcase that opens when you pull on Hume, 'because nobody has ever voluntarily touched Hume'."
},
{
id: "grace_2",
section: "people",
group: "Grace",
title: "Eleanor Hale's granddaughter",
when: ["visited:roger_story", "visited:grace_motives", "visited:grace_connection"],
text: "Her grandmother learned projection at Roger Molly's kitchen table, stood witness at his merger, and was erased by the Board for it. Grace has spent her life finishing what Eleanor started."
},
{
id: "vane_1",
section: "people",
group: "Inspector Vane",
title: "Board Oversight",
when: "flag:met_vane",
text: "Inspector of the Board of Psychic Regulation. Grey coat, gloves, a small ledger. Finds threats untidy. Has never, in her career, looked the other way."
},
{
id: "vane_2",
section: "people",
group: "Inspector Vane",
title: "Kite",
when: "flag:vane_secret",
text: "In her filing-room mind, one drawer at the very bottom is locked, labelled in a child's handwriting: KITE. A girl on a green hill, and a red kite flying without a string."
},
{
id: "vane_3",
section: "people",
group: "Inspector Vane",
title: "Closed by subject",
when: "visited:vane_page",
text: "VANE, ADELAIDE. AGE 12. Nobody took her kite. She wrote it into a ledger herself and shut the book - and has been keeping it shut ever since."
},
{
id: "pip_1",
section: "people",
group: "Pip",
title: "The first-year with the frog",
when: "visited:term_pip",
text: "Eleven years old. Projected a frog called Admiral during morning assembly. The frog said 'ribbit'. Neither of them likes cubes."
},
{
id: "pip_2",
section: "people",
group: "Pip",
title: "Code name: the Frog",
when: "flag:ally_pip",
text: "Insists on the code name 'the Frog', on the grounds that Admiral is the Admiral. Lost a classmate who made it snow in the refectory. Nobody looks at first-years."
},
{
id: "harrowgate_1",
section: "people",
group: "Lady Harrowgate",
title: "Chair of the Board",
when: "visited:inquiry_begins",
text: "Plum silk, pearls, a single black plume, and a smile like a closed door. Believes every story should have one ending, approved and stamped in triplicate."
},
{
id: "harrowgate_2",
section: "people",
group: "Lady Harrowgate",
title: "Edmund",
when: "flag:harrowgate_heard",
text: "Her younger brother projected a gold lion at ten, and at fifteen followed it into Kensington Gardens with no witness and no safeguards. What came back never knew her name."
},
{
id: "ashby_1",
section: "people",
group: "Thomas Ashby",
title: "Cell nine",
when: "visited:quiet_ward_ashby",
text: "Nineteen. Projected a ship's cat called Biscuit at twelve. The Board cut her out and left a space the exact shape of her. Draws her on the wall, over and over, in burnt match."
},
{
id: "ashby_2",
section: "people",
group: "Thomas Ashby",
title: "Biscuit",
when: "flag:ashby_restored",
text: "Given back, by feel, in a white-tiled room. Ginger, purring like a kettle, and contemptuous of the Board. 'Oh, you idiot. Where have you been?'"
},
{
id: "captain_1",
section: "people",
group: "The Captain",
title: "Grammar Police",
when: ["visited:reason_success", "visited:recruit_captain"],
text: "Captain of the Royal Alphabet's grammar police, by the subordinate clauses on his sleeve. Lends letters in triplicate. Uses no contractions. Considers a postscript to a postscript irregular."
},
{
id: "roger_1",
section: "people",
group: "Roger-and-Molly",
title: "A medium-sized life",
when: "visited:meet_roger",
text: "Not quite Roger, not quite Molly: a clerk's sleeve-garters and a pirate's earring, a face that settles into one and then the other like a spun coin. 'I had a small life, and she had a big dream.'"
},
// ------------------------------------------------------------ Roger Molly's letters
{
id: "letter_1",
section: "letters",
group: "Letters",
title: "I. March, 1803",
when: ["visited:research", "visited:research_alone"],
text: "My dear Agnes - The weather is foul and coal is ninepence. Mr Fotheringay has moved my desk nearer the window, which he says is a kindness and I suspect is a draught. I have taken to drawing a ship in the margin of the day-book when the sums are slow. Nobody has noticed. I find I rather hope somebody will. Your affectionate brother, Roger."
},
{
id: "letter_2",
section: "letters",
group: "Letters",
title: "II. November, 1803",
when: "visited:research_alone",
text: "Agnes - You will laugh. I have acquired an imaginary friend, at the age of thirty-four. She sails the ship in my margins and has very decided opinions about my accounts, most of them unrepeatable. She says I add up other people's money as if I were apologising for it. She is not wrong. R."
},
{
id: "letter_3",
section: "letters",
group: "Letters",
title: "III. April, 1804",
when: "visited:term_restricted",
text: "Dear Agnes - She told me today that I am braver than I look. I said that was not difficult. She said that was exactly her point. I walked home the long way, by the river, and did not once look at my boots. A small thing. You would not believe how large it felt. R."
},
{
id: "letter_4",
section: "letters",
group: "Letters",
title: "IV. January, 1805",
when: "visited:meet_roger",
text: "Agnes - We have been practising. Evenings, and Sundays. Some nights I go too far and wake convinced my name is Captain Something; some nights she goes too quiet and I sit up saying hers until she answers. She is patient, which surprises us both. Miss Hale from the school comes on Thursdays to take notes. R. (and M.)"
},
{
id: "letter_5",
section: "letters",
group: "Letters",
title: "V. Confiscated, 1805",
when: ["visited:archive_success", "visited:archive_alarm"],
text: "[Found in the Board archive, stamped NOT DELIVERED.] Agnes - Miss Hale says we are ready. I am frightened, and happy, and frightened of being happy, which she says is the sanest thing about me. If anyone tells you afterwards that I was lost, do not believe them. I am only going somewhere you cannot post letters to. R. and M."
},
{
id: "letter_6",
section: "letters",
group: "Letters",
title: "VI. Undated",
when: ["visited:bank_planning", "visited:ritual_complete"],
text: "Dear Agnes,\n\nGone plunderin'.\n\nYour loving brother (both of them)."
},
// ------------------------------------------------------------ Board papers
{
id: "paper_circular",
section: "papers",
group: "Papers",
title: "On the Management of Persistent Projections",
when: "item:board_circular",
text: "BOARD CIRCULAR 17/41. Projections exhibiting persistence, opinion or humour beyond the eighteenth day are to be referred for quieting at the establishment in the sub-basement, Board Offices, Whitehall. Parents need not be informed. Signed, H. Harrowgate, Chair."
},
{
id: "paper_vane_file",
section: "papers",
group: "Papers",
title: "Inspector's file: one student",
when: "visited:vane_interview",
text: "SUBJECT: second-year, Ridgewell. RECORD: unremarkable, until recently. NOTES: hears the sea. Lies (well / badly - delete as applicable). RECOMMENDATION: observe. A second hand, smaller, has added in pencil and then rubbed out: 'reminds me of'."
},
{
id: "paper_ward",
section: "papers",
group: "Papers",
title: "Quiet Ward intake card",
when: "visited:quiet_ward_entry",
text: "NAME: ________. PROJECTION: ________. PROCEDURE: quieting (standard). OUTCOME: cooperative. There are forty-one of these cards in the drawer beside the door. Every OUTCOME says the same thing."
},
{
id: "paper_erasure",
section: "papers",
group: "Papers",
title: "Order of Erasure",
when: "visited:inquiry_verdict",
text: "BY ORDER OF THE BOARD. At the autumn equinox, the concept PIRATE shall be struck from the Ledger of the British Dreamspace. Persistent projections dependent on the concept will cease. No further action is anticipated. H.H."
},
{
id: "paper_safeguards",
section: "papers",
group: "Papers",
title: "Eleanor Hale's safeguards",
when: ["visited:grace_warning", "flag:grace_witness"],
text: "One: only when both are certain, not merely eager. Two: a witness who knows your name, and will say it aloud if you begin to forget it. Three: anchors - a street, a door, a stolen thing. The Board burned every copy but this one."
}
];
// ../../../../private/tmp/molly-roger/src/story/player.js
var ADDRESS_OPTIONS = {
lass: { label: "Lass", word: "lass" },
lad: { label: "Lad", word: "lad" },
matey: { label: "Matey", word: "matey" }
};
var PRONOUN_OPTIONS = {
she: {
label: "she / her",
they: "she",
them: "her",
their: "her",
theirs: "hers",
themself: "herself",
they_are: "she is",
they_were: "she was",
they_have: "she has"
},
he: {
label: "he / him",
they: "he",
them: "him",
their: "his",
theirs: "his",
themself: "himself",
they_are: "he is",
they_were: "he was",
they_have: "he has"
},
they: {
label: "they / them",
they: "they",
them: "them",
their: "their",
theirs: "theirs",
themself: "themself",
they_are: "they are",
they_were: "they were",
they_have: "they have"
}
};
var DEFAULT_PLAYER = { name: "Ada", address: "lass", pronouns: "she" };
var NAME_MAX_LENGTH = 24;
var PRONOUN_TOKENS = ["they", "them", "their", "theirs", "themself", "they_are", "they_were", "they_have"];
var TOKENS = ["name", "lass", ...PRONOUN_TOKENS];
// ../../../../private/tmp/molly-roger/src/story/index.js
var START_SCENE = "prologue_exam";
var raw = {
...prologueScenes,
...act1Scenes,
...act2Scenes,
...termScenes,
...inquiryScenes,
...ledgerScenes,
...act3Scenes,
...endingScenes
};
var scenes = Object.fromEntries(
Object.entries(raw).map(([id, scene]) => [id, {
id,
speaker: null,
...scene,
choices: scene.ending ? [{ text: "Play Again", nextScene: START_SCENE, playAgain: true }] : scene.choices || []
}])
);
var endingIds = Object.keys(scenes).filter((id) => scenes[id].ending);
// ../../../../private/tmp/molly-roger/src/engine/conditions.js
var OPS = {
">=": (a, b) => a >= b,
"<=": (a, b) => a <= b,
">": (a, b) => a > b,
"<": (a, b) => a < b,
"==": (a, b) => a === b,
"!=": (a, b) => a !== b
};
var SET_RE = /^(flag|item|visited):([\w-]+)$/;
var NUM_RE = /^(?:rel:(\w+)|count:(\w+)|(self|suspicion|psychic|endings))\s*(>=|<=|==|!=|>|<)\s*(-?\d+)$/;
function parseAtom(raw2) {
let atom = raw2.trim();
let negate = false;
if (atom.startsWith("!")) {
negate = true;
atom = atom.slice(1).trim();
}
let m = atom.match(SET_RE);
if (m) return { negate, kind: m[1], id: m[2] };
m = atom.match(NUM_RE);
if (m) {
if (m[1] && !characterByKey[m[1]]) throw new Error(`Unknown character key "${m[1]}" in "${raw2}"`);
const kind = m[1] ? "rel" : m[2] ? "count" : m[3];
const id = m[1] ? characterByKey[m[1]] : m[2] || null;
return { negate, kind, id, op: m[4], value: Number(m[5]) };
}
throw new Error(`Can't understand condition "${raw2}"`);
}
var parseCondition = (expr) => expr.split("&").map(parseAtom);
function numberFor(atom, state2) {
switch (atom.kind) {
case "rel":
return state2.relationships[atom.id] ?? 0;
case "count":
return state2.counters?.[atom.id] ?? 0;
case "self":
return state2.self;
case "suspicion":
return state2.suspicion;
case "psychic":
return state2.psychicLevel;
case "endings":
return (state2.discoveredEndings || []).length;
}
}
function atomHolds(atom, state2) {
let result;
if (atom.kind === "flag") result = state2.flags.includes(atom.id);
else if (atom.kind === "item") result = state2.items.includes(atom.id);
else if (atom.kind === "visited") result = state2.visited.includes(atom.id);
else result = OPS[atom.op](numberFor(atom, state2), atom.value);
return atom.negate ? !result : result;
}
function evaluate(expr, state2) {
return parseCondition(expr).every((atom) => atomHolds(atom, state2));
}
function describe(atom) {
const sym = { ">=": "at least", "<=": "at most", ">": "above", "<": "below", "==": "exactly", "!=": "not" }[atom.op];
switch (atom.kind) {
case "item":
return atom.negate ? `Without ${items[atom.id]?.name || atom.id}` : `Requires ${items[atom.id]?.name || atom.id}`;
case "rel":
return `${characters[atom.id].relationshipLabel}'s trust ${sym} ${atom.value}`;
case "self":
return `Self ${sym} ${atom.value}`;
case "suspicion":
return `Suspicion ${sym} ${atom.value}`;
case "psychic":
return `Psychic level ${sym} ${atom.value}`;
case "count":
return atom.id === "allies" ? `Needs ${atom.value} allies` : "Not yet";
case "endings":
return `Discover ${atom.value} endings first`;
default:
return atom.negate ? "Not possible right now" : "Something you haven't discovered yet";
}
}
function checkRequirement(expr, state2) {
if (!expr) return { ok: true, hint: "" };
const failing = parseCondition(expr).filter((atom) => !atomHolds(atom, state2));
return { ok: failing.length === 0, hint: [...new Set(failing.map(describe))].join(" \xB7 ") };
}
var IF_BLOCK = /\[\[if ([^\]]+)\]\]((?:(?!\[\[if )[\s\S])*?)\[\[\/if\]\]/;
function renderConditionals(text2, state2) {
let prev;
do {
prev = text2;
text2 = text2.replace(IF_BLOCK, (_, expr, body) => {
const [yes, no = ""] = body.split("[[else]]");
return evaluate(expr, state2) ? yes : no;
});
} while (text2 !== prev);
return text2;
}
// ../../../../private/tmp/molly-roger/src/engine/text.js
function tokenValue(token, player) {
const p = { ...DEFAULT_PLAYER, ...player };
if (token === "name") return p.name || DEFAULT_PLAYER.name;
if (token === "lass") return (ADDRESS_OPTIONS[p.address] || ADDRESS_OPTIONS.lass).word;
const pronouns = PRONOUN_OPTIONS[p.pronouns] || PRONOUN_OPTIONS.they;
return pronouns[token];
}
var capitalise = (s) => s.charAt(0).toUpperCase() + s.slice(1);
function applyTokens(text2, player) {
return text2.replace(/\{(\w+)\}/g, (match, raw2) => {
const token = raw2.charAt(0).toLowerCase() + raw2.slice(1);
if (!TOKENS.includes(token)) return match;
const value = tokenValue(token, player);
return raw2.charAt(0) === raw2.charAt(0).toUpperCase() ? capitalise(value) : value;
});
}
function tidyPunctuation(text2) {
return text2.replace(/([.!?])([A-Za-z])/g, "$1 $2").replace(/([.!?]')([A-Za-z])/g, "$1 $2").replace(/([.!?]"\s*)([A-Za-z])/g, "$1 $2");
}
function typeset(text2) {
return text2.replace(/\.\.\./g, "\u2026").replace(/(^|\n)- /g, "$1\u2013 ").replace(/ - /g, " \u2013 ").replace(/(^|[\s(])'(?=(em|tis|twas|til|cause|n)\b|\d)/g, "$1\u2019").replace(/(^|[\s(\[–—“])'/g, "$1\u2018").replace(/'/g, "\u2019").replace(/(^|[\s(\[–—‘])"/g, "$1\u201C").replace(/"/g, "\u201D");
}
function renderText(raw2, state2) {
let text2 = renderConditionals(raw2, state2);
text2 = applyTokens(text2, state2.player);
text2 = text2.replace(/[ \t]+\n/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
return typeset(tidyPunctuation(text2));
}
// ../../../../private/tmp/molly-roger/src/stage/art/portraits.js
var HEAD = "M72 205 C74 185 70 170 62 158 C50 140 52 100 62 80 C72 58 96 48 116 52 C134 56 144 70 146 88 C147 96 146 100 148 106 L160 123 C161 126 158 128 152 128 C153 132 155 135 154 137 C152 139 151 140 153 142 C154 145 152 148 149 149 C150 155 152 160 146 164 C140 168 130 168 124 170 C120 178 120 190 122 205 Z";
var INK = "#0b0910";
function silhouette({ key, fill = INK, behind = "", bust, front = "", details = "", head: head2 = "", hollow = false }) {
const body = hollow ? `fill="${INK}" fill-opacity="0.25" stroke="currentColor" stroke-width="1.6" stroke-dasharray="5 4"` : `fill="${fill}"`;
return `<svg viewBox="0 0 200 260" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-who="${key}">
<g ${body}>
<g ${head2 ? `transform="${head2}"` : ""}>${behind}</g>
<path d="${bust}"/>
<g ${head2 ? `transform="${head2}"` : ""}><path d="${HEAD}"/>${front}</g>
</g>
<g fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" opacity="0.9">${details}</g>
</svg>`;
}
var molly = silhouette({
key: "molly",
fill: "url(#molly-ghost)",
behind: `
<defs>
<linearGradient id="molly-ghost" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#1b1240"/>
<stop offset="0.7" stop-color="#0d0920"/>
<stop offset="1" stop-color="#0d0920" stop-opacity="0.35"/>
</linearGradient>
</defs>
<path d="M66 74 C42 96 34 140 40 182 C44 212 34 236 26 256 L60 252 C62 222 68 190 72 160 Z"/>
<path d="M58 120 C46 150 50 190 44 222 C52 200 58 170 64 150 Z"/>`,
bust: "M24 260 C28 228 50 208 84 200 L100 230 L118 200 C150 204 172 222 180 260 Z",
front: `
<path d="M30 74 C56 56 90 46 120 46 C148 46 170 54 184 66 C174 74 162 70 150 66
C142 42 120 26 98 28 C78 30 64 44 58 64 C48 66 38 72 30 74 Z"/>
<path d="M84 200 L70 232 L96 226 Z"/><path d="M118 200 L134 232 L110 226 Z"/>`,
details: `
<circle cx="98" cy="134" r="6"/>
<path d="M60 64 C90 52 130 52 152 62" stroke-dasharray="2 4" opacity="0.6"/>
<circle cx="100" cy="40" r="3"/><path d="M95 45 L105 35 M95 35 L105 45" opacity="0.7"/>`
});
var worthington = silhouette({
key: "worthington",
behind: `<path d="M62 84 C50 102 52 134 62 152 C70 142 72 112 70 92 Z"/>`,
bust: "M30 260 C34 228 58 206 94 204 C130 202 162 214 174 260 Z",
front: `
<path d="M100 148 C108 172 124 182 138 172 C132 164 120 160 112 148 Z"/>
<path d="M118 196 L136 214 L118 214 Z"/>
<path d="M124 210 C116 206 112 216 120 218 C112 222 118 230 126 222 C132 230 138 222 130 218 C138 216 134 206 126 210 Z"/>`,
details: `
<ellipse cx="151" cy="104" rx="4" ry="5"/>
<path d="M147 103 L100 96"/>
<path d="M150 109 C152 120 146 130 140 136" opacity="0.6"/>`
});
var grace = silhouette({
key: "grace",
behind: `<circle cx="56" cy="96" r="19"/><path d="M58 72 C68 54 96 44 120 50 C100 50 84 58 74 72 Z"/>`,
bust: "M36 260 C38 232 60 210 94 206 C128 204 158 216 168 260 Z",
front: `
<path d="M118 172 L134 170 L132 208 L114 208 Z"/>
<path d="M60 222 C56 208 70 200 84 206 C76 212 70 220 60 222 Z"/>
<path d="M138 62 C146 60 150 68 144 72 C140 70 138 66 138 62 Z"/>`,
details: `
<circle cx="124" cy="196" r="4"/>
<path d="M120 182 L132 180 M119 190 L131 188" opacity="0.5"/>
<path d="M46 88 C52 82 62 84 64 92" opacity="0.4"/>`
});
var vane = silhouette({
key: "vane",
behind: `<path d="M54 152 C40 122 42 80 60 60 C80 38 122 34 152 50 C164 58 168 70 166 80
C158 82 150 78 142 76 C128 66 104 64 88 72 C76 80 70 100 72 120 C74 136 70 146 66 152 Z"/>`,
bust: "M30 260 C32 230 56 208 92 204 C128 202 158 214 170 260 Z",
front: `
<path d="M152 50 C168 56 176 70 172 84 C166 82 160 80 156 76 Z"/>
<path d="M120 192 L138 198 L134 214 L118 210 Z"/>`,
details: `
<circle cx="149" cy="104" r="6"/>
<path d="M143 103 L104 96"/>
<path d="M108 150 L122 176 M122 176 C114 176 112 186 120 184 M122 176 C130 176 132 186 124 184" opacity="0.8"/>
<circle cx="150" cy="224" r="1.6" fill="currentColor"/><circle cx="154" cy="238" r="1.6" fill="currentColor"/><circle cx="158" cy="252" r="1.6" fill="currentColor"/>`
});
var pip = silhouette({
key: "pip",
head: "translate(26 40) scale(0.82)",
bust: "M46 260 C48 238 66 222 96 218 C126 216 150 226 158 260 Z",
front: `<path d="M56 74 C66 50 110 42 140 54 C152 58 162 66 176 70 C166 76 150 74 136 72 C112 64 86 68 64 82 Z"/>`,
details: `
<path d="M120 222 C120 210 132 204 142 210 C150 204 160 212 154 222 Z" fill="currentColor" opacity="0.85"/>
<circle cx="138" cy="209" r="2.2" fill="#0b0910"/><circle cx="150" cy="211" r="2.2" fill="#0b0910"/>`
});
var harrowgate = silhouette({
key: "harrowgate",
behind: `<path d="M56 124 C34 92 42 38 80 18 C110 2 152 12 162 44 C152 48 142 52 136 60 C120 50 96 52 82 64 C70 78 64 100 66 124 Z"/>
<path d="M104 22 C98 -2 124 -24 158 -28 C136 -12 122 4 112 24 Z"/>`,
bust: "M28 260 C30 228 54 206 92 202 C130 200 162 214 176 260 Z",
front: `<path d="M110 194 C124 182 146 186 146 202 C158 206 156 222 140 222 L112 214 Z"/>`,
details: `
<circle cx="128" cy="184" r="2.2"/><circle cx="134" cy="188" r="2.2"/><circle cx="139" cy="193" r="2.2"/>
<circle cx="157" cy="102" r="5.5"/><path d="M157 108 L162 132"/>`
});
var ashby = silhouette({
key: "ashby",
hollow: true,
behind: `<path d="M66 70 C78 52 104 46 124 52 C112 54 98 58 88 66 Z"/>`,
bust: "M34 260 C36 232 58 210 92 206 C126 204 156 216 168 260 Z",
details: `<path d="M86 120 C96 112 108 112 116 120" opacity="0.4"/>`
});
var roger = silhouette({
key: "roger",
fill: "url(#roger-blend)",
behind: `<defs><linearGradient id="roger-blend" x1="0" y1="0" x2="1" y2="0">
<stop offset="0" stop-color="#1b1240"/><stop offset="1" stop-color="#1a130c"/></linearGradient></defs>
<path d="M64 120 C52 140 50 170 44 196 C56 180 62 160 68 140 Z"/>`,
bust: "M30 260 C34 228 58 206 94 204 C130 202 162 214 174 260 Z",
front: `<path d="M60 72 C62 46 88 32 112 34 C134 36 146 50 148 66 C158 68 166 72 168 76 C140 80 90 80 52 76 Z"/>
<path d="M118 196 L136 214 L118 214 Z"/>`,
details: `
<circle cx="98" cy="134" r="6"/>
<path d="M70 66 C64 50 74 36 90 30" stroke-width="2.4"/>
<path d="M112 66 L150 66" opacity="0.6"/>`
});
var captain = silhouette({
key: "captain",
bust: "M28 260 C30 226 56 204 94 202 C132 200 164 214 176 260 Z",
front: `<path d="M56 80 C54 50 80 16 106 12 C134 10 152 38 152 70 C158 74 162 78 160 82 C130 86 90 86 50 84 Z"/>
<path d="M116 192 L140 196 L138 214 L114 210 Z"/>`,
details: `
<text x="98" y="58" font-family="Geist Variable, Inter Variable, sans-serif" font-size="20" fill="currentColor" stroke="none">\xA7</text>
<path d="M128 84 C134 110 140 130 146 150" opacity="0.8"/>
<circle cx="150" cy="226" r="1.6" fill="currentColor"/><circle cx="154" cy="240" r="1.6" fill="currentColor"/>`
});
var portraits = {
"Molly Roger": molly,
"Professor Worthington": worthington,
"Grace": grace,
"Inspector Vane": vane,
"Pip": pip,
"Lady Harrowgate": harrowgate,
"Thomas Ashby": ashby,
"Roger-and-Molly": roger,
"The Captain": captain
};
var castDefaults = {
"Molly Roger": { mood: "pleased", projection: true },
"Professor Worthington": { mood: "stern" },
"Grace": { mood: "thoughtful" },
"Inspector Vane": { mood: "stern" },
"Pip": { mood: "pleased" },
"Lady Harrowgate": { mood: "stern" },
"Thomas Ashby": { mood: "sad" },
"Roger-and-Molly": { mood: "thoughtful", projection: true },
"The Captain": { mood: "stern" }
};
// ../../../../private/tmp/molly-roger/src/stage/art/endingCards.js
var GOLD = "#c9a227";
var INK2 = "#1a130c";
function frame(id, { bg, numeral, title, motif, accent }) {
return `<svg class="tarot" viewBox="0 0 200 340" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="${title}">
<defs>
<linearGradient id="${id}-face" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#f4ead0"/><stop offset="1" stop-color="#e2d2a8"/>
</linearGradient>
<linearGradient id="${id}-scene" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="${bg[0]}"/><stop offset="1" stop-color="${bg[1]}"/>
</linearGradient>
<clipPath id="${id}-clip"><rect x="22" y="44" width="156" height="226" rx="2"/></clipPath>
</defs>
<rect x="1" y="1" width="198" height="338" rx="10" fill="url(#${id}-face)" stroke="${INK2}" stroke-width="2"/>
<rect x="10" y="10" width="180" height="320" rx="6" fill="none" stroke="${GOLD}" stroke-width="1.5"/>
<rect x="14" y="14" width="172" height="312" rx="4" fill="none" stroke="${GOLD}" stroke-width="0.6"/>
${[[14, 14], [186, 14], [14, 326], [186, 326]].map(([x, y]) => `<path d="M${x} ${y - 5} L${x + 5} ${y} L${x} ${y + 5} L${x - 5} ${y} Z" fill="${GOLD}"/>`).join("")}
<text x="100" y="34" text-anchor="middle" font-family="Geist Variable, Inter Variable, sans-serif" font-size="15" fill="${INK2}">${numeral}</text>
<rect x="22" y="44" width="156" height="226" rx="2" fill="url(#${id}-scene)"/>
<g clip-path="url(#${id}-clip)">${motif}</g>
<rect x="22" y="44" width="156" height="226" rx="2" fill="none" stroke="${INK2}" stroke-width="1.2"/>
<path d="M18 284 H182 L176 296 L182 308 H18 L24 296 Z" fill="${accent}" stroke="${INK2}" stroke-width="1"/>
<text x="100" y="301" text-anchor="middle" font-family="Geist Variable, Inter Variable, sans-serif" font-size="${title.length > 16 ? 12 : 14}" fill="#f6ecd2">${title}</text>
</svg>`;
}
var head = (x, y, s, fill, flip = false, op = 1) => `<g transform="translate(${x} ${y}) scale(${flip ? -s : s} ${s})" opacity="${op}"><path d="${HEAD}" fill="${fill}"/></g>`;
var stars = (n, seed, color = "#efe8ff") => {
let s = seed, out = "";
for (let i = 0; i < n; i++) {
s = (s * 9301 + 49297) % 233280;
const x = 24 + s / 233280 * 152;
s = (s * 9301 + 49297) % 233280;
const y = 48 + s / 233280 * 120;
out += `<circle cx="${x.toFixed(1)}" cy="${y.toFixed(1)}" r="${(0.5 + i % 3 * 0.4).toFixed(1)}" fill="${color}" opacity="0.8"/>`;
}
return out;
};
var MOTIFS = {
pirate_life: {
bg: ["#2a1d5c", "#0d0826"],
accent: "#5b3fd9",
// Two profiles nose to nose - the space between them makes a third shape.
motif: stars(24, 7) + head(-8, 70, 0.62, "#c9b8ff", false, 0.85) + head(208, 70, 0.62, "#ffe6c0", true, 0.85) + `<circle cx="100" cy="128" r="30" fill="#fff6d8" opacity="0.25"/><path d="M22 238 Q60 226 100 238 T178 238 V270 H22 Z" fill="#120a30"/><path d="M84 236 L118 236 L112 246 L90 246 Z M100 236 V200 M100 204 Q114 214 100 226" fill="#0b0716" stroke="#0b0716" stroke-width="2"/>`
},
peaceful_merger: {
bg: ["#f2c58a", "#3a2a6a"],
accent: "#8a6dff",
motif: `<circle cx="100" cy="100" r="28" fill="#fff2cf" opacity="0.9"/><path d="M30 270 C40 220 80 210 92 180 C96 168 100 160 100 150" stroke="#3fd6ff" stroke-width="9" fill="none" opacity="0.8"/><path d="M170 270 C160 220 120 210 108 180 C104 168 100 160 100 150" stroke="#c9a227" stroke-width="9" fill="none" opacity="0.8"/><path d="M100 150 C100 130 100 110 100 100" stroke="#efe6ff" stroke-width="12" fill="none" opacity="0.85"/>`
},
approved_psychic: {
bg: ["#3a2c1a", "#120d08"],
accent: "#8a6a12",
motif: `<path d="M50 250 V120 Q100 50 150 120 V250" fill="none" stroke="${GOLD}" stroke-width="2"/>` + [62, 76, 90, 100, 110, 124, 138].map((x) => `<line x1="${x}" y1="${x === 100 ? 82 : 100}" x2="${x}" y2="250" stroke="${GOLD}" stroke-width="1.6"/>`).join("") + `<line x1="44" y1="250" x2="156" y2="250" stroke="${GOLD}" stroke-width="4"/><circle cx="100" cy="74" r="5" fill="none" stroke="${GOLD}" stroke-width="2"/><path d="M100 160 L124 172 L100 184 L76 172 Z M76 172 V198 L100 210 L124 198 V172 M100 184 V210" fill="rgba(240,220,160,0.15)" stroke="#f2e0a8" stroke-width="1.5"/>`
},
teacher_ending: {
bg: ["#1d2a24", "#0d1410"],
accent: "#2f6b4f",
motif: `<rect x="34" y="70" width="132" height="90" fill="#22302a" stroke="#4a3420" stroke-width="5"/><path d="M70 128 C84 112 116 112 130 128 L118 134 L82 134 Z" fill="none" stroke="#efe6d6" stroke-width="1.5" opacity="0.8"/><text x="100" y="100" text-anchor="middle" font-family="Georgia, serif" font-size="12" fill="#efe6d6" opacity="0.7">Lesson the First</text><path d="M140 250 C150 210 160 190 176 178 C160 200 152 226 146 252 Z" fill="#efe6d6"/><rect x="60" y="200" width="80" height="50" fill="#120c07"/><rect x="54" y="194" width="92" height="8" fill="#2a1d12"/>`
},
friends_ending: {
bg: ["#a7743f", "#2a1d5c"],
accent: "#1f7fb0",
motif: `<path d="M22 230 Q100 120 178 230 V270 H162 V236 Q100 150 38 236 V270 H22 Z" fill="#120c14"/><g fill="#120c14"><path d="M78 176 l-4 0 l1 -20 q-6 -2 -4 -10 q2 -8 9 -6 q7 2 5 10 q-1 6 -5 6 l1 20 Z"/><path d="M122 176 l4 0 l-1 -20 q6 -2 4 -10 q-2 -8 -9 -6 q-7 2 -5 10 q1 6 5 6 l-1 20 Z"/></g><line x1="86" y1="160" x2="114" y2="160" stroke="#f6ecd2" stroke-width="2"/>` + stars(10, 3)
},
informant: {
bg: ["#2a2016", "#0b0805"],
accent: "#6a4a2a",
motif: `<path d="M30 200 L100 214 L170 200 L170 248 L100 262 L30 248 Z" fill="#efe6cf"/><path d="M100 214 V262" stroke="#8a7a5a" stroke-width="1.2"/>` + [0, 1, 2, 3].map((i) => `<line x1="42" y1="${212 + i * 9}" x2="92" y2="${220 + i * 9}" stroke="#5a4a3a" stroke-width="0.8"/>`).join("") + `<path d="M120 196 C130 140 150 110 172 90 C156 130 140 166 126 200 Z" fill="#efe6cf"/><path d="M60 100 q8 18 0 26 q-8 -8 0 -26 Z" fill="#8fbfe0" opacity="0.8"/>` + head(-10, 70, 0.55, "#0b0805", false, 0.6)
},
silenced: {
bg: ["#3b4250", "#14161c"],
accent: "#4a4f5c",
motif: `<ellipse cx="100" cy="170" rx="56" ry="20" fill="none" stroke="#9aa3ad" stroke-width="10"/><ellipse cx="100" cy="170" rx="56" ry="20" fill="none" stroke="#2a2e36" stroke-width="2" stroke-dasharray="3 7"/><rect x="86" y="182" width="28" height="24" rx="3" fill="#9aa3ad"/><path d="M92 182 V174 Q100 162 108 174 V182" fill="none" stroke="#9aa3ad" stroke-width="4"/><circle cx="100" cy="194" r="3" fill="#14161c"/><path d="M150 90 q10 -4 14 4 M156 104 q10 -2 12 6" stroke="#c9b8ff" stroke-width="1.4" fill="none" opacity="0.45"/>`
},
ritual_consumed: {
bg: ["#2a0f2a", "#08040c"],
accent: "#7a1f3a",
motif: `<path d="M64 110 Q100 70 136 110 Q144 170 100 220 Q56 170 64 110 Z" fill="#e8dcf4" opacity="0.92"/><ellipse cx="84" cy="130" rx="11" ry="8" fill="#08040c"/><ellipse cx="116" cy="130" rx="11" ry="8" fill="#08040c"/><path d="M88 176 Q100 168 112 176" stroke="#08040c" stroke-width="3" fill="none"/><path d="M100 76 L94 104 L104 120 L96 150" stroke="#08040c" stroke-width="1.6" fill="none"/>` + head(36, 50, 0.7, "#8a6dff", false, 0.25)
},
three_day_weekend: {
bg: ["#f0c070", "#6a3a7a"],
accent: "#a0522d",
motif: `<rect x="56" y="80" width="88" height="110" rx="4" fill="#f6ecd2" stroke="${INK2}" stroke-width="1.5"/><rect x="56" y="80" width="88" height="24" rx="4" fill="#9a1f24"/><text x="100" y="98" text-anchor="middle" font-family="Geist Variable, Inter Variable, sans-serif" font-size="13" fill="#f6ecd2">MONDAY</text><text x="100" y="160" text-anchor="middle" font-family="Geist Variable, Inter Variable, sans-serif" font-size="46" fill="${INK2}" opacity="0.25">?</text><path d="M56 190 L68 176 L80 192 L92 178 L104 194 L116 180 L128 194 L144 180 V190 Z" fill="#6a3a7a"/><path d="M62 70 C80 58 120 58 138 70 C128 74 118 72 110 70 C104 56 96 56 90 70 C82 72 72 74 62 70 Z" fill="${INK2}"/><path d="M40 240 Q100 220 160 240" stroke="#f6ecd2" stroke-width="3" fill="none" opacity="0.7"/>`
},
vane_unbound: {
bg: ["#9fc6e8", "#e8d6b0"],
accent: "#9a1f24",
motif: `<path d="M120 70 L146 100 L120 140 L94 100 Z" fill="#c0393f" stroke="${INK2}" stroke-width="1.2"/><path d="M120 70 V140 M94 100 H146" stroke="${INK2}" stroke-width="1" opacity="0.6"/><path d="M120 140 C110 170 130 190 112 214 C100 230 92 236 80 248" stroke="${INK2}" stroke-width="1.2" fill="none"/>` + [0, 1, 2].map((i) => `<path d="M${116 - i * 10} ${160 + i * 26} l8 -4 l-2 8 Z" fill="#c0393f"/>`).join("") + `<path d="M40 262 L80 248 L120 262 L120 270 L40 270 Z" fill="#efe6cf" stroke="${INK2}" stroke-width="1"/>`
},
lending_library: {
bg: ["#2a1d5c", "#120c30"],
accent: "#2f6b4f",
motif: `<path d="M50 250 V110 Q100 60 150 110 V250 Z" fill="#ffd98a" opacity="0.85"/><path d="M58 250 V114 Q100 72 142 114 V250 Z" fill="none" stroke="${INK2}" stroke-width="2"/>` + [0, 1, 2].map((r) => [0, 1, 2, 3, 4, 5].map((c) => `<rect x="${64 + c * 12}" y="${150 + r * 32}" width="9" height="24" fill="${["#3b2a20", "#2a3328", "#41241f", "#2c2a3d"][(r + c) % 4]}"/>`).join("")).join("") + `<path d="M100 130 C110 122 122 128 118 138 C126 140 124 150 116 150 L100 146 Z" fill="#8a6dff" opacity="0.8"/>`
},
ledger_burned: {
bg: ["#3a1408", "#0b0503"],
accent: "#c0571f",
motif: `<path d="M44 220 C70 206 92 210 100 222 C108 210 130 206 156 220 L156 250 C130 238 108 240 100 252 C92 240 70 238 44 250 Z" fill="#efe6cf"/><path d="M64 214 C60 180 84 170 78 140 C96 156 98 176 100 190 C104 168 114 150 112 120 C134 146 138 180 132 214 Z" fill="#f2a03a" opacity="0.9"/><path d="M80 214 C78 192 92 186 90 168 C100 180 104 196 104 206 C110 192 116 184 116 170 C126 188 124 204 118 214 Z" fill="#ffe6a8"/>` + [0, 1, 2, 3, 4].map((i) => `<circle cx="${70 + i * 15}" cy="${100 - i % 2 * 20}" r="1.6" fill="#ffd59a"/>`).join("")
},
exposed: {
bg: ["#d8cfbd", "#9a8f7a"],
accent: "#2a2a2a",
motif: `<rect x="40" y="70" width="120" height="170" fill="#f4eee0" stroke="${INK2}" stroke-width="1.2" transform="rotate(-4 100 155)"/><g transform="rotate(-4 100 155)"><text x="100" y="94" text-anchor="middle" font-family="Geist Variable, Inter Variable, sans-serif" font-size="14" fill="${INK2}">THE TIMES</text><line x1="48" y1="100" x2="152" y2="100" stroke="${INK2}"/><text x="100" y="120" text-anchor="middle" font-family="Geist Variable, Inter Variable, sans-serif" font-size="11" fill="${INK2}">THE BOARD'S</text><text x="100" y="134" text-anchor="middle" font-family="Geist Variable, Inter Variable, sans-serif" font-size="11" fill="${INK2}">SECRET WARD</text>` + [0, 1, 2, 3, 4, 5, 6].map((i) => `<line x1="50" y1="${150 + i * 10}" x2="${i % 3 === 2 ? 110 : 150}" y2="${150 + i * 10}" stroke="${INK2}" stroke-width="0.8" opacity="0.5"/>`).join("") + `</g>`
},
hollow: {
bg: ["#c9d3cc", "#5f6f68"],
accent: "#4a5752",
motif: head(20, 46, 0.9, "none", false, 1).replace('fill="none"', 'fill="none" stroke="#1c2421" stroke-width="2.5" stroke-dasharray="6 5"') + `<rect x="22" y="232" width="156" height="38" fill="#4a5752"/>` + [0, 1, 2, 3, 4, 5, 6].map((i) => `<line x1="${34 + i * 22}" y1="44" x2="${34 + i * 22}" y2="232" stroke="#2e3834" stroke-width="2" opacity="0.35"/>`).join("")
},
pips_teacher: {
bg: ["#1d2a24", "#0d1410"],
accent: "#3a8a4a",
motif: `<rect x="34" y="66" width="132" height="84" fill="#22302a" stroke="#4a3420" stroke-width="5"/><text x="100" y="98" text-anchor="middle" font-family="Georgia, serif" font-size="11" fill="#efe6d6" opacity="0.8">Not a cube.</text><path d="M84 128 C84 116 96 110 106 116 C114 110 124 118 118 128 Z" fill="#7bd389" opacity="0.8"/><path d="M70 250 C70 226 82 214 100 214 C118 214 130 226 130 250 Z" fill="#0b0910"/><circle cx="100" cy="196" r="16" fill="#0b0910"/><path d="M84 188 C90 176 112 174 120 184 C124 186 128 188 132 190 C118 192 100 190 84 192 Z" fill="#0b0910"/><path d="M110 212 C110 204 118 200 124 204 C130 200 136 206 132 212 Z" fill="#7bd389"/>`
},
brass_bird: {
bg: ["#3a2c1a", "#120d08"],
accent: "#8a6a12",
motif: `<circle cx="100" cy="140" r="54" fill="#ffd98a" opacity="0.15"/><path d="M100 150 C84 150 74 140 72 128 C86 132 92 130 100 120 C108 130 114 132 128 128 C126 140 116 150 100 150 Z" fill="#c9a227"/><path d="M72 128 C54 108 40 92 30 70 C52 80 66 96 82 120 Z" fill="#e7c46a"/><path d="M128 128 C146 108 160 92 170 70 C148 80 134 96 118 120 Z" fill="#e7c46a"/><circle cx="100" cy="114" r="10" fill="#c9a227"/><path d="M108 114 L118 116 L108 118 Z" fill="#8a6a12"/><circle cx="103" cy="112" r="1.6" fill="${INK2}"/><path d="M96 150 L92 168 M104 150 L108 168" stroke="#8a6a12" stroke-width="2"/>` + [0, 1, 2].map((i) => `<path d="M${46 + i * 8} ${96 + i * 6} l18 4" stroke="#8a6a12" stroke-width="1"/>`).join("")
}
};
MOTIFS.true_ending = {
bg: ["#1c1440", "#05030f"],
accent: "#c9a227",
motif: stars(30, 11, "#ffe6c0") + `<path d="M100 170 C80 156 50 154 30 162 L30 238 C50 230 80 232 100 246 Z" fill="#efe6cf"/><path d="M100 170 C120 156 150 154 170 162 L170 238 C150 230 120 232 100 246 Z" fill="#e6dcc0"/><line x1="100" y1="170" x2="100" y2="246" stroke="#8a7a5a" stroke-width="1.2"/>` + [[60, 120, 0.9], [96, 92, 1], [132, 116, 0.85], [78, 66, 0.7], [122, 60, 0.75], [100, 132, 0.95]].map(([x, y, s]) => `<g transform="translate(${x} ${y}) scale(${s})"><path d="M-12 6 L12 6 L8 12 L-8 12 Z M0 6 V-12 M0 -11 Q9 -4 0 3" fill="#c9a227" stroke="#c9a227" stroke-width="1.4"/></g>`).join("") + head(18, 186, 0.32, "#c9b8ff", false, 0.7) + head(182, 186, 0.32, "#ffe6c0", true, 0.7)
};
var ROMAN = ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", "XIII", "XIV", "XV", "XVI", "XVII", "XVIII", "XIX", "XX"];
function endingCard(endingId, index, title) {
const m = MOTIFS[endingId] || { bg: ["#2a2016", "#0b0805"], accent: "#5a4a3a", motif: "" };
return frame(`card-${endingId}`, { ...m, numeral: ROMAN[index] || "", title });
}
function cardBack(index) {
const id = `cardback-${index}`;
return `<svg class="tarot" viewBox="0 0 200 340" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Undiscovered ending">
<defs>
<pattern id="${id}-p" width="20" height="20" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
<rect width="20" height="20" fill="#1c1440"/><path d="M0 10 H20 M10 0 V20" stroke="#2b2068" stroke-width="1"/>
</pattern>
</defs>
<rect x="1" y="1" width="198" height="338" rx="10" fill="url(#${id}-p)" stroke="#0b0716" stroke-width="2"/>
<rect x="10" y="10" width="180" height="320" rx="6" fill="none" stroke="${GOLD}" stroke-width="1.5" opacity="0.8"/>
<circle cx="100" cy="170" r="46" fill="#120c30" stroke="${GOLD}" stroke-width="1.5"/>
<path d="M64 170 Q100 136 136 170 Q100 204 64 170 Z" fill="none" stroke="${GOLD}" stroke-width="1.5"/>
<circle cx="100" cy="170" r="12" fill="${GOLD}" opacity="0.85"/><circle cx="100" cy="170" r="5" fill="#120c30"/>
<text x="100" y="40" text-anchor="middle" font-family="Geist Variable, Inter Variable, sans-serif" font-size="15" fill="${GOLD}">${ROMAN[index] || ""}</text>
<text x="100" y="304" text-anchor="middle" font-family="Geist Variable, Inter Variable, sans-serif" font-size="14" fill="${GOLD}" opacity="0.8">Unwritten</text>
</svg>`;
}
// ../../../../private/tmp/molly-roger/src/ui/panels.js
function openGallery(state2) {
const found = new Set(state2.discoveredEndings);
els.gallerySubtitle.textContent = `${found.size} of ${endingIds.length} discovered`;
els.galleryGrid.innerHTML = endingIds.map((id, i) => {
const scene = scenes[id];
return found.has(id) ? `<figure class="gallery-card found">${endingCard(id, i, scene.endingTitle)}
<figcaption class="gallery-name">${escapeHtml(scene.endingTitle)}</figcaption></figure>` : `<figure class="gallery-card">${cardBack(i)}
<figcaption class="gallery-hint">${escapeHtml(scene.hint || "Not yet written.")}</figcaption></figure>`;
}).join("");
openOverlay(els.galleryOverlay);
}
function renderPills(container, name, options, selected) {
container.innerHTML = Object.entries(options).map(([value, label]) => `
<label class="pill">
<input type="radio" name="${name}" value="${value}" ${value === selected ? "checked" : ""}>
<span>${escapeHtml(label)}</span>
</label>`).join("");
}
var selectedValue = (container, name) => container.querySelector(`input[name="${name}"]:checked`)?.value;
function confirmDialog(message, okLabel = "OK") {
return new Promise((resolve) => {
let answer = false;
els.confirmMessage.textContent = message;
els.confirmOk.textContent = okLabel;
els.confirmOk.onclick = () => {
answer = true;
closeOverlay(els.confirmOverlay);
};
openOverlay(els.confirmOverlay, { onClose: () => resolve(answer) });
els.confirmCancel.focus();
});
}
function askForPlayer(current2 = DEFAULT_PLAYER, { mandatory = false, submitLabel = "Sign the register" } = {}) {
return new Promise((resolve) => {
let result = null;
const overlay = els.setupOverlay;
overlay.toggleAttribute("data-locked", mandatory);
els.setupCancel.hidden = mandatory;
overlay.querySelector("#setup-submit").textContent = submitLabel;
els.setupName.maxLength = NAME_MAX_LENGTH;
els.setupName.value = current2.name || "";
els.setupName.placeholder = DEFAULT_PLAYER.name;
renderPills(
els.setupAddress,
"address",
Object.fromEntries(Object.entries(ADDRESS_OPTIONS).map(([k, v]) => [k, v.label])),
current2.address
);
renderPills(
els.setupPronouns,
"pronouns",
Object.fromEntries(Object.entries(PRONOUN_OPTIONS).map(([k, v]) => [k, v.label])),
current2.pronouns
);
const read = () => ({
name: els.setupName.value.trim().slice(0, NAME_MAX_LENGTH) || DEFAULT_PLAYER.name,
address: selectedValue(els.setupAddress, "address") || DEFAULT_PLAYER.address,
pronouns: selectedValue(els.setupPronouns, "pronouns") || DEFAULT_PLAYER.pronouns
});
const preview = () => {
els.setupPreview.textContent = applyTokens(
"Molly: 'I be Molly Roger, {lass}!' \xB7 Vane's ledger: '{Name}. {They_are} one to watch.'",
read()
);
};
preview();
els.setupForm.oninput = preview;
els.setupForm.onsubmit = (e) => {
e.preventDefault();
result = read();
overlay.removeAttribute("data-locked");
closeOverlay(overlay);
};
openOverlay(overlay, { onClose: () => resolve(result) });
els.setupName.focus();
els.setupName.select();
});
}
function wireSettings({ onEditPlayer }) {
const s = getSettings();
renderPills(
els.settingsSpeed,
"speed",
Object.fromEntries(Object.entries(TEXT_SPEEDS).map(([k, v]) => [k, v.label])),
s.textSpeed
);
renderPills(els.settingsTheme, "theme", THEMES, s.theme);
els.settingsChanges.checked = s.showChanges;
els.settingsSetPieces.checked = s.setPieces;
els.settingsGentle.checked = s.gentle;
els.settingsSound.checked = s.sound;
els.settingsVolume.value = s.volume;
els.settingsSpeed.addEventListener("change", () => updateSettings({ textSpeed: selectedValue(els.settingsSpeed, "speed") }));
els.settingsTheme.addEventListener("change", () => updateSettings({ theme: selectedValue(els.settingsTheme, "theme") }));
els.settingsChanges.addEventListener("change", () => updateSettings({ showChanges: els.settingsChanges.checked }));
els.settingsSetPieces.addEventListener("change", () => updateSettings({ setPieces: els.settingsSetPieces.checked }));
els.settingsGentle.addEventListener("change", () => updateSettings({ gentle: els.settingsGentle.checked }));
els.settingsSound.addEventListener("change", () => updateSettings({ sound: els.settingsSound.checked }));
els.settingsVolume.addEventListener("input", () => updateSettings({ volume: Number(els.settingsVolume.value) }));
els.settingsEditPlayer.addEventListener("click", onEditPlayer);
els.settingsLink.addEventListener("click", () => openOverlay(els.settingsOverlay));
}
function openSatchel(state2) {
const carried = state2.items.map((id) => items[id]).filter(Boolean);
const notes = state2.flags.map((id) => flags[id]?.note).filter(Boolean);
const total = Object.keys(items).length;
els.satchelBody.innerHTML = `
<h2 class="satchel-heading">Carried <span>${carried.length} of ${total} found</span></h2>
${carried.length ? `<ul class="satchel-list">${carried.map((item) => `
<li class="satchel-item">
<i class="fas ${item.icon}"></i>
<div>
<div class="satchel-name">${escapeHtml(item.name)}</div>
<div class="satchel-desc">${escapeHtml(typeset(item.description))}</div>
</div>
</li>`).join("")}</ul>` : '<p class="journey-empty">Nothing yet. Keep your eyes open.</p>'}
<h2 class="satchel-heading">What you know</h2>
${notes.length ? `<ul class="satchel-notes">${notes.map((n) => `<li>${escapeHtml(typeset(n))}</li>`).join("")}</ul>` : '<p class="journey-empty">You know very little, so far.</p>'}`;
openOverlay(els.satchelOverlay);
}
var codexTab = "people";
function openCodex(state2) {
const unlocked = new Set(state2.codex);
els.codexSubtitle.textContent = `${unlocked.size} of ${codex.length} entries found - kept across every playthrough`;
els.codexTabs.innerHTML = Object.entries(CODEX_SECTIONS).map(([id, label]) => {
const all = codex.filter((e) => e.section === id);
const found = all.filter((e) => unlocked.has(e.id)).length;
return `<button type="button" role="tab" class="codex-tab${id === codexTab ? " active" : ""}" data-tab="${id}" aria-selected="${id === codexTab}">
${escapeHtml(label)} <span>${found}/${all.length}</span></button>`;
}).join("");
els.codexTabs.querySelectorAll("button").forEach((b) => b.addEventListener("click", () => {
codexTab = b.dataset.tab;
openCodex(state2);
}));
const groups = /* @__PURE__ */ new Map();
for (const e of codex.filter((e2) => e2.section === codexTab)) {
if (!groups.has(e.group)) groups.set(e.group, []);
groups.get(e.group).push(e);
}
els.codexBody.innerHTML = [...groups.entries()].map(([group, entries]) => {
const any = entries.some((e) => unlocked.has(e.id));
const heading = codexTab === "people" ? `<h2 class="codex-group">${any ? escapeHtml(group) : "Someone you haven't met"}</h2>` : "";
return `<section class="codex-section">${heading}${entries.map((e) => unlocked.has(e.id) ? `<article class="codex-entry"><h3>${escapeHtml(e.title)}</h3><p>${escapeHtml(typeset(e.text)).replace(/\n/g, "<br>")}</p></article>` : `<article class="codex-entry locked"><h3>Not yet discovered</h3></article>`).join("")}</section>`;
}).join("");
if (!els.codexOverlay.classList.contains("open")) openOverlay(els.codexOverlay);
}
// ../../../../private/tmp/molly-roger/src/engine/dialogue.js
var PLAYER = "you";
var NARRATION = "none";
var TAG = /^@([a-z]+):\s*/;
var ALIASES = Object.entries(characters).flatMap(([name, c]) => (c.aliases || [name]).map((alias) => [alias, name])).sort((a, b) => b[0].length - a[0].length);
var PLAYER_VERB = /\byou (?:say|said|ask|asked|tell|told|whisper|whispered|reply|replied|answer|answered|admit|admitted|manage|managed|murmur|murmured|shout|shouted|call|called|hear yourself say|begin|began|insist|insisted|offer|offered|snap|snapped|mutter|muttered)\b/i;
function quoteRuns(paragraph) {
const runs = [];
let i = 0;
let buf = "";
let inQuote = false;
const flush = (quoted) => {
if (buf) runs.push({ quoted, text: buf });
buf = "";
};
while (i < paragraph.length) {
const ch = paragraph[i];
if (!inQuote && ch === "\u2018") {
flush(false);
inQuote = true;
buf = ch;
} else if (inQuote && ch === "\u2019" && isClosing(paragraph, i)) {
buf += ch;
flush(true);
inQuote = false;
} else {
buf += ch;
}
i++;
}
flush(inQuote);
return runs;
}
function isClosing(s, i) {
const before = s[i - 1] || "";
const after = s[i + 1] || "";
if (!after || /[\s]/.test(after) && /[.,!?;:…–—)]/.test(before)) return true;
if (/[.,!?;:…–—)]/.test(after)) return !/[a-z]/i.test(after);
return false;
}
var isSpoken = (runs) => runs.some((r) => r.quoted && r.text.replace(/[‘’]/g, "").trim().length >= 12);
function speakerIn(narration) {
let best = null;
for (const [alias, name] of ALIASES) {
const m = new RegExp(`\\b${alias.replace(/[-]/g, "\\-")}\\b`).exec(narration);
if (m && (!best || m.index < best.index)) best = { index: m.index, name };
}
const you = PLAYER_VERB.exec(narration);
if (you && (!best || you.index < best.index)) best = { index: you.index, name: PLAYER };
return best?.name || null;
}
function splitLines(text2, sceneSpeaker = null) {
let previous = null;
let lastNamed = null;
return text2.split(/\n{2,}/).map((raw2) => {
let paragraph = raw2;
let tagged;
const tag = TAG.exec(paragraph);
if (tag) {
paragraph = paragraph.slice(tag[0].length);
tagged = tag[1] === NARRATION ? null : tag[1] === PLAYER ? PLAYER : characterByKey[tag[1]] || null;
}
const runs = quoteRuns(paragraph);
let speaker;
if (tag) {
speaker = tagged;
} else if (!isSpoken(runs)) {
speaker = null;
} else {
const narration = runs.filter((r) => !r.quoted).map((r) => r.text).join(" ");
speaker = speakerIn(narration) || previous || lastNamed || sceneSpeaker || null;
}
const named = speaker ? null : speakerIn(paragraph);
lastNamed = named === PLAYER ? null : named;
previous = speaker;
return { text: paragraph, speaker };
});
}
var stripTags = (text2) => text2.replace(/(^|\n\n)@[a-z]+:\s*/g, "$1");
// ../../../../private/tmp/molly-roger/src/ui/typewriter.js
var DEFAULT_SPEED_MS = 20;
var reducedMotion = window.matchMedia?.("(prefers-reduced-motion: reduce)");
var timer = null;
var finishNow = null;
function cancelTyping() {
if (timer) clearInterval(timer);
timer = null;
finishNow = null;
}
function buildParagraphs(lines) {
if (typeof lines === "string") lines = lines.split(/\n{2,}/).map((text2) => ({ text: text2, speaker: null }));
let previousLabel = null;
return lines.map(({ text: text2, speaker }) => {
const p = document.createElement("p");
const segments = [];
if (speaker) {
p.className = "line" + (speaker.player ? " line-player" : "");
p.style.setProperty("--speaker", speaker.color);
if (speaker.label === previousLabel) {
p.classList.add("line-cont");
} else {
const tag = document.createElement("span");
tag.className = "speaker-tag";
tag.textContent = speaker.label;
p.appendChild(tag);
}
for (const run of quoteRuns(text2)) {
const span = document.createElement("span");
span.className = run.quoted ? "said" : "aside";
const node = document.createTextNode("");
span.appendChild(node);
p.appendChild(span);
segments.push({ node, text: run.text });
}
} else {
const node = document.createTextNode("");
p.appendChild(node);
segments.push({ node, text: text2 });
}
previousLabel = speaker?.label || null;
return { p, segments };
});
}
function typeText(lines, el, onDone, speed = DEFAULT_SPEED_MS) {
cancelTyping();
const paragraphs = buildParagraphs(lines);
el.textContent = "";
if (paragraphs[0]) el.appendChild(paragraphs[0].p);
el.classList.add("typing");
el.setAttribute("aria-busy", "true");
const finish = () => {
cancelTyping();
for (const { p, segments } of paragraphs) {
for (const s of segments) s.node.data = s.text;
if (!p.isConnected) el.appendChild(p);
}
el.classList.remove("typing");
el.removeAttribute("aria-busy");
onDone?.();
};
finishNow = finish;
if (reducedMotion?.matches || speed <= 0) {
finish();
return;
}
let para = 0;
let seg = 0;
let i = 0;
timer = setInterval(() => {
const current2 = paragraphs[para];
if (!current2) return finish();
const segment = current2.segments[seg];
if (segment && i < segment.text.length) {
segment.node.appendData(segment.text[i++]);
return;
}
i = 0;
if (segment && seg < current2.segments.length - 1) {
seg++;
return;
}
seg = 0;
para++;
if (para < paragraphs.length) el.appendChild(paragraphs[para].p);
else finish();
}, speed);
}
function skipTyping() {
if (!finishNow) return false;
finishNow();
return true;
}
var isTyping = () => finishNow !== null;
// ../../../../private/tmp/molly-roger/src/engine/rules.js
var SAVE_VERSION = 5;
var SELF_START = 100;
var SUSPICION_START = 0;
function createState(player = DEFAULT_PLAYER) {
return {
currentSceneId: null,
psychicLevel: 1,
self: SELF_START,
// how much of "you" is intact; protects you in a merger
suspicion: SUSPICION_START,
// marks in Inspector Vane's ledger
currentPath: "Undecided",
relationships: emptyRelationships(),
flags: [],
items: [],
counters: {},
visited: [],
// scenes whose entry effects have already been applied
journeySteps: [],
// [{ sceneId, choiceText, snapshot }]
discoveredEndings: [],
// persists across restarts
codex: [],
// unlocked codex entries - also persists across restarts
runs: 0,
// how many playthroughs have been started
player: { ...DEFAULT_PLAYER, ...player }
};
}
var clamp = (v, lo, hi) => Math.max(lo, Math.min(hi, v));
var addUnique = (list, ids) => {
for (const id of ids || []) if (!list.includes(id)) list.push(id);
};
var removeAll = (list, ids) => list.filter((id) => !(ids || []).includes(id));
function computePath(rel) {
const molly2 = rel["Molly Roger"];
const worthington2 = rel["Professor Worthington"];
if (molly2 > 50 && worthington2 < 30) return "Rebellion";
if (worthington2 > 50 && molly2 < 30) return "Institutional";
if (molly2 > 30 && worthington2 > 30) return "Balanced";
return "Undecided";
}
function applyEffects(state2, src) {
for (const [name, delta] of Object.entries(src.relationshipChanges || {})) {
if (name in state2.relationships) {
state2.relationships[name] = clamp(state2.relationships[name] + delta, 0, 100);
}
}
if (src.psychicChange) state2.psychicLevel = Math.max(1, state2.psychicLevel + src.psychicChange);
if (src.selfChange) state2.self = clamp(state2.self + src.selfChange, 0, 100);
if (src.suspicionChange) state2.suspicion = clamp(state2.suspicion + src.suspicionChange, 0, 100);
addUnique(state2.flags, src.setFlags);
state2.flags = removeAll(state2.flags, src.clearFlags);
addUnique(state2.items, src.addItems);
state2.items = removeAll(state2.items, src.removeItems);
for (const [name, delta] of Object.entries(src.counters || {})) {
state2.counters[name] = (state2.counters[name] || 0) + delta;
}
state2.currentPath = computePath(state2.relationships);
}
function view(state2) {
return {
psychicLevel: state2.psychicLevel,
self: state2.self,
suspicion: state2.suspicion,
relationships: { ...state2.relationships },
currentPath: state2.currentPath,
flags: new Set(state2.flags),
items: new Set(state2.items),
counters: { ...state2.counters },
visited: new Set(state2.visited),
player: { ...state2.player }
};
}
function applyChoice(state2, choice) {
applyEffects(state2, choice);
}
function resolveNext(choice, state2) {
return typeof choice.nextScene === "function" ? choice.nextScene(view(state2)) : choice.nextScene;
}
function epiloguesFor(scene, state2) {
if (!scene.ending || scene.epilogue === false) return [];
return epilogues.filter((e) => !(e.except || []).includes(scene.id) && evaluate(e.when, state2));
}
function resolveText(scene, state2) {
let raw2 = typeof scene.text === "function" ? scene.text(view(state2)) : scene.text;
const extra = epiloguesFor(scene, state2);
if (extra.length) raw2 += "\n\n\u2726\n\n" + extra.map((e) => e.text).join("\n\n");
return renderText(raw2, state2);
}
function effectiveChoice(choice, outcomeKey) {
if (!choice.outcomes) return choice;
const key = outcomeKey || choice.skipOutcome;
const outcome = choice.outcomes[key];
if (!outcome) throw new Error(`Choice "${choice.text}" has no outcome "${key}"`);
return { ...outcome, text: choice.text };
}
function choicesFor(scene, state2, { setPieces = false } = {}) {
return scene.choices.filter((choice) => !(choice.hideWhen && evaluate(choice.hideWhen, state2))).filter((choice) => setPieces ? !choice.plainOnly : !choice.setPiece).map((choice) => {
const { ok, hint } = checkRequirement(choice.requires, state2);
return { choice, locked: !ok, hint: choice.lockedHint || hint, text: renderText(choice.text, state2) };
}).filter((c) => !(c.locked && c.choice.hideLocked));
}
function castFor(scene, state2) {
if (scene.ending) return [];
const list = scene.cast || (scene.speaker ? [{ who: scene.speaker }] : []);
const used = /* @__PURE__ */ new Set();
return list.filter((c) => !c.when || evaluate(c.when, state2)).map((c) => {
const pos = c.pos || (used.has("right") ? "left" : "right");
used.add(pos);
return { who: c.who, mood: c.mood || null, pos };
});
}
function snapshot(state2) {
return {
psychicLevel: state2.psychicLevel,
self: state2.self,
suspicion: state2.suspicion,
currentPath: state2.currentPath,
relationships: { ...state2.relationships },
flags: [...state2.flags],
items: [...state2.items],
counters: { ...state2.counters },
visited: [...state2.visited]
};
}
function enterScene(state2, scene, choiceText) {
if (!state2.visited.includes(scene.id)) {
applyEffects(state2, scene);
state2.visited.push(scene.id);
}
state2.currentPath = computePath(state2.relationships);
state2.currentSceneId = scene.id;
if (scene.ending && !state2.discoveredEndings.includes(scene.id)) {
state2.discoveredEndings.push(scene.id);
}
state2.journeySteps.push({ sceneId: scene.id, choiceText: choiceText || null, snapshot: snapshot(state2) });
return unlockCodex(state2);
}
function unlockCodex(state2) {
const added = [];
for (const entry of codex) {
if (state2.codex.includes(entry.id)) continue;
const conditions = Array.isArray(entry.when) ? entry.when : [entry.when];
if (conditions.some((c) => evaluate(c, state2))) {
state2.codex.push(entry.id);
added.push(entry.id);
}
}
return added;
}
function newRun(previous, player) {
const state2 = createState(player);
state2.discoveredEndings = [...previous?.discoveredEndings || []];
state2.codex = [...previous?.codex || []];
state2.runs = (previous?.runs || 0) + 1;
if (state2.discoveredEndings.length) state2.flags.push("ghost_memory");
return state2;
}
function rewindTo(state2, index) {
const step = state2.journeySteps[index];
if (!step) return false;
const s = step.snapshot;
state2.psychicLevel = s.psychicLevel;
state2.self = s.self ?? SELF_START;
state2.suspicion = s.suspicion ?? SUSPICION_START;
state2.currentPath = s.currentPath;
state2.relationships = { ...emptyRelationships(), ...s.relationships };
state2.flags = [...s.flags || []];
state2.items = [...s.items || []];
state2.counters = { ...s.counters || {} };
state2.visited = [...s.visited || []];
state2.journeySteps = state2.journeySteps.slice(0, index + 1);
state2.currentSceneId = step.sceneId;
return true;
}
function highestAct(state2, scenes2) {
return state2.journeySteps.reduce((max, step) => Math.max(max, scenes2[step.sceneId]?.act || 0), 0);
}
function describeChanges(before, after) {
const out = [];
for (const name of relationshipNames) {
const d = after.relationships[name] - before.relationships[name];
if (d) out.push({ kind: "rel", label: characters[name].relationshipLabel, delta: d, color: characters[name].color });
}
const num = (key, label, kind) => {
const d = after[key] - before[key];
if (d) out.push({ kind, label, delta: d });
};
num("self", "Self", "self");
num("suspicion", "Suspicion", "suspicion");
num("psychicLevel", "Psychic level", "psychic");
for (const id of after.items) {
if (!before.items.includes(id)) out.push({ kind: "item", label: items[id]?.name || id, gained: true });
}
for (const id of before.items) {
if (!after.items.includes(id)) out.push({ kind: "item", label: items[id]?.name || id, gained: false });
}
for (const id of after.flags) {
if (!before.flags.includes(id)) out.push({ kind: "flag", id });
}
return out;
}
// ../../../../private/tmp/molly-roger/src/engine/save.js
var STORAGE_KEY = "molly-roger-save";
var persistenceMode = "unknown";
function hasLocalStorage() {
try {
const k = "__molly_roger_probe__";
localStorage.setItem(k, "1");
localStorage.removeItem(k);
return true;
} catch {
return false;
}
}
async function storageSet(key, value) {
if (hasLocalStorage()) {
try {
localStorage.setItem(key, value);
persistenceMode = "local";
return true;
} catch {
}
}
persistenceMode = "memory";
return false;
}
async function storageGet(key) {
if (hasLocalStorage()) {
persistenceMode = "local";
try {
return localStorage.getItem(key);
} catch {
return null;
}
}
persistenceMode = "memory";
return null;
}
function serialise(state2) {
return JSON.stringify({ version: SAVE_VERSION, ...state2 });
}
function migrate(data) {
if (!data || typeof data !== "object") return null;
const version = data.version || 1;
if (version < 2) {
const fill2 = (rel) => ({ ...emptyRelationships(), ...rel || {} });
data.relationships = fill2(data.relationships);
data.journeySteps = (data.journeySteps || []).map((step, i, all) => ({
sceneId: step.sceneId,
choiceText: step.choiceText || null,
snapshot: {
...step.snapshot,
relationships: fill2(step.snapshot?.relationships),
visited: all.slice(0, i + 1).map((s) => s.sceneId)
}
}));
data.visited = data.journeySteps.map((s) => s.sceneId);
data.version = 2;
}
if (data.version < 3) {
const fresh = createState();
const upgrade = (snap) => ({
self: fresh.self,
suspicion: fresh.suspicion,
flags: [],
items: [],
...snap
});
Object.assign(data, upgrade(data));
data.player = data.player || fresh.player;
data.journeySteps = data.journeySteps.map((step) => ({ ...step, snapshot: upgrade(step.snapshot) }));
data.version = 3;
}
if (data.version < 4) {
data.counters = data.counters || {};
data.journeySteps = data.journeySteps.map((step) => ({ ...step, snapshot: { counters: {}, ...step.snapshot } }));
data.version = 4;
}
if (data.version < 5) {
data.codex = data.codex || [];
data.runs = data.runs || 1;
data.version = 5;
}
const fill = (rel) => ({ ...emptyRelationships(), ...rel || {} });
data.relationships = fill(data.relationships);
data.journeySteps = data.journeySteps.map((step) => ({ ...step, snapshot: { ...step.snapshot, relationships: fill(step.snapshot?.relationships) } }));
const state2 = { ...createState(), ...data };
delete state2.version;
if (!scenes[state2.currentSceneId]) return null;
state2.journeySteps = state2.journeySteps.filter((s) => scenes[s.sceneId]);
state2.discoveredEndings = (state2.discoveredEndings || []).filter((id) => scenes[id]);
return state2;
}
async function save(state2) {
return storageSet(STORAGE_KEY, serialise(state2));
}
async function load() {
const raw2 = await storageGet(STORAGE_KEY);
if (!raw2) return null;
try {
return migrate(JSON.parse(raw2));
} catch (e) {
console.warn("Saved data was unreadable; starting fresh.", e);
return null;
}
}
// ../../../../private/tmp/molly-roger/src/ui/hud.js
function renderStatus(state2) {
els.playerName.textContent = state2.player.name;
els.galleryCount.textContent = `${state2.discoveredEndings.length}/${endingIds.length}`;
els.codexCount.textContent = state2.codex?.length ? `${state2.codex.length}/${codex.length}` : "";
els.psychicLevel.textContent = `Psychic ${state2.psychicLevel}`;
els.path.textContent = state2.currentPath;
els.satchelCount.textContent = state2.items.length ? String(state2.items.length) : "";
}
function bar(label, value, color, dotColor = color) {
return `
<div class="relationship-bar">
<div class="relationship-label">
<span class="relationship-dot" style="background:${dotColor}"></span>${escapeHtml(label)}
</div>
<div class="relationship-track" role="meter" aria-label="${escapeHtml(label)}" aria-valuemin="0" aria-valuemax="100" aria-valuenow="${value}">
<div class="relationship-fill" style="width:${value}%;background:${color}"></div>
</div>
<span class="relationship-value">${value}</span>
</div>`;
}
function ledger(suspicion) {
const strokes = Math.round(suspicion / 5);
let groups = "";
for (let i = 0; i < strokes; i += 5) {
const n = Math.min(5, strokes - i);
groups += `<span class="tally${n === 5 ? " full" : ""}">${"<i></i>".repeat(Math.min(n, 4))}</span>`;
}
const level = suspicion >= 75 ? "Under watch" : suspicion >= 40 ? "Noted" : suspicion > 0 ? "A mark or two" : "Clean";
return `
<div class="relationship-bar ledger-row">
<div class="relationship-label">
<span class="relationship-dot" style="background:#9AA3AD"></span>Vane's ledger
</div>
<div class="ledger" role="meter" aria-label="Suspicion" aria-valuemin="0" aria-valuemax="100" aria-valuenow="${suspicion}">
${groups || '<span class="ledger-empty">no marks</span>'}
</div>
<span class="relationship-value ledger-level${suspicion >= 75 ? " danger" : ""}">${level}</span>
</div>`;
}
function renderRelationships(state2) {
const selfColor = state2.self < 40 ? "var(--bad)" : state2.self < 70 ? "var(--warn)" : "var(--ink-soft)";
els.relationships.innerHTML = `
<div class="hud-columns">
<section>
<h3>Relationships</h3>
${relationshipNames.filter((n) => !characters[n].revealWhen || evaluate(characters[n].revealWhen, state2)).map((n) => bar(characters[n].relationshipLabel, state2.relationships[n], characters[n].color)).join("")}
</section>
<section>
<h3>State of mind</h3>
${bar("Self", state2.self, selfColor)}
${ledger(state2.suspicion)}
</section>
</div>`;
}
function objectiveFor(act, state2) {
for (const [cond, text2] of act?.objectives || []) {
if (!cond || evaluate(cond, state2)) return text2;
}
return "";
}
function avatar(name) {
const svg = (portraits[name] || "").replace('viewBox="0 0 200 260"', 'viewBox="30 14 150 150"');
const c = characters[name];
return `<span class="avatar" style="--speaker:${c?.color || "var(--accent)"}">${svg}</span>`;
}
function renderProgress(state2, scene) {
const actNumbers = Object.keys(acts).map(Number).sort((a, b) => a - b);
const current2 = scene?.ending ? Infinity : scene?.act || 1;
const act = acts[scene?.act];
els.actTrack.innerHTML = actNumbers.map((n) => {
const status = n < current2 ? "done" : n === current2 ? "current" : "todo";
const a = acts[n];
return `<li class="act-step ${status}" title="${escapeHtml(`${a.title} \xB7 ${a.subtitle}`)}"${status === "current" ? ' aria-current="step"' : ""}>
<span class="act-bar"></span><span class="act-short">${escapeHtml(a.short || a.title)}</span>
<span class="sr-only">${escapeHtml(`${a.title}: ${a.subtitle}`)}${status === "done" ? " (done)" : ""}</span>
</li>`;
}).join("");
if (scene?.ending) {
els.progressAct.textContent = "Ending";
const found = state2.discoveredEndings.length;
els.objective.innerHTML = `<span class="objective-label">The end</span>${escapeHtml(scene.endingTitle || "")}. You've found ${found} of ${endingIds.length} endings.`;
} else {
els.progressAct.textContent = act ? `${act.title} \xB7 ${act.subtitle}` : "";
const aim = objectiveFor(act, state2);
els.objective.innerHTML = aim ? `<span class="objective-label">Current aim</span>${escapeHtml(aim)}` : "";
}
const signed = Object.entries(crew).filter(([, flag]) => state2.flags.includes(flag)).map(([name]) => name);
const mustering = scene?.act === 5 || evaluate("visited:crew_muster", state2);
if (signed.length || mustering) {
els.crewCount.textContent = `${signed.length} of ${Object.keys(crew).length}`;
els.crewList.innerHTML = signed.length ? signed.map((name) => `<li class="crew-member" title="${escapeHtml(name)}">${avatar(name)}<span class="crew-name">${escapeHtml(characters[name]?.short || name)}</span></li>`).join("") : `<li class="crew-empty">No one yet. Allies you've earned can be asked to join.</li>`;
} else {
els.crewCount.textContent = "";
els.crewList.innerHTML = "";
}
els.carriedList.innerHTML = state2.items.map((id) => {
const item = items[id];
if (!item) return "";
return `<li><button type="button" class="carried-chip" data-item="${escapeHtml(id)}" title="${escapeHtml(item.description)}">
<i class="fas ${escapeHtml(item.icon)}" aria-hidden="true"></i>${escapeHtml(item.name)}</button></li>`;
}).join("");
}
function renderChanges(changes) {
const visible = changes.filter((c) => c.kind !== "flag");
const learned = changes.some((c) => c.kind === "flag");
if (!visible.length && !learned) {
els.changes.innerHTML = "";
return;
}
const chip = (c) => {
if (c.kind === "codex") {
return `<span class="change-chip item"><i class="fas fa-book-open"></i>Codex: ${escapeHtml(c.label)}</span>`;
}
if (c.kind === "item") {
return `<span class="change-chip item"><i class="fas ${c.gained ? "fa-plus" : "fa-minus"}"></i>${escapeHtml(c.label)}</span>`;
}
const good = c.kind === "suspicion" ? c.delta < 0 : c.delta > 0;
const sign = c.delta > 0 ? "+" : "\u2212";
const dot = c.color ? `<span class="relationship-dot" style="background:${c.color}"></span>` : "";
return `<span class="change-chip ${good ? "up" : "down"}">${dot}${escapeHtml(c.label)} ${sign}${Math.abs(c.delta)}</span>`;
};
els.changes.innerHTML = visible.map(chip).join("") + (learned ? '<span class="change-chip note"><i class="fas fa-feather"></i>New note in your satchel</span>' : "");
}
var PERSISTENCE_NOTES = {
local: "Progress saves to this browser.",
memory: "Progress won't be saved after you close this tab."
};
function renderPersistenceNote(mode) {
els.persistenceNote.textContent = PERSISTENCE_NOTES[mode] || "";
els.persistenceNote.classList.toggle("warning", mode === "memory");
}
var saveToastTimer = null;
function showSaveToast(ok) {
const el = els.saveIndicator;
el.classList.toggle("warning", !ok);
el.querySelector("span").textContent = ok ? "Progress Saved" : "Saved for this session only";
el.classList.add("visible");
clearTimeout(saveToastTimer);
saveToastTimer = setTimeout(() => el.classList.remove("visible"), 2200);
}
// ../../../../private/tmp/molly-roger/src/ui/journey.js
function sceneLabel(sceneId) {
return sceneId.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
}
var MAX_CRUMBS = 5;
var arrow = () => {
const a = document.createElement("span");
a.className = "breadcrumb-arrow";
a.innerHTML = '<i class="fas fa-chevron-right"></i>';
return a;
};
function renderBreadcrumbs(steps, { onJump, onShowAll }) {
const root = els.breadcrumbs;
root.innerHTML = "";
if (!steps.length) return;
const start = Math.max(0, steps.length - MAX_CRUMBS);
if (start > 0) {
const more = document.createElement("button");
more.type = "button";
more.className = "breadcrumb-more";
more.textContent = `+${start} earlier\u2026`;
more.title = "See your full journey";
more.addEventListener("click", onShowAll);
root.append(more, arrow());
}
for (let idx = start; idx < steps.length; idx++) {
const step = steps[idx];
const isCurrent = idx === steps.length - 1;
const chip = document.createElement(isCurrent ? "span" : "button");
chip.className = "breadcrumb-item" + (isCurrent ? " current" : "");
chip.textContent = sceneLabel(step.sceneId);
if (step.choiceText) chip.title = `You chose: "${step.choiceText}"`;
if (!isCurrent) {
chip.type = "button";
chip.addEventListener("click", () => onJump(idx));
} else {
chip.setAttribute("aria-current", "step");
}
root.appendChild(chip);
if (!isCurrent) root.appendChild(arrow());
}
}
function renderJourneyList(steps, { onJump }) {
const list = els.journeyList;
list.innerHTML = "";
if (!steps.length) {
list.innerHTML = `<div class="journey-empty">Your journey hasn't begun yet.</div>`;
return;
}
steps.forEach((step, idx) => {
const isCurrent = idx === steps.length - 1;
const item = document.createElement(isCurrent ? "div" : "button");
item.className = "journey-item" + (isCurrent ? " current" : "");
const choice = step.choiceText || (idx === 0 ? "Begin the story" : "");
item.innerHTML = `
<div class="journey-step-number">${idx + 1}</div>
<div class="journey-step-content">
<div class="journey-step-label">${escapeHtml(sceneLabel(step.sceneId))}</div>
${choice ? `<div class="journey-step-choice">"${escapeHtml(choice)}"</div>` : ""}
</div>
${isCurrent ? '<i class="fas fa-map-marker-alt journey-jump-icon" title="You are here"></i>' : '<i class="fas fa-undo journey-jump-icon" title="Jump back here"></i>'}`;
if (!isCurrent) {
item.type = "button";
item.addEventListener("click", () => onJump(idx));
}
list.appendChild(item);
});
}
// ../../../../private/tmp/molly-roger/src/ui/presentation.js
var wait = (ms) => new Promise((r) => setTimeout(r, ms));
var reducedMotion2 = window.matchMedia?.("(prefers-reduced-motion: reduce)");
async function showActTransition(actNumber) {
const info = acts[actNumber];
if (!info) return;
els.actTitle.textContent = info.title;
els.actSubtitle.textContent = info.subtitle;
els.actTransition.classList.add("visible");
await wait(reducedMotion2?.matches ? 1400 : 2400);
els.actTransition.classList.remove("visible");
await wait(reducedMotion2?.matches ? 50 : 750);
}
function renderEnding(scene, state2, { onShowGallery } = {}) {
els.stage.classList.add("ending-panel");
els.endingEyebrow.hidden = false;
els.endingTitle.hidden = false;
els.endingTitle.textContent = scene.endingTitle || "The end";
const row = (label, value) => `<div class="ending-summary-row"><span class="ending-summary-label">${escapeHtml(label)}</span><span class="ending-summary-value">${escapeHtml(value)}</span></div>`;
els.endingSummary.innerHTML = [
row("Path", state2.currentPath),
row("Psychic level", state2.psychicLevel),
row("Self", `${state2.self}%`),
row("Marks in Vane's ledger", state2.suspicion),
row("Items found", `${state2.items.length} of ${Object.keys(items).length}`),
row("Choices made", Math.max(0, state2.journeySteps.length - 1)),
...relationshipNames.filter((n) => !characters[n].revealWhen || evaluate(characters[n].revealWhen, state2)).map((n) => row(characters[n].relationshipLabel, `${state2.relationships[n]}%`)),
`<div class="ending-discovered">${state2.discoveredEndings.length} of ${endingIds.length} endings discovered
<button type="button" data-show-gallery>View the cards</button></div>`
].join("");
els.endingSummary.hidden = false;
els.endingSummary.querySelector("[data-show-gallery]")?.addEventListener("click", onShowGallery);
}
function clearEnding() {
els.stage.classList.remove("ending-panel");
els.endingEyebrow.hidden = true;
els.endingTitle.hidden = true;
els.endingSummary.hidden = true;
}
// ../../../../private/tmp/molly-roger/src/stage/art/kit.js
var W = 800;
var H = 300;
function rng(seed) {
let s = seed >>> 0 || 1;
return () => {
s = s * 1664525 + 1013904223 >>> 0;
return s / 4294967296;
};
}
var r1 = (n) => Math.round(n * 10) / 10;
var lerp = (a, b, t) => a + (b - a) * t;
function makeKit(prefix) {
const defs = [];
let n = 0;
const id = (p = "d") => `${prefix}-${p}${++n}`;
const stopTags = (stops) => stops.map(([o, c, a = 1]) => `<stop offset="${o}" stop-color="${c}" stop-opacity="${a}"/>`).join("");
const k = {
id,
def(s) {
defs.push(s);
},
lin(stops, x1 = 0, y1 = 0, x2 = 0, y2 = 1) {
const i = id("l");
defs.push(`<linearGradient id="${i}" x1="${x1}" y1="${y1}" x2="${x2}" y2="${y2}">${stopTags(stops)}</linearGradient>`);
return `url(#${i})`;
},
rad(stops, cx = 0.5, cy = 0.5, r = 0.5) {
const i = id("r");
defs.push(`<radialGradient id="${i}" cx="${cx}" cy="${cy}" r="${r}">${stopTags(stops)}</radialGradient>`);
return `url(#${i})`;
},
/** A soft pool of light. */
glow(x, y, r, color, opacity = 0.7, cls = "") {
const fill = k.rad([[0, color, opacity], [0.35, color, opacity * 0.45], [1, color, 0]]);
return `<circle cx="${x}" cy="${y}" r="${r}" fill="${fill}" class="${cls}"/>`;
},
/** Elliptical light pool (e.g. on a floor). */
pool(x, y, rx, ry, color, opacity = 0.5, cls = "") {
const fill = k.rad([[0, color, opacity], [1, color, 0]]);
return `<ellipse cx="${x}" cy="${y}" rx="${rx}" ry="${ry}" fill="${fill}" class="${cls}"/>`;
},
svg(body) {
return `<svg viewBox="0 0 ${W} ${H}" preserveAspectRatio="xMidYMid slice" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><defs>${defs.join("")}</defs>${body}</svg>`;
}
};
return k;
}
var layer = (depth, body) => `<g class="layer" data-depth="${depth}">${body}</g>`;
var rect = (x, y, w, h, fill, extra = "") => `<rect x="${r1(x)}" y="${r1(y)}" width="${r1(w)}" height="${r1(h)}" fill="${fill}" ${extra}/>`;
var poly = (pts, fill, extra = "") => `<polygon points="${pts.map((p) => p.map(r1).join(",")).join(" ")}" fill="${fill}" ${extra}/>`;
var path = (d, fill, extra = "") => `<path d="${d}" fill="${fill}" ${extra}/>`;
var line = (x1, y1, x2, y2, stroke, w = 1, extra = "") => `<line x1="${r1(x1)}" y1="${r1(y1)}" x2="${r1(x2)}" y2="${r1(y2)}" stroke="${stroke}" stroke-width="${w}" ${extra}/>`;
var circle = (cx, cy, r, fill, extra = "") => `<circle cx="${r1(cx)}" cy="${r1(cy)}" r="${r1(r)}" fill="${fill}" ${extra}/>`;
var text = (x, y, str, { size = 14, fill = "#fff", family = "Geist Variable, Inter Variable, sans-serif", extra = "" } = {}) => `<text x="${r1(x)}" y="${r1(y)}" font-family="${family}" font-size="${size}" fill="${fill}" ${extra}>${str}</text>`;
function stars2(rand2, n, { x0 = -30, x1 = 830, y0 = 0, y1 = 200, color = "#f1ecff", rMin = 0.4, rMax = 1.6 } = {}) {
let out = "";
for (let i = 0; i < n; i++) {
const cls = i % 5 === 0 ? "twinkle" : i % 7 === 0 ? "twinkle alt" : "";
out += circle(
lerp(x0, x1, rand2()),
lerp(y0, y1, rand2()),
lerp(rMin, rMax, rand2()),
color,
`opacity="${r1(0.3 + rand2() * 0.6)}" class="${cls}"`
);
}
return out;
}
function archWindow(x, y, w, h, { glass = "#2c3a55", frame: frame2 = "#0d0a07", bars = true, glassExtra = "" } = {}) {
const r = w / 2;
const d = `M${x} ${y + h} V${y + r} A${r} ${r} 0 0 1 ${x + w} ${y + r} V${y + h} Z`;
let out = path(d, frame2);
const inset = 4;
const di = `M${x + inset} ${y + h - inset} V${y + r} A${r - inset} ${r - inset} 0 0 1 ${x + w - inset} ${y + r} V${y + h - inset} Z`;
out += path(di, glass, glassExtra);
if (bars) {
out += line(x + r, y + inset, x + r, y + h - inset, frame2, 2.5);
for (let i = 1; i <= 3; i++) out += line(x + inset, y + r + (h - r) * i / 4, x + w - inset, y + r + (h - r) * i / 4, frame2, 2);
}
return out;
}
function gaslamp(k, x, y, s = 1, { color = "#ffcf7a", bracket = "#0d0a07", glowR = 70 } = {}) {
return `<g>
${k.glow(x, y, glowR * s, color, 0.55, "flicker")}
${line(x - 16 * s, y + 18 * s, x, y + 8 * s, bracket, 2.5 * s)}
${poly([[x - 6 * s, y - 4 * s], [x + 6 * s, y - 4 * s], [x + 4 * s, y + 8 * s], [x - 4 * s, y + 8 * s]], bracket)}
${poly([[x - 4.5 * s, y - 2.5 * s], [x + 4.5 * s, y - 2.5 * s], [x + 3 * s, y + 6.5 * s], [x - 3 * s, y + 6.5 * s]], color, 'class="flicker alt" opacity="0.95"')}
${poly([[x - 7 * s, y - 4 * s], [x + 7 * s, y - 4 * s], [x, y - 10 * s]], bracket)}
</g>`;
}
function candle(k, x, y, s = 1, { wax = "#d9ccb0", color = "#ffcf7a" } = {}) {
return `<g>
${k.glow(x, y - 16 * s, 60 * s, color, 0.55, "flicker")}
${rect(x - 3 * s, y - 12 * s, 6 * s, 12 * s, wax)}
${path(`M${x} ${y - 22 * s} C${x + 3 * s} ${y - 17 * s} ${x + 2.5 * s} ${y - 13 * s} ${x} ${y - 12.5 * s} C${x - 2.5 * s} ${y - 13 * s} ${x - 3 * s} ${y - 17 * s} ${x} ${y - 22 * s} Z`, color, 'class="flicker"')}
</g>`;
}
function bookshelf(rand2, x, y, w, h, { shelves = 5, frame: frame2 = "#0b0806", colors = ["#3b2a20", "#2a3328", "#41241f", "#2c2a3d", "#4a3a22"], light = 1 } = {}) {
let out = rect(x, y, w, h, frame2);
const shelfH = (h - 8) / shelves;
for (let s = 0; s < shelves; s++) {
const sy = y + 4 + s * shelfH;
let bx = x + 5;
while (bx < x + w - 8) {
const bw = 4 + rand2() * 7;
const bh = shelfH * (0.62 + rand2() * 0.3);
if (bx + bw > x + w - 5) break;
if (rand2() < 0.06) {
bx += bw;
continue;
}
const c = colors[Math.floor(rand2() * colors.length)];
const lean = rand2() < 0.05;
out += rect(
bx,
sy + shelfH - 3 - bh,
bw,
bh,
c,
`opacity="${r1(0.55 + rand2() * 0.45 * light)}"${lean ? ` transform="rotate(8 ${r1(bx)} ${r1(sy + shelfH - 3)})"` : ""}`
);
bx += bw + 0.6;
}
out += rect(x, sy + shelfH - 3, w, 3, frame2);
}
return out;
}
function column(x, y, w, h, fill, flute = "rgba(0,0,0,0.25)") {
return rect(x - 4, y, w + 8, 8, fill) + rect(x - 2, y + 8, w + 4, 5, fill) + rect(x, y + 13, w, h - 26, fill) + [0.25, 0.5, 0.75].map((t) => line(x + w * t, y + 16, x + w * t, y + h - 16, flute, 1.5)).join("") + rect(x - 4, y + h - 13, w + 8, 13, fill);
}
function waveBand(y, amp, fill, extra = "") {
let d = `M-200 ${y}`;
for (let x = -200; x <= 1040; x += 40) {
const cy = x % 80 === 0 ? y - amp : y + amp;
d += ` Q${x + 20} ${cy} ${x + 40} ${y}`;
}
d += ` V320 H-200 Z`;
return path(d, fill, extra);
}
function rooftops(rand2, y, x0, x1, fill, { minH = 20, maxH = 70 } = {}) {
let d = `M${x0} 320 V${y}`;
let x = x0;
while (x < x1) {
const w = 30 + rand2() * 60;
const top = y - minH - rand2() * (maxH - minH);
const roof = rand2();
if (roof < 0.4) {
d += ` V${r1(top)} L${r1(x + w / 2)} ${r1(top - 16)} L${r1(x + w)} ${r1(top)}`;
} else {
d += ` V${r1(top)} H${r1(x + w * 0.2)} V${r1(top - 14)} H${r1(x + w * 0.3)} V${r1(top)} H${r1(x + w)}`;
}
x += w;
}
d += ` V320 Z`;
return path(d, fill);
}
function figure(x, yFeet, h, fill, hat = "none", extra = "") {
const s = h / 100;
const P = (px, py) => `${r1(x + px * s)} ${r1(yFeet - (100 - py) * s)}`;
let d = `M${P(-12, 100)} L${P(-14, 40)} Q${P(-14, 28)} ${P(-4, 26)} L${P(-4, 20)} Q${P(-9, 18)} ${P(-8, 10)} Q${P(-7, 2)} ${P(0, 2)} Q${P(7, 2)} ${P(8, 10)} Q${P(9, 18)} ${P(4, 20)} L${P(4, 26)} Q${P(14, 28)} ${P(14, 40)} L${P(12, 100)} Z`;
let out = path(d, fill, extra);
if (hat === "top") out += rect(x - 6 * s, yFeet - 104 * s, 12 * s, 9 * s, fill) + rect(x - 10 * s, yFeet - 96 * s, 20 * s, 2 * s, fill);
if (hat === "bonnet") out += path(`M${P(-10, 14)} Q${P(-10, -4)} ${P(2, -2)} Q${P(12, 0)} ${P(12, 10)} L${P(6, 8)} Q${P(0, 2)} ${P(-6, 10)} Z`, fill);
if (hat === "helmet") out += path(`M${P(-9, 6)} Q${P(-8, -14)} ${P(0, -16)} Q${P(8, -14)} ${P(9, 6)} Z`, fill) + circle(x, yFeet - 115 * s, 2.5 * s, fill);
return out;
}
function glyphs(rand2, n, { x0 = 0, x1 = 800, y0 = 20, y1 = 220, chars = "ABCDEFGHIJKLMNOPQRSTUVXYZ&?", colors = ["#b9a6ff"], sMin = 12, sMax = 30, cls = "bob" } = {}) {
let out = "";
for (let i = 0; i < n; i++) {
const ch = chars[Math.floor(rand2() * chars.length)];
const x = lerp(x0, x1, rand2());
const y = lerp(y0, y1, rand2());
const rot = r1((rand2() - 0.5) * 40);
out += `<g class="${i % 2 ? cls + " alt" : cls}">${text(x, y, ch, {
size: r1(lerp(sMin, sMax, rand2())),
fill: colors[i % colors.length],
extra: `opacity="${r1(0.35 + rand2() * 0.5)}" transform="rotate(${rot} ${r1(x)} ${r1(y)})"`
})}</g>`;
}
return out;
}
// ../../../../private/tmp/molly-roger/src/stage/art/locations.js
var HAND = "Georgia, serif";
function lecture_hall() {
const k = makeKit("lh");
const rand2 = rng(11);
const beam = k.lin([[0, "#c8d6ff", 0.22], [1, "#c8d6ff", 0]]);
let back = rect(-40, -20, 880, 340, k.lin([[0, "#3b2c1b"], [1, "#130e08"]]));
for (const x of [30, 128, 610, 708]) {
back += archWindow(x, 26, 62, 150, { glass: "#27344d", frame: "#100b07" });
back += poly([[x + 4, 176], [x + 58, 176], [x + 120, 300], [x - 50, 300]], beam, 'class="shimmer"');
}
back += rect(-40, 186, 880, 120, "#1c140c") + line(-40, 186, 840, 186, "#3d2c18", 2);
const cx = 330, cy = 100, s = 24;
let mid = rect(250, 40, 300, 136, "#4a3420") + rect(258, 48, 284, 120, "#1d2822");
mid += path(
`M${cx} ${cy - s} L${cx + s} ${cy - s / 2} L${cx} ${cy} L${cx - s} ${cy - s / 2} Z M${cx - s} ${cy - s / 2} V${cy + s / 2} L${cx} ${cy + s} L${cx + s} ${cy + s / 2} V${cy - s / 2} M${cx} ${cy} V${cy + s}`,
"none",
'stroke="#e9e5d6" stroke-width="1.6" opacity="0.75"'
);
mid += circle(410, 100, 22, "none", 'stroke="#e9e5d6" stroke-width="1.5" opacity="0.7"') + `<ellipse cx="410" cy="100" rx="22" ry="7" fill="none" stroke="#e9e5d6" stroke-width="1" opacity="0.5"/>`;
mid += text(272, 66, "Approved Forms:", { size: 11, fill: "#e9e5d6", family: HAND, extra: 'opacity="0.7"' }) + text(272, 158, "I. Cube II. Sphere", { size: 10, fill: "#e9e5d6", family: HAND, extra: 'opacity="0.6"' }) + text(462, 112, "\u2717", { size: 26, fill: "#e9e5d6", extra: 'opacity="0.45"' }) + path("M470 136 C480 126 500 126 512 136 L500 142 L482 142 Z", "none", 'stroke="#e9e5d6" stroke-width="1.2" opacity="0.4"');
mid += gaslamp(k, 222, 92, 1.1) + gaslamp(k, 578, 92, 1.1);
mid += poly([[380, 196], [420, 196], [428, 250], [372, 250]], "#120c07");
let front = "";
for (let row = 0; row < 3; row++) {
const y = 222 + row * 30;
const c = ["#140e08", "#0d0905", "#060403"][row];
let heads = "";
for (let x = -30 + rand2() * 20; x < 840; x += 34 + rand2() * 12) {
heads += circle(x, y - 10 - rand2() * 4, 9 + rand2() * 2, c);
heads += path(`M${r1(x - 16)} ${y + 4} Q${r1(x)} ${r1(y - 8)} ${r1(x + 16)} ${y + 4} Z`, c);
}
front += heads + rect(-40, y, 880, 40, c);
}
return k.svg(layer(0.1, back) + layer(0.3, mid) + layer(0.7, front));
}
function practice_rooms() {
const k = makeKit("pr");
let back = rect(-40, -20, 880, 340, k.lin([[0, "#2e2416"], [1, "#120d08"]]));
for (let x = -40; x < 840; x += 80) back += rect(x + 6, 20, 68, 150, "none", 'stroke="#3d2f1c" stroke-width="2"');
back += circle(400, 52, 22, "#e9dcc0", 'opacity="0.85"') + circle(400, 52, 22, "none", 'stroke="#4a3420" stroke-width="4"') + line(400, 52, 400, 38, "#1a120a", 2) + line(400, 52, 410, 56, "#1a120a", 2);
back += rect(560, 40, 150, 70, "#e6d6b2", 'opacity="0.9"') + rect(566, 46, 138, 58, "none", 'stroke="#7a5a2a" stroke-width="1"') + text(578, 70, "APPROVED FORMS ONLY", { size: 10.5, fill: "#3a2510" }) + text(588, 92, "By Order of the Board", { size: 9, fill: "#5a3e1e", family: HAND });
let mid = "";
const shapes = [[160, 120, "cube"], [290, 90, "sphere"], [520, 130, "cube"], [660, 100, "sphere"], [400, 150, "cube"]];
shapes.forEach(([x, y, kind], i) => {
const g = k.glow(x, y, 46, "#e7c46a", 0.35);
const s = 20;
const shape = kind === "cube" ? path(`M${x} ${y - s} L${x + s} ${y - s / 2} L${x} ${y} L${x - s} ${y - s / 2} Z M${x - s} ${y - s / 2} V${y + s / 2} L${x} ${y + s} L${x + s} ${y + s / 2} V${y - s / 2} M${x} ${y} V${y + s}`, "rgba(201,162,39,0.12)", 'stroke="#e7c46a" stroke-width="1.6"') : circle(x, y, s, "rgba(201,162,39,0.12)", 'stroke="#e7c46a" stroke-width="1.6"') + `<ellipse cx="${x}" cy="${y}" rx="${s}" ry="6" fill="none" stroke="#e7c46a" stroke-width="1" opacity="0.6"/>`;
mid += `<g class="bob${i % 2 ? " alt" : ""}">${g}${shape}</g>`;
});
let front = poly([[-40, 200], [840, 200], [840, 320], [-40, 320]], "#0e0a06");
for (let i = -8; i <= 8; i++) front += line(400 + i * 30, 200, 400 + i * 140, 320, "#3a2c18", 1, 'opacity="0.7"');
for (const y of [212, 230, 255, 290]) front += line(-40, y, 840, y, "#3a2c18", 1, 'opacity="0.6"');
front += rect(80, 230, 150, 14, "#070503") + rect(92, 244, 8, 60, "#070503") + rect(210, 244, 8, 60, "#070503");
return k.svg(layer(0.1, back) + layer(0.35, mid) + layer(0.7, front));
}
function worthington_office() {
const k = makeKit("wo");
const rand2 = rng(23);
let back = rect(-40, -20, 880, 340, k.lin([[0, "#33261a"], [1, "#140e09"]]));
back += bookshelf(rand2, -30, 10, 230, 230, { shelves: 6 });
back += archWindow(560, 30, 120, 160, { glass: "#1b2638", frame: "#0f0a06" });
for (let i = 0; i < 26; i++) {
const x = 566 + rand2() * 108, y = 50 + rand2() * 130;
back += line(x, y, x - 3, y + 10, "#8fa6c8", 1, 'opacity="0.35"');
}
back += `<ellipse cx="400" cy="70" rx="34" ry="44" fill="#4a3420"/><ellipse cx="400" cy="70" rx="27" ry="37" fill="#1e1610"/>` + path(`M386 104 C384 82 392 60 404 56 C418 60 420 84 414 104 Z`, "#0c0806") + circle(402, 62, 10, "#0c0806");
let mid = k.glow(300, 168, 120, "#9fd38a", 0.32, "flicker");
mid += rect(170, 182, 330, 18, "#100a06") + rect(180, 200, 310, 100, "#0c0805");
mid += poly([[290, 150], [312, 150], [318, 166], [284, 166]], "#2d5a35") + rect(298, 166, 6, 16, "#0c0805");
mid += rect(360, 172, 60, 10, "#d9ccb0", 'opacity="0.8" transform="rotate(-6 390 177)"') + rect(380, 168, 50, 10, "#e6dcc4", 'opacity="0.7" transform="rotate(4 405 173)"');
mid += circle(460, 172, 9, "#0c0805") + line(460, 163, 474, 150, "#d9ccb0", 1.5);
mid += circle(230, 158, 22, "#1a2a24") + `<ellipse cx="230" cy="158" rx="22" ry="7" fill="none" stroke="#c9a227" stroke-width="1" opacity="0.6"/>` + line(230, 136, 230, 182, "#c9a227", 1.5, 'opacity="0.7"') + rect(222, 180, 16, 4, "#0c0805");
mid += path("M560 300 V210 Q560 180 600 180 H660 Q700 180 700 210 V300 Z", "#0b0705");
let front = rect(-40, -20, 140, 340, "#080504") + rect(14, 40, 70, 120, "#c79a4a", 'opacity="0.35"');
front += figure(50, 168, 104, "#080504", "bonnet", 'opacity="0.55"');
front += circle(92, 170, 4, "#c9a227", 'opacity="0.8"');
return k.svg(layer(0.1, back) + layer(0.35, mid) + layer(0.75, front));
}
function corridor() {
const k = makeKit("co");
const VP = { x: 400, y: 138 };
const far = { x0: 352, x1: 448, y0: 104, y1: 172 };
let back = rect(-40, -20, 880, 340, "#0d0905");
back += poly([[-40, -20], [far.x0, far.y0], [far.x0, far.y1], [-40, 320]], k.lin([[0, "#2c2014"], [1, "#16100a"]], 0, 0, 1, 0));
back += poly([[840, -20], [far.x1, far.y0], [far.x1, far.y1], [840, 320]], k.lin([[0, "#2c2014"], [1, "#16100a"]], 1, 0, 0, 0));
back += poly([[-40, -20], [840, -20], [far.x1, far.y0], [far.x0, far.y0]], "#140e08");
back += poly([[-40, 320], [840, 320], [far.x1, far.y1], [far.x0, far.y1]], k.lin([[0, "#1a120b"], [1, "#2e2114"]]));
back += rect(far.x0, far.y0, far.x1 - far.x0, far.y1 - far.y0, "#3a2a17") + rect(384, 120, 32, 52, "#d9b469", 'opacity="0.55"');
for (const t of [0.2, 0.45, 0.65, 0.8]) {
for (const side of [-1, 1]) {
const xNear = side < 0 ? -40 : 840;
const xFar = side < 0 ? far.x0 : far.x1;
const xa = lerp(xNear, xFar, t), xb = lerp(xNear, xFar, t + 0.08);
const topA = lerp(-20, far.y0, t) + lerp(90, 14, t), topB = lerp(-20, far.y0, t + 0.08) + lerp(90, 14, t + 0.08);
const botA = lerp(320, far.y1, t), botB = lerp(320, far.y1, t + 0.08);
back += poly([[xa, topA], [xb, topB], [xb, botB], [xa, botA]], "#0b0704");
}
}
let mid = "";
for (const t of [0.12, 0.38, 0.6, 0.76]) {
const s = lerp(1.6, 0.45, t);
mid += gaslamp(k, lerp(-40, far.x0, t) + 14 * s, lerp(60, 120, t), s, { glowR: 60 });
mid += gaslamp(k, lerp(840, far.x1, t) - 14 * s, lerp(60, 120, t), s, { glowR: 60 });
mid += k.pool(VP.x, lerp(300, far.y1 + 4, t), lerp(260, 40, t), lerp(26, 4, t), "#ffcf7a", 0.18);
}
mid += figure(400, 171, 44, "#0a0705", "bonnet");
mid += rect(404, 150, 6, 8, "#0a0705");
return k.svg(layer(0.05, back) + layer(0.25, mid));
}
function ridgewell_exterior(variant = "later") {
const k = makeKit("rx" + variant);
const rand2 = rng(variant === "after" ? 41 : 42);
const rainy = variant === "after";
const sky = rainy ? k.lin([[0, "#3b4250"], [1, "#1a1d24"]]) : k.lin([[0, "#2c2346"], [0.55, "#a8664a"], [1, "#e7b26f"]]);
let back = rect(-40, -20, 880, 340, sky);
if (!rainy) back += k.glow(620, 210, 160, "#ffd59a", 0.55) + stars2(rand2, 18, { y1: 90 });
back += rooftops(rand2, 230, -40, 840, rainy ? "#262a33" : "#3b2a3a", { minH: 10, maxH: 50 });
const b = rainy ? "#121419" : "#160f14";
let mid = rect(150, 120, 500, 180, b);
mid += poly([[140, 122], [400, 70], [660, 122]], b);
mid += rect(370, 30, 60, 100, b) + poly([[364, 32], [400, 0], [436, 32]], b);
mid += circle(400, 70, 16, rainy ? "#d8d2c0" : "#f2e3bd", 'opacity="0.85"') + line(400, 70, 400, 59, b, 2) + line(400, 70, 408, 74, b, 2);
for (let r = 0; r < 3; r++) {
for (let c = 0; c < 10; c++) {
const lit = rand2() < (rainy ? 0.35 : 0.5);
mid += rect(172 + c * 47, 140 + r * 44, 18, 26, lit ? "#f2c46b" : "#1e1a1c", lit ? 'opacity="0.85" class="flicker alt"' : "");
}
}
const tree = (x, s) => path(`M${x} 300 V${240 - 20 * s} M${x} 260 Q${x - 60 * s} ${200 - 30 * s} ${x - 20 * s} ${160 - 40 * s} Q${x + 10 * s} ${120 - 40 * s} ${x + 50 * s} ${170 - 30 * s} Q${x + 80 * s} ${220 - 20 * s} ${x} 260`, b, `stroke="${b}" stroke-width="${6 * s}"`);
mid += tree(70, 1.2) + tree(740, 1.1);
let front = rect(-40, 280, 880, 40, "#07060a");
for (let x = -40; x < 840; x += 16) {
front += rect(x, 222, 3, 60, "#07060a") + poly([[x - 2, 224], [x + 1.5, 214], [x + 5, 224]], "#07060a");
}
front += rect(-40, 232, 880, 4, "#07060a") + rect(-40, 262, 880, 4, "#07060a");
front += rect(350, 200, 6, 82, "#07060a") + rect(444, 200, 6, 82, "#07060a");
front += gaslamp(k, 300, 186, 1.1, { glowR: 70 }) + rect(298, 196, 4, 90, "#07060a");
return k.svg(layer(0.05, back) + layer(0.3, mid) + layer(0.75, front));
}
function library() {
const k = makeKit("li");
const rand2 = rng(7);
let back = rect(-40, -20, 880, 340, k.lin([[0, "#17302f"], [1, "#081314"]]));
back += archWindow(355, 18, 90, 150, { glass: "#2d5550", frame: "#091416" });
back += k.glow(400, 90, 120, "#8fe0cf", 0.25);
const farColors = ["#1f3d3a", "#244542", "#1b3633", "#2a4a40"];
back += bookshelf(rand2, -40, 30, 380, 170, { shelves: 5, frame: "#0e2022", colors: farColors, light: 0.6 });
back += bookshelf(rand2, 460, 30, 380, 170, { shelves: 5, frame: "#0e2022", colors: farColors, light: 0.6 });
back += rect(-40, 200, 880, 120, "#0b1a1c");
let mid = bookshelf(rand2, -30, -10, 170, 300, { shelves: 7, frame: "#050c0d" });
mid += bookshelf(rand2, 660, -10, 170, 300, { shelves: 7, frame: "#050c0d" });
mid += line(170, -10, 236, 300, "#0a0605", 5) + line(196, -10, 262, 300, "#0a0605", 5);
for (let i = 1; i < 10; i++) {
const t = i / 10;
mid += line(lerp(170, 236, t), lerp(-10, 300, t), lerp(196, 262, t), lerp(-10, 300, t), "#0a0605", 3);
}
mid += `<g class="sway">${line(520, -20, 520, 58, "#050c0d", 1.5)}${poly([[504, 58], [536, 58], [546, 76], [494, 76]], "#050c0d")}${k.glow(520, 82, 90, "#ffd58a", 0.45, "flicker")}</g>`;
let front = k.glow(310, 222, 130, "#7cd9a0", 0.28, "flicker");
front += rect(220, 236, 380, 14, "#040909") + rect(236, 250, 10, 70, "#040909") + rect(574, 250, 10, 70, "#040909");
front += poly([[294, 214], [326, 214], [334, 228], [286, 228]], "#1f5a3c") + rect(306, 228, 8, 8, "#040909");
front += rect(420, 226, 80, 10, "#3b2a20") + rect(426, 216, 70, 10, "#41241f") + rect(430, 208, 56, 8, "#2a3328");
front += path("M520 236 L556 230 L590 236 L556 240 Z", "#d9ccb0", 'opacity="0.75"');
return k.svg(layer(0.1, back) + layer(0.35, mid) + layer(0.75, front));
}
function grace_hideout() {
const k = makeKit("gh");
const rand2 = rng(31);
k.def(`<pattern id="gh-brick" width="40" height="20" patternUnits="userSpaceOnUse">
<rect width="40" height="20" fill="#132726"/>
<path d="M0 0 H40 M0 10 H40 M20 0 V10 M0 10 V20 M40 10 V20" stroke="#0a1716" stroke-width="2"/></pattern>`);
let back = rect(-40, -20, 880, 340, "url(#gh-brick)");
back += rect(-40, -20, 880, 340, k.lin([[0, "#000", 0.1], [1, "#000", 0.6]]));
back += rect(420, 32, 240, 130, "#2c1d12") + rect(428, 40, 224, 114, "#1b2524");
back += circle(490, 96, 34, "none", 'stroke="#e6efe9" stroke-width="1.4" opacity="0.7"') + circle(520, 96, 34, "none", 'stroke="#e6efe9" stroke-width="1.4" opacity="0.7"') + text(455, 150, "R.M. + M.R. = ?", { size: 13, fill: "#e6efe9", family: HAND, extra: 'opacity="0.65"' }) + path("M570 70 C590 60 610 74 600 92 L612 90", "none", 'stroke="#e6efe9" stroke-width="1.3" opacity="0.6"') + text(582, 120, "anchor", { size: 11, fill: "#e6efe9", family: HAND, extra: 'opacity="0.55" transform="rotate(-8 582 120)"' });
back += rect(40, 70, 200, 6, "#0a1514");
for (let i = 0; i < 6; i++) {
const x = 52 + i * 31, h = 18 + rand2() * 18;
back += rect(x, 70 - h, 20, h, ["#2a6a64", "#5a4a2a", "#3fbbff"][i % 3], `opacity="${r1(0.35 + rand2() * 0.3)}"`) + rect(x + 4, 70 - h - 4, 12, 4, "#0a1514");
}
let mid = k.glow(200, 140, 110, "#3fbbff", 0.4, "pulse");
mid += line(200, 150, 200, 250, "#7d6a3a", 4) + poly([[176, 250], [224, 250], [212, 238], [188, 238]], "#7d6a3a");
mid += `<g class="spin"><ellipse cx="200" cy="140" rx="54" ry="16" fill="none" stroke="#c9a227" stroke-width="2.5" opacity="0.9"/></g>`;
mid += `<ellipse cx="200" cy="140" rx="16" ry="54" fill="none" stroke="#c9a227" stroke-width="2" opacity="0.7"/>`;
mid += `<ellipse cx="200" cy="140" rx="40" ry="40" fill="none" stroke="#c9a227" stroke-width="1.5" opacity="0.6" transform="rotate(45 200 140)"/>`;
mid += poly([[200, 124], [210, 140], [200, 156], [190, 140]], "#9ff0ff", 'class="pulse"');
mid += rect(620, 180, 70, 70, "#0e1c1c") + rect(626, 168, 60, 12, "#2a3328") + rect(632, 156, 50, 12, "#41241f");
let front = rect(-40, 252, 880, 70, "#050a0a") + rect(-40, 246, 880, 8, "#0b1414");
front += candle(k, 560, 246, 1.3);
front += path("M380 246 L430 238 L470 246 L430 250 Z", "#d9ccb0", 'opacity="0.8"') + line(430, 238, 430, 250, "#5a4a2a", 1);
front += rect(300, 240, 22, 4, "#e6efe9", 'opacity="0.8" transform="rotate(-12 311 242)"');
return k.svg(layer(0.1, back) + layer(0.4, mid) + layer(0.75, front));
}
function writing_desk() {
const k = makeKit("wd");
const rand2 = rng(53);
let back = rect(-40, -20, 880, 340, k.lin([[0, "#1d2a2c"], [1, "#0a1112"]]));
back += rect(440, 20, 220, 180, "#0a0f10");
back += rect(450, 30, 200, 160, k.lin([[0, "#1a2340"], [1, "#3a3a5a"]]));
back += stars2(rand2, 14, { x0: 452, x1: 648, y0: 32, y1: 110, rMax: 1.1 }) + circle(600, 64, 14, "#f2ecd8", 'opacity="0.9"') + circle(594, 60, 13, "#1a2340");
back += rooftops(rand2, 190, 450, 650, "#0b0e18", { minH: 20, maxH: 70 });
back += line(550, 30, 550, 190, "#0a0f10", 5) + line(450, 110, 650, 110, "#0a0f10", 5);
let mid = rect(-40, 210, 880, 110, k.lin([[0, "#2b1d14"], [1, "#120c08"]]));
mid += candle(k, 300, 212, 1.6);
mid += poly([[360, 224], [520, 216], [532, 270], [372, 278]], "#efe6cf");
for (let i = 0; i < 6; i++) mid += line(380, 236 + i * 6.5, 504 - (i === 5 ? 50 : 0), 230 + i * 6.5, "#5a4a3a", 1, 'opacity="0.6"');
mid += circle(500, 262, 9, "#9a1f24") + circle(500, 262, 5, "#c0393f", 'opacity="0.7"');
mid += path("M560 250 C590 200 640 170 690 150 C650 190 610 220 566 254 Z", "#e6dcc4", 'opacity="0.85"') + line(566, 254, 548, 270, "#3a2a1a", 2);
mid += rect(600, 236, 30, 26, "#0b0806") + rect(606, 228, 18, 8, "#0b0806");
return k.svg(layer(0.1, back) + layer(0.5, mid));
}
function between_worlds() {
const k = makeKit("bw");
const rand2 = rng(61);
let back = rect(-40, -20, 460, 340, k.lin([[0, "#3d3020"], [1, "#a7743f"]]));
back += rect(400, -20, 440, 340, k.lin([[0, "#130d33"], [1, "#3b2a7a"]]));
back += rect(300, -20, 200, 340, k.lin([[0, "#3d3020", 0], [0.5, "#5a3a6a", 0.9], [1, "#130d33", 0]], 0, 0, 1, 0));
back += stars2(rand2, 36, { x0: 420, x1: 830, y1: 180 });
const clip = k.id("clip");
k.def(`<clipPath id="${clip}"><rect x="360" y="-20" width="500" height="340"/></clipPath>`);
back += `<g clip-path="url(#${clip})">${waveBand(236, 5, "#21185a", 'class="wave slow"')}</g>`;
back += rooftops(rand2, 230, -40, 380, "#1a130c", { minH: 20, maxH: 90 });
let mid = path("M120 300 V250 Q400 90 680 250 V300 H630 V262 Q400 140 170 262 V300 Z", "#0d0a12");
for (let i = 1; i < 12; i++) {
const t = i / 12;
const x = lerp(170, 630, t);
const y = 262 - Math.sin(Math.PI * t) * 108;
mid += line(x, y, x, y - 18, "#0d0a12", 2);
}
mid += path("M150 252 Q400 110 650 252", "none", 'stroke="#0d0a12" stroke-width="4"');
mid += figure(400, 166, 34, "#0d0a12", "none");
mid += gaslamp(k, 150, 220, 1, { glowR: 60 }) + rect(148, 228, 4, 80, "#0d0a12");
let front = rect(-40, 286, 420, 40, "#0a0806");
front += `<g clip-path="url(#${clip})">${waveBand(282, 6, "#120c38", 'class="wave"')}</g>`;
front += glyphs(rand2, 6, { x0: 460, x1: 800, y0: 40, y1: 200, colors: ["#b9a6ff", "#8fe8ff"] });
return k.svg(layer(0.05, back) + layer(0.35, mid) + layer(0.7, front));
}
function dreamSky(k, rand2, top = "#2a2154", bottom = "#08061a") {
return rect(-40, -20, 880, 340, k.lin([[0, top], [1, bottom]])) + stars2(rand2, 60);
}
function observatory() {
const k = makeKit("ob");
const rand2 = rng(17);
let back = dreamSky(k, rand2, "#1a1640", "#0a0820");
back += k.glow(400, 70, 90, "#d8d0ff", 0.4) + circle(400, 70, 26, "#ece8ff") + circle(392, 64, 5, "#c9c0ee") + circle(410, 78, 3, "#c9c0ee");
let mid = path("M-40 320 V140 Q400 -150 840 140 V320 Z M368 -40 L432 -40 L428 170 L372 170 Z", "#0a0816", 'fill-rule="evenodd"');
for (const t of [0.15, 0.3, 0.7, 0.85]) {
const x = lerp(-40, 840, t);
mid += path(`M${x} 320 Q${lerp(x, 400, 0.6)} 60 ${t < 0.5 ? 372 : 428} 10`, "none", 'stroke="#1a1533" stroke-width="3"');
}
mid += rect(-40, 250, 880, 70, "#07060f");
let front = `<g transform="rotate(-32 470 210)">${rect(330, 196, 240, 26, "#05040c")}${rect(560, 190, 24, 38, "#05040c")}</g>`;
front += line(470, 214, 430, 300, "#05040c", 6) + line(470, 214, 520, 300, "#05040c", 6) + line(470, 214, 470, 300, "#05040c", 5);
const sh = (x, y, d, cls) => `<g class="${cls}">${k.glow(x, y, 50, "#8a6dff", 0.35)}${d}</g>`;
front += sh(170, 150, path("M170 130 L190 140 L170 150 L150 140 Z M150 140 V160 L170 170 L190 160 V140 M170 150 V170", "rgba(138,109,255,0.15)", 'stroke="#b9a6ff" stroke-width="1.5"'), "bob");
front += sh(260, 110, circle(260, 110, 18, "rgba(63,214,255,0.12)", 'stroke="#8fe8ff" stroke-width="1.5"'), "bob alt");
front += sh(660, 120, path("M630 128 C650 112 682 112 696 128 L684 134 L642 134 Z", "rgba(138,109,255,0.18)", 'stroke="#d6cbff" stroke-width="1.6"'), "bob");
return k.svg(layer(0.05, back) + layer(0.3, mid) + layer(0.7, front));
}
function dreamspace() {
const k = makeKit("ds");
const rand2 = rng(5);
let back = dreamSky(k, rand2);
back += path("M-40 90 C120 40 280 130 420 80 C560 30 700 110 840 60 L840 110 C700 160 560 80 420 130 C280 180 120 90 -40 140 Z", k.lin([[0, "#3fd6ff", 0.16], [1, "#8a6dff", 0.04]]), 'class="shimmer"');
back += circle(640, 70, 34, "#ece8ff", 'opacity="0.9"') + circle(626, 62, 32, "#1d1748");
const island = (x, y, w, cls) => `<g class="${cls}">${path(`M${x - w} ${y} Q${x} ${y - 12} ${x + w} ${y} L${x + w * 0.5} ${y + 24} L${x + w * 0.1} ${y + 46} L${x - w * 0.4} ${y + 22} Z`, "#120c30")}
${rect(x - w * 0.5, y - 14, w * 0.25, 12, "#efe6cf", 'opacity="0.55"')}${rect(x - w * 0.2, y - 18, w * 0.2, 16, "#d9ccb0", 'opacity="0.45"')}
${line(x + w * 0.3, y - 4, x + w * 0.3, y - 34, "#120c30", 2)}${circle(x + w * 0.3, y - 38, 9, "#120c30")}</g>`;
let mid = island(170, 140, 60, "bob") + island(520, 170, 44, "bob alt") + island(720, 120, 36, "bob");
mid += glyphs(rand2, 14, { y1: 200, colors: ["#b9a6ff", "#8fe8ff", "#ff8fcf"] });
let front = waveBand(230, 7, "#1d1550", 'class="wave slow" opacity="0.9"') + waveBand(250, 8, "#140e3c", 'class="wave rev"') + waveBand(272, 9, "#0b0726", 'class="wave"');
front += k.pool(640, 240, 140, 10, "#d8d0ff", 0.25, "shimmer");
return k.svg(layer(0.05, back) + layer(0.35, mid) + layer(0.75, front));
}
function dream_inner() {
const k = makeKit("di");
const rand2 = rng(9);
let back = rect(-40, -20, 880, 340, k.rad([[0, "#6a4a7a"], [0.5, "#2a1a48"], [1, "#0a0618"]], 0.5, 0.45, 0.7));
for (let i = 0; i < 6; i++) {
const s = 1 - i * 0.15;
const w = 380 * s, h = 300 * s, x = 400 - w / 2, y = 290 - h;
back += path(
`M${r1(x)} 300 V${r1(y + w / 2)} A${r1(w / 2)} ${r1(w / 2)} 0 0 1 ${r1(x + w)} ${r1(y + w / 2)} V300`,
"none",
`stroke="${i % 2 ? "#c9a227" : "#9b82ff"}" stroke-width="${r1(2.5 * s)}" opacity="${r1(0.25 + i * 0.1)}"`
);
}
back += k.glow(400, 160, 140, "#ffd9a0", 0.55, "pulse");
const headL = `<g transform="translate(300 60) scale(0.9)"><path d="${HEAD}" fill="#ffe6c0" opacity="0.18"/></g>`;
const headR = `<g transform="translate(500 60) scale(-0.9 0.9)"><path d="${HEAD}" fill="#c9b8ff" opacity="0.18"/></g>`;
let mid = `<g class="bob">${headL}${headR}</g>`;
mid += glyphs(rand2, 8, { y0: 40, y1: 260, chars: "\xB7\u2726\u2727", colors: ["#ffe6c0", "#c9b8ff"], sMin: 10, sMax: 18 });
return k.svg(layer(0.05, back) + layer(0.3, mid));
}
function alphabet_vault() {
const k = makeKit("av");
const rand2 = rng(13);
let back = rect(-40, -20, 880, 340, k.lin([[0, "#1c1440"], [1, "#07051a"]]));
for (let x = -40; x < 840; x += 40) for (let y = 0; y < 300; y += 40) back += circle(x + 20, y + 20, 1.6, "#3a2e6b");
back += circle(400, 140, 128, "#0d0924") + circle(400, 140, 120, "#2b2068") + circle(400, 140, 104, "#1a1245");
back += k.glow(400, 140, 150, "#bfa8ff", 0.5, "pulse");
back += `<ellipse cx="560" cy="140" rx="40" ry="122" fill="#2b2068" stroke="#5c4fa8" stroke-width="3"/>`;
for (let a = 0; a < 12; a++) {
const t = a / 12 * Math.PI * 2;
back += circle(400 + Math.cos(t) * 112, 140 + Math.sin(t) * 112, 5, "#5c4fa8");
}
let mid = "";
for (const [x0, x1] of [[-30, 230], [570, 830]]) {
for (let row = 0; row < 4; row++) {
const y = 60 + row * 52;
mid += rect(x0, y + 6, x1 - x0, 5, "#0a0720");
for (let x = x0 + 10; x < x1 - 10; x += 26) {
mid += text(x, y, "ABCDEFGHIJKLMNOPQRSTUVXYZ"[Math.floor(rand2() * 25)], { size: 22, fill: "#9b82ff", extra: `opacity="${r1(0.35 + rand2() * 0.4)}"` });
}
}
}
mid += rect(372, 214, 56, 60, "#0d0924") + rect(364, 208, 72, 8, "#2b2068");
mid += `<g class="pulse">${k.glow(400, 172, 60, "#3fd6ff", 0.6)}</g>`;
mid += text(372, 196, "W", { size: 50, fill: "#e8faff" }) + text(375, 198, "W", { size: 50, fill: "#3fd6ff", extra: 'opacity="0.5"' });
const beam = k.lin([[0, "#fff6d0", 0.35], [1, "#fff6d0", 0]], 0, 0, 1, 1);
let front = `<g class="sway">${poly([[120, 150], [130, 150], [420, 300], [250, 300]], beam)}</g>`;
front += `<g class="sway" style="animation-delay:-3s">${poly([[680, 150], [690, 150], [560, 300], [380, 300]], beam)}</g>`;
front += figure(120, 300, 150, "#05030f", "helmet") + figure(690, 300, 150, "#05030f", "helmet");
front += rect(-40, 290, 880, 30, "#05030f");
return k.svg(layer(0.05, back) + layer(0.35, mid) + layer(0.8, front));
}
function old_bank() {
const k = makeKit("ob2");
const rand2 = rng(29);
let back = rect(-40, -20, 880, 340, k.lin([[0, "#1f1838"], [1, "#0b0918"]]));
back += poly([[300, -20], [500, -20], [480, 18], [440, 6], [400, 24], [350, 8], [320, 20]], "#cfd6ff", 'opacity="0.35"');
const beam = k.lin([[0, "#cfd6ff", 0.3], [1, "#cfd6ff", 0]]);
back += poly([[320, 10], [480, 10], [600, 300], [220, 300]], beam, 'class="shimmer"');
for (const x of [40, 170, 590, 720]) back += column(x, 10, 46, 260, "#2a2346", "rgba(0,0,0,0.3)");
back += rect(-40, 270, 880, 50, "#120e22");
let mid = rect(80, 180, 640, 20, "#1a1430") + rect(80, 200, 640, 100, "#100c20");
for (let i = 0; i < 6; i++) {
const x = 110 + i * 100;
mid += path(`M${x} 180 V120 Q${x + 35} 96 ${x + 70} 120 V180`, "none", 'stroke="#8a7a3a" stroke-width="2" opacity="0.8"');
for (let b = 1; b < 6; b++) mid += line(x + b * 11.6, 110, x + b * 11.6, 180, "#8a7a3a", 1.2, 'opacity="0.6"');
}
mid += rect(200, 166, 50, 14, "#3a2a20") + rect(206, 154, 40, 12, "#41241f") + rect(560, 168, 60, 12, "#2c2a3d");
let front = "";
for (let i = 0; i < 14; i++) {
const x = rand2() * 800, y = 270 + rand2() * 30;
front += rect(x, y, 16, 11, "#d9ccb0", `opacity="${r1(0.25 + rand2() * 0.4)}" transform="rotate(${r1(rand2() * 60 - 30)} ${r1(x)} ${r1(y)})"`);
}
front += path("M-40 -20 L90 -20 Q40 20 -40 90 Z", "none", 'stroke="#cfd6ff" stroke-width="0.6" opacity="0.4"') + path("M-40 20 Q20 0 60 -20 M-40 50 Q30 20 80 -20", "none", 'stroke="#cfd6ff" stroke-width="0.6" opacity="0.35"');
front += path("M640 300 L660 250 L700 250 L690 300 Z M650 250 L640 210 L690 205 L700 250", "#06040e");
return k.svg(layer(0.05, back) + layer(0.35, mid) + layer(0.8, front));
}
function ritual_chamber() {
const k = makeKit("rc");
const rand2 = rng(19);
let back = rect(-40, -20, 880, 340, k.rad([[0, "#2a1a50"], [1, "#05030c"]], 0.5, 0.6, 0.7));
for (const x of [-20, 120, 600, 740]) back += path(`M${x} 260 V90 Q${x + 40} 50 ${x + 80} 90 V260`, "#0d0820");
const col = k.lin([[0, "#d6cbff", 0], [0.4, "#b9a6ff", 0.45], [1, "#8fe8ff", 0.6]]);
back += `<g class="pulse">${rect(360, -20, 80, 270, col)}</g>`;
let mid = "";
for (const [rx, ry, op] of [[280, 48, 0.8], [220, 38, 0.6], [150, 26, 0.7], [70, 12, 0.9]]) {
mid += `<ellipse cx="400" cy="250" rx="${rx}" ry="${ry}" fill="none" stroke="#b9a6ff" stroke-width="1.6" opacity="${op}"/>`;
}
mid += path("M400 212 L590 268 L210 268 Z", "none", 'stroke="#c9a227" stroke-width="1.2" opacity="0.6"');
const runes = "\u16B1\u16D7\u16DF\u16DA\u16DA\u16D6\u16B1\u16DF\u16B7\u16D6\u16B1";
for (let i = 0; i < 14; i++) {
const t = i / 14 * Math.PI * 2;
mid += text(400 + Math.cos(t) * 250 - 6, 254 + Math.sin(t) * 43, runes[i % runes.length], { size: 14, fill: "#d6cbff", family: "serif", extra: 'opacity="0.75" class="twinkle"' });
}
mid += k.pool(400, 250, 200, 30, "#8a6dff", 0.35, "pulse");
let front = "";
for (let i = 0; i < 7; i++) {
const t = Math.PI * (0.1 + i / 6 * 0.8);
front += candle(k, 400 - Math.cos(t) * 330, 300 - Math.sin(t) * 16, 1.3 + rand2() * 0.3, { wax: "#cfc4e8" });
}
front += rect(-40, 296, 880, 30, "#05030c");
return k.svg(layer(0.05, back) + layer(0.4, mid) + layer(0.8, front));
}
function conceptual_seas() {
const k = makeKit("cs");
const rand2 = rng(3);
let back = rect(-40, -20, 880, 340, k.lin([[0, "#1a1240"], [0.6, "#6a3a7a"], [1, "#f0a36a"]]));
back += stars2(rand2, 40, { y1: 120 }) + k.glow(560, 230, 200, "#ffd59a", 0.6) + circle(560, 230, 34, "#ffe6b8", 'opacity="0.9"');
back += waveBand(232, 4, "#3a2668", 'class="wave slow"');
let mid = `<g class="rock">
${path("M220 236 L470 236 L440 268 L250 268 Z", "#0b0716")}
${line(300, 236, 300, 90, "#0b0716", 4)}${line(390, 236, 390, 110, "#0b0716", 4)}
${path("M304 96 Q350 130 304 170 Z", "#efe6cf", 'opacity="0.9"')}${path("M304 176 Q360 200 304 226 Z", "#efe6cf", 'opacity="0.85"')}
${path("M394 116 Q436 150 394 186 Z", "#efe6cf", 'opacity="0.85"')}
${path("M300 90 L330 96 L300 104 Z", "#0b0716")}${circle(312, 97, 2.5, "#efe6cf")}
${line(220, 236, 180, 206, "#0b0716", 3)}${line(180, 206, 300, 92, "#0b0716", 1)}
</g>`;
mid += glyphs(rand2, 10, { y0: 250, y1: 290, colors: ["#ffe6b8", "#b9a6ff"], sMin: 10, sMax: 18 });
let front = waveBand(262, 7, "#24164e", 'class="wave rev"') + waveBand(284, 8, "#120a30", 'class="wave"');
front += k.pool(560, 270, 160, 8, "#ffd59a", 0.35, "shimmer");
return k.svg(layer(0.05, back) + layer(0.4, mid) + layer(0.8, front));
}
function hearing_room() {
const k = makeKit("hr");
const rand2 = rng(71);
let back = rect(-40, -20, 880, 340, k.lin([[0, "#2c2117"], [1, "#100c08"]]));
for (const x of [-10, 110, 600, 720]) back += archWindow(x, 20, 70, 160, { glass: "#2a3348", frame: "#0f0a06" });
back += path("M330 0 H470 V150 L400 128 L330 150 Z", "#3a1420") + path("M330 0 H470 V150 L400 128 L330 150 Z", "none", 'stroke="#c9a227" stroke-width="2"');
back += path("M362 64 Q400 36 438 64 Q400 92 362 64 Z", "none", 'stroke="#c9a227" stroke-width="2"') + circle(400, 64, 9, "#c9a227");
back += path("M368 100 L400 108 L432 100 L432 118 L400 126 L368 118 Z", "none", 'stroke="#c9a227" stroke-width="1.5"');
back += gaslamp(k, 240, 80, 1.1) + gaslamp(k, 560, 80, 1.1);
let mid = "";
for (let i = 0; i < 9; i++) {
const x = 150 + i * 62;
const tall = i === 4;
if (tall) mid += path(`M${x - 26} 196 V${120} Q${x} 100 ${x + 26} 120 V196 Z`, "#2a0c14");
mid += circle(x, tall ? 146 : 156, tall ? 13 : 11, "#0b0806") + path(`M${x - 22} 196 Q${x} ${tall ? 150 : 162} ${x + 22} 196 Z`, "#0b0806");
}
mid += rect(110, 192, 580, 16, "#1c3a26") + rect(110, 208, 580, 70, "#173020");
for (const x of [200, 330, 470, 600]) mid += path(`M${x} 192 V178 Q${x + 6} 170 ${x + 12} 178 V192 Z`, "#b9c6d6", 'opacity="0.55"');
let front = "";
for (let row = 0; row < 2; row++) {
const y = 256 + row * 30;
let heads = "";
for (let x = -30 + rand2() * 20; x < 840; x += 36 + rand2() * 12) heads += circle(x, y - 12, 10 + rand2() * 2, row ? "#060403" : "#0c0805");
front += heads + rect(-40, y, 880, 40, row ? "#060403" : "#0c0805");
}
return k.svg(layer(0.08, back) + layer(0.3, mid) + layer(0.7, front));
}
function quiet_ward() {
const k = makeKit("qw");
const VP = { x: 400, y: 140 };
const far = { x0: 360, x1: 440, y0: 110, y1: 168 };
k.def(`<pattern id="qw-tile" width="22" height="22" patternUnits="userSpaceOnUse"><rect width="22" height="22" fill="#9fb0a8"/><path d="M0 0 H22 M0 0 V22" stroke="#7d8f87" stroke-width="1.5"/></pattern>`);
let back = rect(-40, -20, 880, 340, "#5f6f68");
back += poly([[-40, -20], [far.x0, far.y0], [far.x0, far.y1], [-40, 320]], "url(#qw-tile)");
back += poly([[840, -20], [far.x1, far.y0], [far.x1, far.y1], [840, 320]], "url(#qw-tile)");
back += poly([[-40, -20], [840, -20], [far.x1, far.y0], [far.x0, far.y0]], "#4a5752");
back += poly([[-40, 320], [840, 320], [far.x1, far.y1], [far.x0, far.y1]], "#6c7c75");
back += rect(far.x0, far.y0, far.x1 - far.x0, far.y1 - far.y0, "#2e3834");
back += rect(-40, -20, 880, 340, k.lin([[0, "#0a100e", 0.55], [0.5, "#0a100e", 0.2], [1, "#0a100e", 0.65]]));
let mid = "";
for (const t of [0.12, 0.36, 0.56, 0.72]) {
for (const side of [-1, 1]) {
const xNear = side < 0 ? -40 : 840, xFar = side < 0 ? far.x0 : far.x1;
const xa = lerp(xNear, xFar, t), xb = lerp(xNear, xFar, t + 0.09);
const top = (tt) => lerp(-20, far.y0, tt) + lerp(70, 10, tt);
const bot = (tt) => lerp(320, far.y1, tt);
mid += poly([[xa, top(t)], [xb, top(t + 0.09)], [xb, bot(t + 0.09)], [xa, bot(t)]], "#2f3a36");
const wy = lerp(top(t), bot(t), 0.22), wh = (bot(t) - top(t)) * 0.18;
const wx = lerp(xa, xb, 0.25), ww = (xb - xa) * 0.5;
mid += rect(Math.min(wx, wx + ww), wy, Math.abs(ww), wh, "#c8d4cc", 'opacity="0.35"');
for (let b = 1; b < 4; b++) mid += line(wx + ww * b / 4, wy, wx + ww * b / 4, wy + wh, "#1c2421", Math.max(1, 2.5 * (1 - t)));
}
}
mid += k.pool(VP.x, 290, 260, 22, "#e6f0e8", 0.18) + gaslamp(k, 400, 40, 1.2, { color: "#e8f2ea", glowR: 90 });
mid += figure(400, 166, 34, "#1c2421", "none", 'opacity="0.7"');
return k.svg(layer(0.05, back) + layer(0.25, mid));
}
function board_archive() {
const k = makeKit("ba");
const rand2 = rng(83);
let back = rect(-40, -20, 880, 340, k.lin([[0, "#241b10"], [1, "#0c0906"]]));
const cabinets = (x0, x1, y, h, c, light) => {
let out = "";
for (let x = x0; x < x1; x += 34) {
out += rect(x, y, 32, h, c);
for (let d = 0; d < Math.floor(h / 22); d++) {
out += rect(x + 3, y + 3 + d * 22, 26, 18, "none", `stroke="#000" stroke-opacity="0.35" stroke-width="1"`) + rect(x + 12, y + 10 + d * 22, 8, 3, "#c9a227", `opacity="${r1(0.25 + rand2() * 0.4 * light)}"`);
}
}
return out;
};
back += cabinets(-40, 300, 40, 180, "#3a2c1a", 0.5) + cabinets(500, 840, 40, 180, "#3a2c1a", 0.5);
back += k.glow(400, 120, 140, "#ffd98a", 0.25);
let mid = cabinets(-40, 180, -10, 290, "#21180d", 1) + cabinets(620, 840, -10, 290, "#21180d", 1);
mid += line(190, -10, 250, 300, "#0b0806", 5) + line(214, -10, 274, 300, "#0b0806", 5);
for (let i = 1; i < 10; i++) {
const t = i / 10;
mid += line(lerp(190, 250, t), lerp(-10, 300, t), lerp(214, 274, t), lerp(-10, 300, t), "#0b0806", 3);
}
let front = k.glow(400, 200, 110, "#ffe6a8", 0.45, "pulse");
front += rect(350, 232, 100, 70, "#120d08") + rect(340, 226, 120, 8, "#2a1d10");
front += path("M356 226 V180 Q400 140 444 180 V226 Z", "rgba(220,235,255,0.10)", 'stroke="#d8e2f0" stroke-width="1.5" stroke-opacity="0.6"');
front += path("M372 214 L400 220 L428 214 L428 200 L400 206 L372 200 Z", "#efe3c4") + line(400, 206, 400, 220, "#8a6a3a", 1);
return k.svg(layer(0.08, back) + layer(0.35, mid) + layer(0.7, front));
}
function dream_ledger() {
const k = makeKit("dl");
const rand2 = rng(97);
let back = dreamSky(k, rand2, "#1c1440", "#05030f");
back += k.glow(400, 150, 260, "#b9a6ff", 0.25);
let mid = "";
for (let i = 0; i < 16; i++) {
const x = rand2() * 800, y = rand2() * 260, rot = r1(rand2() * 70 - 35);
mid += `<g class="bob${i % 2 ? " alt" : ""}">${rect(x, y, 26, 34, "#efe6ff", `opacity="${r1(0.25 + rand2() * 0.35)}" transform="rotate(${rot} ${r1(x + 13)} ${r1(y + 17)})"`)}</g>`;
}
let front = `<g class="bob">
${path("M400 120 C340 100 250 104 190 124 L190 262 C250 244 340 242 400 262 Z", "#efe6cf")}
${path("M400 120 C460 100 550 104 610 124 L610 262 C550 244 460 242 400 262 Z", "#e6dcc0")}
${path("M190 262 C250 244 340 242 400 262 C460 242 550 244 610 262 L610 270 C550 254 460 254 400 274 C340 254 250 254 190 270 Z", "#8a7a5a")}
${line(400, 120, 400, 262, "#8a7a5a", 1.5)}`;
for (let r = 0; r < 9; r++) {
const y = 140 + r * 12;
front += line(212, y + 2, 384, y - 1, "#3a2e1a", 1, 'opacity="0.5"') + line(416, y - 1, 590 - (r === 4 ? 70 : 0), y + 2, "#3a2e1a", 1, 'opacity="0.5"');
}
front += text(440, 196, "PIRATE", { size: 18, fill: "#2a1d10" }) + line(436, 191, 520, 191, "#9a1f24", 2.5, 'class="shimmer"');
front += `</g>`;
front += k.pool(400, 290, 220, 14, "#b9a6ff", 0.35, "pulse");
return k.svg(layer(0.05, back) + layer(0.35, mid) + layer(0.65, front));
}
function london_street() {
const k = makeKit("ls");
const rand2 = rng(107);
let back = rect(-40, -20, 880, 340, k.lin([[0, "#3a3240"], [0.6, "#7a5a48"], [1, "#b98a5a"]]));
back += rooftops(rand2, 150, -40, 840, "#2a2230", { minH: 20, maxH: 70 });
back += rect(-40, 140, 880, 200, k.lin([[0, "#d9c8b0", 0.18], [1, "#d9c8b0", 0]]));
const shop = (x, w, sign, c) => rect(x, 120, w, 150, c) + rect(x + 8, 132, w - 16, 26, "#1a120c") + text(x + w / 2, 151, sign, { size: 14, fill: "#e8c97a", extra: 'text-anchor="middle"' }) + rect(x + 12, 172, w - 24, 70, "#f2c46b", 'opacity="0.55" class="flicker alt"') + line(x + w / 2, 172, x + w / 2, 242, c, 3);
let mid = shop(-20, 190, "HITE HART", "#2a1a14") + shop(180, 170, "ORKSHOP", "#22201c") + shop(360, 200, "BOOTS & ELLINGTONS", "#2a1a24") + shop(570, 150, "INE CELLARS", "#1e2022") + shop(730, 140, "THE TIMES", "#2a1a14");
mid += rect(-40, 268, 880, 60, "#2a2420");
for (let x = -40; x < 840; x += 18) for (let y = 274; y < 320; y += 10) mid += rect(x + (y % 20 ? 9 : 0), y, 16, 8, "#332c27", 'opacity="0.8"');
let front = gaslamp(k, 120, 170, 1.4, { glowR: 90 }) + rect(117, 182, 6, 130, "#0b0806");
front += figure(260, 300, 70, "#0b0806", "none") + rect(268, 252, 20, 14, "#efe6cf", 'transform="rotate(-8 278 259)"');
front += path("M520 300 V236 Q520 214 548 214 H660 Q690 214 690 240 V300 Z", "#0b0806") + circle(560, 296, 22, "none", 'stroke="#0b0806" stroke-width="6"') + circle(660, 296, 22, "none", 'stroke="#0b0806" stroke-width="6"');
front += circle(605, 250, 11, "none", 'stroke="#c9a227" stroke-width="2"') + circle(605, 250, 3, "#c9a227");
return k.svg(layer(0.06, back) + layer(0.35, mid) + layer(0.75, front));
}
var sets = {
lecture_hall,
practice_rooms,
worthington_office,
corridor,
ridgewell_exterior,
library,
grace_hideout,
writing_desk,
between_worlds,
observatory,
dreamspace,
dream_inner,
alphabet_vault,
old_bank,
ritual_chamber,
conceptual_seas,
hearing_room,
quiet_ward,
board_archive,
dream_ledger,
london_street
};
var cache = /* @__PURE__ */ new Map();
function buildSet(name, variant) {
const key = `${name}:${variant || ""}`;
if (!cache.has(key)) cache.set(key, sets[name](variant));
return cache.get(key);
}
// ../../../../private/tmp/molly-roger/src/stage/particles.js
var TAU = Math.PI * 2;
var rand = (a, b) => a + Math.random() * (b - a);
var LETTERS = "ABCDEFGHIJKLMNOPQRSTUVXYZ&?";
var PRESETS = {
dust: {
count: 46,
spawn: (w, h) => ({ x: rand(0, w), y: rand(0, h), r: rand(0.5, 1.8), vx: rand(-0.06, 0.06), vy: rand(-0.08, 0.03), a: rand(0.15, 0.55), t: rand(0, TAU) }),
color: (p) => `rgba(255, 222, 165, ${p.a * (0.6 + 0.4 * Math.sin(p.t))})`
},
moondust: {
count: 50,
spawn: (w, h) => ({ x: rand(w * 0.3, w * 0.75), y: rand(0, h), r: rand(0.4, 1.5), vx: rand(-0.05, 0.05), vy: rand(0.02, 0.1), a: rand(0.2, 0.6), t: rand(0, TAU) }),
color: (p) => `rgba(210, 220, 255, ${p.a * (0.6 + 0.4 * Math.sin(p.t))})`
},
dream: {
count: 56,
spawn: (w, h, initial) => ({ x: rand(0, w), y: initial ? rand(0, h) : h + 5, r: rand(0.6, 2.2), vx: rand(-0.1, 0.1), vy: rand(-0.35, -0.1), a: rand(0.3, 0.8), t: rand(0, TAU), hue: Math.random() < 0.6 ? 255 : 190 }),
color: (p) => `hsla(${p.hue}, 100%, 78%, ${p.a * (0.5 + 0.5 * Math.sin(p.t))})`,
glow: true
},
letters: {
count: 18,
spawn: (w, h, initial) => ({ x: rand(0, w), y: initial ? rand(0, h) : h + 20, r: rand(10, 20), vx: rand(-0.1, 0.1), vy: rand(-0.3, -0.12), a: rand(0.25, 0.6), t: rand(0, TAU), rot: rand(-0.5, 0.5), vr: rand(-4e-3, 4e-3), ch: LETTERS[Math.floor(Math.random() * LETTERS.length)] }),
draw(ctx2, p) {
ctx2.save();
ctx2.translate(p.x, p.y);
ctx2.rotate(p.rot);
ctx2.font = `${p.r}px "Geist Variable", sans-serif`;
ctx2.fillStyle = `rgba(190, 170, 255, ${p.a})`;
ctx2.fillText(p.ch, 0, 0);
ctx2.restore();
}
},
embers: {
count: 60,
spawn: (w, h, initial) => ({ x: rand(w * 0.15, w * 0.85), y: initial ? rand(0, h) : h + 5, r: rand(0.6, 2), vx: rand(-0.15, 0.15), vy: rand(-0.9, -0.3), a: rand(0.5, 1), t: rand(0, TAU), life: 1 }),
color: (p) => `rgba(255, ${Math.round(150 + 80 * p.life)}, 90, ${p.a * p.life})`,
glow: true,
age: (p) => {
p.life -= 3e-3;
return p.life > 0;
}
},
rain: {
count: 140,
spawn: (w, h, initial) => ({ x: rand(-50, w), y: initial ? rand(0, h) : rand(-40, -5), len: rand(8, 16), vx: 1.4, vy: rand(6, 9), a: rand(0.15, 0.35) }),
draw(ctx2, p) {
ctx2.strokeStyle = `rgba(190, 205, 230, ${p.a})`;
ctx2.lineWidth = 1;
ctx2.beginPath();
ctx2.moveTo(p.x, p.y);
ctx2.lineTo(p.x - p.vx * 2, p.y - p.len);
ctx2.stroke();
}
},
stars: {
count: 30,
spawn: (w, h) => ({ x: rand(0, w), y: rand(0, h * 0.6), r: rand(0.5, 1.4), vx: 0, vy: 0, a: rand(0.3, 0.9), t: rand(0, TAU) }),
color: (p) => `rgba(235, 230, 255, ${p.a * (0.4 + 0.6 * Math.abs(Math.sin(p.t)))})`,
shooting: true
},
none: { count: 0 }
};
function createParticles(canvas) {
const ctx2 = canvas.getContext("2d");
const reduced = window.matchMedia?.("(prefers-reduced-motion: reduce)");
let preset = PRESETS.none;
let particles2 = [];
let shooter = null;
let w = 0, h = 0, dpr = 1;
let raf = null;
function resize() {
const cw = canvas.clientWidth;
const ch = canvas.clientHeight;
if (!cw || !ch) return false;
dpr = Math.min(window.devicePixelRatio || 1, 2);
w = cw;
h = ch;
canvas.width = Math.round(w * dpr);
canvas.height = Math.round(h * dpr);
ctx2.setTransform(dpr, 0, 0, dpr, 0, 0);
return true;
}
const sizeIsStale = () => canvas.clientWidth !== w || canvas.clientHeight !== h || canvas.width === 0;
function step() {
if (sizeIsStale()) {
const wasEmpty = !w || !h;
if (resize() && wasEmpty) particles2 = particles2.map(() => preset.spawn(w, h, true));
}
ctx2.clearRect(0, 0, w, h);
for (let i = 0; i < particles2.length; i++) {
const p = particles2[i];
p.x += p.vx;
p.y += p.vy;
if (p.t !== void 0) p.t += 0.02;
if (p.vr) p.rot += p.vr;
const alive = preset.age ? preset.age(p) : true;
if (!alive || p.y < -30 || p.y > h + 30 || p.x < -60 || p.x > w + 60) {
particles2[i] = preset.spawn(w, h, false);
if (preset === PRESETS.dust || preset === PRESETS.moondust) particles2[i].y = rand(0, h);
continue;
}
if (preset.draw) {
preset.draw(ctx2, p);
} else {
ctx2.fillStyle = preset.color(p);
if (preset.glow) {
ctx2.shadowColor = ctx2.fillStyle;
ctx2.shadowBlur = 6;
}
ctx2.beginPath();
ctx2.arc(p.x, p.y, p.r, 0, TAU);
ctx2.fill();
ctx2.shadowBlur = 0;
}
}
if (preset.shooting) {
if (!shooter && Math.random() < 4e-3) shooter = { x: rand(w * 0.2, w), y: rand(0, h * 0.3), life: 1 };
if (shooter) {
const g = ctx2.createLinearGradient(shooter.x, shooter.y, shooter.x + 60, shooter.y - 20);
g.addColorStop(0, `rgba(255,255,255,${shooter.life})`);
g.addColorStop(1, "rgba(255,255,255,0)");
ctx2.strokeStyle = g;
ctx2.lineWidth = 1.2;
ctx2.beginPath();
ctx2.moveTo(shooter.x, shooter.y);
ctx2.lineTo(shooter.x + 60, shooter.y - 20);
ctx2.stroke();
shooter.x -= 6;
shooter.y += 2;
shooter.life -= 0.025;
if (shooter.life <= 0) shooter = null;
}
}
}
function loop() {
step();
raf = requestAnimationFrame(loop);
}
function stop() {
if (raf) cancelAnimationFrame(raf);
raf = null;
}
function start() {
stop();
if (!preset.count) {
ctx2.clearRect(0, 0, w, h);
return;
}
if (reduced?.matches) {
step();
return;
}
loop();
}
function set(name) {
const next = PRESETS[name] || PRESETS.none;
if (next === preset && particles2.length) return;
preset = next;
resize();
particles2 = Array.from({ length: preset.count || 0 }, () => preset.spawn(w, h, true));
start();
}
new ResizeObserver(() => {
if (resize() && !raf) start();
}).observe(canvas);
document.addEventListener("visibilitychange", () => document.hidden ? stop() : start());
return { set };
}
// ../../../../private/tmp/molly-roger/src/stage/stage.js
var reducedMotion3 = window.matchMedia?.("(prefers-reduced-motion: reduce)");
var TRANSITION_FOR_REALM = { dream: "tear", institution: "ink", neutral: "glow" };
var particles = null;
var currentSet = null;
var currentRealm = null;
var parallax = { x: 0, y: 0 };
function initStage() {
particles = createParticles(els.stageParticles);
els.stage.addEventListener("pointermove", (e) => {
const r = els.stage.getBoundingClientRect();
parallax = { x: ((e.clientX - r.left) / r.width - 0.5) * 2, y: ((e.clientY - r.top) / r.height - 0.5) * 2 };
applyParallax();
});
els.stage.addEventListener("pointerleave", () => {
parallax = { x: 0, y: 0 };
applyParallax();
});
}
function applyParallax() {
if (reducedMotion3?.matches) return;
const { x, y } = parallax;
els.stageScenery.querySelectorAll(".scenery-frame.shown .layer").forEach((g) => {
const d = Number(g.dataset.depth) || 0;
g.style.transform = `translate(${(-x * d * 24).toFixed(1)}px, ${(-y * d * 8).toFixed(1)}px)`;
});
els.stageCast.style.transform = `translate(${(-x * 12).toFixed(1)}px, ${(-y * 3).toFixed(1)}px)`;
}
function playTransition(kind) {
if (reducedMotion3?.matches) return;
const el = els.stageTransition;
el.className = "stage-transition";
void el.offsetWidth;
el.classList.add(kind);
}
function showScenery(location) {
const key = `${location.set}:${location.variant || ""}`;
if (key === currentSet) return;
const frame2 = document.createElement("div");
frame2.className = "scenery-frame";
frame2.innerHTML = buildSet(location.set, location.variant);
const old = [...els.stageScenery.children];
els.stageScenery.appendChild(frame2);
requestAnimationFrame(() => requestAnimationFrame(() => {
frame2.classList.add("shown");
applyParallax();
}));
old.forEach((f) => {
f.classList.remove("shown");
setTimeout(() => f.remove(), 1e3);
});
if (currentSet !== null) {
playTransition(location.realm !== currentRealm ? TRANSITION_FOR_REALM[location.realm] || "glow" : "glow");
}
currentSet = key;
currentRealm = location.realm;
}
function showCast(cast, speaker) {
const keep = /* @__PURE__ */ new Set();
for (const member of cast) {
const key = `${member.who}@${member.pos}`;
keep.add(key);
const defaults = castDefaults[member.who] || {};
const mood = member.mood || defaults.mood || "neutral";
const color = characters[member.who]?.color || "#ffffff";
let el = els.stageCast.querySelector(`[data-key="${CSS.escape(key)}"]`);
if (el && el._leaving) {
clearTimeout(el._leaving);
el._leaving = null;
el.style.opacity = "";
}
if (!el) {
el = document.createElement("div");
el.dataset.key = key;
el.innerHTML = `<div class="figure">${portraits[member.who] || ""}</div>`;
el.style.setProperty("--char", color);
el.style.color = color;
el.setAttribute("aria-hidden", "true");
els.stageCast.appendChild(el);
}
el.className = [
"cast-member",
`pos-${member.pos}`,
`mood-${mood}`,
defaults.projection ? "projection" : "",
speaker && member.who !== speaker ? "listening" : ""
].filter(Boolean).join(" ");
}
[...els.stageCast.children].forEach((el) => {
if (!keep.has(el.dataset.key) && !el._leaving) {
el.style.opacity = "0";
el._leaving = setTimeout(() => el.remove(), 450);
}
});
}
function renderStage(scene, cast) {
const location = locations[scene.location] || { set: "dreamspace", realm: "dream", ambience: "dream" };
showScenery(location);
particles.set(location.ambience || "none");
els.stageLocation.textContent = location.name || "";
els.stageSpeaker.textContent = scene.ending ? "" : scene.speaker || "";
showCast(cast, scene.speaker);
if (scene.ending) {
const index = endingIds.indexOf(scene.id);
els.stageCard.innerHTML = endingCard(scene.id, index, scene.endingTitle);
} else {
els.stageCard.innerHTML = "";
}
}
// ../../../../private/tmp/molly-roger/src/ui/setpieces/projection.js
var CUBE = [[100, 30], [140, 50], [140, 95], [100, 115], [60, 95], [60, 50]];
var SAIL = [[98, 12], [152, 74], [146, 106], [100, 112], [95, 64], [97, 28]];
var BRASS = [201, 162, 39];
var VIOLET = [155, 130, 255];
var DURATION = 6;
var mix = (a, b, t) => a.map((v, i) => Math.round(v + (b[i] - v) * t));
var projection_default = {
title: "The Examination",
help: "Press and hold <b>Focus</b> (or hold <kbd>Space</kbd>) to keep the cube a cube. The wind wants a sail. You don't have to fight it.",
mount(root, ctx2, finish) {
root.innerHTML = `
<div class="sp-projection">
<svg viewBox="0 0 200 130" class="sp-shape" aria-hidden="true">
<polygon class="sp-poly"/>
<g class="sp-edges"><line x1="100" y1="72" x2="100" y2="115"/><line x1="100" y1="72" x2="60" y2="50"/><line x1="100" y1="72" x2="140" y2="50"/></g>
</svg>
<div class="sp-gauge" aria-hidden="true">
<span>Cube</span><div class="sp-gauge-track"><div class="sp-gauge-mark"></div></div><span>Sail</span>
</div>
<div class="sp-timer" role="progressbar" aria-label="Time remaining"><div></div></div>
</div>
<div class="sp-actions">
<button type="button" class="sp-btn primary" data-hold>Focus (hold)</button>
<button type="button" class="sp-btn" data-sail>Let it become something else</button>
<button type="button" class="sp-btn" data-still>Make nothing at all</button>
</div>`;
const poly2 = root.querySelector(".sp-poly");
const edges = root.querySelector(".sp-edges");
const mark = root.querySelector(".sp-gauge-mark");
const timer2 = root.querySelector(".sp-timer div");
const holdBtn = root.querySelector("[data-hold]");
let m = 0.15;
let holding = false;
let t = 0;
let last = performance.now();
const late = [];
let raf = null;
const draw = () => {
const pts = CUBE.map((p, i) => [p[0] + (SAIL[i][0] - p[0]) * m, p[1] + (SAIL[i][1] - p[1]) * m]);
poly2.setAttribute("points", pts.map((p) => p.map((n) => n.toFixed(1)).join(",")).join(" "));
const [r, g, b] = mix(BRASS, VIOLET, m);
poly2.style.fill = `rgba(${r},${g},${b},0.18)`;
poly2.style.stroke = `rgb(${r},${g},${b})`;
edges.style.opacity = Math.max(0, 1 - m * 1.6).toFixed(2);
edges.style.stroke = `rgb(${r},${g},${b})`;
mark.style.left = `${(m * 100).toFixed(1)}%`;
timer2.style.width = `${Math.max(0, 100 - t / DURATION * 100)}%`;
};
const loop = (now) => {
const dt = Math.min(0.05, (now - last) / 1e3);
last = now;
t += dt;
const wind = (0.3 + 0.22 * Math.sin(t * 2.3) + 0.14 * Math.sin(t * 5.7 + 1)) * (ctx2.gentle ? 0.6 : 1);
m = clamp2(m + (holding ? -0.8 : wind) * dt, 0, 1);
if (t > DURATION / 2) late.push(m);
draw();
if (t >= DURATION) {
const avg = late.reduce((a, b) => a + b, 0) / Math.max(1, late.length);
if (avg < 0.45) finish("cube", "Six faces. Twelve edges. No opinions. Worthington nods.");
else finish("sail", "It billows. For one heartbeat the whole hall smells of the sea.");
return;
}
raf = requestAnimationFrame(loop);
};
const hold = (on) => {
holding = on;
holdBtn.classList.toggle("active", on);
};
const onKey = (e) => {
if (e.code !== "Space") return;
e.preventDefault();
hold(e.type === "keydown");
};
holdBtn.addEventListener("pointerdown", () => hold(true));
holdBtn.addEventListener("pointerup", () => hold(false));
holdBtn.addEventListener("pointerleave", () => hold(false));
window.addEventListener("keydown", onKey);
window.addEventListener("keyup", onKey);
root.querySelector("[data-sail]").addEventListener("click", () => finish("sail", "You stop holding on. The cube loosens, and catches a wind that isn't blowing."));
root.querySelector("[data-still]").addEventListener("click", () => finish("still", "You let the air stay empty, and in the quiet you hear someone humming."));
draw();
raf = requestAnimationFrame(loop);
return () => {
cancelAnimationFrame(raf);
window.removeEventListener("keydown", onKey);
window.removeEventListener("keyup", onKey);
};
}
};
// ../../../../private/tmp/molly-roger/src/ui/setpieces/vault.js
var BEAMS = [0.3, 0.55, 0.8];
var SWING = 0.13;
var DIVERT_TIME = 1.8;
var CATCH_DIST = 0.035;
var SCANDALS = 5;
var SCANDAL_LINES = [
"A duchess, a tuba and the Archbishop of Canterbury.",
"The Prince Consort's secret career as a music-hall juggler.",
"Three cabinet ministers in one very small rowing boat.",
"The Lord Chancellor's wig, discovered to be a cat.",
"An entirely fictional affair involving the Royal Mint."
];
var vault_default = {
title: "The Royal Alphabet Vault",
help: "Molly is crossing to the Vault door. When a searchlight sweeps near her, press its number (<kbd>1</kbd> <kbd>2</kbd> <kbd>3</kbd>) or click it to project a scandal and turn it away. Scandals are limited - spend them wisely.",
mount(root, ctx2, finish) {
const fast = ctx2.state.flags.has("sea_legs");
const crossTime = fast ? 6.5 : 8;
const beamSpeed = ctx2.gentle ? 0.6 : 1;
const catchDist = ctx2.gentle ? CATCH_DIST * 0.75 : CATCH_DIST;
const startScandals = ctx2.gentle ? SCANDALS + 2 : SCANDALS;
root.innerHTML = `
<div class="sp-vault">
<div class="sp-lane">
<div class="sp-door" aria-hidden="true"></div>
${BEAMS.map((_, i) => `<div class="sp-beam" data-beam="${i}"><span class="sp-beam-cone"></span><span class="sp-beam-spot"></span></div>`).join("")}
<div class="sp-path" aria-hidden="true"></div>
<div class="sp-molly" aria-label="Molly"><i class="fas fa-skull-crossbones"></i></div>
<div class="sp-scandal" aria-live="polite"></div>
</div>
</div>
<div class="sp-actions">
${BEAMS.map((_, i) => `<button type="button" class="sp-btn" data-divert="${i}">${i + 1}. Distract light ${i + 1}</button>`).join("")}
</div>
<p class="sp-count">Scandals left: <b>${startScandals}</b>${fast ? " · Your sea legs carry you quickly." : ""}</p>`;
const molly2 = root.querySelector(".sp-molly");
const scandalEl = root.querySelector(".sp-scandal");
const countEl = root.querySelector(".sp-count b");
const beams = BEAMS.map((anchor, i) => ({
anchor,
phase: Math.random() * Math.PI * 2,
speed: 1.1 + Math.random() * 0.6,
diverted: 0,
el: root.querySelector(`[data-beam="${i}"]`),
btn: root.querySelector(`[data-divert="${i}"]`)
}));
let scandals = startScandals;
let t = 0;
let last = performance.now();
let raf = null;
let lineIndex = 0;
const divert = (i) => {
const b = beams[i];
if (!b || b.diverted > 0 || scandals <= 0) return;
scandals--;
b.diverted = DIVERT_TIME;
countEl.textContent = scandals;
scandalEl.textContent = SCANDAL_LINES[lineIndex++ % SCANDAL_LINES.length];
scandalEl.classList.remove("pop");
void scandalEl.offsetWidth;
scandalEl.classList.add("pop");
ctx2.sfx("scandal");
};
const loop = (now) => {
const dt = Math.min(0.05, (now - last) / 1e3);
last = now;
t += dt;
const mollyX = clamp2(0.04 + t / crossTime * 0.9, 0, 0.94);
molly2.style.left = `${(mollyX * 100).toFixed(2)}%`;
for (const b of beams) {
b.diverted = Math.max(0, b.diverted - dt);
const x = b.diverted > 0 ? b.anchor - 0.22 : b.anchor + SWING * Math.sin(t * b.speed * beamSpeed + b.phase);
b.el.style.left = `${(x * 100).toFixed(2)}%`;
b.el.classList.toggle("diverted", b.diverted > 0);
b.btn.disabled = b.diverted > 0 || scandals <= 0;
if (b.diverted <= 0 && Math.abs(x - mollyX) < catchDist) {
molly2.classList.add("caught");
finish("lose", "Caught in the light! Molly snatches what she can - a single comma - and runs.");
return;
}
}
if (mollyX >= 0.93) {
finish("win", "Molly slips through the Vault door like a rumour.");
return;
}
raf = requestAnimationFrame(loop);
};
const onKey = (e) => {
if (/^[1-3]$/.test(e.key)) {
e.preventDefault();
e.stopPropagation();
divert(Number(e.key) - 1);
}
};
beams.forEach((b, i) => {
b.btn.addEventListener("click", () => divert(i));
b.el.addEventListener("click", () => divert(i));
});
window.addEventListener("keydown", onKey, true);
const start = setTimeout(() => {
last = performance.now();
raf = requestAnimationFrame(loop);
}, 900);
return () => {
clearTimeout(start);
cancelAnimationFrame(raf);
window.removeEventListener("keydown", onKey, true);
};
}
};
// ../../../../private/tmp/molly-roger/src/ui/setpieces/interrogation.js
function rounds(s) {
return [
{
q: "Where were you on the night the letter was taken?",
thoughts: [
{ text: "The dormitory clock, ticking", value: 2 },
{ text: "The sound of the sea, very far off", value: 1 },
{ text: "Molly laughing at the Vault door", value: 0 }
]
},
{
q: "Who is Molly Roger?",
thoughts: [
{ text: "A name from an old story", value: 2 },
{ text: "A voice I hear sometimes", value: 1 },
{ text: s.flags.has("promised_molly") ? "Someone I promised" : "My friend. My captain.", value: 0 }
]
},
{
q: "And what is it you want, {name}?",
thoughts: [
{ text: "To pass my examinations", value: 2 },
{ text: "To understand my Sight", value: 1 },
{ text: s.flags.has("pip_friend") ? "To keep Pip and Admiral away from you" : "To help her become real", value: 0 }
]
}
];
}
var REACTION = [
"Her pencil moves for a long time.",
"Her pencil moves, once.",
"Her pencil doesn't move at all."
];
var interrogation_default = {
title: "Inspector Vane's Questions",
help: "Vane asks; you choose which thought to let her see. The truest thought always pushes forward. Pick the safest before time runs out - <kbd>1</kbd> <kbd>2</kbd> <kbd>3</kbd> work too.",
mount(root, ctx2, finish) {
const s = ctx2.state;
const seconds = clamp2(4 + (s.self - 50) / 25 - s.suspicion / 50, 2.5, 7) * (ctx2.reduced || ctx2.gentle ? 1.6 : 1);
const all = rounds(s);
let round = 0;
let score = 0;
let timer2 = null;
let raf = null;
let locked = false;
root.innerHTML = `
<div class="sp-interrogation">
<p class="sp-question"></p>
<div class="sp-thoughts" role="group" aria-label="Thoughts"></div>
<div class="sp-timer" role="progressbar" aria-label="Time remaining"><div></div></div>
<p class="sp-reaction" aria-live="polite"></p>
<div class="sp-pips" aria-hidden="true">${all.map(() => "<span></span>").join("")}</div>
</div>`;
const qEl = root.querySelector(".sp-question");
const box = root.querySelector(".sp-thoughts");
const bar2 = root.querySelector(".sp-timer div");
const reaction = root.querySelector(".sp-reaction");
const pips = [...root.querySelectorAll(".sp-pips span")];
let current2 = [];
const answer = (value) => {
if (locked) return;
locked = true;
clearTimeout(timer2);
cancelAnimationFrame(raf);
score += Math.max(0, value);
pips[round].className = ["bad", "mid", "good"][Math.max(0, value)];
reaction.textContent = value < 0 ? "You hesitate. She writes that down too." : REACTION[value];
ctx2.sfx("quill");
round++;
setTimeout(next, 1e3);
};
const next = () => {
if (round >= all.length) {
if (score >= 5) finish("perfect", "Vane closes the ledger. 'Thank you. That will be all.'");
else if (score >= 3) finish("fair", "'Dreams,' Vane says, 'are not yet an offence.'");
else finish("poor", "Vane writes for a long time. 'You're a poor liar,' she says, not unkindly.");
return;
}
locked = false;
const r = all[round];
qEl.textContent = `'${r.q.replace("{name}", s.player?.name || "")}'`;
reaction.textContent = "";
current2 = shuffle(r.thoughts);
box.innerHTML = current2.map((th, i) => `<button type="button" class="sp-thought${th.value === 0 ? " intrusive" : ""}" data-i="${i}" style="--d:${(Math.random() * 2).toFixed(2)}s">
<span class="sp-key">${i + 1}</span>${th.text}</button>`).join("");
box.querySelectorAll("button").forEach((btn) => btn.addEventListener("click", () => answer(current2[Number(btn.dataset.i)].value)));
box.querySelector("button").focus();
const start = performance.now();
const tick2 = (now) => {
const left = 1 - (now - start) / (seconds * 1e3);
bar2.style.width = `${Math.max(0, left * 100)}%`;
if (left > 0) raf = requestAnimationFrame(tick2);
};
raf = requestAnimationFrame(tick2);
timer2 = setTimeout(() => answer(-1), seconds * 1e3);
};
const onKey = (e) => {
if (/^[1-3]$/.test(e.key) && current2[Number(e.key) - 1]) {
e.preventDefault();
e.stopPropagation();
answer(current2[Number(e.key) - 1].value);
}
};
window.addEventListener("keydown", onKey, true);
next();
return () => {
clearTimeout(timer2);
cancelAnimationFrame(raf);
window.removeEventListener("keydown", onKey, true);
};
}
};
// ../../../../private/tmp/molly-roger/src/ui/setpieces/anchors.js
var ANCHORS = [
"The street you were born on",
"The colour of your mother's door",
"The first thing you ever stole"
];
var DECOYS = [
"The smell of tar on her hands",
"The name of her ship",
"The word for what she is",
"The sound of the sea",
"The weight of a cutlass"
];
var anchors_default = {
title: "Hold On",
help: (s) => s.flags.has("anchored") || s.flags.has("grace_witness") ? "Molly's voice is rising like a tide. Say your anchors in Grace's order - <b>street, door, stolen thing</b> - before it drowns you out. Keys <kbd>1</kbd>-<kbd>6</kbd> work too." : "Molly's voice is rising like a tide. Somewhere in it are three things that are only yours. Find them, in the right order, before it drowns you out. Nobody taught you the order - guess, and hold on.",
mount(root, ctx2, finish) {
const s = ctx2.state;
const anchored = s.flags.has("anchored");
const witness = s.flags.has("grace_witness");
const total = (9 + (anchored ? 3 : 0)) * (ctx2.reduced || ctx2.gentle ? 1.6 : 1);
let remaining = total;
let said = 0;
let tiles = [];
let last = performance.now();
let raf = null;
root.innerHTML = `
<div class="sp-anchors">
<div class="sp-tide" aria-hidden="true"><div></div></div>
<p class="sp-said" aria-live="polite"></p>
<div class="sp-tiles" role="group" aria-label="Phrases"></div>
${witness ? '<p class="sp-witness">Somewhere close, Grace is saying your name.</p>' : ""}
</div>`;
const tide = root.querySelector(".sp-tide div");
const saidEl = root.querySelector(".sp-said");
const box = root.querySelector(".sp-tiles");
tiles = shuffle([...ANCHORS, ...shuffle(DECOYS).slice(0, 3)]);
const render2 = () => {
box.innerHTML = tiles.map((text2, i) => {
const hint = witness && text2 === ANCHORS[said];
return `<button type="button" class="sp-tile${hint ? " hint" : ""}" data-i="${i}"><span class="sp-key">${i + 1}</span>${text2}</button>`;
}).join("");
box.querySelectorAll("button").forEach((btn) => btn.addEventListener("click", () => pick(Number(btn.dataset.i))));
saidEl.textContent = ANCHORS.slice(0, said).map((a) => a.replace(/^The /, "")).join(" - ");
};
const pick = (i) => {
const text2 = tiles[i];
if (!text2) return;
if (text2 === ANCHORS[said]) {
said++;
tiles = tiles.filter((t) => t !== text2);
if (!anchored) tiles = shuffle(tiles);
ctx2.sfx("anchor");
if (said === ANCHORS.length) {
finish("held", "Street. Door. Stolen thing. You hold on - and your name stays yours.");
return;
}
render2();
} else {
remaining -= ctx2.gentle ? 1 : 1.8;
const btn = box.querySelector(`[data-i="${i}"]`);
btn?.classList.add("wrong");
ctx2.sfx("wrong");
}
};
const loop = (now) => {
remaining -= (now - last) / 1e3;
last = now;
tide.style.width = `${Math.min(100, (1 - remaining / total) * 100)}%`;
if (remaining <= 0) {
finish("lost", "The tide comes in over everything. You'll have to hope you're strong enough without them.");
return;
}
raf = requestAnimationFrame(loop);
};
const onKey = (e) => {
if (/^[1-6]$/.test(e.key)) {
e.preventDefault();
e.stopPropagation();
pick(Number(e.key) - 1);
}
};
window.addEventListener("keydown", onKey, true);
render2();
raf = requestAnimationFrame(loop);
return () => {
cancelAnimationFrame(raf);
window.removeEventListener("keydown", onKey, true);
};
}
};
// ../../../../private/tmp/molly-roger/src/ui/setpieces/index.js
var PIECES = { projection: projection_default, vault: vault_default, interrogation: interrogation_default, anchors: anchors_default };
var reducedMotion4 = window.matchMedia?.("(prefers-reduced-motion: reduce)");
function runSetPiece(type, host, { state: state2, skipOutcome, sfx: sfx2 = () => {
}, gentle = false }) {
const piece = PIECES[type];
if (!piece) return Promise.resolve(skipOutcome);
return new Promise((resolve) => {
host.innerHTML = `
<section class="setpiece" aria-label="${piece.title}">
<header class="sp-head">
<h3 class="sp-title">${piece.title}</h3>
<p class="sp-help">${typeof piece.help === "function" ? piece.help(state2) : piece.help}</p>
</header>
<div class="sp-body"></div>
<p class="sp-result" aria-live="assertive"></p>
<footer class="sp-foot">
<button type="button" class="sp-skip">Skip - decide for me</button>
</footer>
</section>`;
const body = host.querySelector(".sp-body");
const result = host.querySelector(".sp-result");
let finished = false;
let cleanup = () => {
};
const finish = (key, message) => {
if (finished) return;
finished = true;
cleanup();
host.querySelector(".sp-skip").disabled = true;
if (message) {
result.textContent = message;
result.classList.add("shown");
}
sfx2(key === skipOutcome ? "choice" : "setpiece");
setTimeout(() => {
host.innerHTML = "";
resolve(key);
}, message ? 1500 : 0);
};
host.querySelector(".sp-skip").addEventListener("click", () => finish(skipOutcome));
body.innerHTML = `<div class="sp-ready"><button type="button" class="sp-btn primary sp-begin">Begin</button></div>`;
const begin = body.querySelector(".sp-begin");
begin.addEventListener("click", () => {
if (finished) return;
cleanup = piece.mount(body, { state: state2, reduced: !!reducedMotion4?.matches, sfx: sfx2, gentle }, finish) || (() => {
});
body.querySelector("button")?.focus();
}, { once: true });
begin.focus();
});
}
var clamp2 = (v, lo, hi) => Math.max(lo, Math.min(hi, v));
var shuffle = (arr) => {
const a = [...arr];
for (let i = a.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[a[i], a[j]] = [a[j], a[i]];
}
return a;
};
// ../../../../private/tmp/molly-roger/src/ui/home.js
var open = false;
var artDrawn = false;
var isHomeOpen = () => open;
function drawArt() {
if (artDrawn) return;
artDrawn = true;
els.homeScenery.innerHTML = buildSet("conceptual_seas");
els.homeFigure.innerHTML = portraits["Molly Roger"];
els.homeFigure.style.color = characters["Molly Roger"].color;
}
function describeRun(state2) {
const scene = scenes[state2.currentSceneId];
if (!scene) return state2.player.name;
if (scene.ending) return `${state2.player.name} \xB7 Ending: ${scene.endingTitle}`;
const act = acts[scene.act];
return [state2.player.name, act && `${act.title} \xB7 ${act.subtitle}`].filter(Boolean).join(" \xB7 ");
}
function endingDots(state2) {
const found = new Set(state2.discoveredEndings);
const dots = endingIds.map((id) => `<span class="home-dot${found.has(id) ? " found" : ""}"></span>`).join("");
const label = found.size ? `${found.size} of ${endingIds.length} endings found${state2.runs > 1 ? ` \xB7 ${state2.runs} runs` : ""}` : `${endingIds.length} endings to find`;
return `<div class="home-dots" aria-hidden="true">${dots}</div><span class="home-dots-label">${escapeHtml(label)}</span>`;
}
function showHome(state2, { hasSave: hasSave2 }) {
drawArt();
els.homeContinue.hidden = !hasSave2;
els.homeContinueMeta.textContent = hasSave2 ? describeRun(state2) : "";
els.homeNew.classList.toggle("primary", !hasSave2);
els.homeNewMeta.textContent = hasSave2 ? "Starts over. Endings and the codex are kept." : `Choose your name, then begin. There are ${endingIds.length} endings to find.`;
const codexCount = state2.codex?.length || 0;
els.homeGalleryCount.textContent = `${state2.discoveredEndings.length}/${endingIds.length}`;
els.homeCodexCount.textContent = `${codexCount}/${codex.length}`;
els.homeEndings.innerHTML = endingDots(state2);
els.home.hidden = false;
document.querySelector(".app")?.setAttribute("inert", "");
document.body.classList.add("home-open");
open = true;
requestAnimationFrame(() => (hasSave2 ? els.homeContinue : els.homeNew).focus({ preventScroll: true }));
}
function hideHome() {
if (!open) return;
open = false;
els.home.hidden = true;
document.querySelector(".app")?.removeAttribute("inert");
document.body.classList.remove("home-open");
}
// ../../../../private/tmp/molly-roger/src/game.js
var state = createState();
var lastShownAct = 0;
var visibleChoices = [];
var busy = false;
var shown = false;
var hasSave = false;
var codexTitle = (id) => codex.find((e) => e.id === id)?.title || id;
async function goTo(sceneId, choiceText, before = null) {
const scene = scenes[sceneId];
if (!scene) {
showSceneError({ id: sceneId }, new Error("missing scene"));
return;
}
if (scene.act && scene.act > lastShownAct) {
busy = true;
sfx("curtain");
await showActTransition(scene.act);
lastShownAct = scene.act;
busy = false;
}
const unlocked = enterScene(state, scene, choiceText);
const changes = before ? describeChanges(before, snapshot(state)) : [];
changes.push(...unlocked.map((id) => ({ kind: "codex", label: codexTitle(id) })));
if (changes.some((c) => c.kind === "item" && c.gained)) sfx("item");
if (scene.ending) sfx("ending");
render(scene, changes);
persist(false);
}
async function choose(index) {
const entry = visibleChoices[index];
if (!entry || entry.locked || busy) return;
const { choice } = entry;
clearChoices();
sfx("choice");
if (choice.playAgain) {
newGame(state.player);
return;
}
let outcome = null;
if (choice.setPiece) {
busy = true;
outcome = await runSetPiece(choice.setPiece, els.choices, {
state: view(state),
skipOutcome: choice.skipOutcome,
sfx,
gentle: getSettings().gentle
});
busy = false;
}
const picked = effectiveChoice(choice, outcome);
const before = snapshot(state);
applyChoice(state, picked);
goTo(resolveNext(picked, state), entry.text, before);
}
function chooseByNumber(n) {
if (isTyping() || busy || isHomeOpen()) return;
choose(n - 1);
}
function jumpTo(index) {
if (busy || !rewindTo(state, index)) return;
lastShownAct = highestAct(state, scenes);
closeOverlay(els.journeyOverlay);
render(scenes[state.currentSceneId], []);
persist(false);
}
function newGame(player) {
state = newRun(state, player);
lastShownAct = 0;
hasSave = true;
els.continueBanner.hidden = true;
goTo(START_SCENE, null);
}
async function restart() {
if (busy) return;
const ok = await confirmDialog("Start a new game? Your current journey will be lost (discovered endings and the codex are kept).", "Restart");
if (!ok) return;
const player = await askForPlayer(state.player, { submitLabel: "Begin again" });
if (player) newGame(player);
}
async function editPlayer() {
closeOverlay(els.settingsOverlay);
const player = await askForPlayer(state.player, { submitLabel: "Amend the register" });
if (!player) return;
state.player = player;
if (!hasSave) return;
if (!busy && shown) render(scenes[state.currentSceneId], []);
persist(false);
}
function openJourney() {
renderJourneyList(state.journeySteps, { onJump: jumpTo });
openOverlay(els.journeyOverlay);
}
var openSatchel2 = () => openSatchel(state);
var openGallery2 = () => openGallery(state);
var openCodex2 = () => openCodex(state);
function refreshChoices() {
if (busy || isTyping()) return;
const scene = scenes[state.currentSceneId];
if (scene) renderChoices(scene);
}
function clearChoices() {
visibleChoices = [];
els.choices.innerHTML = "";
}
function render(scene, changes) {
shown = true;
document.body.dataset.theme = scene.theme || "neutral";
renderStage(scene, castFor(scene, state));
const location = locations[scene.location] || {};
els.sceneHeading.textContent = scene.ending ? `Ending: ${scene.endingTitle}` : location.name || "";
setScene(location.realm || scene.theme, location.ambience || "none");
if (scene.ending) renderEnding(scene, state, { onShowGallery: openGallery2 });
else clearEnding();
clearChoices();
renderStatus(state);
renderRelationships(state);
renderProgress(state, scene);
const act = acts[scene.act];
els.actPill.textContent = scene.ending ? "Ending" : act ? `${act.title} \xB7 ${act.subtitle}` : "";
renderChanges(getSettings().showChanges ? changes : []);
renderBreadcrumbs(state.journeySteps, { onJump: jumpTo, onShowAll: openJourney });
els.sceneText.classList.remove("fade-in");
void els.sceneText.offsetWidth;
els.sceneText.classList.add("fade-in");
els.sceneText.parentElement.scrollTop = 0;
els.skipHint.classList.add("visible");
els.srLive.textContent = "";
let text2;
try {
text2 = resolveText(scene, state);
} catch (err) {
showSceneError(scene, err);
return;
}
showChoicesWaiting(scene);
typeText(linesFor(text2, scene), els.sceneText, () => {
els.skipHint.classList.remove("visible");
els.srLive.textContent = stripTags(text2);
renderRelationships(state);
renderProgress(state, scene);
renderChoices(scene);
}, textSpeedMs());
}
function showChoicesWaiting(scene) {
let count = 3;
try {
count = Math.max(1, Math.min(4, choicesFor(scene, state, { setPieces: getSettings().setPieces }).length));
} catch {
}
els.choices.innerHTML = `
<div class="choices-waiting" role="status">
<div class="waiting-head">
<span class="waiting-dots" aria-hidden="true"><i></i><i></i><i></i></span>
<span>Your choices will appear here</span>
</div>
${Array.from({ length: count }, (_, i) => `<div class="waiting-card" style="--i:${i}" aria-hidden="true"><span></span><span></span></div>`).join("")}
<button type="button" class="waiting-skip">Show them now <kbd>Space</kbd></button>
</div>`;
els.choices.querySelector(".waiting-skip").addEventListener("click", () => skipTyping());
}
function linesFor(text2, scene) {
return splitLines(text2, scene.speaker).map(({ text: text3, speaker }) => {
if (speaker === PLAYER) {
return { text: text3, speaker: { label: state.player.name || "You", color: "var(--accent)", player: true } };
}
const c = speaker && characters[speaker];
return { text: text3, speaker: c ? { label: c.short || speaker, color: c.color } : null };
});
}
function showSceneError(scene, err) {
console.error(`Scene "${scene?.id}" failed to render`, err);
els.skipHint.classList.remove("visible");
els.sceneText.textContent = "The Dreamspace hiccups. This page of the story wouldn't open - it's our fault, not yours.";
els.choices.innerHTML = "";
const back = document.createElement("button");
back.type = "button";
back.className = "choice-btn";
back.innerHTML = '<span class="choice-number">1</span><span class="choice-body">Go back one step</span>';
back.addEventListener("click", () => jumpTo(Math.max(0, state.journeySteps.length - 2)));
els.choices.appendChild(back);
}
function renderChoices(scene) {
visibleChoices = choicesFor(scene, state, { setPieces: getSettings().setPieces });
els.choices.innerHTML = "";
visibleChoices.forEach((entry, i) => {
const { choice, locked, hint, text: text2 } = entry;
const btn = document.createElement("button");
btn.type = "button";
btn.className = "choice-btn fade-in" + (choice.risky ? " risky" : "") + (choice.playAgain ? " play-again" : "") + (choice.setPiece ? " setpiece-choice" : "") + (locked ? " locked" : "");
btn.style.animationDelay = `${i * 60}ms`;
btn.disabled = locked;
const icon = locked ? '<i class="fas fa-lock lock-icon" aria-hidden="true"></i>' : choice.risky ? '<i class="fas fa-triangle-exclamation risky-icon" title="This choice carries real risk"></i>' : "";
btn.innerHTML = `
<span class="choice-number">${i + 1}</span>
<span class="choice-body">
<span>${icon}${escapeHtml(text2)}</span>
${locked && hint ? `<span class="choice-hint">${escapeHtml(hint)}</span>` : ""}
${choice.setPiece && !locked ? '<span class="choice-hint"><i class="fas fa-hand-sparkles"></i> Interactive</span>' : ""}
</span>`;
if (locked) btn.setAttribute("aria-label", `${text2} (locked: ${hint})`);
btn.addEventListener("click", () => choose(i));
els.choices.appendChild(btn);
});
if (document.activeElement === document.body || !document.activeElement) {
els.choices.querySelector("button:not(:disabled)")?.focus({ preventScroll: true });
}
}
async function persist(showToast) {
const ok = await save(state);
renderPersistenceNote(persistenceMode);
if (showToast) showSaveToast(ok);
}
async function boot() {
const saved = await load();
renderPersistenceNote(persistenceMode);
if (saved) {
state = saved;
lastShownAct = highestAct(state, scenes);
hasSave = true;
}
showHome(state, { hasSave });
}
function openHome() {
if (busy) return;
showHome(state, { hasSave });
}
function continueGame() {
if (!hasSave) return;
hideHome();
if (!shown) render(scenes[state.currentSceneId], []);
}
async function startNewGame() {
if (hasSave) {
const ok = await confirmDialog("Start a new game? Your current journey will be lost (discovered endings and the codex are kept).", "Start again");
if (!ok) return;
}
const player = await askForPlayer(state.player, { submitLabel: hasSave ? "Begin again" : "Sign the register" });
if (!player) return;
hideHome();
newGame(player);
}
// ../../../../private/tmp/molly-roger/src/main.js
function wireControls() {
els.restartBtn.addEventListener("click", restart);
els.saveBtn.addEventListener("click", () => persist(true));
els.aboutLink.addEventListener("click", () => openOverlay(els.aboutOverlay));
els.storyLink.addEventListener("click", () => openOverlay(els.storyOverlay));
els.journeyLink.addEventListener("click", openJourney);
els.satchelLink.addEventListener("click", openSatchel2);
els.carriedOpen.addEventListener("click", openSatchel2);
els.carriedList.addEventListener("click", (e) => {
if (e.target.closest(".carried-chip")) openSatchel2();
});
els.galleryLink.addEventListener("click", openGallery2);
els.codexLink.addEventListener("click", openCodex2);
els.homeLink.addEventListener("click", openHome);
els.homeContinue.addEventListener("click", continueGame);
els.homeNew.addEventListener("click", startNewGame);
els.homeGallery.addEventListener("click", openGallery2);
els.homeCodex.addEventListener("click", openCodex2);
els.homeAbout.addEventListener("click", () => openOverlay(els.aboutOverlay));
els.homeSettings.addEventListener("click", () => openOverlay(els.settingsOverlay));
let setPiecesWas = getSettings().setPieces;
onSettingsChange((s) => {
setVolume(s.volume);
setEnabled(s.sound);
if (s.setPieces !== setPiecesWas) {
setPiecesWas = s.setPieces;
refreshChoices();
}
});
window.addEventListener("pointerdown", unlock, { once: true });
window.addEventListener("keydown", unlock, { once: true });
els.dismissContinueBanner.addEventListener("click", () => {
els.continueBanner.hidden = true;
});
wireSettings({ onEditPlayer: editPlayer });
els.sceneText.addEventListener("click", skipTyping);
document.addEventListener("keydown", (e) => {
if (anyOverlayOpen() || isHomeOpen() || e.ctrlKey || e.metaKey || e.altKey) return;
const tag = document.activeElement?.tagName;
const onButton = tag === "BUTTON" || tag === "A";
if (e.key === " " && !onButton) {
e.preventDefault();
skipTyping();
return;
}
if (e.key === "Enter" && !onButton) {
if (skipTyping()) e.preventDefault();
return;
}
if (/^[1-9]$/.test(e.key)) chooseByNumber(Number(e.key));
});
}
window.addEventListener("DOMContentLoaded", () => {
loadSettings();
setVolume(getSettings().volume);
setEnabled(getSettings().sound);
collectElements();
watchTheme();
wireOverlays();
wireControls();
initStage();
boot();
});
})();
(() => {
document.querySelectorAll("[data-back-to-games]").forEach(link => {
link.addEventListener("click", () => {
try {
localStorage.setItem("archive_menu_hidden", "false");
window.parent?.dispatchEvent(new Event("archive-menu-toggle"));
} catch {}
});
});
const getFsElement = () => {
try {
if (window.parent && window.parent.document) {
const pFs = window.parent.document.fullscreenElement || window.parent.document.webkitFullscreenElement;
if (pFs) return pFs;
}
} catch {}
return document.fullscreenElement || document.webkitFullscreenElement;
};
const syncFullscreenIcons = () => {
const isFs = !!getFsElement();
document.querySelectorAll("[data-fullscreen-toggle] i").forEach(icon => {
icon.className = isFs ? "fas fa-compress" : "fas fa-expand";
});
};
document.querySelectorAll("[data-fullscreen-toggle]").forEach(btn => {
btn.addEventListener("click", () => {
const target = window.frameElement || document.documentElement;
if (!getFsElement()) {
const req = target.requestFullscreen || target.webkitRequestFullscreen;
req?.call(target);
} else {
try {
const pDoc = window.parent?.document;
if (pDoc && (pDoc.fullscreenElement || pDoc.webkitFullscreenElement)) {
(pDoc.exitFullscreen || pDoc.webkitExitFullscreen)?.call(pDoc);
return;
}
} catch {}
(document.exitFullscreen || document.webkitExitFullscreen)?.call(document);
}
});
});
document.addEventListener("fullscreenchange", syncFullscreenIcons);
document.addEventListener("webkitfullscreenchange", syncFullscreenIcons);
try {
window.parent?.document?.addEventListener("fullscreenchange", syncFullscreenIcons);
window.parent?.document?.addEventListener("webkitfullscreenchange", syncFullscreenIcons);
} catch {}
})();
</script>
</body>
</html>