카드 게임 시간 무제한(우노·뱅!·달무티·고스톱·도둑잡기·포커·바퀴벌레 포커·99), 공통 카드 움직임(card-fx), 우노·달무티·도둑잡기·포커 소리·애니메이션
- 무제한(null): 차례 시계·타임아웃 없음, 자리 비움만 짧은 시계, 연결 끊김은 방 유예 뒤 자동 행동 그대로 - 포커는 리바이 고르는 시간도 무제한 가능, 고스톱은 고·스톱 선택 시간도 무제한 가능, 뱅!은 반응 시간·캐릭터 고르기도 - card-fx: 날아가는 카드·칩(ghost), 제자리 날아오기, 배너, view 변화 감지 훅(처음 렌더·다시 보기는 건너뜀) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -475,6 +475,30 @@ describe('시간 초과와 나가기 (§8.5)', () => {
|
||||
expect(s.away.B).toBe(false);
|
||||
});
|
||||
|
||||
test('무제한 (turnSeconds null): no clock for turns, hand check or tax return; timeouts still work and away keeps the 5 s clock', () => {
|
||||
expect(dalmuti.optionsSchema.safeParse({ turnSeconds: null }).success).toBe(true);
|
||||
// Hand check and tax return have no clock either.
|
||||
let c = make({ turnSeconds: null });
|
||||
expect(c.phase.kind).toBe('revolutionCheck');
|
||||
expect(dalmuti.deadline!(c)).toBeNull();
|
||||
expect(dalmuti.view(c, 'A').deadlineTotalMs).toBe(0);
|
||||
for (const p of c.players) c = act(c, p, { type: 'timeout' });
|
||||
expect(c.phase.kind).toBe('taxReturn');
|
||||
expect(dalmuti.deadline!(c)).toBeNull();
|
||||
// Playing: no turn clock; a dropped connection's timeouts still play and lead to away.
|
||||
let s = rig(make({ turnSeconds: null }), { order: P5, hands: { A: [C(1, 1), C(9, 1), C(9, 2), C(9, 3)], B: [C(12, 1), C(12, 2)], C: [C(12, 3)], D: [C(12, 4)], E: [C(12, 5)] } });
|
||||
s.timeoutsInRow.B = 2;
|
||||
s = play(s, 'A', [C(9, 1)]);
|
||||
expect(dalmuti.deadline!(s)).toBeNull();
|
||||
s = act(s, 'B', { type: 'timeout' });
|
||||
expect(s.away.B).toBe(true);
|
||||
for (const p of ['C', 'D', 'E']) s = pass(s, p);
|
||||
s = play(s, 'A', [C(9, 2)]);
|
||||
expect(s.current).toBe('B');
|
||||
expect(dalmuti.deadline!(s)).toBe(s.turnStartedAt + 5000);
|
||||
expect(dalmuti.view(s, 'A').deadlineTotalMs).toBe(5000);
|
||||
});
|
||||
|
||||
test('leaving does not eliminate: the seat stays, marked away, and keeps being auto-played', () => {
|
||||
let s = rig(make(), { order: P5, hands: { A: [C(9, 1)], B: [C(12, 1), C(5, 1)], C: [C(12, 3)], D: [C(12, 4)], E: [C(12, 5)] } });
|
||||
expect(dalmuti.onLeave!(s, 'B')).toEqual({ type: 'leave' });
|
||||
|
||||
Reference in New Issue
Block a user