제한 시간 보정 2: 같은 마감 안에서는 투표로 답할 사람이 줄어도 준 시간 유지, 마감은 남은 답할 사람 중 가장 늦은 화면 기준, 자체 시계를 쓰는 게임도 늘어난 마감을 표시

- room: reveal 단계 키를 게임 마감만으로, clockExtra = max(본인, 답할 사람들)
- 라이어·마피아·아발론 시계, 뱅 반응·차례 타이머, 바둑 계가·마작 울기 타이머가 방 마감(연출 시간 포함)을 따름
- 아발론 암살 마감: 당겨진 마감은 숨기고 늘어난 마감은 보여 줌(무제한이면 그대로 숨김)
- 테스트: 공통 재투표(대표자 A·느린 B·A 투표 후 유지), e2e 라이어 화면 시계 = 방 마감

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-11-08 12:09:36 +09:00
parent bc8cb7ae8c
commit f793391b79
8 changed files with 117 additions and 26 deletions

View File

@@ -883,7 +883,7 @@ function useShownEvents(v: MafiaView): PublicEvent[] {
return useMemo(() => (v.events.at(-1)?.n ?? 0) <= shownN ? v.events : v.events.filter((e) => e.n <= shownN), [v.events, shownN]);
}
function MafiaBoard({ view: v, me, players, act, pending }: BoardProps<MafiaView>) {
function MafiaBoard({ view: v, me, players, act, pending, deadline }: BoardProps<MafiaView>) {
// The room chat is closed while playing, so this game's own chat lines play the chat sound.
useChatSound(v.chat.at(-1)?.key);
const ph = v.phase;
@@ -956,7 +956,8 @@ function MafiaBoard({ view: v, me, players, act, pending }: BoardProps<MafiaView
</strong>
<span className="s">{sub}</span>
</span>
<Clock endsAt={ph.endsAt} unlimited={ph.endsAt === null && ph.kind !== 'ended'} />
{/* The room's deadline is the phase clock plus the time the screens took to finish animating (it only moves later). */}
<Clock endsAt={ph.endsAt === null ? null : Math.max(ph.endsAt, deadline ?? ph.endsAt)} unlimited={ph.endsAt === null && ph.kind !== 'ended'} />
{my && <RoleCard role={my.role} mates={my.mates} players={players} always={!!v.winner || !actV.my!.alive} />}
</section>
<News v={shownV} players={players} />