diff --git a/apps/web/src/pages/RoomPage.tsx b/apps/web/src/pages/RoomPage.tsx index 73f6e13..36b82aa 100644 --- a/apps/web/src/pages/RoomPage.tsx +++ b/apps/web/src/pages/RoomPage.tsx @@ -741,12 +741,18 @@ function ResultPanel({ room, me, players, onLeave, onAgain }: { room: RoomView; const allFirst = !solo && result.ranking.length === 1; const won = !solo && !allFirst && result.ranking[0]?.includes(me.id); const lost = !solo && !allFirst && !won && result.ranking.some((g) => g.includes(me.id)); + // 사건 파일 함께 풀기: everyone who stayed shares one rank, so it is solved or not rather than a draw. + const coop = room.gameId === 'case-file' && (room.options as { mode?: string }).mode !== 'race' && result.reason === 'normal' && !!result.ranking[0]?.includes(me.id); + const coopSolved = coop && Object.values(result.scoreText ?? {}).some((t) => t.includes('해결') && !t.includes('미해결')); useEffect(() => { if (played.current) return; played.current = true; - if (won) sounds.win(); + if (coop) { + if (coopSolved) sounds.win(); + else sounds.lose(); + } else if (won) sounds.win(); else if (lost) sounds.lose(); - }, [won, lost]); + }, [won, lost, coop, coopSolved]); if (hidden) { return (
@@ -760,7 +766,7 @@ function ResultPanel({ room, me, players, onLeave, onAgain }: { room: RoomView; } return ( setHidden(true)} label="게임 결과"> -

{allFirst ? '무승부예요' : won ? '🎉 이겼어요!' : lost ? '아쉽게 졌어요' : '게임이 끝났어요'}

+

{coop ? (coopSolved ? '🎉 사건을 해결했어요!' : '사건을 풀지 못했어요') : allFirst ? '무승부예요' : won ? '🎉 이겼어요!' : lost ? '아쉽게 졌어요' : '게임이 끝났어요'}

{result.summary}

{seatedAll.length > seated.length &&

🤖 연습 게임이라 기록에는 남지 않아요.

}