-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
executable file
·10737 lines (10153 loc) · 412 KB
/
Copy pathscript.js
File metadata and controls
executable file
·10737 lines (10153 loc) · 412 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
const yearEl = document.getElementById("year");
if (yearEl) {
yearEl.textContent = String(new Date().getFullYear());
}
const sitePage = document.querySelector(".site-page");
if (sitePage) {
(() => {
const textTargets = Array.from(sitePage.querySelectorAll(
"main p, main li, main a, main span, .hero p, .hero h2, .hero h3, .hero strong, .hero span, .warning-banner strong, .warning-banner span"
)).filter((element) => {
if (!element || element.closest(".site-nav") || element.closest("footer")) {
return false;
}
if (element.classList.contains("glitch-title")) {
return false;
}
if (element.children.length > 0 && !element.matches("a, li, p, span, strong, h2, h3")) {
return false;
}
const text = (element.textContent || "").replace(/\s+/g, " ").trim();
return text.length >= 8;
});
const leetMap = {
a: "4",
b: "8",
e: "3",
g: "6",
i: "1",
o: "0",
s: "5",
t: "7",
z: "2"
};
const activeGlitches = new WeakMap();
const statusPhrases = [
() => `ERROR ${Math.floor(1000 + Math.random() * 9000)}`,
() => `ERR 0x${Math.floor(4096 + Math.random() * 61439).toString(16).toUpperCase()}`,
() => "RELOADING",
() => "SIGNAL LOST",
() => "DESYNC",
() => "RECOVERING",
() => "CACHE MISS",
() => "PATCHING"
];
function randomLogStamp() {
const hours = String(Math.floor(Math.random() * 2)).padStart(2, "0");
const minutes = String(Math.floor(Math.random() * 60)).padStart(2, "0");
const seconds = String(Math.floor(Math.random() * 60)).padStart(2, "0");
return `${hours}:${minutes}:${seconds}`;
}
function horrorLogLine() {
const stamp = randomLogStamp();
const logs = [
`LOG ${stamp} — Invitation packet addressed to Paul arrived from a casino no city grid contains.`,
`LOG ${stamp} — Entry contract states all debt may be resolved through three approved games.`,
`LOG ${stamp} — Trial one designated GAMBLING KING. Purpose: teach the subject to protect the debt instead of paying it.`,
`LOG ${stamp} — Trial two designated DEATH WHEEL. Purpose: confirm the subject will keep spinning after the warning is understood.`,
`LOG ${stamp} — Trial three designated DEATH BLACKJACK. Purpose: determine whether the subject will challenge the dealer after seeing his real face.`,
`LOG ${stamp} — Subject reported the games looked beatable before the first balance update.`,
`LOG ${stamp} — First winners were not released. They were promoted deeper into the House.`,
`LOG ${stamp} — Titles are not rewards. Titles are seating assignments for returned players.`,
`LOG ${stamp} — Home screen provided to reduce panic between table recalls.`,
`LOG ${stamp} — Balance notes match handwriting recovered from prior contestants who reached the exit door.`,
`LOG ${stamp} — Update feed now classified as confession archive.`,
`LOG ${stamp} — Save transfer permitted because the House follows the player between devices.`,
`LOG ${stamp} — Gambling King account continued earning after the owner stopped touching the reels.`,
`LOG ${stamp} — Death Wheel camera captured one extra segment facing inward toward the viewer.`,
`LOG ${stamp} — Death Blackjack dealer requested another hand after the table had already been cleared.`,
`LOG ${stamp} — Route preview briefly displayed a node labeled RETURN WITH LESS.`,
`LOG ${stamp} — Neural sync indicates the subject now calls the intake procedure a game.`,
`LOG ${stamp} — No verified record exists of a player leaving after clearing all three.`
];
return pickOne(logs);
}
function pickOne(list) {
return list[Math.floor(Math.random() * list.length)];
}
function randomWordIndex(words) {
const candidates = words
.map((word, index) => ({ word, index }))
.filter(({ word }) => /[A-Za-z]/.test(word) && word.length >= 3);
return candidates.length ? pickOne(candidates).index : -1;
}
function leetifyWord(word) {
return word
.split("")
.map((char) => {
const lower = char.toLowerCase();
if (leetMap[lower] && Math.random() < 0.45) {
return leetMap[lower];
}
return Math.random() < 0.12 && /[A-Za-z]/.test(char)
? String.fromCharCode(65 + Math.floor(Math.random() * 26))
: char;
})
.join("");
}
function scrambleWord(word) {
if (word.length < 4) {
return leetifyWord(word);
}
const middle = word.slice(1, -1).split("");
for (let i = middle.length - 1; i > 0; i -= 1) {
const swapIndex = Math.floor(Math.random() * (i + 1));
[middle[i], middle[swapIndex]] = [middle[swapIndex], middle[i]];
}
return `${word[0]}${middle.join("")}${word[word.length - 1]}`;
}
function mutateText(text) {
const words = text.split(/(\s+)/);
if (!words.length) {
return text;
}
const modeRoll = Math.random();
if (modeRoll < 0.28) {
return pickOne(statusPhrases)();
}
const index = randomWordIndex(words);
if (index < 0) {
return text;
}
if (modeRoll < 0.64) {
words[index] = leetifyWord(words[index]);
} else {
words[index] = scrambleWord(words[index]);
}
if (Math.random() < 0.22) {
const secondIndex = randomWordIndex(words);
if (secondIndex >= 0 && secondIndex !== index) {
words[secondIndex] = pickOne(["ERROR", "RELOADING", "DESYNC", "PATCH"]);
}
}
return words.join("");
}
function shuffled(list) {
const copy = [...list];
for (let i = copy.length - 1; i > 0; i -= 1) {
const swapIndex = Math.floor(Math.random() * (i + 1));
[copy[i], copy[swapIndex]] = [copy[swapIndex], copy[i]];
}
return copy;
}
function clearTargetGlitch(target, fallbackText) {
target.textContent = target.dataset.glitchOriginal || fallbackText;
target.classList.remove("word-glitch-active", "word-glitch-horror");
delete target.dataset.glitchOriginal;
delete target.dataset.horrorEcho;
activeGlitches.delete(target);
}
function triggerTextGlitch() {
if (!textTargets.length) {
return;
}
const availableTargets = textTargets.filter((target) => target && !activeGlitches.get(target));
if (!availableTargets.length) {
scheduleNextGlitch();
return;
}
const horrorEligibleTargets = availableTargets.filter((target) => target.matches("p, li, span, strong"));
if (horrorEligibleTargets.length && Math.random() < 0.08) {
const horrorCount = Math.min(Math.random() < 0.35 ? 2 : 1, horrorEligibleTargets.length);
const horrorTargets = shuffled(horrorEligibleTargets).slice(0, horrorCount);
horrorTargets.forEach((target) => {
const original = target.textContent || "";
const replacement = horrorLogLine();
activeGlitches.set(target, true);
target.dataset.glitchOriginal = original;
target.dataset.horrorEcho = replacement;
target.classList.add("word-glitch-horror");
target.textContent = replacement;
const holdMs = 6800 + Math.floor(Math.random() * 900);
window.setTimeout(() => {
clearTargetGlitch(target, original);
}, holdMs);
});
sitePage.classList.add("page-horror-burst");
window.setTimeout(() => {
sitePage.classList.remove("page-horror-burst");
}, 880);
scheduleNextGlitch();
return;
}
const burstRoll = Math.random();
const burstCount = burstRoll < 0.18
? Math.min(4, availableTargets.length)
: burstRoll < 0.56
? Math.min(3, availableTargets.length)
: Math.min(2, availableTargets.length);
const burstTargets = shuffled(availableTargets).slice(0, burstCount);
let appliedCount = 0;
burstTargets.forEach((target) => {
const original = target.textContent || "";
const mutated = mutateText(original);
if (!mutated || mutated === original) {
return;
}
appliedCount += 1;
activeGlitches.set(target, true);
target.dataset.glitchOriginal = original;
target.classList.add("word-glitch-active");
target.textContent = mutated;
const holdMs = 700 + Math.floor(Math.random() * 550);
window.setTimeout(() => {
clearTargetGlitch(target, original);
}, holdMs);
});
if (appliedCount > 0 && (appliedCount > 1 || Math.random() < 0.18)) {
sitePage.classList.add("page-glitch-burst");
window.setTimeout(() => {
sitePage.classList.remove("page-glitch-burst");
}, 240);
}
scheduleNextGlitch();
}
function scheduleNextGlitch() {
const delay = 1100 + Math.floor(Math.random() * 2600);
window.setTimeout(triggerTextGlitch, delay);
}
scheduleNextGlitch();
})();
}
const SECRET_TITLE_ERROR_TEXT = "ERROR: DATA NOT FOUND";
const SECRET_TITLE_LOCKED_EFFECT_TEXT = "ERROR: ACCESS DENIED";
const SECRET_TITLE_PROGRESS_TEXT = "ERROR: SIGNAL NOT CLASSIFIED";
const SECRET_TITLE_STREAK_TARGETS = {
"null-signature": 2,
"uncut-exit": 2,
"straight-teeth": 2,
"ash-sleeper": 2,
"unforged-witness": 2,
"fivefold-omen": 2,
"closed-ledger": 3,
"full-circuit": 2,
"house-reserve": 2
};
const TITLE_CURSED_CARD_KEYS = ["debt-card", "burn-card", "heavy-card", "mirror-curse"];
const SECRET_TITLE_DEFS = {
"null-signature": {
label: "Null Signature",
rarity: 5,
desc: "Crossed the floor with bare cards, no marks, no shelter, and no tricks left to lean on.",
effect: "Adds 1 Ace and 1 ten, removes 1 two, 1 three, and 1 four.",
unlockText: "Clear World 1 this way in 2 runs in a row: no owned special cards, no passives, no titles equipped, no Camp or Forge visits, and no Double Down or Split.",
deckPlan: {
add: { A: 1, 10: 1 },
remove: { "2": 1, "3": 1, "4": 1 }
}
},
"last-spark": {
label: "Last Spark",
rarity: 5,
desc: "Reached the exit as a dying ember after the House had already taken most of the run.",
effect: "Adds 1 Ace and 1 King, removes 1 two, 1 three, and 1 five.",
unlockText: "Clear World 1 with exactly 1 life remaining after losing at least 5 lives in the run, without visiting Camp.",
deckPlan: {
add: { A: 1, K: 1 },
remove: { "2": 1, "3": 1, "5": 1 }
}
},
"uncut-exit": {
label: "Uncut Exit",
rarity: 5,
desc: "Walked through the whole floor clean while still touching the route's recovery tools.",
effect: "Adds 1 Ace and 1 Queen, removes 1 two, 1 three, 1 four, and 1 five.",
unlockText: "Clear World 1 this way in 2 runs in a row: no life loss, visit both Camp and Forge, and take no Risk Table or Casino Vault.",
deckPlan: {
add: { A: 1, Q: 1 },
remove: { "2": 1, "3": 1, "4": 1, "5": 1 }
}
},
"straight-teeth": {
label: "Straight Teeth",
rarity: 5,
desc: "Refused the greedy cuts and cleared the route with only clean table play.",
effect: "Adds 1 King and 2 nines, removes 1 three, 1 four, and 1 six.",
unlockText: "Clear World 1 this way in 2 runs in a row: no Double Down or Split, visit both Camp and Forge, plus at least 1 Risk Table and 1 Casino Vault.",
deckPlan: {
add: { K: 1, "9": 2 },
remove: { "3": 1, "4": 1, "6": 1 }
}
},
"ash-sleeper": {
label: "Ash Sleeper",
rarity: 5,
desc: "Skipped every campfire, but still trusted the forge once and kept moving.",
effect: "Adds 1 Ace and 1 Jack, removes 1 two, 1 four, and 1 six.",
unlockText: "Clear World 1 this way in 2 runs in a row: no Camp, at least 2 Forge visits, lose no more than 1 life, and win at least 2 hands containing Burn Card.",
deckPlan: {
add: { A: 1, J: 1 },
remove: { "2": 1, "4": 1, "6": 1 }
}
},
"unforged-witness": {
label: "Unforged Witness",
rarity: 5,
desc: "Rejected the forge, took shelter once, and still beat the floor with untouched steel.",
effect: "Adds 1 King and 1 Jack, removes 1 three, 1 five, and 1 six.",
unlockText: "Clear World 1 this way in 2 runs in a row: no Forge, at least 2 Camp visits, open at least 1 Casino Vault, and win at least 2 hands containing Debt Card.",
deckPlan: {
add: { K: 1, J: 1 },
remove: { "3": 1, "5": 1, "6": 1 }
}
},
"fivefold-omen": {
label: "Fivefold Omen",
rarity: 5,
desc: "Hit enough naturals in one run that the House started counting backward.",
effect: "Adds 2 Aces and 1 ten, removes 1 two, 1 three, 1 four, and 1 five.",
unlockText: "Clear World 1 this way in 2 runs in a row: win 7 natural blackjacks in the run and lose no boss round.",
deckPlan: {
add: { A: 2, "10": 1 },
remove: { "2": 1, "3": 1, "4": 1, "5": 1 }
}
},
"closed-ledger": {
label: "Closed Ledger",
rarity: 5,
desc: "Never gave a boss a round back, even after the rest of the floor tried to bleed the run dry.",
effect: "Adds 1 Ace, 1 King, and 1 Queen, removes 1 two, 1 three, 1 four, and 1 five.",
unlockText: "Clear World 1 this way in 3 runs in a row: lose no boss round, lose at least 3 lives elsewhere, and still visit both Camp and Forge.",
deckPlan: {
add: { A: 1, K: 1, Q: 1 },
remove: { "2": 1, "3": 1, "4": 1, "5": 1 }
}
},
"full-circuit": {
label: "Full Circuit",
rarity: 5,
desc: "Touched every wire in the House and still came back carrying the current.",
effect: "Adds 1 Ace, 1 Jack, and 1 ten, removes 1 two, 1 three, 1 four, and 1 five.",
unlockText: "Clear World 1 this way in 2 runs in a row: visit Camp, Forge, Risk Table, Casino Vault, clear a Skill Trial, open 2 Vaults, take 2 Risk Tables, never lose a boss round, and win with both Heavy Card and Mirror Curse in the run.",
deckPlan: {
add: { A: 1, J: 1, "10": 1 },
remove: { "2": 1, "3": 1, "4": 1, "5": 1 }
}
},
"house-reserve": {
label: "House Reserve",
rarity: 5,
desc: "Left the floor rich enough that the House should have noticed the missing weight in its vaults.",
effect: "Adds 1 Ace, 1 King, 1 ten, and 1 nine, removes 1 two, 1 three, 1 four, 1 five, and 1 six.",
unlockText: "Clear World 1 this way in 2 runs in a row: finish with at least $9000 and 5 lives, after opening 2 Vaults, taking 2 Risk Tables, never visiting Camp, and winning at least 3 cursed-card hands total.",
deckPlan: {
add: { A: 1, K: 1, "10": 1, "9": 1 },
remove: { "2": 1, "3": 1, "4": 1, "5": 1, "6": 1 }
}
}
};
function defaultRareTitleMarks() {
return Object.fromEntries(Object.keys(SECRET_TITLE_DEFS).map((key) => [key, 0]));
}
function sanitizeRareTitleMarks(source = {}) {
const defaults = defaultRareTitleMarks();
return Object.keys(defaults).reduce((acc, key) => {
acc[key] = Math.max(0, Number(source?.[key]) || 0);
return acc;
}, {});
}
function defaultRareTitleStreaks() {
return Object.fromEntries(Object.keys(SECRET_TITLE_DEFS).map((key) => [key, 0]));
}
function sanitizeRareTitleStreaks(source = {}) {
const defaults = defaultRareTitleStreaks();
return Object.keys(defaults).reduce((acc, key) => {
acc[key] = Math.max(0, Number(source?.[key]) || 0);
return acc;
}, {});
}
function defaultCursedWinMarks() {
return Object.fromEntries(TITLE_CURSED_CARD_KEYS.map((key) => [key, 0]));
}
function sanitizeCursedWinMarks(source = {}) {
const defaults = defaultCursedWinMarks();
return Object.keys(defaults).reduce((acc, key) => {
acc[key] = Math.max(0, Number(source?.[key]) || 0);
return acc;
}, {});
}
function countUnlockedRareTitles(progress) {
const marks = sanitizeRareTitleMarks(progress?.rareTitleMarks);
return Object.keys(marks).reduce((sum, key) => sum + (marks[key] > 0 ? 1 : 0), 0);
}
function isSecretTitleMeta(meta) {
return !!meta?.hidden;
}
function applyDeckPlan(cards, deckPlan) {
if (!deckPlan) {
return;
}
const suitPool = ["spades", "hearts", "diamonds", "clubs"];
Object.entries(deckPlan.add || {}).forEach(([rank, count]) => {
for (let i = 0; i < count; i += 1) {
cards.push({ suit: suitPool[(cards.length + i) % suitPool.length], rank });
}
});
Object.entries(deckPlan.remove || {}).forEach(([rank, count]) => {
for (let i = 0; i < count; i += 1) {
const idx = cards.findIndex((card) => card.rank === rank);
if (idx >= 0) {
cards.splice(idx, 1);
}
}
});
}
function buildHomeSecretTitleMeta() {
return Object.fromEntries(Object.entries(SECRET_TITLE_DEFS).map(([key, meta]) => [
key,
{
label: meta.label,
rarity: meta.rarity,
effect: meta.effect,
hidden: true,
unlockText: meta.unlockText,
unlock: (progress) => (progress?.rareTitleMarks?.[key] || 0) > 0
}
]));
}
function buildBlackjackSecretTitleMeta() {
return Object.fromEntries(Object.entries(SECRET_TITLE_DEFS).map(([key, meta]) => [
key,
{
label: meta.label,
rarity: meta.rarity,
desc: meta.desc,
effect: meta.effect,
hidden: true,
unlockText: meta.unlockText,
unlock: (progress) => (progress?.rareTitleMarks?.[key] || 0) > 0,
applyDeck: (cards) => applyDeckPlan(cards, meta.deckPlan)
}
]));
}
const RUN_CURSE_DEFS = {
"ragged-purse": {
label: "Ragged Purse",
desc: "Start each fresh run with $160 less cash.",
xpBonus: 18
},
"soul-leak": {
label: "Soul Leak",
desc: "Start each fresh run with 2 fewer lives.",
xpBonus: 22
},
"crooked-shops": {
label: "Crooked Shops",
desc: "All shop prices increase by 35%.",
xpBonus: 18
},
"loaded-house": {
label: "Loaded House",
desc: "Enemies begin each run with +5 Intelligence.",
xpBonus: 20
},
"blood-stakes": {
label: "Blood Stakes",
desc: "Base table stakes increase by 25%.",
xpBonus: 22
},
"withered-shoe": {
label: "Withered Shoe",
desc: "Each fresh deck loses 1 Ace and 2 ten-value cards.",
xpBonus: 24
},
"collectors-tithe": {
label: "Collector's Tithe",
desc: "Positive table payouts are reduced by 12%.",
xpBonus: 18
}
};
function sanitizeCurseKeys(keys) {
if (!Array.isArray(keys)) {
return [];
}
return [...new Set(keys.filter((key) => RUN_CURSE_DEFS[key]))];
}
function curseLoadoutUnlocked(progress) {
return (Number(progress?.worldOneClears) || 0) >= 1;
}
function configuredCurseKeys(progress) {
return curseLoadoutUnlocked(progress) ? sanitizeCurseKeys(progress?.equippedCurses) : [];
}
function curseXpBonusPercent(keys) {
return sanitizeCurseKeys(keys).reduce((total, key) => total + (RUN_CURSE_DEFS[key]?.xpBonus || 0), 0);
}
const bjHomePage = document.querySelector(".death-blackjack-home-page");
if (bjHomePage && !document.querySelector(".blackjack-screen")) {
(() => {
const HOME_PROGRESS_KEY = "death_blackjack_progress_v1";
const HOME_RUN_KEY = "death_blackjack_run_save_v2";
const HOME_KEYBINDS_KEY = "death_blackjack_keybinds_v1";
const HOME_SAVE_CODE_PREFIX = "DBJ1";
const HOME_ACCOUNT_CODE_PREFIX = "DBJA1";
const HOME_CURRENT_SAVE_VERSION = 2;
const HOME_DEV_ACCOUNT_ID = "dev-house";
const HOME_DEV_ACCOUNT_LABEL = "House Developer";
const homeStatusEl = document.getElementById("bjHomeStatus");
const homeEquippedTitlesEl = document.getElementById("bjHomeEquippedTitles");
const homeTitleCollectionEl = document.getElementById("bjHomeTitleCollection");
const homeProgressStatsEl = document.getElementById("bjHomeProgressStats");
const homeLevelTrackEl = document.getElementById("bjHomeLevelTrack");
const homeRunLogEl = document.getElementById("bjHomeRunLog");
const homeAchievementsEl = document.getElementById("bjHomeAchievements");
const curseStatusEl = document.getElementById("bjCurseStatus");
const curseSettingsEl = document.getElementById("bjCurseSettings");
const continueRunLink = document.getElementById("bjContinueRunLink");
const freshRunLink = document.getElementById("bjFreshRunLink");
const titleSettingsEl = document.getElementById("bjTitleSettings");
const titleStatusEl = document.getElementById("bjTitleStatus");
const keybindSettingsEl = document.getElementById("bjKeybindSettings");
const keybindStatusEl = document.getElementById("bjKeybindStatus");
const resetKeybindsBtn = document.getElementById("bjResetKeybindsBtn");
const accountStatusEl = document.getElementById("bjAccountStatus");
const exportAccountBtn = document.getElementById("bjExportAccountBtn");
const joinAccountBtn = document.getElementById("bjJoinAccountBtn");
const leaveAccountBtn = document.getElementById("bjLeaveAccountBtn");
const accountCodePanelEl = document.getElementById("bjAccountCodePanel");
const accountCodeInputEl = document.getElementById("bjAccountCodeInput");
const copyAccountBtn = document.getElementById("bjCopyAccountBtn");
const applyAccountBtn = document.getElementById("bjApplyAccountBtn");
const homeDevToolsCardEl = document.getElementById("bjHomeDevToolsCard");
const homeDevToolsStatusEl = document.getElementById("bjHomeDevToolsStatus");
const homeDevUnlockTitlesBtn = document.getElementById("bjHomeDevUnlockTitlesBtn");
const homeDevMaxProgressBtn = document.getElementById("bjHomeDevMaxProgressBtn");
const homeDevClearRunBtn = document.getElementById("bjHomeDevClearRunBtn");
const exportSaveBtn = document.getElementById("bjExportSaveBtn");
const importSaveBtn = document.getElementById("bjImportSaveBtn");
const deleteSaveBtn = document.getElementById("bjDeleteSaveBtn");
const saveCodePanelEl = document.getElementById("bjSaveCodePanel");
const saveCodeStatusEl = document.getElementById("bjSaveCodeStatus");
const saveCodeInputEl = document.getElementById("bjSaveCodeInput");
const copySaveBtn = document.getElementById("bjCopySaveBtn");
const applySaveBtn = document.getElementById("bjApplySaveBtn");
let waitingForKeybindAction = "";
let homeProgress = null;
let customKeybinds = null;
const HOME_RANK_LABELS = {
1: "Ashbound (Common)",
2: "Cinder (Uncommon)",
3: "Hellforged (Rare)",
4: "Dreadmarked (Epic)",
5: "Abyssal (Legendary)"
};
const HOME_MAX_LEVEL = 100;
const HOME_MAX_RUN_LOGS = 8;
function buildHomeLevelThresholds(maxLevel = HOME_MAX_LEVEL) {
const thresholds = [0];
let total = 0;
for (let level = 2; level <= maxLevel; level += 1) {
let increment = 50 + ((level - 2) * 8);
if (level > 10 && level <= 30) {
increment = 115 + ((level - 11) * 5);
} else if (level > 30 && level <= 60) {
increment = 215 + ((level - 31) * 6);
} else if (level > 60) {
increment = 395 + ((level - 61) * 7);
}
total += increment;
thresholds.push(total);
}
return thresholds;
}
function buildHomeRouteLevels(maxLevel = HOME_MAX_LEVEL) {
const levels = [];
for (let level = 2; level <= Math.min(10, maxLevel); level += 1) {
levels.push(level);
}
for (let level = 12; level <= Math.min(30, maxLevel); level += 2) {
levels.push(level);
}
for (let level = 33; level <= Math.min(60, maxLevel); level += 3) {
levels.push(level);
}
for (let level = 65; level <= maxLevel; level += 5) {
levels.push(level);
}
return levels;
}
const HOME_LEVEL_THRESHOLDS = buildHomeLevelThresholds();
function sanitizeRecentRuns(entries) {
if (!Array.isArray(entries)) {
return [];
}
return entries
.filter((entry) => entry && typeof entry === "object")
.map((entry) => ({
summary: typeof entry.summary === "string" ? entry.summary.slice(0, 72) : "Unknown result",
detail: typeof entry.detail === "string" ? entry.detail.slice(0, 160) : "",
map: Math.max(1, Math.min(5, Number(entry.map) || 1)),
cash: Math.max(0, Number(entry.cash) || 0),
lives: Math.max(0, Number(entry.lives) || 0)
}))
.slice(0, HOME_MAX_RUN_LOGS);
}
function homeProgressScore(progress) {
return (
((Number(progress.totalBossesDefeated) || 0) * 100) +
((Number(progress.highestMapReached) || 0) * 35) +
((Number(progress.worldOneClears) || 0) * 320) +
((Number(progress.vaultsOpened) || 0) * 16) +
((Number(progress.forgesUsed) || 0) * 18) +
((Number(progress.blackjacksWon) || 0) * 14) +
((Number(progress.skillTrialsCleared) || 0) * 55) +
((Number(progress.runsCompleted) || 0) * 22) +
((Number(progress.curseXpEarned) || 0)) +
(countUnlockedRareTitles(progress) * 180) +
(sanitizeRecentRuns(progress.recentRuns).length * 6)
);
}
function homeProgressLevel(progress) {
const score = homeProgressScore(progress);
let level = 1;
for (let i = 0; i < HOME_LEVEL_THRESHOLDS.length; i += 1) {
if (score >= HOME_LEVEL_THRESHOLDS[i]) {
level = i + 1;
}
}
return level;
}
function homeNextLevelTarget(progress) {
const level = homeProgressLevel(progress);
const nextThreshold = HOME_LEVEL_THRESHOLDS[level];
return Number.isFinite(nextThreshold) ? nextThreshold : null;
}
const HOME_TITLE_META = {
newcomer: { label: "Newcomer", rarity: 1, effect: "Adds 1 extra 8 to each fresh deck.", unlock: () => true, unlockText: "Unlocked by default." },
ashwalker: { label: "Ashwalker", rarity: 1, effect: "Adds 1 Ace and removes 1 two.", unlock: (p) => p.highestMapReached >= 2, unlockText: "Reach Map 2 in a run." },
"pit-counter": { label: "Pit Counter", rarity: 2, effect: "Removes 1 three and 1 four.", unlock: (p) => p.totalBossesDefeated >= 1, unlockText: "Defeat 1 boss." },
"chip-keeper": { label: "Chip Keeper", rarity: 2, effect: "Adds 1 ten and 1 six.", unlock: (p) => p.vaultsOpened >= 3, unlockText: "Open 3 Casino Vaults." },
"cinder-counter": { label: "Cinder Counter", rarity: 2, effect: "Adds 1 Jack and removes 1 two.", unlock: (p) => p.forgesUsed >= 3, unlockText: "Use the Card Forge 3 times." },
"house-burned": { label: "House Burned", rarity: 3, effect: "Adds 1 ten and removes 1 two, 1 three, and 1 four.", unlock: (p) => p.totalBossesDefeated >= 3, unlockText: "Defeat 3 bosses." },
"house-reader": { label: "House Reader", rarity: 3, effect: "Adds 1 Ace and 1 nine, removes 1 two and 1 five.", unlock: (p) => p.blackjacksWon >= 5, unlockText: "Win 5 natural blackjacks." },
"ledger-breaker": { label: "Ledger Breaker", rarity: 3, effect: "Adds 2 face cards, removes 1 two, 1 three, and 1 four.", unlock: (p) => p.skillTrialsCleared >= 3, unlockText: "Clear 3 Skill Trials." },
"devils-favorite": { label: "Devil's Favorite", rarity: 4, effect: "Adds 1 Ace and 1 King, removes 1 two, 1 three, and 1 four.", unlock: (p) => p.worldOneClears >= 1, unlockText: "Clear World 1 once." },
"abyss-witness": { label: "Abyss Witness", rarity: 5, effect: "Adds 1 Ace, 1 King, and 1 Queen, removes 1 two, 1 three, 1 four, and 1 five.", unlock: (p) => p.worldOneClears >= 3, unlockText: "Clear World 1 three times." },
"seat-of-cinders": { label: "Seat of Cinders", rarity: 4, effect: "Adds 1 Ace and 1 Queen, removes 1 two, 1 three, 1 four, and 1 five.", unlock: (p) => homeProgressLevel(p) >= 12 && p.worldOneClears >= 2, unlockText: "Reach level 12 and clear World 1 twice." },
"debt-eclipse": { label: "Debt Eclipse", rarity: 4, effect: "Adds 2 tens and removes 1 two, 1 three, 1 four, and 1 six.", unlock: (p) => homeProgressLevel(p) >= 18 && p.totalBossesDefeated >= 8, unlockText: "Reach level 18 and defeat 8 bosses." },
"table-revenant": { label: "Table Revenant", rarity: 5, effect: "Adds 1 Ace, 1 King, and 1 ten, removes 1 two, 1 three, 1 four, and 1 five.", unlock: (p) => homeProgressLevel(p) >= 24 && p.blackjacksWon >= 12, unlockText: "Reach level 24 and win 12 natural blackjacks." },
"house-mirage": { label: "House Mirage", rarity: 5, effect: "Adds 1 Ace, 1 Queen, and 1 Jack, removes 1 two, 1 three, 1 four, 1 five, and 1 six.", unlock: (p) => homeProgressLevel(p) >= 28 && p.skillTrialsCleared >= 8 && p.vaultsOpened >= 8, unlockText: "Reach level 28, clear 8 trials, and open 8 vaults." },
"crowned-return": { label: "Crowned Return", rarity: 5, effect: "Adds 1 Ace, 1 King, 1 Queen, and 1 ten, removes 1 two, 1 three, 1 four, 1 five, and 1 six.", unlock: (p) => homeProgressLevel(p) >= 33 && p.worldOneClears >= 5 && p.totalBossesDefeated >= 12, unlockText: "Reach level 33, clear World 1 five times, and defeat 12 bosses." },
"pit-sovereign": { label: "Pit Sovereign", rarity: 4, effect: "Adds 1 Ace, 1 King, 1 Jack, and 1 nine, removes 1 two, 1 three, 1 four, and 1 five.", unlock: (p) => homeProgressLevel(p) >= 45 && p.totalBossesDefeated >= 24 && p.worldOneClears >= 8, unlockText: "Reach level 45, defeat 24 bosses, and clear World 1 eight times." },
"ledger-null": { label: "Ledger Null", rarity: 5, effect: "Adds 2 Aces and 1 Queen, removes 1 two, 1 three, 1 four, 1 five, and 1 six.", unlock: (p) => homeProgressLevel(p) >= 60 && p.skillTrialsCleared >= 15 && p.vaultsOpened >= 15, unlockText: "Reach level 60, clear 15 trials, and open 15 vaults." },
"house-blackout": { label: "House Blackout", rarity: 5, effect: "Adds 1 Ace, 1 King, 1 Queen, 1 Jack, and 1 ten, removes 1 two, 1 three, 1 four, 1 five, 1 six, and 1 seven.", unlock: (p) => homeProgressLevel(p) >= 75 && p.blackjacksWon >= 30 && p.totalBossesDefeated >= 40 && p.worldOneClears >= 12, unlockText: "Reach level 75, win 30 natural blackjacks, defeat 40 bosses, and clear World 1 twelve times." },
"final-seat": { label: "Final Seat", rarity: 5, effect: "Adds 2 Aces, 1 King, 1 Queen, 1 Jack, and 1 ten, removes 1 two, 1 three, 1 four, 1 five, 1 six, 1 seven, and 1 eight.", unlock: (p) => homeProgressLevel(p) >= 100 && p.worldOneClears >= 20 && p.totalBossesDefeated >= 60 && p.blackjacksWon >= 50, unlockText: "Reach level 100, clear World 1 twenty times, defeat 60 bosses, and win 50 natural blackjacks." }
};
Object.assign(HOME_TITLE_META, buildHomeSecretTitleMeta());
function normalizeHomeZeroStart(progress) {
const hasActivity = progress.totalBossesDefeated > 0
|| progress.worldOneClears > 0
|| progress.vaultsOpened > 0
|| progress.forgesUsed > 0
|| progress.blackjacksWon > 0
|| progress.skillTrialsCleared > 0
|| progress.runsCompleted > 0
|| progress.curseXpEarned > 0
|| countUnlockedRareTitles(progress) > 0
|| sanitizeRecentRuns(progress.recentRuns).length > 0;
if (!hasActivity && progress.highestMapReached <= 1) {
progress.highestMapReached = 0;
}
return progress;
}
const HOME_DEFAULT_KEYBINDS = {
hit: ["h", "enter"],
stand: ["s"],
double: ["d"],
split: ["p"],
map: ["m"],
nextHand: ["e"],
prevHand: ["q"]
};
const HOME_KEYBIND_LABELS = {
hit: { label: "Hit / Start Next Table", desc: "Primary action and round start." },
stand: { label: "Stand", desc: "Stand on the active hand." },
double: { label: "Double Down", desc: "Double the current hand." },
split: { label: "Split", desc: "Split a valid opening pair." },
map: { label: "Map", desc: "Open or close the battle map." },
nextHand: { label: "Next Hand", desc: "Select the next playable hand." },
prevHand: { label: "Previous Hand", desc: "Select the previous playable hand." }
};
function defaultHomeProgress() {
return {
accountId: HOME_DEV_ACCOUNT_ID,
accountLabel: HOME_DEV_ACCOUNT_LABEL,
accountRole: "dev",
accountProtected: true,
devToolsUnlocked: true,
totalBossesDefeated: 0,
highestMapReached: 0,
worldOneClears: 0,
vaultsOpened: 0,
forgesUsed: 0,
blackjacksWon: 0,
skillTrialsCleared: 0,
runsCompleted: 0,
curseXpEarned: 0,
rareTitleMarks: defaultRareTitleMarks(),
rareTitleStreaks: defaultRareTitleStreaks(),
equippedCurses: [],
equippedTitles: [],
recentRuns: []
};
}
function createGuestHomeProgress() {
return {
...defaultHomeProgress(),
accountId: `guest-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`,
accountLabel: "Pit Guest",
accountRole: "guest",
accountProtected: false,
devToolsUnlocked: false
};
}
function normalizedKeyName(key) {
const value = String(key || "").toLowerCase().trim();
if (value === " ") return "space";
if (value === "escape") return "esc";
return value;
}
function keybindsWithDefaults(source = {}) {
return Object.keys(HOME_DEFAULT_KEYBINDS).reduce((acc, action) => {
const value = Array.isArray(source[action]) ? source[action].map((entry) => normalizedKeyName(entry)).filter(Boolean) : HOME_DEFAULT_KEYBINDS[action];
acc[action] = [...new Set(value.length ? value : HOME_DEFAULT_KEYBINDS[action])];
return acc;
}, {});
}
function loadHomeProgress() {
try {
const raw = window.localStorage.getItem(HOME_PROGRESS_KEY);
const parsed = raw ? JSON.parse(raw) : {};
const fallback = defaultHomeProgress();
const equippedTitles = Array.isArray(parsed.equippedTitles)
? [...new Set(parsed.equippedTitles.filter((key) => HOME_TITLE_META[key]).slice(0, 3))]
: HOME_TITLE_META[parsed.selectedTitle]
? [parsed.selectedTitle]
: [];
return normalizeHomeZeroStart({
accountId: typeof parsed.accountId === "string" ? parsed.accountId : fallback.accountId,
accountLabel: typeof parsed.accountLabel === "string" ? parsed.accountLabel : fallback.accountLabel,
accountRole: typeof parsed.accountRole === "string" ? parsed.accountRole : fallback.accountRole,
accountProtected: parsed.accountProtected !== false,
devToolsUnlocked: parsed.devToolsUnlocked !== false,
totalBossesDefeated: Math.max(0, Number(parsed.totalBossesDefeated) || 0),
highestMapReached: Math.max(0, Math.min(5, Number(parsed.highestMapReached) || 0)),
worldOneClears: Math.max(0, Number(parsed.worldOneClears) || 0),
vaultsOpened: Math.max(0, Number(parsed.vaultsOpened) || 0),
forgesUsed: Math.max(0, Number(parsed.forgesUsed) || 0),
blackjacksWon: Math.max(0, Number(parsed.blackjacksWon) || 0),
skillTrialsCleared: Math.max(0, Number(parsed.skillTrialsCleared) || 0),
runsCompleted: Math.max(0, Number(parsed.runsCompleted) || 0),
curseXpEarned: Math.max(0, Number(parsed.curseXpEarned) || 0),
rareTitleMarks: sanitizeRareTitleMarks(parsed.rareTitleMarks),
rareTitleStreaks: sanitizeRareTitleStreaks(parsed.rareTitleStreaks),
equippedCurses: configuredCurseKeys(parsed),
equippedTitles,
recentRuns: sanitizeRecentRuns(parsed.recentRuns)
});
} catch {
return defaultHomeProgress();
}
}
function saveHomeProgress() {
try {
window.localStorage.setItem(HOME_PROGRESS_KEY, JSON.stringify(homeProgress));
} catch {}
}
function loadHomeKeybinds() {
try {
const raw = window.localStorage.getItem(HOME_KEYBINDS_KEY);
if (!raw) {
return keybindsWithDefaults();
}
return keybindsWithDefaults(JSON.parse(raw));
} catch {
return keybindsWithDefaults();
}
}
function saveHomeKeybinds() {
try {
window.localStorage.setItem(HOME_KEYBINDS_KEY, JSON.stringify(customKeybinds));
} catch {}
}
function formatKeybind(keys = []) {
return keys.map((key) => key === "enter" ? "Enter" : key === "esc" ? "Esc" : key === "space" ? "Space" : key.length === 1 ? key.toUpperCase() : key).join(" / ");
}
function stableSerialize(value) {
if (Array.isArray(value)) {
return `[${value.map((entry) => stableSerialize(entry)).join(",")}]`;
}
if (value && typeof value === "object") {
const entries = Object.keys(value)
.sort()
.map((key) => `${JSON.stringify(key)}:${stableSerialize(value[key])}`);
return `{${entries.join(",")}}`;
}
return JSON.stringify(value);
}
function encodedSaveCode(payload) {
const json = stableSerialize(payload);
const encoded = btoa(unescape(encodeURIComponent(json)));
return `${HOME_SAVE_CODE_PREFIX}-${encoded}`;
}
function encodedAccountCode(payload) {
const json = stableSerialize(payload);
const encoded = btoa(unescape(encodeURIComponent(json)));
return `${HOME_ACCOUNT_CODE_PREFIX}-${encoded}`;
}
function migrateHomeSavePayload(payload) {
const parsed = payload && typeof payload === "object" ? payload : {};
const progress = {
...defaultHomeProgress(),
...(parsed.progress || {})
};
const equippedTitles = Array.isArray(progress.equippedTitles)
? [...new Set(progress.equippedTitles.filter((key) => HOME_TITLE_META[key]).slice(0, 3))]
: HOME_TITLE_META[progress.selectedTitle]
? [progress.selectedTitle]
: [];
return {
version: HOME_CURRENT_SAVE_VERSION,
progress: normalizeHomeZeroStart({
accountId: typeof progress.accountId === "string" ? progress.accountId : HOME_DEV_ACCOUNT_ID,
accountLabel: typeof progress.accountLabel === "string" ? progress.accountLabel : HOME_DEV_ACCOUNT_LABEL,
accountRole: typeof progress.accountRole === "string" ? progress.accountRole : "dev",
accountProtected: progress.accountProtected !== false,
devToolsUnlocked: progress.devToolsUnlocked !== false,
totalBossesDefeated: Math.max(0, Number(progress.totalBossesDefeated) || 0),
highestMapReached: Math.max(0, Math.min(5, Number(progress.highestMapReached) || 0)),
worldOneClears: Math.max(0, Number(progress.worldOneClears) || 0),
vaultsOpened: Math.max(0, Number(progress.vaultsOpened) || 0),
forgesUsed: Math.max(0, Number(progress.forgesUsed) || 0),
blackjacksWon: Math.max(0, Number(progress.blackjacksWon) || 0),
skillTrialsCleared: Math.max(0, Number(progress.skillTrialsCleared) || 0),
runsCompleted: Math.max(0, Number(progress.runsCompleted) || 0),
curseXpEarned: Math.max(0, Number(progress.curseXpEarned) || 0),
rareTitleMarks: sanitizeRareTitleMarks(progress.rareTitleMarks),
rareTitleStreaks: sanitizeRareTitleStreaks(progress.rareTitleStreaks),
equippedCurses: configuredCurseKeys(progress),
equippedTitles,
recentRuns: sanitizeRecentRuns(progress.recentRuns)
}),
run: parsed.run && typeof parsed.run === "object" ? parsed.run : null
};
}
function decodeSaveCode(saveCode) {
const normalized = String(saveCode || "").trim().replace(/\s+/g, "");
if (!normalized.startsWith(`${HOME_SAVE_CODE_PREFIX}-`)) {
throw new Error("Save code prefix is invalid.");
}
const payload = normalized.slice(HOME_SAVE_CODE_PREFIX.length + 1);
const json = decodeURIComponent(escape(atob(payload)));
return migrateHomeSavePayload(JSON.parse(json));
}
function decodeAccountCode(accountCode) {
const normalized = String(accountCode || "").trim().replace(/\s+/g, "");
if (!normalized.startsWith(`${HOME_ACCOUNT_CODE_PREFIX}-`)) {
throw new Error("Account code prefix is invalid.");
}
const payload = normalized.slice(HOME_ACCOUNT_CODE_PREFIX.length + 1);
const json = decodeURIComponent(escape(atob(payload)));
const parsed = JSON.parse(json);
const progress = migrateHomeSavePayload({ progress: parsed.progress || parsed }).progress;
return {
progress,
keybinds: keybindsWithDefaults(parsed.keybinds || {})
};
}
function setSaveCodePanelOpen(show) {
if (!saveCodePanelEl) {
return;
}
saveCodePanelEl.classList.toggle("hidden", !show);
}
function setAccountCodePanelOpen(show) {
if (!accountCodePanelEl) {
return;
}
accountCodePanelEl.classList.toggle("hidden", !show);
}
function updateSaveCodeStatus(message = "Export, import, or wipe Death Blackjack data from here.") {
if (saveCodeStatusEl) {
saveCodeStatusEl.textContent = message;
}
}
function updateTitleStatus(message = "Titles stay between runs, unlock from feats, and slightly reshape the deck.") {
if (titleStatusEl) {
titleStatusEl.textContent = message;
}
}
function updateKeybindStatus(message = "Click a bind, then press a key.") {
if (keybindStatusEl) {
keybindStatusEl.textContent = message;
}
}
function updateAccountStatus(message = "Manage your current account, leave it safely, or rejoin with an account code later.") {
if (accountStatusEl) {
accountStatusEl.textContent = message;
}
}
function updateHomeDevToolsStatus(message = "Dev-only testing tools appear here on the protected developer account.") {
if (homeDevToolsStatusEl) {
homeDevToolsStatusEl.textContent = message;
}
}
function renderHomeDevTools() {
if (!homeDevToolsCardEl) {
return;
}
const show = !!homeProgress?.devToolsUnlocked;
homeDevToolsCardEl.classList.toggle("hidden", !show);
if (!show) {
return;
}
updateHomeDevToolsStatus("Developer account active. Use these tools to unlock content, max progression, or clear a stuck run save.");
}
const HOME_ROUTE_REWARD_MAP = {
2: { title: "Lucky Seven Packet", detail: "The House gives your first real deck prize.", rewards: ["Card: Lucky Seven", "Passive: Chip Stash"] },
3: { title: "Dealer Read Kit", detail: "You start reading the table instead of only surviving it.", rewards: ["Card: Marked Card", "Passive: Steel Nerves"] },
4: { title: "Cinder Shop Pool", detail: "Rank II items enter the live route.", rewards: ["Rank II shop pool"] },
5: { title: "Ace Ledger", detail: "Your deck starts leaning toward cleaner value lines.", rewards: ["Card: Ace Anchor", "Passive: Profit Margin"] },
6: { title: "Grim Table Tools", detail: "The route starts paying out harsher but stronger pieces.", rewards: ["Card: Grim Chip", "Passive: Dealer Tell"] },
7: { title: "Trap Line", detail: "You gain table punish tools and better side-event value.", rewards: ["Card: Dealer Trap", "Passive: Vault Interest"] },
8: { title: "Trial Packet", detail: "The route finally pays out for cleaner high-end finishes.", rewards: ["Card: Finisher Card", "Passive: Trial Script"] },
9: { title: "First Dreadmarked Trail", detail: "The first epic title chase appears in the ledger.", rewards: ["Achievement: Seat of Cinders"] },
10: { title: "Hellforged Shop Pool", detail: "Rank III items enter the live route.", rewards: ["Rank III shop pool"] },
12: { title: "Seat of Cinders", detail: "Your first epic title prize can now be claimed.", rewards: ["Title hunt: Seat of Cinders"] },
14: { title: "Boss Dividend Line", detail: "Boss rooms start paying your run back harder.", rewards: ["Passive: Ace Credit", "Passive: Boss Dividend"] },
16: { title: "Croupier Cache", detail: "The House starts handing out stronger opening table tools.", rewards: ["Passive: Croupier Stash"] },