-
게임이 끝났어요
+
+ 게임이 끝났어요
{f.losingKind && }
-
- {nick(players, f.loser)}님 패배 · 나머지 모두 승리
-
+ {nick(players, f.loser)}님 패배 · 나머지 모두 승리
{v.lastReveal && }
);
}
- return (
-
- {r.holder !== null && r.claim ? (
- <>
- {v.options.claimHistory &&
}
-
- {v.card && v.card.known ?
:
}
-
-
- {r.lastPasser === me ? '내가' : `${nick(players, r.lastPasser!)}님이`} {r.holder === me ? '나에게' : `${nick(players, r.holder)}님에게`}
-
- {claimLine(r.claim)}
+ if (r.holder !== null && r.claim) {
+ return (
+
+
+
+ ➜
+
+
+
+ {v.card && v.card.known ? : }
+
+
+ {r.lastPasser === me ? '내가' : `${nick(players, r.lastPasser!)}님이`} {r.holder === me ? '나에게' : `${nick(players, r.holder)}님에게`}
-
- {v.card?.known &&
점선 카드는 내가 아는 카드예요{v.card.kind === r.claim ? ' (지금 주장은 진짜)' : ' (지금 주장은 거짓)'}}
-
nick(players, p)).join(', ')}`}>
- 👁 본 사람
- {r.seen.map((p) => (
-
- {p === me ? '나' : nick(players, p)}
-
- ))}
- {r.passes > 0 && · {r.passes}번 넘어왔어요}
-
- >
- ) : (
- <>
-
-
- {r.starter === me ? '내가 카드를 건넬 차례예요' : `${nick(players, r.starter)}님의 카드를 기다리는 중`}
+ {claimLine(r.claim)}
- >
- )}
- {v.lastReveal && (r.holder === null || v.lastReveal.round === r.no - 1) &&
}
+
+ {v.card?.known && 점선 카드는 내가 아는 카드예요{v.card.kind === r.claim ? ' (지금 주장은 진짜)' : ' (지금 주장은 거짓)'}}
+ {v.options.claimHistory && r.claims.length > 1 && }
+ nick(players, p)).join(', ')}`}>
+ 👁 본 사람
+ {r.seen.map((p) => (
+
+ {p === me ? '나' : nick(players, p)}
+
+ ))}
+ {r.passes > 0 && · {r.passes}번 넘어왔어요}
+
+
+ );
+ }
+ const last = v.lastReveal && v.lastReveal.round === r.no - 1 ? v.lastReveal : null;
+ return (
+
+ {last ? : }
+ {r.starter === me ? '내가 카드를 건넬 차례예요' : `${nick(players, r.starter)}님의 카드를 기다리는 중`}
);
}
@@ -695,6 +782,7 @@ function MyArea({
deadline,
offering,
bubble,
+ fresh,
}: {
v: CockroachView;
me: string;
@@ -703,12 +791,13 @@ function MyArea({
offering: boolean;
/** What I just said with 빠른 말: shown over my own area too, like everybody else's. */
bubble: string | null;
+ fresh: Kind | null;
}) {
const front = v.fronts[me]!;
const active = waitingOn(v) === me;
const total = v.handCounts[me] ?? 0;
return (
-
+
{bubble && (
{bubble}
@@ -721,27 +810,28 @@ function MyArea({
{active && }
-
-
내 앞마당 {front.total}장
-
-
-
-
-
내 손패 {total}장{offering ? ' (위에서 고르세요)' : ''}
- {!offering && (
-
`${KIND_KO[g.kind]} ${g.ids.length}장`).join(', ') || '없음'}`}>
- {(v.myHand ?? []).map((g) => (
-
-
+ 내 손패 {total}장{offering ? ' · 건넬 카드는 "1/3 건넬 카드 고르기"에서 골라요' : ''}
+ `${KIND_KO[g.kind]} ${g.ids.length}장`).join(', ') || '없음'}`}>
+ {(v.myHand ?? []).map((g, i, all) => {
+ const mid = (all.length - 1) / 2;
+ return (
+
+
{g.ids.length}
- ))}
- {total === 0 && 손패가 없어요. 카드를 건넬 차례가 오면 져요.}
-
- )}
+ );
+ })}
+ {total === 0 && 손패가 없어요. 카드를 건넬 차례가 오면 져요.}
+
+
+
+
내 앞마당 {front.total}장
+
+
+
@@ -789,13 +879,14 @@ function CockroachBoard({ view: v, me, players, act, pending, deadline }: BoardP
sfx.cardFlip();
setTimeout(() => (rv.correct ? sfx.good() : cpSfx.wrong()), fxMs(260));
showBanner(rv.call === 'true' ? '진짜!' : '거짓말!', rv.correct ? 'green' : 'red', `${rv.caller === me ? '내가' : `${nick(players, rv.caller)}님이`} ${rv.correct ? '맞혔어요' : '틀렸어요'}`);
- flyGhost(document.querySelector('.cp-table'), seatEl(rv.takenBy), { delay: 380, ms: 480, className: 'cp-ghost' });
+ // After the flip and the stamp, a face-up copy goes to the 앞마당 of whoever takes it.
+ flyGhost(document.querySelector('.cp-revealcard') ?? document.querySelector('.cp-table'), seatEl(rv.takenBy), { delay: 1000, ms: 480, className: `cp-face-${rv.kind}`, label: KIND_KO[rv.kind] });
setTimeout(() => {
bump(seatEl(rv.takenBy), 'shake');
const n = v.fronts[rv.takenBy]?.counts[rv.kind] ?? 0;
if (!over && n >= v.loseCount - 1) cpSfx.danger();
else cpSfx.splat();
- }, fxMs(820));
+ }, fxMs(1500));
}
if (over && !p.over && v.final) {
const f = v.final;
@@ -803,7 +894,7 @@ function CockroachBoard({ view: v, me, players, act, pending, deadline }: BoardP
showBanner(`${f.loser === me ? '내가' : `${nick(players, f.loser)}님`} 패배!`, 'dark', f.losingKind ? `${KIND_KO[f.losingKind]}${hasBatchim(KIND_KO[f.losingKind]) ? '이' : '가'} 너무 많아요` : undefined);
cpSfx.danger();
bump(seatEl(f.loser), 'shake');
- }, flip ? fxMs(1300) : 0);
+ }, flip ? fxMs(1900) : 0);
}
if (flip) {
const rv = v.lastReveal!;
@@ -828,7 +919,7 @@ function CockroachBoard({ view: v, me, players, act, pending, deadline }: BoardP
prev.current = { claims: claimsKey, reveal: revealKey, said: lastSaid, waiting: w, peek: peekKey, over };
if (slide || flip) {
setFresh({ slide, flip });
- const t = setTimeout(() => setFresh({ slide: false, flip: false }), fxMs(700));
+ const t = setTimeout(() => setFresh({ slide: false, flip: false }), fxMs(2400));
return () => clearTimeout(t);
}
return undefined;
@@ -839,16 +930,23 @@ function CockroachBoard({ view: v, me, players, act, pending, deadline }: BoardP
const responding = amPlayer && v.round.holder === me && !v.round.peeked && v.phase === 'respond';
const seats = amPlayer ? v.order.slice(v.order.indexOf(me!) + 1).concat(v.order.slice(0, v.order.indexOf(me!))) : v.order;
+ // The card that just went face up lands in front of whoever took it.
+ const landed = fresh.flip && v.lastReveal ? { id: v.lastReveal.takenBy, kind: v.lastReveal.kind } : null;
+ const landedFor = (id: string) => (landed?.id === id ? landed.kind : null);
+
return (
-
- {seats.map((p) => (
-
- ))}
-
-
+
+
+ {seats.map((p) => (
+
+ ))}
+
+ {amPlayer &&
}
+
+
{offering || passing ? (
) : responding ? (
@@ -857,7 +955,6 @@ function CockroachBoard({ view: v, me, players, act, pending, deadline }: BoardP
)}
- {amPlayer &&
}
{announce}
diff --git a/apps/web/src/games/cockroach-poker/quick.tsx b/apps/web/src/games/cockroach-poker/quick.tsx
index 4ef6640..435daf2 100644
--- a/apps/web/src/games/cockroach-poker/quick.tsx
+++ b/apps/web/src/games/cockroach-poker/quick.tsx
@@ -5,13 +5,20 @@ import type { QuickCard } from '../types';
function Card({ x, y, face, w = 44, h = 62, tilt = 0, red = false }: { x: number; y: number; face?: string; w?: number; h?: number; tilt?: number; red?: boolean }) {
return (
-
+
+ {!face && (
+
+
+
+
+
+ )}
{face ? (
{face}
) : (
-
+
?
)}
@@ -26,22 +33,26 @@ function Person({ x, y, label }: { x: number; y: number; label: string }) {
🙂
-
+
{label}
);
}
+/** Wood-rimmed felt, like the game table. */
+const Felt = () =>
;
+
const GivePic = (