카드 게임 시간 무제한(우노·뱅!·달무티·고스톱·도둑잡기·포커·바퀴벌레 포커·99), 공통 카드 움직임(card-fx), 우노·달무티·도둑잡기·포커 소리·애니메이션

- 무제한(null): 차례 시계·타임아웃 없음, 자리 비움만 짧은 시계, 연결 끊김은 방 유예 뒤 자동 행동 그대로
- 포커는 리바이 고르는 시간도 무제한 가능, 고스톱은 고·스톱 선택 시간도 무제한 가능, 뱅!은 반응 시간·캐릭터 고르기도
- card-fx: 날아가는 카드·칩(ghost), 제자리 날아오기, 배너, view 변화 감지 훅(처음 렌더·다시 보기는 건너뜀)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-13 13:04:11 +09:00
parent f12cf12b84
commit ac37a6a6d8
44 changed files with 1438 additions and 198 deletions

View File

@@ -28,7 +28,7 @@ function practice(options: Record<string, unknown> = {}) {
room.addBot('A');
room.configure('A', { options: { ...(room.config.options as object), ...options } });
expect(room.start('A')).toBeNull();
return { room, clock, msgs };
return { room, clock, msgs, a };
}
/** Bots move at once; when the game waits on the person, they play their first legal action (or the clock runs out). */
@@ -72,3 +72,19 @@ test('500 points with house rules: the person only times out, the computers stil
const view = JSON.stringify(GAMES.uno!.view(s, 'A'));
for (const bot of s.seats.filter(isBotId)) for (const c of s.hands[bot]!) expect(view).not.toContain(`"${c.id}"`);
});
test('무제한 time: no clock while the person is here; a dropped connection is still auto-played after the grace time', () => {
const { room, clock, a } = practice({ turnSeconds: null });
// Let the computers move until the game waits on the person.
for (let i = 0; i < 200 && room.bots.dueAt !== null; i++) room.bots.fire();
const s = () => room.game!.state as UnoState;
expect(GAMES.uno!.activePlayers(s())).toContain('A');
expect(room.effectiveDeadline()).toBeNull();
const turn = s().turnNo;
room.disconnect(a);
const d = room.effectiveDeadline();
expect(d).not.toBeNull();
clock.advance(d! - clock.advance(0) + 1);
room.onTimer();
expect(s().turnNo !== turn || s().log.some((e) => e.t === 'timeout' && e.p === 'A')).toBe(true);
});