카드 게임 시간 무제한(우노·뱅!·달무티·고스톱·도둑잡기·포커·바퀴벌레 포커·99), 공통 카드 움직임(card-fx), 우노·달무티·도둑잡기·포커 소리·애니메이션
- 무제한(null): 차례 시계·타임아웃 없음, 자리 비움만 짧은 시계, 연결 끊김은 방 유예 뒤 자동 행동 그대로 - 포커는 리바이 고르는 시간도 무제한 가능, 고스톱은 고·스톱 선택 시간도 무제한 가능, 뱅!은 반응 시간·캐릭터 고르기도 - card-fx: 날아가는 카드·칩(ghost), 제자리 날아오기, 배너, view 변화 감지 훅(처음 렌더·다시 보기는 건너뜀) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -461,6 +461,22 @@ describe('시간 초과와 나가기 (§8.5)', () => {
|
||||
expect(s.away.A).toBe(false);
|
||||
});
|
||||
|
||||
test('무제한 (turnSeconds null): no turn clock, but timeouts (dropped connection) still play and lead to away', () => {
|
||||
expect(uno.optionsSchema.safeParse({ turnSeconds: null }).success).toBe(true);
|
||||
let s = rig(make({ turnSeconds: null }), { hands: { A: ['B9a', 'B8a', 'B7a', 'B6a'], B: ['G2a', 'G3a', 'G4a'], C: ['Y3a', 'Y4a', 'Y5a'] }, discard: ['R5a'] });
|
||||
expect(uno.deadline!(s)).toBeNull();
|
||||
expect(uno.view(s, 'A').deadlineTotalMs).toBe(0);
|
||||
for (let i = 0; i < 3; i++) {
|
||||
s.current = 'A';
|
||||
s.phase = { kind: 'turn' };
|
||||
s = act(s, 'A', { type: 'timeout' });
|
||||
}
|
||||
expect(s.away.A).toBe(true);
|
||||
s.current = 'A';
|
||||
s.phase = { kind: 'turn' };
|
||||
expect(uno.deadline!(s)).toBe(s.turnStartedAt + 5000);
|
||||
});
|
||||
|
||||
test('leaving: the hand goes under the draw pile, the turn moves on; the last one left wins', () => {
|
||||
let s = rig(make(), { hands: { A: ['R1a', 'R2a'], B: ['G2a'], C: ['Y3a'] }, discard: ['R5a'] });
|
||||
expect(uno.onLeave!(s, 'A')).toEqual({ type: 'leave' });
|
||||
|
||||
Reference in New Issue
Block a user