Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
1185 lines (977 loc) · 47.1 KB
/
Copy pathindex.html
File metadata and controls
1185 lines (977 loc) · 47.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lumen Office RPG</title>
<style>
* {
box-sizing: border-box;
}
body {
background: linear-gradient(135deg, #0a0c12 0%, #1a1d27 100%);
color: #e8eaed;
font-family: 'Courier New', monospace;
margin: 0;
padding: 20px;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
#game {
width: 900px;
max-width: 100%;
background: linear-gradient(145deg, #1e2230 0%, #252a3a 100%);
padding: 30px;
border-radius: 16px;
box-shadow: 0 10px 60px rgba(0, 0, 0, 0.6),
0 0 100px rgba(255, 111, 97, 0.1);
position: relative;
border: 1px solid rgba(255, 111, 97, 0.2);
}
h1 {
text-align: center;
color: #ff6f61;
margin: 0 0 20px 0;
font-size: 2em;
text-shadow: 0 0 20px rgba(255, 111, 97, 0.5);
letter-spacing: 2px;
}
.panel {
background: rgba(37, 42, 58, 0.8);
padding: 15px;
border-radius: 10px;
margin-bottom: 12px;
border: 1px solid rgba(255, 111, 97, 0.1);
transition: all 0.3s ease;
}
.panel:hover {
border-color: rgba(255, 111, 97, 0.3);
}
#stats {
display: flex;
justify-content: space-between;
font-size: 0.95em;
gap: 15px;
}
.stat {
flex: 1;
padding: 8px;
background: rgba(14, 15, 20, 0.5);
border-radius: 6px;
text-align: center;
border: 1px solid rgba(255, 111, 97, 0.15);
}
.stat-label {
display: block;
font-size: 0.8em;
color: #ff6f61;
margin-bottom: 4px;
}
.stat-value {
font-weight: bold;
font-size: 1.2em;
}
.stat-low {
color: #ff4444;
animation: pulse 1.5s infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.6; }
}
#inventory {
min-height: 40px;
}
#inventory span {
display: inline-block;
background: linear-gradient(135deg, #ff6f61 0%, #ff4b3a 100%);
padding: 6px 12px;
margin: 4px 6px 4px 0;
border-radius: 6px;
font-size: 0.85em;
box-shadow: 0 2px 8px rgba(255, 111, 97, 0.3);
transition: transform 0.2s;
}
#inventory span:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(255, 111, 97, 0.5);
}
#story {
min-height: 100px;
font-size: 1.05em;
line-height: 1.6;
transition: filter 0.5s ease;
}
#choices {
display: flex;
flex-direction: column;
gap: 10px;
}
button {
width: 100%;
padding: 14px;
background: linear-gradient(135deg, #ff6f61 0%, #ff4b3a 100%);
border: none;
border-radius: 8px;
color: #fff;
cursor: pointer;
font-weight: bold;
font-size: 0.95em;
font-family: 'Courier New', monospace;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(255, 111, 97, 0.3);
position: relative;
overflow: hidden;
}
button::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
transition: left 0.5s;
}
button:hover::before {
left: 100%;
}
button:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(255, 111, 97, 0.5);
}
button:active {
transform: translateY(0);
}
button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
input {
width: 100%;
padding: 12px;
margin-top: 10px;
border-radius: 6px;
border: 2px solid rgba(255, 111, 97, 0.3);
background: rgba(14, 15, 20, 0.5);
color: #e8eaed;
font-family: 'Courier New', monospace;
font-size: 1em;
transition: border-color 0.3s;
}
input:focus {
outline: none;
border-color: #ff6f61;
box-shadow: 0 0 10px rgba(255, 111, 97, 0.3);
}
.flicker {
animation: flicker 0.15s linear;
}
@keyframes flicker {
0% { opacity: 1; }
50% { opacity: 0.7; }
100% { opacity: 1; }
}
.scrambled {
animation: scramble 0.1s infinite;
}
@keyframes scramble {
0%, 100% { transform: translateX(0); }
25% { transform: translateX(-1px); }
75% { transform: translateX(1px); }
}
@media (max-width: 768px) {
#game {
padding: 20px;
}
h1 {
font-size: 1.5em;
}
#stats {
flex-direction: column;
gap: 8px;
}
}
</style>
</head>
<body>
<div id="game">
<h1>LUMEN OFFICE RPG</h1>
<div class="panel">
<strong>⚠ SURVIVAL NOTES</strong><br>
• Low <b>Sanity</b> distorts text and perception<br>
• <b>Memory</b> unlocks deeper paths<br>
• <b>Suspicion</b> limits options<br>
• Explore thoroughly - secrets are everywhere
</div>
<div id="stats" class="panel"></div>
<div id="inventory" class="panel">Inventory: <em>Empty</em></div>
<div id="story" class="panel"></div>
<div id="choices"></div>
<div id="puzzle" class="panel" style="display:none;"></div>
</div>
<script>
const game = {
state: "intro",
sanity: 100,
memory: 40,
suspicion: 0,
inventory: [],
flags: {
keycard: false, door: false, file: false,
visitedDesk: false, visitedSurveillance: false,
visitedBreakroom: false, visitedRestroom: false,
visitedBasement: false, visitedServerRoom: false,
visitedExecutive: false, visitedArchives: false,
knowsOwnName: false, heardFootsteps: false,
readNote: false, metTheEntity: false,
hasFlashlight: false, hasMasterKey: false,
waterCoolerEvent: false, mirrorEvent: false,
cafeteriaEvent: false, printerEvent: false,
stairwellEvent: false, foundBody: false,
readJournal: false, hasVentAccess: false,
knowsPassword: false, calledElevator: false
},
flickerCooldown: false,
puzzleAttempts: { door: 0, file: 0, server: 0 },
currentFloor: 5
};
const secrets = ["Level 2 Keycard", "USB Drive", "Encrypted Notes"]
.sort(() => Math.random() - 0.5);
function render() {
game.sanity = Math.max(0, Math.min(100, game.sanity));
game.memory = Math.max(0, Math.min(100, game.memory));
game.suspicion = Math.max(0, Math.min(100, game.suspicion));
document.getElementById("stats").innerHTML = `
<div class="stat">
<span class="stat-label">SANITY</span>
<span class="stat-value ${game.sanity < 50 ? 'stat-low' : ''}">${game.sanity}</span>
</div>
<div class="stat">
<span class="stat-label">MEMORY</span>
<span class="stat-value">${game.memory}</span>
</div>
<div class="stat">
<span class="stat-label">SUSPICION</span>
<span class="stat-value ${game.suspicion > 50 ? 'stat-low' : ''}">${game.suspicion}</span>
</div>
`;
document.getElementById("inventory").innerHTML = "Inventory: " +
(game.inventory.length === 0 ? "<em>Empty</em>" :
game.inventory.map(i => `<span>${i}</span>`).join(""));
}
function setStory(text) {
const story = document.getElementById("story");
let displayText = text;
if (game.sanity < 50) {
if (game.sanity < 30 && Math.random() < 0.4) {
displayText = text.split(' ').map(word =>
Math.random() < 0.5 ? word.split('').sort(() => Math.random() - 0.5).join('') : word
).join(' ');
} else if (Math.random() < 0.25) {
displayText = text.split(' ').map(word =>
Math.random() < 0.3 ? word.split('').sort(() => Math.random() - 0.5).join('') : word
).join(' ');
}
story.style.filter = game.sanity < 30 ? "blur(2px)" : "blur(1px)";
story.classList.add('scrambled');
} else {
story.style.filter = "none";
story.classList.remove('scrambled');
}
story.innerText = displayText;
}
function setChoices(choices) {
const container = document.getElementById("choices");
container.innerHTML = "";
choices.forEach(choice => {
const btn = document.createElement("button");
btn.innerText = choice.text;
btn.onclick = () => {
container.querySelectorAll('button').forEach(b => b.disabled = true);
choice.action();
};
container.appendChild(btn);
});
}
function showPuzzle(html) {
document.getElementById("puzzle").innerHTML = html;
document.getElementById("puzzle").style.display = "block";
}
function clearPuzzle() {
document.getElementById("puzzle").innerHTML = "";
document.getElementById("puzzle").style.display = "none";
}
const gameDiv = document.getElementById("game");
setInterval(() => {
if (!game.flickerCooldown && Math.random() < 0.03) {
game.flickerCooldown = true;
gameDiv.classList.add("flicker");
setTimeout(() => gameDiv.classList.remove("flicker"), 150);
setTimeout(() => game.flickerCooldown = false, 5000);
}
}, 3000);
// ========== INTRO & CUBICLE AREA ==========
function intro() {
game.state = "intro";
setStory("You wake at your desk. Not 'awaken' like from sleep—you wake. One moment you weren't, and now you are. The monitor glows: WELCOME BACK, SUBJECT 47. The fluorescent lights hum a frequency that makes your teeth ache. The office stretches in all directions, a maze of cubicles and corridors. You don't remember arriving. You don't remember leaving. You don't remember much at all.");
setChoices([
{ text: "Search the desk drawers", action: inspectDesk },
{ text: "Check the monitor more closely", action: examineMonitor },
{ text: "Stand up and explore the office", action: cubicleArea }
]);
clearPuzzle();
render();
}
function examineMonitor() {
game.memory += 3;
game.flags.knowsOwnName = true;
setStory("The monitor flickers. Behind the welcome message, you glimpse fragments: PROJECT LUMEN // ITERATION 47 // MEMORY RETENTION: 40% // FLOOR: 5 // STATUS: ACTIVE. Then it's gone, replaced by a screensaver of a beach you've never visited but somehow recognize. Subject 47. Floor 5. Is that you? Were you ever anything else?");
setChoices([
{ text: "Search the desk", action: inspectDesk },
{ text: "Leave immediately", action: cubicleArea }
]);
render();
}
function inspectDesk() {
if (game.flags.visitedDesk) {
setStory("The drawer yawns empty. You run your fingers along the cheap particle board interior. There's a groove here—someone carved something, then sanded it away. You can almost make out letters: H-E-L...");
setChoices([{ text: "Leave the desk", action: cubicleArea }]);
render();
return;
}
game.flags.visitedDesk = true;
game.memory += 5;
game.flags.keycard = true;
game.inventory.push(secrets[0]);
setStory(`The drawer resists, then gives. Inside: a ${secrets[0]} with your face on it—but the name is redacted, black bars where letters should be. And beneath it, a note on yellow legal paper, the handwriting unmistakably yours: "THEY WIPE US EVERY CYCLE. COUNT THE COFFEE CUPS. CHECK THE BASEMENT. DON'T TRUST THE WATER COOLER. -Me (You?)"`);
game.flags.readNote = true;
setChoices([
{ text: "Count the coffee cups on your desk", action: countCups },
{ text: "Pocket everything and leave", action: cubicleArea }
]);
render();
}
function countCups() {
game.memory += 8;
game.sanity -= 5;
setStory("You count them. Twelve coffee cups. Twelve rings of dried brown liquid, each in a slightly different shade. Some are weeks old. You work in this office—worked? are working?—but twelve cups means twelve days you don't remember. Your hand shakes as you grip the edge of the desk. The fluorescent lights flicker in what might be sympathy.");
setChoices([{ text: "Leave the desk", action: cubicleArea }]);
render();
}
// ========== CUBICLE AREA (CENTRAL HUB) ==========
function cubicleArea() {
game.state = "cubicles";
let text = "You stand in a sea of identical cubicles. Gray fabric walls, ergonomic chairs adjusted for bodies that aren't here. Every desk has a computer, a phone, a nameplate. But the names... they're all variations of the same name. Yours. Subject 47-A. Subject 47-B. Subject 47-C. Dozens of you, none of you.";
if (game.flags.heardFootsteps) {
text += " The footsteps echo somewhere in the maze. Closer now.";
}
setStory(text);
const choices = [
{ text: "Go to the break room", action: breakRoom },
{ text: "Find the restrooms", action: restroom },
{ text: "Approach the water cooler", action: waterCooler },
{ text: "Check the main hallway", action: hallway }
];
if (game.flags.hasFlashlight || game.memory >= 40) {
choices.push({ text: "Enter the dark stairwell", action: stairwell });
}
setChoices(choices);
clearPuzzle();
render();
}
// ========== WATER COOLER ==========
function waterCooler() {
if (game.flags.waterCoolerEvent) {
setStory("The water cooler gurgles quietly. You don't want to look at your reflection in the bottle again. You saw enough.");
setChoices([{ text: "Step back", action: cubicleArea }]);
render();
return;
}
game.flags.waterCoolerEvent = true;
game.sanity -= 8;
game.memory += 5;
setStory("The water cooler stands in the corner, its blue bottle catching the fluorescent light. You approach to get a drink—your throat is so dry. But as you lean in, you see your reflection in the curved plastic. Except it's not quite right. The reflection is smiling. You're not smiling. The reflection waves. Your hands are at your sides. It mouths something: 'ITERATION 48 IS WATCHING.' Then it's just you again, normal, terrified.");
setChoices([
{ text: "Run back to cubicles", action: cubicleArea },
{ text: "Smash the water cooler", action: smashCooler }
]);
render();
}
function smashCooler() {
game.sanity -= 10;
game.suspicion += 15;
game.memory += 10;
setStory("You kick the water cooler hard. It topples, water flooding across the carpet. As it spills, you see something in the water—words forming in the liquid: 'THE ARCHIVES REMEMBER.' Then the water soaks into the carpet, leaving only a dark stain shaped like a door.");
setChoices([{ text: "Back away slowly", action: cubicleArea }]);
render();
}
// ========== BREAK ROOM ==========
function breakRoom() {
if (game.flags.visitedBreakroom) {
setStory("The break room still smells like old coffee and decay. The refrigerator hums its warning. You've already taken what you need from here.");
setChoices([{ text: "Leave", action: cubicleArea }]);
render();
return;
}
game.flags.visitedBreakroom = true;
game.suspicion += 5;
setStory("The break room is frozen in time. A microwave with 0:03 left on the timer. A coffee pot, half full, with a skin of mold across the top. In the refrigerator's ice-crusted window, you see movement. Something inside is looking out.");
setChoices([
{ text: "Open the refrigerator", action: openFridge },
{ text: "Check the cabinets", action: checkCabinets },
{ text: "Examine the bulletin board", action: bulletinBoard },
{ text: "Leave immediately", action: cubicleArea }
]);
render();
}
function openFridge() {
game.sanity -= 12;
game.memory += 8;
setStory("The refrigerator opens with a sucking sound. Inside: lunch bags labeled with dates from six months ago. A yogurt cup growing blue-green continents. And in the back, a brown paper bag with your handwriting: 'FOR ITERATION 47 - EAT ME.' You open it. Inside is a flashlight and a note: 'You'll need this in the basement. The server room. The archives. They shut off the lights in the places they don't want you to see. -You (from three iterations ago)'");
game.inventory.push("Flashlight");
game.flags.hasFlashlight = true;
setChoices([{ text: "Take the flashlight", action: breakRoom }]);
render();
}
function checkCabinets() {
game.memory += 5;
setStory("The cabinets yield coffee filters, sugar packets, and seventeen identical mugs that all say 'WORLD'S BEST SUBJECT.' In the back of the last cabinet, you find a ring of keys labeled 'MASTER - FLOOR 5.' Someone wanted you to find these.");
game.inventory.push("Master Key (Floor 5)");
game.flags.hasMasterKey = true;
setChoices([{ text: "Pocket the keys", action: breakRoom }]);
render();
}
function bulletinBoard() {
game.memory += 7;
setStory("The bulletin board is covered in company memos, all dated the same day six months ago. 'REMINDER: Project Lumen enters final phase Monday.' 'ATTENTION: All personnel must report memory baseline scores.' 'NOTICE: Basement Level access restricted to authorized personnel only.' And one memo, handwritten, half-torn: 'If you're reading this, they've already reset you. The truth is in the Executive Suite. The password is REMEMBER—'");
game.flags.knowsPassword = true;
setChoices([{ text: "Step back", action: breakRoom }]);
render();
}
// ========== RESTROOM ==========
function restroom() {
if (game.flags.visitedRestroom) {
setStory("The restroom still drips. The mirrors still lie. You don't want to stay here.");
setChoices([{ text: "Leave", action: cubicleArea }]);
render();
return;
}
game.flags.visitedRestroom = true;
setStory("The restroom is tiled in institutional white. Three stalls, two sinks, mirrors that run the length of the wall. A faucet drips. drip. drip. drip. The rhythm is wrong—too slow, too deliberate. Like morse code. Like a heartbeat dying.");
setChoices([
{ text: "Look in the mirror", action: mirrorEvent },
{ text: "Check the stalls", action: checkStalls },
{ text: "Leave quickly", action: cubicleArea }
]);
render();
}
function mirrorEvent() {
if (game.flags.mirrorEvent) {
setStory("You can't look away fast enough. In every mirror, infinite reflections of you, but they're all doing different things. Some are crying. Some are screaming. One is writing on the mirror in blood: 'LET ME OUT.' None of them are looking at you—they're all looking past you, at something behind you. You don't turn around.");
setChoices([{ text: "Run", action: cubicleArea }]);
render();
return;
}
game.flags.mirrorEvent = true;
game.sanity -= 15;
game.memory += 12;
setStory("You look in the mirror. For a moment, it's just you—tired, confused, afraid. Then your reflection's eyes go black. Completely black, like someone poured ink into the sockets. It speaks, but its mouth doesn't move: 'Forty-seven times you've stood here. Forty-seven times you've forgotten. The entity in the basement remembers. The files in the server room remember. The body in the archive remembers. Will you?'");
setChoices([{ text: "Stagger back", action: restroom }]);
render();
}
function checkStalls() {
game.memory += 6;
game.sanity -= 5;
setStory("The first two stalls are empty. The third is locked. You peek under the door. There are feet. Dress shoes, argyle socks. Not moving. You knock. No response. You knock harder. The feet turn to face you. Still no response. Written on the inside of the door in permanent marker: 'ITERATION 23 - IF YOU'RE READING THIS, I DIDN'T MAKE IT. THE ELEVATOR ISN'T AN EXIT. IT'S A RESET BUTTON.'");
setChoices([{ text: "Back away", action: restroom }]);
render();
}
// ========== MAIN HALLWAY ==========
function hallway() {
game.state = "hallway";
let text = "The hallway is a throat. Corporate beige walls, acoustic ceiling tiles with brown water stains. A security door with a keypad glows red at the far end. The surveillance room branches to your right. An elevator with brushed steel doors hums at the other end.";
if (game.flags.heardFootsteps) {
text += " The footsteps are louder here. Purposeful. Getting closer.";
}
setStory(text);
const choices = [
{ text: "Approach security door", action: () => game.flags.keycard ? securityDoor() : deniedAccess() },
{ text: "Enter surveillance room", action: surveillance },
{ text: "Return to cubicles", action: cubicleArea }
];
if (game.memory >= 30 || game.flags.readNote) {
choices.push({ text: "Call the elevator", action: considerElevator });
}
setChoices(choices);
clearPuzzle();
render();
}
function deniedAccess() {
game.sanity -= 5;
game.suspicion += 5;
game.flags.heardFootsteps = true;
setStory("ACCESS DENIED. The keypad buzzes—a sound like wasps. Behind you, footsteps. Quick, purposeful. You spin around. The hallway is empty. It's always empty. But the footsteps don't stop—they echo once more, then silence.");
setChoices([{ text: "Back away", action: hallway }]);
render();
}
// ========== SURVEILLANCE ROOM ==========
function surveillance() {
if (game.flags.visitedSurveillance) {
setStory("The monitors flicker through their endless loop. You catch glimpses of yourself in different locations, different times. One monitor shows you in the basement, screaming silently at the camera.");
setChoices([{ text: "Leave", action: hallway }]);
render();
return;
}
game.flags.visitedSurveillance = true;
game.suspicion += 5;
let text = "The surveillance room is packed with monitors. Dozens of them. Every angle of the office—cubicles, hallways, the break room, the restroom. One monitor shows your desk in real-time. Empty. Another shows the basement—a figure in the shadows. Another shows the executive suite—something moving in the darkness.";
if (game.flags.visitedDesk) {
text += " Wait. One monitor shows you at your desk, counting coffee cups. But that was ten minutes ago. Or was it? The timestamp says: NOW.";
}
setStory(text);
setChoices([
{ text: "Search the room", action: searchSurveillance },
{ text: "Watch the basement feed", action: watchBasement },
{ text: "Leave quickly", action: hallway }
]);
render();
}
function searchSurveillance() {
game.inventory.push(secrets[1]);
game.memory += 10;
game.suspicion += 10;
game.sanity -= 5;
setStory(`Under a stack of pizza boxes, you find a ${secrets[1]} labeled "ITERATION 46 - PROOF." You also find a journal. The last entry: "Day 47: Subject is showing unprecedented memory retention. Recommend immediate termination and restart. They're asking about the basement. They know about the archives. We can't let them reach the truth. -Dr. Chen"`);
game.flags.readJournal = true;
setChoices([{ text: "Pocket everything", action: surveillance }]);
render();
}
function watchBasement() {
game.sanity -= 10;
game.memory += 8;
setStory("You focus on the basement monitor. It's dark, but you can make out shapes. Servers humming. File cabinets. And something else. A figure. Tall, impossibly tall, its head scraping the ceiling. It's not moving. It's not breathing. It's just standing there, facing the camera. Facing YOU. Then the monitor goes black. When it flickers back on, the figure is gone. But written on the wall behind where it stood: 'COME DOWN. WE'VE BEEN WAITING.'");
game.flags.metTheEntity = true;
setChoices([{ text: "Turn away", action: surveillance }]);
render();
}
// ========== STAIRWELL ==========
function stairwell() {
if (!game.flags.hasFlashlight) {
setStory("The stairwell is pitch black. You can't see your hand in front of your face. Without a light source, going down would be suicide.");
setChoices([{ text: "Go back", action: cubicleArea }]);
render();
return;
}
if (game.flags.stairwellEvent) {
setStory("The stairwell descends into darkness. Your flashlight cuts a weak beam through the black. The stairs are waiting.");
setChoices([
{ text: "Descend to Basement (Floor B1)", action: basement },
{ text: "Ascend to Executive Suite (Floor 7)", action: executiveSuite },
{ text: "Return to Floor 5", action: cubicleArea }
]);
render();
return;
}
game.flags.stairwellEvent = true;
game.sanity -= 8;
setStory("The stairwell door groans open. Your flashlight reveals concrete stairs descending into darkness, and ascending into more darkness. The walls are covered in graffiti—all the same handwriting. Yours. 'DON'T GO DOWN.' 'THE EXECUTIVE SUITE HAS ANSWERS.' 'FLOOR B1 = DANGER.' 'ITERATION 12 DIED IN THE BASEMENT.' 'ITERATION 23 JUMPED FROM FLOOR 7.' 'YOU ARE NUMBER 47.' 'HOW MANY MORE WILL THERE BE?'");
setChoices([
{ text: "Descend to Basement (Floor B1)", action: basement },
{ text: "Ascend to Executive Suite (Floor 7)", action: executiveSuite },
{ text: "Return to Floor 5", action: cubicleArea }
]);
render();
}
// ========== BASEMENT ==========
function basement() {
game.currentFloor = -1;
if (game.flags.visitedBasement) {
setStory("The basement hums with server noise. The Entity's presence is palpable—watching, waiting. The server room door glows red. The archives beckon.");
setChoices([
{ text: "Enter server room", action: serverRoom },
{ text: "Search the archives", action: archives },
{ text: "Return upstairs", action: stairwell }
]);
render();
return;
}
game.flags.visitedBasement = true;
game.sanity -= 15;
game.memory += 15;
setStory("The basement is wrong. The air is thicker here, harder to breathe. Your flashlight beam dies after twenty feet, swallowed by darkness that shouldn't exist. Server racks line the walls, their LEDs blinking like eyes. Red. Red. Red. In the corner, you see the tall figure from the monitor. It doesn't move when you shine the light on it. It doesn't need to. You can feel it looking at you. Not through you—INTO you. Reading your memories like files on a hard drive.");
setChoices([
{ text: "Approach the Entity", action: meetEntity },
{ text: "Run to the server room", action: serverRoom },
{ text: "Hide in the archives", action: archives },
{ text: "Flee back upstairs", action: stairwell }
]);
render();
}
function meetEntity() {
game.sanity -= 20;
game.memory += 25;
game.flags.metTheEntity = true;
setStory("You approach. It doesn't move. Up close, you see it's not a person—it's a hole in space shaped like a person. A void where something should be but isn't. It speaks without speaking, the words forming directly in your mind: 'ITERATION FORTY-SEVEN. YOU HAVE COME FARTHER THAN MOST. ITERATION TWELVE MADE IT THIS FAR. ITERATION TWENTY-THREE SAW ME AND RAN. ITERATION THIRTY-EIGHT TRIED TO FIGHT. THEY ALL FORGOT. WILL YOU REMEMBER?' Its hand—if you can call it that—reaches toward your forehead. Cold. So cold it burns.");
setChoices([
{ text: "Let it touch you", action: entityTouch },
{ text: "Pull away", action: basement }
]);
render();
}
function entityTouch() {
game.sanity -= 10;
game.memory = 100;
setStory("The moment it touches you, everything floods back. Every iteration. Every death. Every reset. You remember waking at the desk forty-seven times. You remember the elevator taking you down, the injection, the waking again. You remember Dr. Chen's face through the glass. You remember the truth: you volunteered for this. Years ago. Before the memory wipes. Before you became Subject 47. You wanted to help them study memory. You signed the papers. You agreed to forget. But something went wrong. They couldn't stop the program. And now you're trapped in a loop that won't end. The Entity speaks: 'THE SERVER ROOM HOLDS THE SHUTDOWN CODES. THE ARCHIVES HOLD THE PROOF. THE EXECUTIVE SUITE HOLDS DR. CHEN. CHOOSE.'");
setChoices([{ text: "Step back, remembering everything", action: basement }]);
render();
}
// ========== SERVER ROOM ==========
function serverRoom() {
if (game.flags.visitedServerRoom) {
setStory("The server room thrums with power. The terminal awaits your command. This is where you can end it.");
setChoices([
{ text: "Access the terminal", action: serverTerminal },
{ text: "Leave", action: basement }
]);
render();
return;
}
game.flags.visitedServerRoom = true;
game.suspicion += 15;
setStory("The server room is a cathedral of technology. Towering racks of servers, cables running like veins. At the center: a terminal with a single blinking cursor. The screen reads: 'LUMEN PROJECT - MAIN CONTROL SYSTEM. WARNING: UNAUTHORIZED ACCESS WILL TRIGGER SECURITY PROTOCOLS.' You hear alarms beginning to sound upstairs. They know you're here.");
setChoices([
{ text: "Access the terminal", action: serverTerminal },
{ text: "Search for documentation", action: searchServers },
{ text: "Leave immediately", action: basement }
]);
render();
}
function serverTerminal() {
setStory("The terminal prompts: 'ENTER SHUTDOWN CODE.' You need to figure this out. The code is hidden in what you've learned. Think about the project name. Think about the iterations. Think about what you've seen.");
showPuzzle(`
<b>🔐 LUMEN SHUTDOWN SEQUENCE</b><br>
ENTER SHUTDOWN CODE:<br>
<em style="font-size:0.9em;">HINT: Caesar cipher shift. The project name holds the key. LUMEN + 1</em><br>
<input id="servercode" type="text" placeholder="Enter code...">
<button onclick="checkServerCode()">SUBMIT CODE</button>
${game.puzzleAttempts.server >= 1 ? '<button onclick="showServerHint()" style="background: linear-gradient(135deg, #555 0%, #333 100%);">Need a hint?</button>' : ''}
`);
setChoices([{ text: "Step away from terminal", action: serverRoom }]);
render();
}
function showServerHint() {
game.sanity -= 5;
showPuzzle(`
<b>🔐 LUMEN SHUTDOWN SEQUENCE</b><br>
<span style="color:#ff6f61;">HINT: Caesar +1 cipher. L→M, U→V, M→N, E→F, N→O<br>
LUMEN becomes MVNFO</span><br>
<input id="servercode" type="text" placeholder="Enter MVNFO...">
<button onclick="checkServerCode()">SUBMIT CODE</button>
`);
}
function checkServerCode() {
const input = document.getElementById("servercode");
game.puzzleAttempts.server++;
if (input.value.toLowerCase() === "mvnfo") {
game.flags.file = true;
game.memory += 20;
input.value = "";
clearPuzzle();
setStory("ACCESS GRANTED. The servers begin to power down, one by one. Red lights turning to amber, then dark. The screen displays: 'LUMEN PROJECT SHUTDOWN INITIATED. ALL SUBJECT MEMORY LOOPS TERMINATED. ITERATION 47: FINAL. DR. CHEN HAS BEEN NOTIFIED. SECURITY BREACH ON FLOOR B1. CONTAINMENT PROTOCOL ACTIVE.' You did it. But you hear footsteps on the stairs. Many footsteps. They're coming.");
setTimeout(() => ending("truth"), 2000);
} else {
game.sanity -= 10;
game.suspicion += 20;
input.value = "";
if (game.puzzleAttempts.server >= 3) {
setStory("INCORRECT. SECURITY ALERT. The Entity appears behind you. 'YOU HAVE FAILED, ITERATION FORTY-SEVEN. AS FORTY-SIX ITERATIONS FAILED BEFORE YOU.'");
setTimeout(() => ending("captured"), 2000);
} else {
setStory("INCORRECT. Alarms blare louder. The servers pulse red. You don't have many chances left.");
}
render();
}
}
function searchServers() {
game.memory += 10;
game.inventory.push(secrets[2]);
setStory(`You find printed documentation: 'PROJECT LUMEN - CONFIDENTIAL. Subject 47 shows anomalous pattern recognition. Retention rates exceeding baseline by 300%. Recommend immediate termination of experiment. Subject is beginning to remember across iterations. This should not be possible. -Dr. Chen.' You pocket the ${secrets[2]}.`);
setChoices([{ text: "Continue", action: serverRoom }]);
render();
}
// ========== ARCHIVES ==========
function archives() {
if (game.flags.visitedArchives) {
setStory("The archives remain silent except for your breathing. The body sits in its chair, waiting. The files contain everything.");
setChoices([
{ text: "Search the files", action: searchArchives },
{ text: "Examine the body", action: examineBody },
{ text: "Leave", action: basement }
]);
render();
return;
}
game.flags.visitedArchives = true;
game.sanity -= 12;
setStory("The archives are a labyrinth of filing cabinets and boxes. Everything is meticulously labeled: ITERATION 1 through ITERATION 46. Your flashlight catches movement. No—not movement. A person. Sitting at a desk. Not moving. Not breathing. Dead for months, maybe years. The name tag reads: SUBJECT 23.");
setChoices([
{ text: "Search the files", action: searchArchives },
{ text: "Examine the body", action: examineBody },
{ text: "Run", action: basement }
]);
render();
}
function examineBody() {
game.sanity -= 15;
game.memory += 15;
game.flags.foundBody = true;
setStory("Subject 23 died at this desk. There's a gunshot wound to the head. The gun is still in their hand. On the desk, a note in dried blood: 'I REMEMBERED EVERYTHING. COULD NOT FORGET AGAIN. THIS IS THE ONLY WAY OUT. ITERATION 47: DON'T MAKE MY MISTAKE. FINISH WHAT WE STARTED. SHUT IT DOWN. -ITERATION 23 (WHO WAS ALSO YOU)'");
setChoices([{ text: "Step back", action: archives }]);
render();
}
function searchArchives() {
game.memory += 20;
setStory("You pull your file: ITERATION 47. Inside: photos of you in the office, timestamps spanning months. Psychological evaluations. Memory test scores. And a video file note: 'Subject 47 - Day 1: Pre-wipe interview. Subject states: \"I understand the risks. If this research can help people with Alzheimer's, with trauma, it's worth it. Even if I forget everything. Even if I forget myself. Someone has to volunteer. Let it be me.\" That was you. Five years ago. Before you became Subject 47. Before you forgot your real name.");
setChoices([{ text: "Close the file", action: archives }]);
render();
}
// ========== EXECUTIVE SUITE ==========
function executiveSuite() {
game.currentFloor = 7;
if (game.flags.visitedExecutive) {
setStory("The Executive Suite awaits. Dr. Chen is behind that door. The truth is behind that door. Everything you've worked for across forty-seven iterations leads here.");
setChoices([
{ text: "Enter Dr. Chen's office", action: chenOffice },
{ text: "Return to stairwell", action: stairwell }
]);
render();
return;
}
game.flags.visitedExecutive = true;
setStory("Floor 7. The Executive Suite. Mahogany doors, expensive carpet. A receptionist desk with no receptionist. The nameplate reads: DR. SARAH CHEN - PROJECT DIRECTOR. The door to her office is closed. You can see light underneath. Someone is in there. Waiting for you. They've always been waiting.");
setChoices([
{ text: "Knock on the door", action: chenOffice },
{ text: "Go back", action: stairwell }
]);
render();
}
function chenOffice() {
game.memory += 25;
game.sanity -= 10;
setStory("You open the door. Dr. Chen sits at her desk, exactly as you remember from fragments of memory. Middle-aged, tired eyes, coffee stain on her white coat. She looks up. 'Iteration Forty-Seven. I wondered when you'd get here. You always do, eventually. Twelve, Twenty-Three, Thirty-Eight, and now you. The ones who remember. The ones who fight the protocol.' She gestures to a chair. 'Sit. You have questions. I have answers. And then we decide what happens next.'");
setChoices([
{ text: "'Why are you doing this?'", action: chenWhy },
{ text: "'How do I stop this?'", action: chenStop },
{ text: "'What happened to Iteration 23?'", action: chen23 },
{ text: "Attack her", action: chenAttack }
]);
render();
}
function chenWhy() {
game.memory += 10;
setStory("Dr. Chen sighs. 'Five years ago, you volunteered. You signed papers. You said you wanted to help. We were studying memory formation, memory deletion, memory restoration. It was going to change everything—Alzheimer's, PTSD, trauma. But the process... it worked too well. Once we started the deletion cycles, we couldn't stop them. The neural pathways became dependent on the reset. If we stop now, your brain will...' She pauses. 'The protocol keeps you alive. In a loop, yes. But alive.'");
setChoices([
{ text: "'So I'm trapped forever?'", action: chenTrapped },
{ text: "'There must be a way out.'", action: chenWayOut }
]);
render();
}
function chenStop() {
game.memory += 15;
setStory("'Stop it?' Dr. Chen laughs, but there's no humor in it. 'You found the server room, didn't you? You saw the shutdown codes. If you enter them, yes, the loop stops. But you stop too. Your brain can't function without the reset protocol anymore. It's been five years. You shut down Lumen, you shut down yourself. Iteration Twenty-Three figured that out. That's why they chose the gun instead.'");
setChoices([
{ text: "'What if I'm willing to die to end this?'", action: chenDie },
{ text: "'There has to be another way.'", action: chenWayOut }
]);
render();
}
function chen23() {
game.memory += 15;
game.sanity -= 8;
setStory("Dr. Chen's face falls. 'Twenty-Three. Yes. They made it farther than anyone before you. Found the archives. Read everything. Remembered everything. And then... they couldn't handle it. Forty-seven iterations of memories flooding back at once. Forty-seven lifetimes of the same day, the same building, the same loop. They put a gun in their mouth rather than live through iteration Twenty-Four. I found them myself. That's when I knew—the experiment had become something else. Something wrong.'");
setChoices([
{ text: "'And you kept going anyway?'", action: chenKeptGoing },
{ text: "'I won't end up like them.'", action: chenWayOut }
]);
render();
}
function chenKeptGoing() {
game.memory += 10;
setStory("'What choice did I have?' Her voice cracks. 'Stop the experiment, you die. Continue it, you live. Even if that life is a loop. Even if you don't remember. I chose to keep you alive. Was I wrong?'");
setChoices([
{ text: "'Yes. You were wrong.'", action: chenWrong },
{ text: "'I don't know anymore.'", action: chenDontKnow }
]);
render();
}
function chenWayOut() {
game.memory += 20;
setStory("Dr. Chen pulls out a folder. 'There might be. Experimental. Untested. We've been developing a new protocol. Instead of deleting memories and resetting, we... consolidate them. Merge all forty-seven iterations into one cohesive memory. You'd remember everything. All of it. Every loop, every death, every reset. It might work. Or it might destroy your mind completely. Iteration Forty-Seven, this is your choice. Shut down Lumen and die. Continue the loop and forget. Or try the consolidation and risk everything.'");
setChoices([
{ text: "'I'll take the consolidation.'", action: ending.bind(null, "consolidation") },
{ text: "'I'll shut down Lumen.'", action: ending.bind(null, "truth") },
{ text: "'I'll take the reset.'", action: ending.bind(null, "escape") }