Add optional card mode: server deals cards and settles showdowns automatically

- New "カードを配る" switch on the create-table screen (default off); the lobby
  shows "カードあり" for tables that use it
- Card mode (server/cards.js restored): crypto-shuffled deck kept server-side,
  hole cards sent only to their owner until showdown/all-in reveal, board dealt
  per street with burns, all-in runout on a timer (frozen while paused)
- Showdown is evaluated and every pot (incl. side pots, split pots) is paid out
  automatically; host winner selection is only used when card mode is off
- Play UI: board, hole cards, own cards in the action bar, hand names, winning
  cards highlighted; layout tuned for 7+ seats and short screens
- Playing-card styles use .pcard so they don't clash with the existing .card panel
- Tests for hand evaluation, card privacy, runout, side pots, ties and random play

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
agomizi1cmandClaude Opus 5.5 committed 2026-10-17 16:44:22 +09:00
1 parent 6d33440048
commit 66907345ff
13 files changed
+653 -42

No files matched your search

+11
View File
@@ -16,6 +16,8 @@
const timerInput = $('timer');
const intervalInput = $('interval');
const scheduleEl = $('schedule');
const cardsInput = $('cards');
const cardsHint = $('cards-hint');
const blindHint = $('blind-hint');
const errorEl = $('error');
const submitBtn = $('submit');
@@ -66,9 +68,16 @@
.join('');
}
function updateCardsHint() {
cardsHint.textContent = cardsInput.checked
? 'オン: 各自のスマホに手札が配られ、勝敗とポットの分配は自動'
: 'オフ: 実物のカードで遊び、ショーダウンの勝者はホストが選ぶ';
}
function refresh() {
updateHint();
updateSchedule();
updateCardsHint();
}
stackInput.addEventListener('input', () => {
@@ -91,6 +100,7 @@
});
timerInput.addEventListener('change', refresh);
intervalInput.addEventListener('input', refresh);
cardsInput.addEventListener('change', refresh);
$('reroll').addEventListener('click', suggestName);
function validate() {
@@ -128,6 +138,7 @@
bigBlind: int(bbInput),
blindTimerEnabled: timerInput.checked,
blindIntervalMin: int(intervalInput),
cardsEnabled: cardsInput.checked,
token: Store.token,
});
location.href = '/table/' + encodeURIComponent(id);