윷놀이 지역 룰 옵션: 말 없을 때 빽도(버림·다시 던지기·날윷), 낙이면 차례 끝, 던진 순서대로, 업기 고르기, 갈림길 고르기
- 엔진: 새 옵션 5개(기본값은 예전 동작 그대로), MOVE에 piece·alt·stack(선택), 따로 선 무더기는 Piece.group으로 구분 - 컴퓨터: 다른 길·따로 두기·날윷 빽도를 점수로 판단, 따로 선 말도 함께 잡힐 위험으로 계산 - 화면: 방 설정 "지역 룰(우리 동네 규칙)" 묶음(빽도/말 움직이기/던지기, 고른 값 설명, 기본으로 되돌리기), 로비 요약·규칙 보기·도움말에 적용 중인 룰, 게임 중 갈 길 고르기·업기/따로 두기 버튼 - 문서: docs/games/yut.md 2장 표, 7장(추가한 룰·뺀 룰과 이유), 테스트·E2E 갱신 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,11 +6,12 @@ const THROW_KO: Record<Throw, string> = { do: '도', gae: '개', geol: '걸', yu
|
||||
|
||||
const pendingText = (v: YutView) => v.pending.map((t) => THROW_KO[t]).join(', ');
|
||||
|
||||
/** Why the current player throws (again): fresh turn, 윷·모, or a capture bonus. */
|
||||
function throwReason(v: YutView): 'fresh' | 'yutmo' | 'capture' {
|
||||
/** Why the current player throws (again): fresh turn, 윷·모, a capture bonus, or a 빽도 thrown again (지역 룰). */
|
||||
function throwReason(v: YutView): 'fresh' | 'yutmo' | 'capture' | 'backdo' {
|
||||
for (let i = v.log.length - 1; i >= 0; i--) {
|
||||
const e = v.log[i]!;
|
||||
if (e.type === 'bonusThrow') return 'capture';
|
||||
if (e.type === 'backdoRethrow') return 'backdo';
|
||||
if (e.type === 'thrown') return e.result === 'yut' || e.result === 'mo' ? 'yutmo' : 'fresh';
|
||||
if (e.type === 'turnChanged' || e.type === 'nak' || e.type === 'moved') return 'fresh';
|
||||
}
|
||||
@@ -25,6 +26,7 @@ export function helpNow(v: YutView, me: string | null, players: Record<string, P
|
||||
const who = `${players[v.current]?.nickname ?? '다른 사람'}님`;
|
||||
const doing = v.phase === 'throw' ? '윷을 던지는 중이에요.' : `말을 옮기는 중이에요. 모아 둔 결과: ${pendingText(v)}.`;
|
||||
const mySide = v.mySide !== null ? v.sides[v.mySide] : undefined;
|
||||
const ordered = v.options.useOrder === 'thrown';
|
||||
const progress = mySide ? `${v.team ? '우리 팀 말' : '내 말'}: 대기 ${mySide.home}개, 판 위 ${mySide.onBoard}개, 난 말 ${mySide.done}/${v.options.pieces}개.` : '';
|
||||
|
||||
if (!mySide || !me) return `${who}${sideTag} 차례예요. ${doing}\n${goal.replace('내 말을', '자기 편 말을')}`;
|
||||
@@ -41,8 +43,9 @@ export function helpNow(v: YutView, me: string | null, players: Record<string, P
|
||||
const lines: string[] = [];
|
||||
if (reason === 'yutmo') lines.push('윷이나 모가 나와서 한 번 더 던져요! [🥢 한 번 더 던지기]를 눌러 주세요.');
|
||||
else if (reason === 'capture') lines.push('상대 말을 잡아서 한 번 더 던져요! [🥢 한 번 더 던지기]를 눌러 주세요.');
|
||||
else if (reason === 'backdo') lines.push('판에 내 말이 없어서 빽도는 없던 걸로 하고 다시 던져요(이 방의 지역 룰). [🥢 한 번 더 던지기]를 눌러 주세요.');
|
||||
else lines.push(`내 차례예요. [🥢 윷 던지기]를 눌러 윷을 던져요.`);
|
||||
if (v.pending.length) lines.push(`모아 둔 결과(${pendingText(v)})는 다 던진 뒤에 원하는 순서로 써요.`);
|
||||
if (v.pending.length) lines.push(`모아 둔 결과(${pendingText(v)})는 다 던진 뒤에 ${ordered ? '던진 순서대로' : '원하는 순서로'} 써요.`);
|
||||
else lines.push(`도 1칸, 개 2칸, 걸 3칸, 윷 4칸, 모 5칸 움직여요. 윷·모가 나오면 한 번 더 던져요.`);
|
||||
lines.push(progress);
|
||||
return lines.join('\n');
|
||||
@@ -50,6 +53,7 @@ export function helpNow(v: YutView, me: string | null, players: Record<string, P
|
||||
|
||||
const moves = v.legalMoves ?? [];
|
||||
const lines = [`내 차례예요. 모아 둔 결과(${pendingText(v)})를 하나씩 써서 말을 움직여요.`];
|
||||
if (ordered && v.pending.length > 1) lines.push(`이 방은 던진 순서대로 써요. 지금은 맨 앞의 ${THROW_KO[v.pending[0]!]}부터 써요.`);
|
||||
if (moves.length === 1) {
|
||||
lines.push('지금 움직일 수 있는 방법이 하나뿐이에요. 초록색 [자동 이동] 버튼을 누르면 바로 움직여요.');
|
||||
} else {
|
||||
@@ -57,7 +61,10 @@ export function helpNow(v: YutView, me: string | null, players: Record<string, P
|
||||
if (mySide.home > 0 && moves.some((m) => m.from === 'home')) lines.push(`새 말은 [대기 ${mySide.home}개] 버튼을 눌러 판에 올려요.`);
|
||||
}
|
||||
const usable = new Set(moves.map((m) => m.throw));
|
||||
if (v.pending.some((t) => !usable.has(t))) lines.push('지금 쓸 곳이 없는 결과는 눌리지 않아요. 다른 결과를 먼저 써 보세요.');
|
||||
if (!ordered && v.pending.some((t) => !usable.has(t))) lines.push('지금 쓸 곳이 없는 결과는 눌리지 않아요. 다른 결과를 먼저 써 보세요.');
|
||||
if (moves.some((m) => m.alt)) lines.push('모서리나 방에 멈췄던 말은 [갈 길 고르기]에서 지름길과 다른 길 중에 고를 수 있어요.');
|
||||
if (moves.some((m) => m.stack === false)) lines.push('내 말이 있는 자리에 멈출 때 [따로 두기]를 고르면 업지 않고 옆에 둬요.');
|
||||
if (moves.some((m) => m.throw === 'backdo' && m.from === 'home')) lines.push('판에 내 말이 없어서 빽도로 새 말을 참먹이 한 칸 뒤(날윷)에 올릴 수 있어요.');
|
||||
const tips: string[] = [];
|
||||
if (moves.some((m) => m.captures > 0)) {
|
||||
const bonus = moves.some((m) => m.captures > 0 && (m.throw !== 'backdo' || v.options.backdoCaptureBonus));
|
||||
|
||||
Reference in New Issue
Block a user