-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBisque.html
More file actions
1967 lines (1788 loc) · 71.3 KB
/
Bisque.html
File metadata and controls
1967 lines (1788 loc) · 71.3 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">
<script>
(function() {
var ua = navigator.userAgent;
var isPhone = /iPhone|iPad|iPod|Android/i.test(ua) || window.innerWidth < 768;
if (isPhone) {
var meta = document.querySelector('meta[name="viewport"]');
if (meta) {
var targetWidth = 780;
var scale = window.innerWidth / targetWidth;
meta.setAttribute('content', 'width=' + targetWidth + ', initial-scale=' + scale + ', maximum-scale=3.0, user-scalable=yes');
}
}
})();
</script>
<meta name="theme-color" content="#0c1016">
<title>Bisque — Battle for the Bay (Risk-style Strategy) | Board Gaming Hub</title>
<meta name="description" content="Risk-style territory war on Peconic Bay. Free turn-based strategy with rotating starts, no-tie network bonus, multi-fortify. Single HTML file, no signup.">
<link rel="canonical" href="https://boardgaminghub.com/Bisque.html">
<meta property="og:type" content="website">
<meta property="og:url" content="https://boardgaminghub.com/Bisque.html">
<meta property="og:title" content="Bisque — Battle for the Bay">
<meta property="og:description" content="Free Risk-style territory strategy game on Peconic Bay. 100-game balance-validated.">
<meta property="og:image" content="https://boardgaminghub.com/og-image.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://boardgaminghub.com/og-image.png">
<script type="application/ld+json">
{ "@context": "https://schema.org", "@type": "VideoGame", "name": "Bisque",
"description": "Risk-style territory war set on Peconic Bay, Long Island. Rotating starts, fair harvest order, network bonuses.",
"url": "https://boardgaminghub.com/Bisque.html", "genre": "Strategy",
"applicationCategory": "Game", "operatingSystem": "Any",
"offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" } }
</script>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🦞</text></svg>">
<style>
@keyframes diceRoll {
0% { transform: rotateX(0deg) rotateY(0deg) scale(0.5); opacity: 0; }
50% { transform: rotateX(180deg) rotateY(180deg) scale(1.2); opacity: 1; }
100% { transform: rotateX(360deg) rotateY(360deg) scale(1); opacity: 1; }
}
@keyframes glow {
0% { box-shadow: 0 0 5px rgba(255,200,100,0.5); }
50% { box-shadow: 0 0 18px rgba(255,200,100,0.9); }
100% { box-shadow: 0 0 5px rgba(255,200,100,0.5); }
}
@keyframes conquerFlash {
0% { filter: brightness(1); }
25% { filter: brightness(1.8); }
50% { filter: brightness(1); }
75% { filter: brightness(1.5); }
100% { filter: brightness(1); }
}
@keyframes trapBounce {
0% { transform: scale(1); }
50% { transform: scale(1.3); }
100% { transform: scale(1); }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
background: #0E1820;
color: #D8D0C0;
font-family: Georgia, serif;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
user-select: none;
}
#header {
text-align: center;
padding: 12px 0 6px 0;
}
#header h1 {
font-size: 2.2em;
letter-spacing: 6px;
color: #C05030;
text-shadow: 0 2px 8px rgba(192,80,48,0.4);
margin: 0;
}
#header .subtitle {
font-size: 0.85em;
color: #8098A8;
letter-spacing: 2px;
margin-top: -2px;
}
#modeToggle {
display: flex;
justify-content: center;
gap: 0;
margin: 8px auto 4px auto;
}
#modeToggle button {
font-family: Georgia, serif;
font-size: 0.85em;
padding: 5px 18px;
border: 2px solid #C05030;
background: transparent;
color: #D8D0C0;
cursor: pointer;
transition: background 0.2s, color 0.2s;
}
#modeToggle button:first-child { border-radius: 6px 0 0 6px; }
#modeToggle button:last-child { border-radius: 0 6px 6px 0; }
#modeToggle button.active {
background: #C05030;
color: #fff;
}
#playerCountToggle {
display: flex;
justify-content: center;
gap: 0;
margin: 4px auto 4px auto;
}
#playerCountToggle button {
font-family: Georgia, serif;
font-size: 0.8em;
padding: 4px 14px;
border: 2px solid #806040;
background: transparent;
color: #D8D0C0;
cursor: pointer;
transition: background 0.2s, color 0.2s;
}
#playerCountToggle button:first-child { border-radius: 6px 0 0 6px; }
#playerCountToggle button:last-child { border-radius: 0 6px 6px 0; }
#playerCountToggle button.active {
background: #806040;
color: #fff;
}
#turnInfo {
text-align: center;
padding: 6px 0;
font-size: 0.95em;
min-height: 28px;
}
#turnInfo .phase-label {
color: #C05030;
font-weight: bold;
}
#mapWrap {
position: relative;
width: 750px;
height: 480px;
margin: 6px auto;
border-radius: 12px;
border: 2px solid #2A4050;
overflow: hidden;
background: #0E1820;
}
.water-label {
position: absolute;
color: rgba(80, 140, 170, 0.25);
font-family: Georgia, serif;
font-style: italic;
letter-spacing: 2px;
pointer-events: none;
z-index: 0;
white-space: nowrap;
}
#mapSvg {
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;
pointer-events: none;
z-index: 1;
}
#mapSvg line {
stroke: #2A4050;
stroke-width: 1.2;
stroke-dasharray: 4,3;
opacity: 0.6;
}
.territory {
position: absolute;
border-radius: 8px;
padding: 4px 8px;
text-align: center;
cursor: pointer;
border: 2px solid #2A4050;
font-size: 0.58em;
min-width: 58px;
transition: border-color 0.2s, box-shadow 0.2s, background 0.3s;
z-index: 2;
line-height: 1.2;
}
.territory:hover {
border-color: #D8D0C0 !important;
z-index: 5;
}
.territory.selected {
animation: glow 1s infinite;
border-color: #FFC864 !important;
z-index: 10;
}
.territory.conquered {
animation: conquerFlash 0.5s ease;
}
.territory .t-name {
font-size: 0.9em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
opacity: 0.85;
}
.territory .t-traps {
font-size: 1.7em;
font-weight: bold;
line-height: 1.1;
}
.territory .t-traps.bounce {
animation: trapBounce 0.3s ease;
}
.territory.water {
border-style: dashed;
}
.territory.bonus-active {
outline: 2px dashed #FFC864;
outline-offset: 2px;
box-shadow: 0 0 10px rgba(255,200,100,0.35);
}
.p1 { background: rgba(192,80,48,0.35); border-color: rgba(192,80,48,0.7); color: #F0D0C0; }
.p2 { background: rgba(48,128,176,0.35); border-color: rgba(48,128,176,0.7); color: #C0D8E8; }
.p3 { background: rgba(64,160,80,0.35); border-color: rgba(64,160,80,0.7); color: #C0E8C8; }
.p4 { background: rgba(208,160,48,0.35); border-color: rgba(208,160,48,0.7); color: #E8DCC0; }
.pN { background: rgba(136,136,136,0.30); border-color: rgba(136,136,136,0.6); color: #C0C0C0; }
#diceArea {
display: flex;
justify-content: center;
align-items: center;
gap: 30px;
min-height: 60px;
padding: 4px 0;
}
.dice-group {
display: flex;
gap: 6px;
align-items: center;
}
.dice-group .dice-label {
font-size: 0.75em;
color: #8098A8;
margin-right: 4px;
}
.die {
width: 36px;
height: 36px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.3em;
font-weight: bold;
color: #fff;
animation: diceRoll 0.5s ease;
}
.die.atk { background: #C05030; }
.die.def { background: #3080B0; }
.die.win { box-shadow: 0 0 8px rgba(255,255,100,0.8); }
.die.lose { opacity: 0.45; }
#actions {
display: flex;
justify-content: center;
gap: 10px;
padding: 4px 0;
}
#actions button {
font-family: Georgia, serif;
font-size: 0.85em;
padding: 7px 20px;
border: 2px solid #C05030;
border-radius: 6px;
background: transparent;
color: #D8D0C0;
cursor: pointer;
transition: background 0.2s, color 0.2s;
}
#actions button:hover:not(:disabled) {
background: #C05030;
color: #fff;
}
#actions button:disabled {
opacity: 0.3;
cursor: default;
}
#messageArea {
text-align: center;
font-size: 0.9em;
color: #B0A890;
min-height: 22px;
padding: 4px 16px;
max-width: 750px;
}
#legend {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 12px;
padding: 6px 10px 14px 10px;
max-width: 750px;
}
.legend-group {
background: #1A2028;
border-radius: 6px;
padding: 5px 10px;
font-size: 0.72em;
border-left: 3px solid;
}
.legend-group .lg-name { font-weight: bold; }
.legend-group .lg-bonus { color: #C05030; }
.bisque-toggle {
margin: 4px 4px 0 4px;
padding: 5px 16px;
font-size: 0.82em;
font-family: Georgia, serif;
cursor: pointer;
border: 1px solid #806040;
border-radius: 5px;
background: #1A2028;
color: #C0A878;
}
.bisque-toggle:hover { background: #2A2E38; }
.bisque-doc {
display: none;
max-width: 540px;
background: #0E1820;
border: 1px solid #2A4050;
border-radius: 8px;
padding: 14px 18px;
margin: 10px auto;
font-size: 0.78em;
color: #B8C0C8;
line-height: 1.55;
text-align: left;
font-family: Georgia, serif;
}
.bisque-doc.show { display: block; }
.bisque-doc h4 {
color: #C05030;
margin: 10px 0 4px;
letter-spacing: 1px;
}
.bisque-doc h4:first-child { margin-top: 0; }
.bisque-doc ul { margin: 4px 0 6px 18px; padding: 0; }
.bisque-doc li { margin: 2px 0; }
.bisque-doc b { color: #E0C898; }
#overlay {
display: none;
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(14,24,32,0.85);
z-index: 100;
justify-content: center;
align-items: center;
}
#overlay.show { display: flex; }
#overlayBox {
background: #1A2028;
border: 2px solid #C05030;
border-radius: 12px;
padding: 30px 40px;
text-align: center;
max-width: 400px;
}
#overlayBox h2 {
color: #C05030;
font-size: 1.6em;
margin-bottom: 10px;
}
#overlayBox p {
color: #D8D0C0;
margin-bottom: 16px;
font-size: 1em;
}
#overlayBox button {
font-family: Georgia, serif;
font-size: 1em;
padding: 8px 28px;
border: 2px solid #C05030;
border-radius: 6px;
background: #C05030;
color: #fff;
cursor: pointer;
}
#deployInfo {
text-align: center;
font-size: 0.85em;
color: #C8A060;
min-height: 20px;
}
#scoreBar {
display: flex;
justify-content: center;
gap: 24px;
font-size: 0.82em;
padding: 2px 0;
flex-wrap: wrap;
}
.score-p1 { color: #E08060; }
.score-p2 { color: #60A0D0; }
.score-p3 { color: #60C070; }
.score-p4 { color: #D0B050; }
.score-pN { color: #999; }
/* Game nav (desktop + mobile) */
#gameNav { display: block; position: sticky; top: 0; z-index: 9999; background: #1A2030; border-bottom: 1px solid #2A4050; font-family: Georgia, serif; width: 100%; }
#gameNav .nav-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px; max-width: 1200px; margin: 0 auto; position: relative; }
#gameNav .nav-title { color: #D8D0C0; font-size: 0.9em; letter-spacing: 1px; }
#gameNav .nav-toggle { background: none; border: 1px solid #3A5060; color: #D8D0C0; font-size: 1.1em; padding: 3px 10px; border-radius: 4px; cursor: pointer; font-family: Georgia, serif; }
#gameNav .nav-toggle:hover { background: #1E2838; }
#gameNav .nav-menu { display: none; position: absolute; right: 18px; top: 100%; background: #141C28; border: 1px solid #2A4050; border-top: none; min-width: 180px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
#gameNav .nav-menu.open { display: block; }
#gameNav .nav-menu a { display: block; padding: 10px 18px; color: #8098A8; text-decoration: none; font-size: 0.85em; border-bottom: 1px solid #1E2838; }
#gameNav .nav-menu a:last-child { border-bottom: none; }
#gameNav .nav-menu a:hover { background: #1E2838; color: #D8D0C0; }
#gameNav .nav-menu a.current { color: #D8D0C0; font-weight: bold; }
@media (max-width: 768px) {
#gameNav .nav-bar { padding: 8px 14px; }
#gameNav .nav-menu { position: static; right: auto; min-width: 0; border: none; border-top: 1px solid #2A4050; box-shadow: none; }
}
</style>
<script type="application/ld+json">{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Board Gaming Hub","item":"https://boardgaminghub.com/"},{"@type":"ListItem","position":2,"name":"Board Games","item":"https://boardgaminghub.com/#board"},{"@type":"ListItem","position":3,"name":"Bisque","item":"https://boardgaminghub.com/Bisque.html"}]}</script>
<script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"Is Bisque a real-time game?","acceptedAnswer":{"@type":"Answer","text":"No — turn-based with simultaneous fleet positioning. Each turn resolves all moves at once."}},{"@type":"Question","name":"What does the asymmetry mean?","acceptedAnswer":{"@type":"Answer","text":"Defender has more starting ships and home territory but fewer victory-point sources. Attacker has fewer ships but more flexibility. Both sides are winnable; balance is set by playtest."}},{"@type":"Question","name":"How long is a typical game?","acceptedAnswer":{"@type":"Answer","text":"15–30 minutes. Most games end on a 3rd-island flip in the mid-game."}},{"@type":"Question","name":"Is there a campaign mode?","acceptedAnswer":{"@type":"Answer","text":"Single sessions only currently. Campaign linking multiple bays is on the roadmap."}}]}</script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2835365593874464"
crossorigin="anonymous"></script>
</head>
<body>
<style id="siteNav-css">
#siteNav { position: sticky; top: 0; z-index: 99999; background: rgba(16,20,28,0.96); border-bottom: 1px solid #2a3540; font-family: Georgia, "Times New Roman", serif; box-shadow: 0 2px 10px rgba(0,0,0,0.6); color: #d8d0c0; }
#siteNav * { box-sizing: border-box; }
#siteNav .nav-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; max-width: 1400px; margin: 0 auto; gap: 12px; }
#siteNav .nav-home { color: #d8d0c0; text-decoration: none; font-size: 0.82em; letter-spacing: 2px; padding: 5px 12px; border: 1px solid #3a5060; border-radius: 3px; white-space: nowrap; }
#siteNav .nav-home:hover { background: #1e2838; color: #f0e0b0; }
#siteNav .nav-title { color: #f0d89c; font-size: 0.95em; letter-spacing: 3px; font-weight: bold; text-align: center; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#siteNav .nav-toggle { background: none; border: 1px solid #3a5060; color: #d8d0c0; font-size: 0.85em; letter-spacing: 2px; padding: 5px 12px; border-radius: 3px; cursor: pointer; font-family: inherit; white-space: nowrap; }
#siteNav .nav-toggle:hover { background: #1e2838; color: #f0e0b0; }
#siteNav .nav-menu { display: none; background: #0f141c; border-top: 1px solid #2a4050; padding: 14px 16px; max-width: 1400px; margin: 0 auto; }
#siteNav .nav-menu.open { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
#siteNav .nav-cat { min-width: 0; }
#siteNav .nav-cat-label { color: #8098a8; font-size: 0.72em; letter-spacing: 4px; padding: 4px 0 8px 0; border-bottom: 1px solid #2a3540; margin-bottom: 6px; }
#siteNav .nav-cat a { display: block; padding: 6px 10px; color: #a8b0c0; text-decoration: none; font-size: 0.88em; border-radius: 3px; }
#siteNav .nav-cat a:hover { background: #1e2838; color: #f0e0b0; }
#siteNav .nav-cat a.current { color: #f0d89c; font-weight: bold; background: #1e2838; }
@media (max-width: 640px) {
#siteNav .nav-menu.open { grid-template-columns: 1fr; gap: 14px; }
#siteNav .nav-title { font-size: 0.82em; letter-spacing: 2px; }
#siteNav .nav-home,
#siteNav .nav-toggle { font-size: 0.74em; padding: 4px 8px; }
}
</style>
<div id="siteNav">
<div class="nav-bar">
<a href="index.html" class="nav-home">HOME</a>
<span class="nav-title">Bisque</span>
<button class="nav-toggle" onclick="document.querySelector('#siteNav .nav-menu').classList.toggle('open')">GAMES ☰</button>
</div>
<div class="nav-menu">
<div class="nav-cat">
<div class="nav-cat-label">BOARD GAMES</div>
<a href="Agora.html">Agora</a>
<a href="Aresia.html">Aresia</a>
<a href="Backgammon.html">Backgammon</a>
<a href="Bisque.html" class="current">Bisque</a>
<a href="Chess.html">Chess</a>
<a href="Convergence.html">Convergence</a>
<a href="Go.html">Go</a>
<a href="Mancala.html">Mancala</a>
<a href="Odyssey.html">Odyssey</a>
<a href="Othello.html">Othello</a>
<a href="PenteGrammai.html">Pente Grammai</a>
<a href="Senet.html">Senet</a>
<a href="Tidelands.html">Tidelands</a>
<a href="Ur.html">Ur</a>
</div>
<div class="nav-cat">
<div class="nav-cat-label">SIMULATIONS</div>
<a href="Apoapsis.html">Apoapsis</a>
<a href="BiosphereBlue.html">Biosphere Blue</a>
<a href="BonnevilleSpillwayOperator.html">Bonneville Spillway</a>
<a href="Cliffwalkers.html">Cliffwalkers</a>
<a href="Doctrine.html">Doctrine</a>
<a href="EclipsePredictor.html">Eclipse Predictor</a>
<a href="Floodline.html">Floodline</a>
<a href="Metropolis2K.html">Metropolis 2K</a>
<a href="Tower.html">Tower</a>
</div>
</div>
</div>
<div id="gameNav">
<div class="nav-bar">
<span class="nav-title">Bisque</span>
<button class="nav-toggle" onclick="document.querySelector('#gameNav .nav-menu').classList.toggle('open')">☰</button>
</div>
<div class="nav-menu">
<a href="Agora.html" class="">Agora</a>
<a href="Apoapsis.html" class="">Apoapsis</a>
<a href="Aresia.html" class="">Aresia</a>
<a href="Backgammon.html" class="">Backgammon</a>
<a href="Bisque.html" class="current">Bisque</a>
<a href="Chess.html" class="">Chess</a>
<a href="Convergence.html" class="">Convergence</a>
<a href="Go.html" class="">Go</a>
<a href="Mancala.html" class="">Mancala</a>
<a href="Odyssey.html" class="">Odyssey</a>
<a href="Othello.html" class="">Othello</a>
<a href="PenteGrammai.html" class="">Pente Grammai</a>
<a href="Senet.html" class="">Senet</a>
<a href="Tidelands.html" class="">Tidelands</a>
<a href="Tower.html" class="">Tower</a>
<a href="Ur.html" class="">Ur</a>
</div>
</div>
<div id="header">
<h1>BISQUE <span style="font-size:0.7em">🦞</span></h1>
<div class="subtitle">Battle for the Bay</div>
</div>
<div id="modeToggle">
<button id="btn1P" class="active" onclick="setMode(1)">1 Player</button>
<button id="btn2P" onclick="setMode(2)">All Human</button>
</div>
<div id="playerCountToggle">
<button id="btnPC2" class="active" onclick="setPlayerCount(2)">2 Captains</button>
<button id="btnPC3" onclick="setPlayerCount(3)">3 Captains</button>
<button id="btnPC4" onclick="setPlayerCount(4)">4 Captains</button>
</div>
<div id="scoreBar">
<span class="score-p1" id="score1"></span>
<span class="score-p2" id="score2"></span>
<span class="score-p3" id="score3"></span>
<span class="score-p4" id="score4"></span>
<span class="score-pN" id="scoreN"></span>
</div>
<div id="turnInfo"></div>
<div id="deployInfo"></div>
<div id="mapWrap">
<!-- 11 geographic regions of eastern Long Island -->
<svg id="regionBg" viewBox="0 0 750 480" preserveAspectRatio="none"
style="position:absolute;top:0;left:0;width:100%;height:100%;z-index:0;">
<!-- WATER REGIONS (drawn first, land overlaps) -->
<!-- 1. Gardiners Bay — large eastern water, drawn first as base -->
<path d="M250,110 L300,100 L340,95 L380,88 L420,82 L460,78 L500,76 L540,74 L560,72
L750,72 L750,398
L720,398 L700,392 L660,388 L620,382 L580,374 L540,366 L500,356 L460,345
L462,210 L250,210 Z"
fill="#182E42" stroke="#1E3850" stroke-width="0.5"/>
<!-- 2. Noyack Bay — south of Shelter Island -->
<path d="M250,210 L462,210
L460,345 L420,332 L390,324 L370,316 L355,312 L330,322 L280,318 L250,322 Z"
fill="#1C3642" stroke="#224050" stroke-width="0.5"/>
<!-- 3. Great Peconic Bay — upper western water -->
<path d="M65,148 L120,140 L180,128 L240,112 L250,110
L250,225
L240,224 L180,226 L120,228 L65,229 Z"
fill="#1E3B4C" stroke="#245060" stroke-width="0.5"/>
<!-- 4. Little Peconic Bay — lower western water -->
<path d="M65,229 L120,228 L180,226 L240,224 L250,225
L250,322 L220,326 L160,320 L100,316 L65,312 Z"
fill="#1A3545" stroke="#204050" stroke-width="0.5"/>
<!-- 5. Long Island Sound — above North Fork -->
<path d="M0,0 L750,0 L750,72 L560,72
L540,65 L500,56 L460,42 L420,25 L380,12 L340,5 L300,5
L240,10 L180,18 L120,28 L60,40 L0,55 Z"
fill="#14283A" stroke="#1A3248" stroke-width="0.5"/>
<!-- LAND REGIONS (drawn on top of water) -->
<!-- 6. North Fork — diagonal peninsula, upper-left to Orient Point -->
<path d="M0,55 L60,40 L120,28 L180,18 L240,10 L300,5 L340,5
L380,12 L420,25 L460,42 L500,56 L540,65 L560,72
L540,74 L500,76 L460,78 L420,82 L380,88 L340,95
L300,100 L240,112 L180,128 L120,140 L60,148 L0,152 Z"
fill="#C8B088" stroke="#A89060" stroke-width="1"/>
<!-- 7. South Fork — wider lower peninsula to Montauk -->
<path d="M0,310 L60,312 L100,316 L160,320 L220,326 L280,318
L330,322 L355,312 L370,316 L390,324 L420,332 L460,345
L500,356 L540,366 L580,374 L620,382 L660,388 L700,392 L720,398
L710,415 L700,425 L660,432 L620,438 L580,442 L540,445
L500,446 L460,446 L420,445 L380,444 L340,442 L300,440
L260,438 L220,435 L180,432 L140,428 L100,424 L60,420 L0,415 Z"
fill="#B8A078" stroke="#9A7A50" stroke-width="1"/>
<!-- 8. Shelter Island — between the forks -->
<path d="M340,175 L365,165 L395,160 L425,162 L450,172 L462,188
L466,208 L462,228 L450,242 L428,252 L398,258 L368,255
L345,248 L332,235 L326,215 L328,195 Z"
fill="#C0B890" stroke="#A09050" stroke-width="1"/>
<!-- 9. Gardiners Island — in Gardiners Bay -->
<path d="M605,212 L622,202 L640,208 L648,228 L644,252
L632,268 L616,274 L602,265 L595,245 L598,225 Z"
fill="#A89870" stroke="#907840" stroke-width="1"/>
<!-- 10. Plum Island — in Long Island Sound, NE of Orient Point -->
<path d="M468,18 L486,10 L504,16 L510,28 L504,40 L488,46 L472,40 L466,28 Z"
fill="#A89870" stroke="#907840" stroke-width="1"/>
<!-- 12. Riverhead — mainland connecting the two forks -->
<path d="M0,148 L55,158 L72,192 L75,230 L72,268 L55,298 L0,314 Z"
fill="#B0986C" stroke="#9A7A50" stroke-width="1"/>
<!-- 11. Robins Island — in Great Peconic Bay (drawn after Riverhead) -->
<path d="M148,194 L164,188 L182,196 L186,210 L180,224 L162,228 L146,222 L142,208 Z"
fill="#A89870" stroke="#907840" stroke-width="1"/>
<!-- Fisher's Island — in Long Island Sound, far NE -->
<path d="M655,38 L672,32 L698,30 L712,36 L714,48 L700,54 L674,56 L658,50 Z"
fill="#A89870" stroke="#907840" stroke-width="1"/>
</svg>
<svg id="mapSvg"></svg>
</div>
<div id="diceArea"></div>
<div id="actions">
<button id="btnEndAttacks" onclick="endAttacks()" disabled>End Hauling</button>
<button id="btnFortify" onclick="endFortify()" disabled>End Fortify</button>
<button id="btnEndTurn" onclick="endTurn()" disabled>End Turn</button>
</div>
<div id="messageArea"></div>
<div id="legend"></div>
<div style="text-align:center; margin-top:8px;">
<button class="bisque-toggle" onclick="toggleBisqueRules()">Rules</button>
<button class="bisque-toggle" onclick="toggleBisqueStrategy()">Strategy</button>
</div>
<div class="bisque-doc" id="bisque-rules">
<h4>Overview</h4>
Bisque is a Risk-style territory control game set in the Peconic Bay region of eastern Long Island. Players are lobster captains ("Captains") competing to dominate the bay by planting traps across 26 territories — towns, islands, and water bodies. The first captain to wipe out all rivals (or, in solo mode, the surviving human) wins.
<h4>The Map</h4>
26 territories grouped into 6 regions:
<ul>
<li><b>North Fork</b> (6) — Riverhead, Cutchogue, Mattituck, Southold, Greenport, Orient. Bonus +4.</li>
<li><b>South Fork West</b> (3) — Southampton, Bridgehampton, North Haven. Bonus +3.</li>
<li><b>South Fork East</b> (4) — Sag Harbor, East Hampton, Amagansett, Montauk. Bonus +3.</li>
<li><b>The Islands</b> (5) — S.I. Heights, Mashomack, Gardiners Is., Plum Island, Robins Island. Bonus +3.</li>
<li><b>Inner Bays</b> (5) — Peconic Bay, Little Peconic, Noyack Bay, S.I. Sound, NW Harbor. Bonus +3.</li>
<li><b>Outer Waters</b> (3) — Gardiners Bay, Block Island Sound, Fishers Is. Bonus +2.</li>
</ul>
Adjacencies follow real geography. Most nodes connect to 2–3 neighbors; a couple of bay hubs connect to 4. The small islands (Gardiners Is., Plum, Robins, Fishers) each have exactly 2 connections.
<h4>Setup</h4>
Choose <b>2 Captains</b>, <b>3 Captains</b>, or <b>4 Captains</b>, and either <b>1 Player vs AI</b> or <b>All Human (hotseat)</b>. Territories are randomly distributed:
<ul>
<li><b>2 captains:</b> 11 territories each, 4 neutral.</li>
<li><b>3 captains:</b> 8 each, 2 neutral.</li>
<li><b>4 captains:</b> 6 each, 2 neutral.</li>
</ul>
Each captain starts with 20 traps total — 1 placed automatically on each owned territory at setup, the rest distributed randomly across their holdings. Neutral territories start with 2 traps each and never reinforce or attack.
<h4>Each Turn (3 phases)</h4>
<b>1. Deploy</b> — You receive new traps to place on territories you already own. Reinforcement count = max(3, owned÷3) plus a <b>full-region bonus</b> if you own every territory in a group (+4 for North Fork, +3 for SF West/East/Islands/Inner Bays, +2 for Outer Waters). Click your territories to drop traps one at a time.<br><br>
<b>2. Hauling (Attack)</b> — Click one of your territories with at least 2 traps to select it as the source, then click an adjacent enemy or neutral territory to attack. Combat is dice-based:
<ul>
<li>Attacker rolls up to <b>3 dice</b> (= min(3, source traps − 1)).</li>
<li>Defender rolls up to <b>2 dice</b> (= min(2, defender traps)).</li>
<li>Highest die vs. highest die, second-highest vs. second-highest. Defender wins ties.</li>
<li>Each loss removes one trap from that side.</li>
</ul>
If the defender is reduced to 0 traps, the attacker conquers the territory and moves up to (attacker dice rolled) traps in. You can attack as many times as you like, switching sources, until you click <b>End Hauling</b>.<br><br>
<b>3. Fortify</b> — Move traps from any of your territories (with ≥2 traps) to an adjacent friendly territory. Half (rounded down, minimum 1) of the source's traps move over. You may repeat this as many times as you like; click <b>End Fortify</b> when you're done.
<h4>Eliminating Captains and Winning</h4>
When a captain loses their last territory they are <b>eliminated</b> and out for the rest of the game. The last captain standing wins. In 1 Player mode, you win if you eliminate every AI rival; you lose if you are eliminated yourself.
</div>
<div class="bisque-doc" id="bisque-strategy">
<h4>Opening (First 1–2 Turns)</h4>
<ul>
<li>Look at the random territory distribution. Identify the <b>group with the fewest territories owned by enemies</b> — that's your first conquest target. Outer Waters (3 territories), South Fork West (3), and South Fork East (4) are the cheapest groups to lock down.</li>
<li>Don't spread your initial deployments evenly. <b>Stack 4–5 traps on a single border territory</b> in your target region so you can attack on turn 1.</li>
<li>If you start with several connected territories, prioritize defending the chokepoints (the territories with only 1–2 enemy neighbors).</li>
</ul>
<h4>Reinforcement Math</h4>
<ul>
<li>Base reinforcements = max(3, territories÷3). Below 9 territories you're stuck at the 3 minimum — <b>get to 9+ as fast as possible</b> for the first marginal increase.</li>
<li>Region bonuses are huge: holding all 6 North Fork towns gives <b>+4 traps every turn forever</b>. The bonus pays for itself within 2–3 turns.</li>
<li>Compare a 3-territory grab in Outer Waters (+2 bonus) vs. a 6-territory North Fork sweep (+4): Outer Waters is faster and worth almost as much per turn.</li>
</ul>
<h4>Region Priorities</h4>
<ul>
<li><b>Outer Waters (+2)</b>: only 3 territories, all connected, easy to defend — the fastest first bonus. Grab this if you start with even one of: Gardiners Bay, Block Is. Sound, Fishers Is.</li>
<li><b>South Fork West (+3)</b>: 3 territories on a single linear chain. Easy to hold but only 2 chokepoint borders. A great second bonus.</li>
<li><b>The Islands (+3)</b>: 5 territories, but two of them (Plum, Robins) are isolated dead-ends and only have 2 connections. Hard to lose if you camp Mashomack and S.I. Heights.</li>
<li><b>North Fork (+4)</b>: highest bonus but 6 territories along a linear chain — 5 borders to defend. Worth it only if you can secure both ends.</li>
<li><b>SF East (+3)</b>: 4 territories ending at Montauk, but Montauk has the Block Is. Sound link — an attack vector you have to babysit.</li>
<li><b>Inner Bays (+3)</b>: 5 water territories, the most connected region — <b>lots of borders</b>. Avoid trying to hold this whole group; pick off pieces instead.</li>
</ul>
<h4>Combat Math</h4>
<ul>
<li>3 attacker vs. 2 defender dice slightly favors the attacker. Don't attack with fewer dice unless you have to — <b>always try to roll 3 attacker dice</b> (need 4+ traps in source).</li>
<li>The defender wins ties. A 2-defender stack is roughly even with a 3-attacker stack. Stacks of 3+ defenders are very hard to dislodge.</li>
<li>If you must attack a 3+ defender, build your source up to 6–7 traps first.</li>
<li>Long attack chains lose traps to attrition. Plan your conquest order so each successive attack starts with at least 4 traps after the previous move-in.</li>
</ul>
<h4>Chokepoints & Defense</h4>
<ul>
<li>The dead-end islands (Plum, Robins, Fishers, Gardiners Is.) are <b>perfect anchors</b> — only 2 neighbors each, easy to wall off with a small garrison.</li>
<li>Riverhead is the only land bridge connecting North Fork to South Fork. Hold it and you split the entire western map.</li>
<li>Stack big defensive piles on territories with the most enemy neighbors (e.g., Noyack Bay touches 4 things). Leave the safe interior at 1–2 traps.</li>
</ul>
<h4>Fortify Smart</h4>
<ul>
<li>Fortify is your only way to move traps without combat — spend it on the territory you'll attack from <b>next turn</b>.</li>
<li>Half-move means it pays to stockpile big stacks before fortifying. Moving from a 9-stack gives you 4 traps; from a 3-stack only 1.</li>
<li>Don't fortify out of safe interior territories you might need to defend later (e.g., a flank against the AI).</li>
</ul>
<h4>Multiplayer Dynamics (3–4 captains)</h4>
<ul>
<li>The leader gets piled on. Stay <b>second or third</b> in territory count until you can knock someone out in a single turn.</li>
<li>Eliminating a captain in one turn is huge: you absorb their position and deny them future reinforcement.</li>
<li>Don't leave a wounded enemy alive across two turns — a captain with 1–2 territories will be obliterated by whoever attacks first, but if you don't finish them, the opponent gets the territory.</li>
</ul>
<h4>Endgame</h4>
<ul>
<li>Once you control 2+ full regions, your reinforcement income compounds. Switch from expansion to <b>methodical elimination</b>.</li>
<li>Save fortify moves to consolidate giant stacks (12+) and walk them across the map to crush the last enemy stronghold.</li>
<li>Watch for "kingmaker" situations — if two opponents are both close to elimination, attack the one whose territories you actually want.</li>
</ul>
</div>
<div id="overlay">
<div id="overlayBox">
<h2 id="olTitle"></h2>
<p id="olText"></p>
<button onclick="closeOverlay()">New Voyage</button>
</div>
</div>
<script>
/* ===== DATA ===== */
var TERRITORIES = [
/* North Fork (6) */
{ id: 'riverhead', name: 'Riverhead', group: 'northfork', x: 2, y: 200, water: false },
{ id: 'cutchogue', name: 'Cutchogue', group: 'northfork', x: 10, y: 90, water: false },
{ id: 'mattituck', name: 'Mattituck', group: 'northfork', x: 95, y: 72, water: false },
{ id: 'southold', name: 'Southold', group: 'northfork', x: 185, y: 52, water: false },
{ id: 'greenport', name: 'Greenport', group: 'northfork', x: 285, y: 35, water: false },
{ id: 'orient', name: 'Orient', group: 'northfork', x: 405, y: 60, water: false },
/* South Fork West (3) */
{ id: 'southampton', name: 'Southampton', group: 'sfwest', x: 30, y: 380, water: false },
{ id: 'bridgehampton', name: 'Bridgehampton', group: 'sfwest', x: 175, y: 372, water: false },
{ id: 'northHaven', name: 'North Haven', group: 'sfwest', x: 250, y: 320, water: false },
/* South Fork East (4) */
{ id: 'sagHarbor', name: 'Sag Harbor', group: 'sfeast', x: 340, y: 320, water: false },
{ id: 'eastHampton', name: 'East Hampton', group: 'sfeast', x: 465, y: 366, water: false },
{ id: 'amagansett', name: 'Amagansett', group: 'sfeast', x: 545, y: 378, water: false },
{ id: 'montauk', name: 'Montauk', group: 'sfeast', x: 645, y: 392, water: false },
/* The Islands (5) */
{ id: 'shelterHeights', name: 'S.I. Heights', group: 'islands', x: 365, y: 168, water: false },
{ id: 'mashomack', name: 'Mashomack', group: 'islands', x: 425, y: 222, water: false },
{ id: 'gardinersIsland', name: 'Gardiners Is.', group: 'islands', x: 595, y: 230, water: false },
{ id: 'plumIsland', name: 'Plum Island', group: 'islands', x: 478, y: 12, water: false },
{ id: 'robinsIsland', name: 'Robins Island', group: 'islands', x: 140, y: 195, water: false },
/* Inner Bays (5) */
{ id: 'greatPeconicBay', name: 'Peconic Bay', group: 'innerBays', x: 215, y: 175, water: true },
{ id: 'littlePeconicBay', name: 'Little Peconic', group: 'innerBays', x: 75, y: 270, water: true },
{ id: 'noyackBay', name: 'Noyack Bay', group: 'innerBays', x: 295, y: 268, water: true },
{ id: 'siSound', name: 'S.I. Sound', group: 'innerBays', x: 295, y: 128, water: true },
{ id: 'northwestHarbor', name: 'NW Harbor', group: 'innerBays', x: 478, y: 280, water: true },
/* Outer Waters (3) */
{ id: 'gardinersBay', name: 'Gardiners Bay', group: 'outerWaters', x: 560, y: 155, water: true },
{ id: 'blockIslandSound', name: 'Block Is. Snd', group: 'outerWaters', x: 678, y: 295, water: true },
{ id: 'fishersIsland', name: 'Fishers Is.', group: 'outerWaters', x: 660, y: 50, water: false }
];
/* Fast O(1) lookup map — TERRITORIES array is static, build once. */
var TERRITORY_BY_ID = (function() {
var m = {};
for (var i = 0; i < TERRITORIES.length; i++) m[TERRITORIES[i].id] = TERRITORIES[i];
return m;
})();
var GROUPS = {
northfork: { name: 'North Fork', bonus: 4, color: '#C8B088', border: '#B89858' },
sfwest: { name: 'South Fork West', bonus: 3, color: '#B8A078', border: '#A08858' },
sfeast: { name: 'South Fork East', bonus: 3, color: '#C0A880', border: '#A89058' },
islands: { name: 'The Islands', bonus: 3, color: '#C0B890', border: '#A8A068' },
innerBays: { name: 'Inner Bays', bonus: 3, color: '#2A5068', border: '#3A6888' },
outerWaters: { name: 'Outer Waters', bonus: 2, color: '#1E3B4C', border: '#2A5570' }
};
var ADJACENCY = {
/* North Fork — linear chain + bay access */
riverhead: ['cutchogue', 'southampton', 'robinsIsland'],
cutchogue: ['riverhead', 'mattituck'],
mattituck: ['cutchogue', 'southold'],
southold: ['mattituck', 'greenport'],
greenport: ['southold', 'orient', 'siSound'],
orient: ['greenport', 'plumIsland'],
/* South Fork West */
southampton: ['riverhead', 'bridgehampton', 'littlePeconicBay'],
bridgehampton: ['southampton', 'northHaven'],
northHaven: ['bridgehampton', 'sagHarbor'],
/* South Fork East */
sagHarbor: ['northHaven', 'eastHampton', 'noyackBay'],
eastHampton: ['sagHarbor', 'amagansett'],
amagansett: ['eastHampton', 'montauk'],
montauk: ['amagansett', 'blockIslandSound'],
/* The Islands — 2 connections each */
shelterHeights: ['mashomack', 'siSound', 'noyackBay'],
mashomack: ['shelterHeights', 'northwestHarbor'],
gardinersIsland: ['gardinersBay', 'northwestHarbor'],
plumIsland: ['orient', 'gardinersBay'],
robinsIsland: ['greatPeconicBay', 'littlePeconicBay', 'riverhead'],
/* Inner Bays */
greatPeconicBay: ['littlePeconicBay', 'robinsIsland'],
littlePeconicBay: ['greatPeconicBay', 'southampton', 'noyackBay', 'robinsIsland'],
noyackBay: ['littlePeconicBay', 'shelterHeights', 'northwestHarbor', 'sagHarbor'],
siSound: ['greenport', 'shelterHeights', 'gardinersBay'],
northwestHarbor: ['noyackBay', 'mashomack', 'gardinersIsland'],
/* Outer Waters */
gardinersBay: ['siSound', 'gardinersIsland', 'plumIsland', 'blockIslandSound', 'fishersIsland'],
blockIslandSound: ['gardinersBay', 'fishersIsland', 'montauk'],
fishersIsland: ['blockIslandSound', 'gardinersBay']
};
var PLAYER_COLORS = {
1: { main: '#C05030', name: 'Captain Red', rgba: 'rgba(192,80,48,', rgbaWater: 'rgba(192,80,48,', scoreClass: 'score-p1', icon: '🦞', textColor: '#E08060' },
2: { main: '#3080B0', name: 'Captain Blue', rgba: 'rgba(48,128,176,', rgbaWater: 'rgba(48,128,176,', scoreClass: 'score-p2', icon: '🎣', textColor: '#60A0D0' },
3: { main: '#40A050', name: 'Captain Green', rgba: 'rgba(64,160,80,', rgbaWater: 'rgba(64,160,80,', scoreClass: 'score-p3', icon: '⚓', textColor: '#60C070' },
4: { main: '#D0A030', name: 'Captain Gold', rgba: 'rgba(208,160,48,', rgbaWater: 'rgba(208,160,48,', scoreClass: 'score-p4', icon: '⭐', textColor: '#D0B050' },
0: { main: '#888888', name: 'Neutral', rgba: 'rgba(136,136,136,',rgbaWater: 'rgba(136,136,136,',scoreClass: 'score-pN', icon: '⚓', textColor: '#999999' }
};
var LOBSTER_MESSAGES = {
deploy: [
"Set your traps, Captain!",
"Where shall we drop the pots?",
"Bait those traps and lower away!",
"Time to stake your claim on the bay.",
"Fresh territory, fresh catch."
],
attack: [
"Haul away! Time to raid some territory.",
"Those waters look ripe for the taking.",
"Let's show 'em who runs this bay.",
"Claw your way to victory!",
"The best defense is a good lobster offense."
],
fortify: [
"Reinforce your fishing grounds.",
"Move your traps to stronger positions.",
"Shore up your defenses, Captain.",
"Redistribute your fleet of traps.",
"Fortify or pass -- your call, skipper."
],
atkWin: [
"Their traps are crab bait now!",
"You've claimed new fishing rights!",
"The bay bends to your will!",
"Another territory in the pot!",
"Shell-shocking victory!"
],
atkLose: [
"The sea giveth, the sea taketh away.",
"Lost some traps in the current...",
"They fought like cornered lobsters!",
"Rough waters for the attacker.",
"Pinched! Pull back and regroup."
],
defWin: [
"Your traps held the line!",
"They turned tail like scared shrimp!",
"Defensive shell held strong!",
"Not in our waters, pal!"
],
defLose: [
"The invaders are relentless!",
"Traps lost in the skirmish...",
"They're breaking through!"
]
};
/* ===== STATE ===== */
var state = {};
var mode = 1; /* 1 = vs AI, 2 = all human (hotseat) */
var playerCount = 2;
var aiTimer = null;
var selectedTerritory = null;
var attackSource = null;
var fortifySource = null;
function initState() {
state = {
territories: {},
currentPlayer: 1,
phase: 'deploy',
trapsToPlace: 0,
turnNumber: 1,
gameOver: false,
activePlayers: [], /* list of active player numbers (1-based, 0=neutral) */
eliminatedPlayers: [], /* players who lost all territories */
hasNeutral: false
};
selectedTerritory = null;
attackSource = null;
fortifySource = null;
if (aiTimer) { clearTimeout(aiTimer); aiTimer = null; }
}
/* ===== SETUP ===== */
function resetGame() {
initState();
/* Determine active players and neutral */
var totalTerritories = TERRITORIES.length; /* 26 */
var hasNeutral = false;
var neutralCount = 0;
var perPlayer = 0;
if (playerCount === 2) {
perPlayer = 11;
neutralCount = totalTerritories - (perPlayer * 2);
hasNeutral = true;
} else if (playerCount === 3) {
perPlayer = 8;
neutralCount = totalTerritories - (perPlayer * 3);
hasNeutral = true;
} else {
perPlayer = Math.floor(totalTerritories / playerCount);
neutralCount = totalTerritories - (perPlayer * playerCount);
hasNeutral = neutralCount > 0;
}
state.hasNeutral = hasNeutral;
/* Build active player list */
state.activePlayers = [];
for (var p = 1; p <= playerCount; p++) {
state.activePlayers.push(p);
}
/* Shuffle & assign territories */
var ids = TERRITORIES.map(function(t) { return t.id; });
shuffle(ids);
var idx = 0;
/* Assign to each player */
for (var pi = 1; pi <= playerCount; pi++) {
var count = perPlayer;
/* For 4 players, distribute remainder: first (totalTerritories % playerCount) players get an extra */
if (playerCount === 4 && pi <= (totalTerritories % playerCount)) {
count = perPlayer + 1;
}
for (var c = 0; c < count; c++) {
state.territories[ids[idx]] = {
owner: pi,
traps: 1
};
idx++;
}
}
/* Assign neutral territories */
for (var ni = 0; ni < neutralCount; ni++) {
state.territories[ids[idx]] = {
owner: 0, /* 0 = neutral */
traps: 2
};
idx++;
}
/* Assign any leftover (shouldn't happen but safety) */
while (idx < ids.length) {
state.territories[ids[idx]] = {