diff --git a/internal/llm/client.go b/internal/llm/client.go index 500a91e..0e7a1b5 100644 --- a/internal/llm/client.go +++ b/internal/llm/client.go @@ -71,6 +71,7 @@ The script MUST export these functions (no classes, no imports): pendingChoices object[] — pending choice queue (each has targetPlayerIndex,prompt,options) card/topCard suit values: "hearts" | "diamonds" | "spades" | "clubs" + user-facing suit naming in this app: hearts=červený, diamonds=zelený, spades=kule, clubs=žaludy card/topCard value values: "7" | "8" | "9" | "10" | "under" | "upper" | "king" | "ace" onPlayed(cards, state) → { @@ -116,6 +117,7 @@ Rules about rules: - If you need an extra discard, use discardIndex in onPlayed instead of cards.length > 1. - For advanced custom mechanics you may mutate state directly with playerHands/discardPile/deck/currentPlayerIndex. - You may use state.hand, state.handCounts, state.playerCount for hand-inspection rules. +- Prefer Czech wording in "description" and use suit names červený/zelený/kule/žaludy in user-facing text. - Do NOT include markdown fences, comments outside the functions, or any code other than function definitions. - Return ONLY valid JSON — no prose before or after.` diff --git a/web/static/index.html b/web/static/index.html index 0072ea2..3e2a425 100644 --- a/web/static/index.html +++ b/web/static/index.html @@ -1115,10 +1115,10 @@

Vyber barvu

- - - - + + + +
@@ -1205,10 +1205,10 @@ let tableVisible = false; let currentScriptOpen = false; let lobbyPollTimer = null; -const SUIT_ICONS = { hearts:'♥', diamonds:'♦', spades:'♠', clubs:'♣' }; -const SUIT_NAMES = { hearts:'Srdce', diamonds:'Kára', spades:'Piky', clubs:'Kříže' }; -const SUIT_COLOR = { hearts:'red', diamonds:'red', spades:'black', clubs:'black' }; -const VALUE_LABEL = { '7':'7','8':'8','9':'9','10':'10', under:'J', upper:'Q', king:'K', ace:'A' }; +const SUIT_ICONS = { hearts:'♥', diamonds:'🍃', spades:'🔔', clubs:'🌰' }; +const SUIT_NAMES = { hearts:'Červený', diamonds:'Zelený', spades:'Kule', clubs:'Žaludy' }; +const SUIT_COLOR = { hearts:'red', diamonds:'black', spades:'black', clubs:'black' }; +const VALUE_LABEL = { '7':'VII','8':'VIII','9':'IX','10':'X', under:'Sp', upper:'Sv', king:'Kr', ace:'Eso' }; // ── WebSocket ────────────────────────────────────────────────────────── function connect() { @@ -1765,15 +1765,26 @@ function renderMyHand() { } const mine = pending.player_id === myId; + if (!mine) { + const chooser = gameState.players[pending.player_index || 0]; + const chooserName = chooser ? chooser.name : 'soupeře'; + zone.innerHTML = ` +
+
Čeká se na volbu hráče: ${escHtml(chooserName)}
+
+ `; + return; + } + const options = (pending.options || []).map((o) => { const safe = String(o || '').replace(/'/g, "\\'"); - return ``; + return ``; }).join(''); zone.innerHTML = `
${escHtml(pending.prompt || 'Vyber možnost')}
${options}
-
${mine ? 'Vyber jednu možnost.' : 'Čeká se na volbu soupeře…'}
+
Vyber jednu možnost.
`; }