Compare commits
5 Commits
f9ed734db4
...
c2ce1979b2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2ce1979b2 | ||
|
|
7084a20e59 | ||
|
|
0e8ba529c0 | ||
|
|
2403b6747f | ||
|
|
f4fb796dfe |
@@ -2,10 +2,11 @@
|
||||
* 증강 윷놀이 screen parts (docs/games/yut-augmented.md §화면): augment selection, prompts, popups, the "내 증강" panel,
|
||||
* board objects, fog, special-piece badges and the 알까기 aim / replay. Used by index.tsx only when `view.aug` exists.
|
||||
*/
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useEffect, useId, useLayoutEffect, useMemo, useRef, useState, type FocusEvent, type PointerEvent as ReactPointerEvent } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import type { AugFx, AugUseOption, PieceKind, YutAugView, YutView } from '@bg/games/yut';
|
||||
import { AUGS, KIND_KO, TIER_KO, type AugId } from '@bg/games/yut/augments';
|
||||
import { NODE_POS } from '@bg/games/yut/board';
|
||||
import { NODE_NAMES, NODE_POS } from '@bg/games/yut/board';
|
||||
import type { PublicUser } from '@bg/shared/lite';
|
||||
import { Sheet } from '../../components/ui';
|
||||
import { haptic, sounds } from '../../lib/feedback';
|
||||
@@ -63,7 +64,24 @@ export const AUG_CSS = `
|
||||
.aug-board-wrap { position: relative; }
|
||||
.aug-aim { touch-action: none; cursor: crosshair; }
|
||||
.sheet:has(.aug-cards) { width: min(100%, 780px); }
|
||||
@media (prefers-reduced-motion: reduce) { .aug-toast { animation: none; } }
|
||||
.aug-pop { position: fixed; z-index: 1000; width: max-content; max-width: min(300px, calc(100vw - 16px)); pointer-events: none; text-align: left;
|
||||
border: 3px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); padding: 10px 12px;
|
||||
display: flex; flex-direction: column; gap: 6px; box-shadow: 0 10px 28px rgba(0, 0, 0, .28); animation: aug-pop .12s ease both; }
|
||||
.aug-pop.win { border-color: #f59e0b; }
|
||||
.aug-pop h3 { margin: 0; font-size: 1.05rem; }
|
||||
.aug-pop p { margin: 0; font-size: .9rem; }
|
||||
.aug-pop .aug-pop-state { font-weight: 800; color: var(--danger); }
|
||||
.aug-chip[tabindex] { cursor: help; }
|
||||
@keyframes aug-pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
|
||||
.aug-objection { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; background: rgba(17, 24, 39, .82); cursor: pointer;
|
||||
animation: aug-obj-bg .25s ease both; }
|
||||
.aug-objection-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; text-align: center; color: #fff; max-width: min(92vw, 640px); }
|
||||
.aug-objection-box strong { font-size: clamp(3.2rem, 15vw, 7rem); line-height: 1; font-weight: 900; color: #fde047; letter-spacing: -.02em;
|
||||
text-shadow: 0 4px 0 #b91c1c, 0 8px 24px rgba(0, 0, 0, .5); transform: rotate(-4deg); animation: aug-obj-hit .5s cubic-bezier(.2, 1.6, .4, 1) both; }
|
||||
.aug-objection-box p { margin: 0; font-size: 1.05rem; font-weight: 700; }
|
||||
@keyframes aug-obj-hit { 0% { opacity: 0; transform: rotate(-4deg) scale(2.4); } 60% { opacity: 1; transform: rotate(-4deg) scale(.92); } 100% { transform: rotate(-4deg) scale(1); } }
|
||||
@keyframes aug-obj-bg { from { opacity: 0; } to { opacity: 1; } }
|
||||
@media (prefers-reduced-motion: reduce) { .aug-toast, .aug-pop, .aug-objection, .aug-objection-box strong { animation: none; } }
|
||||
`;
|
||||
|
||||
// ---------------------------------------------------------------- round bar
|
||||
@@ -82,6 +100,115 @@ export function AugRoundBar({ v }: { v: YutView }) {
|
||||
);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- augment popup (hover / focus / tap)
|
||||
|
||||
type PopInfo = { id: AugId; state: string[] };
|
||||
|
||||
/** Card that explains one augment, placed under (or above) the element it describes. */
|
||||
function AugPopCard({ el, id, state, popId }: PopInfo & { el: HTMLElement; popId: string }) {
|
||||
const m = AUGS[id];
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
const [pos, setPos] = useState<{ left: number; top: number } | null>(null);
|
||||
const stateKey = state.join('|');
|
||||
useLayoutEffect(() => {
|
||||
const r = el.getBoundingClientRect();
|
||||
const p = ref.current!.getBoundingClientRect();
|
||||
const gap = 8;
|
||||
const vh = window.innerHeight;
|
||||
// below the chip if it fits, else above if it fits, else on the roomier side; then kept inside the screen
|
||||
let top = r.bottom + gap;
|
||||
if (top + p.height > vh - gap) {
|
||||
const above = r.top - gap - p.height;
|
||||
if (above >= gap || r.top > vh - r.bottom) top = above;
|
||||
}
|
||||
top = Math.max(gap, Math.min(top, vh - gap - p.height));
|
||||
const left = Math.min(Math.max(gap, r.left + r.width / 2 - p.width / 2), window.innerWidth - gap - p.width);
|
||||
setPos({ left, top });
|
||||
}, [el, id, stateKey]);
|
||||
return (
|
||||
<div ref={ref} id={popId} role="tooltip" className={`aug-pop${m.win ? ' win' : ''}`} style={pos ?? { left: 0, top: 0, visibility: 'hidden' }}>
|
||||
<span className="aug-card-head">
|
||||
<AugIcon id={id} size={44} />
|
||||
<h3>{m.name}</h3>
|
||||
</span>
|
||||
<span className="aug-tags">
|
||||
<span className="aug-tag">{TIER_KO[m.tier]}</span>
|
||||
<span className="aug-tag">{KIND_KO[m.kind]}</span>
|
||||
{m.once && <span className="aug-tag">1회</span>}
|
||||
{m.win && m.kind !== 'win' && <span className="aug-tag win">승리 조건</span>}
|
||||
{m.custom && <span className="aug-tag custom">추가</span>}
|
||||
</span>
|
||||
<p>{m.text}</p>
|
||||
{m.note && <p className="small muted">{m.note}</p>}
|
||||
{state.map((t) => (
|
||||
<p key={t} className="small aug-pop-state">
|
||||
{t}
|
||||
</p>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Explanation popup for augment chips/buttons instead of the browser's title tooltip:
|
||||
* mouse hover and keyboard focus show it, a finger tap toggles it (when `tap` is set), Esc / scroll / tapping elsewhere closes it.
|
||||
* `info(key)` is read on every render so the card follows live state (used, cat …) and disappears with its augment.
|
||||
*/
|
||||
function useAugPop(info: (key: number) => PopInfo | null) {
|
||||
const popId = useId();
|
||||
const [pop, setPop] = useState<{ key: number; el: HTMLElement; pinned: boolean } | null>(null);
|
||||
const lastPointer = useRef('mouse');
|
||||
useEffect(() => {
|
||||
if (!pop) return;
|
||||
const close = () => setPop(null);
|
||||
const down = (e: PointerEvent) => {
|
||||
if (!pop.el.contains(e.target as Node)) close();
|
||||
};
|
||||
const key = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') close();
|
||||
};
|
||||
window.addEventListener('scroll', close, true);
|
||||
window.addEventListener('resize', close);
|
||||
document.addEventListener('pointerdown', down, true);
|
||||
document.addEventListener('keydown', key);
|
||||
return () => {
|
||||
window.removeEventListener('scroll', close, true);
|
||||
window.removeEventListener('resize', close);
|
||||
document.removeEventListener('pointerdown', down, true);
|
||||
document.removeEventListener('keydown', key);
|
||||
};
|
||||
}, [pop]);
|
||||
const hide = (el: HTMLElement) => setPop((p) => (p && p.el === el && !p.pinned ? null : p));
|
||||
const bind = (key: number, tap = false) => ({
|
||||
'aria-describedby': pop?.key === key ? popId : undefined,
|
||||
onPointerDown: (e: ReactPointerEvent<HTMLElement>) => {
|
||||
lastPointer.current = e.pointerType;
|
||||
},
|
||||
onPointerEnter: (e: ReactPointerEvent<HTMLElement>) => {
|
||||
if (e.pointerType === 'mouse') setPop({ key, el: e.currentTarget, pinned: false });
|
||||
},
|
||||
onPointerLeave: (e: ReactPointerEvent<HTMLElement>) => {
|
||||
if (e.pointerType === 'mouse') hide(e.currentTarget);
|
||||
},
|
||||
onFocus: (e: FocusEvent<HTMLElement>) => {
|
||||
if (e.currentTarget.matches(':focus-visible')) setPop({ key, el: e.currentTarget, pinned: false });
|
||||
},
|
||||
onBlur: (e: FocusEvent<HTMLElement>) => hide(e.currentTarget),
|
||||
...(tap
|
||||
? {
|
||||
onClick: (e: { currentTarget: HTMLElement }) => {
|
||||
if (lastPointer.current === 'mouse') return;
|
||||
const el = e.currentTarget;
|
||||
setPop((p) => (p && p.el === el && p.pinned ? null : { key, el, pinned: true }));
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
});
|
||||
const shown = pop && pop.el.isConnected ? info(pop.key) : null;
|
||||
const node = pop && shown ? createPortal(<AugPopCard el={pop.el} popId={popId} {...shown} />, document.body) : null;
|
||||
return { bind, node };
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- slots in the side card
|
||||
|
||||
export function AugSlots({ v, side }: { v: YutView; side: number }) {
|
||||
@@ -94,6 +221,16 @@ export function AugSlots({ v, side }: { v: YutView; side: number }) {
|
||||
if (s.queenLives !== null) info.push(`👑 목숨 ${s.queenLives}`);
|
||||
if (s.cursed) info.push('🪆 저주: 다음 차례 도만');
|
||||
for (const l of s.links) info.push(`${l.by === 'leech' ? '🩸 거머리' : '💀 네크로'} → ${augSideName(l.to)}${l.on ? '' : ' (멈춤)'}`);
|
||||
const pop = useAugPop((uid) => {
|
||||
const o = s.augs.find((x) => x.uid === uid);
|
||||
if (!o) return null;
|
||||
const state: string[] = [];
|
||||
if (o.used) state.push('✔ 이미 썼어요');
|
||||
if (o.voided) state.push('무효가 됐어요');
|
||||
if (o.catUntil !== null) state.push(`🐱 ${o.catUntil}라운드까지 고양이(효과 멈춤)`);
|
||||
if (o.note) state.push(o.note);
|
||||
return { id: o.id, state };
|
||||
});
|
||||
return (
|
||||
<>
|
||||
{info.length > 0 && <div className="small muted" style={{ marginTop: 6 }}>{info.join(' · ')}</div>}
|
||||
@@ -106,7 +243,8 @@ export function AugSlots({ v, side }: { v: YutView; side: number }) {
|
||||
<span
|
||||
key={o.uid}
|
||||
className={`aug-chip${o.used ? ' used' : ''}${o.voided ? ' voided' : ''}${cat ? ' cat' : ''}${meta.win ? ' win' : ''}`}
|
||||
title={`${meta.name}: ${meta.text}${meta.note ? ` (${meta.note})` : ''}`}
|
||||
tabIndex={0}
|
||||
{...pop.bind(o.uid, true)}
|
||||
aria-label={`${meta.name}${o.used ? ' (사용함)' : ''}${o.voided ? ' (무효)' : ''}${cat ? ` (${o.catUntil}라운드까지 고양이)` : ''}${o.note ? `, ${o.note}` : ''}`}
|
||||
>
|
||||
<AugIcon id={o.id} size={22} cat={cat} />
|
||||
@@ -116,6 +254,7 @@ export function AugSlots({ v, side }: { v: YutView; side: number }) {
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
{pop.node}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -310,10 +449,18 @@ export function AugFxLayer({ v, players, me }: { v: YutView; players: Record<str
|
||||
const seen = useRef(fx.reduce((m, f) => Math.max(m, f.no), 0));
|
||||
const [popup, setPopup] = useState<AugFx | null>(null);
|
||||
const [toast, setToast] = useState<{ key: number; text: string } | null>(null);
|
||||
const [objection, setObjection] = useState<AugFx | null>(null);
|
||||
useEffect(() => {
|
||||
const fresh = fx.filter((f) => f.no > seen.current);
|
||||
if (!fresh.length) return;
|
||||
seen.current = Math.max(...fresh.map((f) => f.no));
|
||||
// 이의있음!: a big full-screen call, then the (already open) new selection shows underneath
|
||||
const obj = fresh.find((f) => f.kind === 'objection');
|
||||
if (obj) {
|
||||
setObjection(obj);
|
||||
sounds.buzz();
|
||||
haptic(80);
|
||||
}
|
||||
// When the game just ended the result window says it all.
|
||||
const big = v.phase === 'finished' ? undefined : fresh.find((f) => f.kind === 'win' || f.kind === 'out' || f.kind === 'bronze');
|
||||
if (big) {
|
||||
@@ -322,7 +469,7 @@ export function AugFxLayer({ v, players, me }: { v: YutView; players: Record<str
|
||||
if (big.kind === 'out') (mine ? sounds.lose : sounds.buzz)();
|
||||
else (mine ? sounds.win : sounds.ding)();
|
||||
}
|
||||
const small = fresh.filter((f) => f !== big && f.kind !== 'flick');
|
||||
const small = fresh.filter((f) => f !== big && f !== obj && f.kind !== 'flick');
|
||||
if (small.length) setToast({ key: small[small.length - 1]!.no, text: small.map((f) => f.text).join(' · ') });
|
||||
}, [fx.map((f) => f.no).join(',')]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
useEffect(() => {
|
||||
@@ -330,8 +477,24 @@ export function AugFxLayer({ v, players, me }: { v: YutView; players: Record<str
|
||||
const t = setTimeout(() => setToast(null), fxMs(3200));
|
||||
return () => clearTimeout(t);
|
||||
}, [toast]);
|
||||
useEffect(() => {
|
||||
if (!objection) return;
|
||||
const t = setTimeout(() => setObjection(null), fxMs(2800));
|
||||
return () => clearTimeout(t);
|
||||
}, [objection]);
|
||||
return (
|
||||
<>
|
||||
{objection &&
|
||||
createPortal(
|
||||
<div className="aug-objection" role="alert" onClick={() => setObjection(null)}>
|
||||
<div className="aug-objection-box">
|
||||
<AugIcon id="objection" size={72} />
|
||||
<strong>이의있음!</strong>
|
||||
<p>{objection.text}</p>
|
||||
</div>
|
||||
</div>,
|
||||
document.body,
|
||||
)}
|
||||
{toast && (
|
||||
<div key={toast.key} className="aug-toast" role="status" aria-live="polite">
|
||||
{toast.text}
|
||||
@@ -389,6 +552,10 @@ export function AugUses({
|
||||
for (const u of a.uses) m.set(u.uid, [...(m.get(u.uid) ?? []), u]);
|
||||
return m;
|
||||
}, [a.uses]);
|
||||
const pop = useAugPop((uid) => {
|
||||
const o = byUid.get(uid)?.[0];
|
||||
return o ? { id: o.id, state: AUGS[o.id].wholeTurn ? ['쓰면 이번 차례가 끝나요'] : [] } : null;
|
||||
});
|
||||
const specials = a.specials;
|
||||
if (!byUid.size && !specials.length) return null;
|
||||
const use = (u: AugUseOption) => {
|
||||
@@ -415,7 +582,7 @@ export function AugUses({
|
||||
className={`btn btn-sm ${targetUid === uid ? 'btn-primary' : 'btn-secondary'}`}
|
||||
disabled={pending}
|
||||
aria-pressed={targetUid === uid}
|
||||
title={AUGS[id].text}
|
||||
{...pop.bind(uid)}
|
||||
onClick={() => {
|
||||
setAim(null);
|
||||
if (opts.length === 1 && id !== 'alkkagi' && !['sniper', 'mine'].includes(id)) setTargetUid(uid);
|
||||
@@ -497,6 +664,7 @@ export function AugUses({
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{pop.node}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -521,8 +689,7 @@ function ManyTargets({ opts, pending, onUse }: { opts: AugUseOption[]; pending:
|
||||
);
|
||||
}
|
||||
|
||||
const NODE_KO = ['참먹이', '도', '개', '걸', '윷', '모', '뒷도', '뒷개', '뒷걸', '뒷윷', '뒷모', '찌도', '찌개', '찌걸', '찌윷', '찌모', '날도', '날개', '날걸', '날윷', '앞모도', '앞모개', '방', '속윷', '속모', '뒷모도', '뒷모개', '사려', '안찌'];
|
||||
const nodeKo = (n: number | 'home' | 'goal') => (n === 'home' ? '대기' : n === 'goal' ? '남' : (NODE_KO[n] ?? String(n)));
|
||||
const nodeKo = (n: number | 'home' | 'goal') => (n === 'home' ? '대기' : n === 'goal' ? '남' : (NODE_NAMES[n] ?? String(n)));
|
||||
|
||||
// ---------------------------------------------------------------- board layers (inside the board <svg>)
|
||||
|
||||
@@ -536,7 +703,7 @@ export function BoardObjects({ v }: { v: YutView }) {
|
||||
{v.aug!.objs.map((o, i) => {
|
||||
const [x, y] = NODE_POS[o.node]!;
|
||||
return (
|
||||
<g key={i} transform={`translate(${x + 3.6} ${y - 3.6})`} aria-label={`${NODE_KO[o.node]}: ${OBJ_KO[o.kind]}`} role="img">
|
||||
<g key={i} transform={`translate(${x + 3.6} ${y - 3.6})`} aria-label={`${NODE_NAMES[o.node]}: ${OBJ_KO[o.kind]}`} role="img">
|
||||
<circle r={2.9} fill="var(--surface)" stroke={o.owner >= 0 ? COLORS[o.owner] : 'var(--wood-line)'} strokeWidth={0.6} opacity={0.95} />
|
||||
<text textAnchor="middle" dominantBaseline="central" fontSize={3.4}>
|
||||
{OBJ_ICON[o.kind]}
|
||||
|
||||
@@ -74,11 +74,11 @@ function freshWith(opts: Record<string, unknown>) {
|
||||
|
||||
test('윷 지역 룰: 기본 방의 요약은 그대로이고, 바꾼 규칙만 요약에 붙어요', () => {
|
||||
const d = GAMES.yut!.defaultOptions as any;
|
||||
expect(optionsSummary(d)).toBe('개인전 · 말 4개 · 빽도 있음 · 참먹이 지나야 남 · 30초');
|
||||
expect(optionsSummary(d)).toBe('개인전 · 말 4개 · 빽도 있음 · 1번(출발) 지나야 남 · 30초');
|
||||
expect(changedTags(d)).toEqual([]);
|
||||
expect(houseRules(d).every((r) => !r.changed)).toBe(true);
|
||||
const o = GAMES.yut!.optionsSchema.parse({ stacking: 'choose', forkRule: 'choose', useOrder: 'thrown', backdoNoPiece: 'rethrow', nakPercent: 5, nakRule: 'lose' }) as any;
|
||||
expect(optionsSummary(o)).toBe('개인전 · 말 4개 · 빽도 있음 · 참먹이 지나야 남 · 낙 5% · 말 없을 때 빽도는 다시 던짐 · 업기 고르기 · 갈림길 고르기 · 던진 순서대로 쓰기 · 낙이면 차례 끝 · 30초');
|
||||
expect(optionsSummary(o)).toBe('개인전 · 말 4개 · 빽도 있음 · 1번(출발) 지나야 남 · 낙 5% · 말 없을 때 빽도는 다시 던짐 · 업기 고르기 · 갈림길 고르기 · 던진 순서대로 쓰기 · 낙이면 차례 끝 · 30초');
|
||||
// Rules that cannot matter are not listed: no 빽도 → no 빽도 rules, no 낙 → no 낙 handling, 팀전 → no ranking.
|
||||
const keys = houseRules(GAMES.yut!.optionsSchema.parse({ backdo: false, mode: 'team' }) as any).map((r) => r.key);
|
||||
expect(keys).not.toContain('backdoNoPiece');
|
||||
@@ -111,5 +111,5 @@ test('윷 지역 룰: 빽도 다시 던지기 / 던진 순서대로 / 갈 길·
|
||||
|
||||
const e = freshWith({ backdoNoPiece: 'enter' });
|
||||
const w = applyAction('yut', e.state, e.me, { type: 'THROW' }, { next: (() => { const q = [...BK.backdo]; return () => q.shift()!; })() } as any);
|
||||
expect(helpNow(view(w, e.me), e.me, users)).toContain('빽도로 새 말을 참먹이 한 칸 뒤(날윷)에 올릴 수 있어요');
|
||||
expect(helpNow(view(w, e.me), e.me, users)).toContain('빽도로 새 말을 1번(출발) 바로 앞 칸(4번 다음 4칸)에 올릴 수 있어요');
|
||||
});
|
||||
|
||||
@@ -75,7 +75,7 @@ export function helpNow(v: YutView, me: string | null, players: Record<string, P
|
||||
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('판에 내 말이 없어서 빽도로 새 말을 참먹이 한 칸 뒤(날윷)에 올릴 수 있어요.');
|
||||
if (moves.some((m) => m.throw === 'backdo' && m.from === 'home')) lines.push('판에 내 말이 없어서 빽도로 새 말을 1번(출발) 바로 앞 칸(4번 다음 4칸)에 올릴 수 있어요.');
|
||||
const tips: string[] = [];
|
||||
if (moves.some((m) => m.captures > 0)) {
|
||||
const bonus = moves.some((m) => m.captures > 0 && (m.throw !== 'backdo' || v.options.backdoCaptureBonus));
|
||||
|
||||
@@ -29,11 +29,11 @@ export function houseRules(o: YutOptions): HouseRule[] {
|
||||
'backdoNoPiece',
|
||||
'판에 내 말이 없을 때 빽도',
|
||||
np !== 'discard',
|
||||
np === 'rethrow' ? '말 없을 때 빽도는 다시 던짐' : '말 없을 때 빽도는 날윷으로',
|
||||
np === 'rethrow' ? '말 없을 때 빽도는 다시 던짐' : '말 없을 때 빽도는 1번(출발) 앞 칸으로',
|
||||
np === 'rethrow'
|
||||
? '판에 내 말이 없을 때 나온 빽도는 없던 걸로 하고 다시 던져요.'
|
||||
: np === 'enter'
|
||||
? `판에 내 말이 없을 때 빽도가 나오면 새 말이 참먹이 한 칸 뒤(날윷)에 올라가요. ${reach ? '다음에 앞으로 가면 바로 나요.' : '다음에 도면 참먹이에 서고, 개 이상이면 바로 나요.'}`
|
||||
? `판에 내 말이 없을 때 빽도가 나오면 새 말이 1번(출발) 바로 앞 칸(4번 다음 4칸)에 올라가요. ${reach ? '다음에 앞으로 가면 바로 나요.' : '다음에 도면 1번에 서고, 개 이상이면 바로 나요.'}`
|
||||
: '판에 내 말이 없으면 빽도는 쓸 곳이 없어서 버려요.',
|
||||
);
|
||||
add(
|
||||
@@ -41,7 +41,7 @@ export function houseRules(o: YutOptions): HouseRule[] {
|
||||
'도 자리에서 빽도',
|
||||
o.backdoFromDo === 'finish',
|
||||
'도 자리 빽도는 바로 남',
|
||||
o.backdoFromDo === 'finish' ? '도 자리에 있는 말이 빽도를 받으면 그 자리에서 바로 나요.' : '도 자리에 있는 말이 빽도를 받으면 참먹이로 가고, 다음에 앞으로 가면 바로 나요.',
|
||||
o.backdoFromDo === 'finish' ? '도 자리에 있는 말이 빽도를 받으면 그 자리에서 바로 나요.' : '도 자리에 있는 말이 빽도를 받으면 1번(출발)으로 가고, 다음에 앞으로 가면 바로 나요.',
|
||||
);
|
||||
add('backdoCaptureBonus', '빽도로 잡았을 때', !o.backdoCaptureBonus, '빽도로 잡으면 더 안 던짐', o.backdoCaptureBonus ? '빽도로 잡아도 한 번 더 던져요.' : '빽도로 잡을 때는 한 번 더 던지지 않아요.');
|
||||
}
|
||||
@@ -62,8 +62,8 @@ export function houseRules(o: YutOptions): HouseRule[] {
|
||||
fork,
|
||||
'갈림길 고르기',
|
||||
fork
|
||||
? '모서리(모·뒷모)나 방에 멈췄다가 출발할 때 지름길로 갈지 다른 길로 갈지 골라요. 지나가기만 할 때는 그대로 직진해요.'
|
||||
: '모서리(모·뒷모)나 방에 멈췄다가 출발하면 늘 안쪽 지름길로 가요. 방에서는 참먹이 쪽으로 가요.',
|
||||
? '2번·3번 모서리나 방에 멈췄다가 출발할 때 지름길로 갈지 다른 길로 갈지 골라요. 지나가기만 할 때는 그대로 직진해요.'
|
||||
: '2번·3번 모서리나 방에 멈췄다가 출발하면 늘 안쪽 지름길로 가요. 방에서는 1번(출발) 쪽으로 가요.',
|
||||
);
|
||||
const ordered = o.useOrder === 'thrown';
|
||||
add(
|
||||
@@ -73,7 +73,7 @@ export function houseRules(o: YutOptions): HouseRule[] {
|
||||
'던진 순서대로 쓰기',
|
||||
ordered ? '모아 둔 결과는 던진 순서대로 써요. 맨 앞 결과를 쓸 곳이 없으면 그 결과만 버려요.' : '모아 둔 결과는 원하는 순서로 써요.',
|
||||
);
|
||||
add('finishRule', '날(완주)', reach, '참먹이 도착하면 남', reach ? '한 바퀴 돈 말이 참먹이에 도착하면 바로 나요.' : '한 바퀴 돈 말이 참먹이를 지나가야 나요. 참먹이에 딱 멈추면 아직 판 위라서 잡힐 수 있어요.');
|
||||
add('finishRule', '날(완주)', reach, '1번(출발) 도착하면 남', reach ? '한 바퀴 돈 말이 1번(출발)에 도착하면 바로 나요.' : '한 바퀴 돈 말이 1번(출발)을 지나가야 나요. 1번에 딱 멈추면 아직 판 위라서 잡힐 수 있어요.');
|
||||
add('nakPercent', '낙', o.nakPercent > 0, `낙 ${o.nakPercent}%`, o.nakPercent > 0 ? `윷가락이 ${o.nakPercent}% 확률로 판 밖으로 떨어져요(낙).` : '낙 없이 해요.');
|
||||
if (o.nakPercent > 0) {
|
||||
const lose = o.nakRule === 'lose';
|
||||
@@ -102,7 +102,7 @@ export function optionsSummary(o: YutOptions): string {
|
||||
o.mode === 'team' ? '팀전' : '개인전',
|
||||
`말 ${o.pieces}개`,
|
||||
o.backdo ? '빽도 있음' : '빽도 없음',
|
||||
o.finishRule === 'pass' ? '참먹이 지나야 남' : '참먹이 도착하면 남',
|
||||
o.finishRule === 'pass' ? '1번(출발) 지나야 남' : '1번(출발) 도착하면 남',
|
||||
...(o.nakPercent ? [`낙 ${o.nakPercent}%`] : []),
|
||||
...changedTags(o),
|
||||
o.turnSeconds === null ? '시간 무제한' : `${o.turnSeconds}초`,
|
||||
|
||||
@@ -8,6 +8,7 @@ import { haptic, sounds } from '../../lib/feedback';
|
||||
import type { BoardProps, GameUI, OptionsProps } from '../types';
|
||||
import { AugOptions } from './aug-options';
|
||||
import { AUGS, AUG_IDS, type AugId } from '@bg/games/yut/augments';
|
||||
import { NODE_NAMES } from '@bg/games/yut/board';
|
||||
import {
|
||||
AUG_CSS,
|
||||
AugFxLayer,
|
||||
@@ -47,22 +48,19 @@ const toAction = (m: YutLegalMove) => ({
|
||||
...(m.stack === false ? { stack: false } : {}),
|
||||
});
|
||||
/** Road names at a fork: the ordinary road first. */
|
||||
const roadNames = (from: From): [string, string] => (from === 22 ? ['참먹이 쪽', '찌모 쪽'] : ['지름길', '바깥 길']);
|
||||
const roadNames = (from: From): [string, string] => (from === 22 ? ['1번(출발) 쪽', '4번 쪽'] : ['지름길', '바깥 길']);
|
||||
type GameEvent = YutView['log'][number];
|
||||
|
||||
// The rules module is imported for types only (no zod in this chunk); these small tables mirror packages/games/src/yut/board.ts.
|
||||
const NODE_NAMES = [
|
||||
'참먹이', '도', '개', '걸', '윷', '모', '뒷도', '뒷개', '뒷걸', '뒷윷',
|
||||
'뒷모', '찌도', '찌개', '찌걸', '찌윷', '찌모', '날도', '날개', '날걸', '날윷',
|
||||
'앞모도', '앞모개', '방', '속윷', '속모', '뒷모도', '뒷모개', '사려', '안찌',
|
||||
];
|
||||
// The rules module is imported for types only (no zod in this chunk); these small tables mirror packages/games/src/yut/board.ts
|
||||
// (board.ts itself has no runtime imports, so NODE_NAMES comes straight from there).
|
||||
const THROW_KO: Record<Throw, string> = { do: '도', gae: '개', geol: '걸', yut: '윷', mo: '모', backdo: '빽도' };
|
||||
const STEPS: Record<Throw, number> = { do: 1, gae: 2, geol: 3, yut: 4, mo: 5, backdo: -1 };
|
||||
const stepText = (t: Throw) => (t === 'backdo' ? '뒤로 1칸' : `${STEPS[t]}칸`);
|
||||
const BIG = new Set([0, 5, 10, 15, 22]);
|
||||
const BIG_LABELS: [number, string][] = [[0, '출발'], [5, '모'], [10, '뒷모'], [15, '찌모'], [22, '방']];
|
||||
/** Corner numbers in the moving direction (2026-11-08: plain numbers instead of 참먹이·모·뒷모·찌모), 1 also says 출발. */
|
||||
const BIG_LABELS: [number, string][] = [[0, '1'], [5, '2'], [10, '3'], [15, '4'], [22, '방']];
|
||||
|
||||
// Board geometry (viewBox 0..100): 참먹이 bottom-right, 모 top-right, 뒷모 top-left, 찌모 bottom-left; pieces go anticlockwise.
|
||||
// Board geometry (viewBox 0..100): 1번(출발) bottom-right, 2번 top-right, 3번 top-left, 4번 bottom-left; pieces go anticlockwise.
|
||||
const LO = 8;
|
||||
const HI = 92;
|
||||
const GAP = (HI - LO) / 5;
|
||||
@@ -82,7 +80,7 @@ const POS: [number, number][] = (() => {
|
||||
[27, 28].forEach((n, k) => (p[n] = lerp(p[10]!, p[0]!, (k + 4) / 6)));
|
||||
return p;
|
||||
})();
|
||||
/** Where pieces come from / go to (just outside 참먹이). */
|
||||
/** Where pieces come from / go to (just outside 1번(출발)). */
|
||||
const HOME_PT: [number, number] = [HI + 4, HI + 7];
|
||||
const LINES: [number, number][] = [
|
||||
...Array.from({ length: 20 }, (_, i) => [i, (i + 1) % 20] as [number, number]),
|
||||
@@ -451,7 +449,7 @@ function YutBoard({ view: v, me, players, act, pending, deadline }: BoardProps<Y
|
||||
{aug && <style>{AUG_CSS}</style>}
|
||||
<div className="yut-board-box aug-board-wrap">
|
||||
{aug && <AugFxLayer v={v} players={players} me={me} />}
|
||||
<svg ref={svgRef} className="yut-board" viewBox="0 0 100 100" role="group" aria-label={`윷판. 말은 오른쪽 아래 참먹이에서 출발해 시계 반대 방향으로 돌아요.${chosen ? ` 고른 말은 ${nodeName(chosen.to)}로 가요.` : ''}`} style={{ background: 'var(--wood)' }}>
|
||||
<svg ref={svgRef} className="yut-board" viewBox="0 0 100 100" role="group" aria-label={`윷판. 말은 오른쪽 아래 1번(출발)에서 출발해 시계 반대 방향으로 돌아요.${chosen ? ` 고른 말은 ${nodeName(chosen.to)}로 가요.` : ''}`} style={{ background: 'var(--wood)' }}>
|
||||
<rect x={1.5} y={1.5} width={97} height={97} rx={6} fill="none" stroke="var(--wood-line)" strokeWidth={0.6} opacity={0.6} />
|
||||
{LINES.map(([a, b]) => (
|
||||
<line key={`${a}-${b}`} x1={POS[a]![0]} y1={POS[a]![1]} x2={POS[b]![0]} y2={POS[b]![1]} stroke="var(--wood-line)" strokeWidth={0.9} strokeLinecap="round" opacity={0.75} />
|
||||
@@ -466,10 +464,13 @@ function YutBoard({ view: v, me, players, act, pending, deadline }: BoardProps<Y
|
||||
</g>
|
||||
))}
|
||||
{BIG_LABELS.map(([n, t]) => (
|
||||
<text key={`l${n}`} x={POS[n]![0]} y={POS[n]![1]} textAnchor="middle" dominantBaseline="central" fontSize={n === 0 ? 2.9 : 3.2} fontWeight={800} fill="var(--wood-line)" opacity={0.9}>
|
||||
<text key={`l${n}`} x={POS[n]![0]} y={POS[n]![1] - (n === 0 ? 1.1 : 0)} textAnchor="middle" dominantBaseline="central" fontSize={n === 22 ? 3.2 : 4.4} fontWeight={800} fill="var(--wood-line)" opacity={0.9}>
|
||||
{t}
|
||||
</text>
|
||||
))}
|
||||
<text x={POS[0]![0]} y={POS[0]![1] + 2.6} textAnchor="middle" dominantBaseline="central" fontSize={2.4} fontWeight={800} fill="var(--wood-line)" opacity={0.9}>
|
||||
출발
|
||||
</text>
|
||||
{/* direction hint at the start */}
|
||||
<path d={`M ${HI - 4.5} ${HI - 9} L ${HI - 4.5} ${HI - 14} M ${HI - 6.3} ${HI - 12} L ${HI - 4.5} ${HI - 14.2} L ${HI - 2.7} ${HI - 12}`} stroke="var(--wood-line)" strokeWidth={0.7} fill="none" strokeLinecap="round" opacity={0.8} />
|
||||
{aug && <BoardObjects v={v} />}
|
||||
@@ -1004,12 +1005,12 @@ function Options({ value: o, onChange }: OptionsProps<YutOptions>) {
|
||||
<Field label="판에 내 말이 없을 때 빽도가 나오면" hint={hint('backdoNoPiece')}>
|
||||
<Seg
|
||||
value={o.backdoNoPiece ?? 'discard'}
|
||||
options={[['discard', '버림'], ['rethrow', '다시 던지기'], ['enter', '날윷에 새 말']]}
|
||||
options={[['discard', '버림'], ['rethrow', '다시 던지기'], ['enter', '1번 앞 칸에 새 말']]}
|
||||
onChange={(backdoNoPiece) => set({ backdoNoPiece })}
|
||||
/>
|
||||
</Field>
|
||||
<Field label="도 자리 말이 빽도를 받으면" hint={hint('backdoFromDo')}>
|
||||
<Seg value={o.backdoFromDo} options={[['chammeogi', '참먹이로(다음에 남)'], ['finish', '바로 남']]} onChange={(backdoFromDo) => set({ backdoFromDo })} />
|
||||
<Seg value={o.backdoFromDo} options={[['chammeogi', '1번(출발)으로(다음에 남)'], ['finish', '바로 남']]} onChange={(backdoFromDo) => set({ backdoFromDo })} />
|
||||
</Field>
|
||||
<Field label="빽도로 잡았을 때" hint={hint('backdoCaptureBonus')}>
|
||||
<Seg value={onOff(o.backdoCaptureBonus)} options={[['on', '한 번 더 던지기'], ['off', '더 안 던짐']]} onChange={(k) => set({ backdoCaptureBonus: k === 'on' })} />
|
||||
@@ -1028,7 +1029,7 @@ function Options({ value: o, onChange }: OptionsProps<YutOptions>) {
|
||||
<Seg value={o.useOrder ?? 'free'} options={[['free', '원하는 순서로'], ['thrown', '던진 순서대로']]} onChange={(useOrder) => set({ useOrder })} />
|
||||
</Field>
|
||||
<Field label="날(완주) 판정" hint={hint('finishRule')}>
|
||||
<Seg value={o.finishRule} options={[['pass', '참먹이를 지나야 남'], ['reach', '참먹이에 도착하면 남']]} onChange={(finishRule) => set({ finishRule })} />
|
||||
<Seg value={o.finishRule} options={[['pass', '1번(출발)을 지나야 남'], ['reach', '1번(출발)에 도착하면 남']]} onChange={(finishRule) => set({ finishRule })} />
|
||||
</Field>
|
||||
</RuleGroup>
|
||||
<RuleGroup title="던지기">
|
||||
@@ -1118,16 +1119,19 @@ function MiniBoard() {
|
||||
<circle key={n} cx={x} cy={y} r={BIG.has(n) ? 6 : 4.2} fill="var(--surface)" stroke="var(--wood-line)" strokeWidth={0.7} />
|
||||
))}
|
||||
{[
|
||||
[0, '출발'],
|
||||
[5, '모'],
|
||||
[10, '뒷모'],
|
||||
[15, '찌모'],
|
||||
[0, '1'],
|
||||
[5, '2'],
|
||||
[10, '3'],
|
||||
[15, '4'],
|
||||
[22, '방'],
|
||||
].map(([n, t]) => (
|
||||
<text key={n} x={POS[n as number]![0]} y={POS[n as number]![1]} textAnchor="middle" dominantBaseline="central" fontSize={3.4} fontWeight={800} fill="var(--text)">
|
||||
<text key={n} x={POS[n as number]![0]} y={POS[n as number]![1] - (n === 0 ? 1.1 : 0)} textAnchor="middle" dominantBaseline="central" fontSize={n === 22 ? 3.4 : 4.4} fontWeight={800} fill="var(--text)">
|
||||
{t}
|
||||
</text>
|
||||
))}
|
||||
<text x={POS[0]![0]} y={POS[0]![1] + 2.6} textAnchor="middle" dominantBaseline="central" fontSize={2} fontWeight={800} fill="var(--text)">
|
||||
출발
|
||||
</text>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@@ -1201,7 +1205,7 @@ function Rules({ options }: { options?: YutOptions }) {
|
||||
<div className="stack">
|
||||
{o?.augmented && <AugRules o={o} />}
|
||||
<p>
|
||||
윷가락 네 개를 던져 나온 만큼 말을 움직여, <strong>내 말을 모두 먼저 판 밖으로 내보내면(날)</strong> 이겨요. 말은 오른쪽 아래 <strong>참먹이</strong>에서 출발해 시계 반대 방향으로 돌아요.
|
||||
윷가락 네 개를 던져 나온 만큼 말을 움직여, <strong>내 말을 모두 먼저 판 밖으로 내보내면(날)</strong> 이겨요. 말은 오른쪽 아래 <strong>1번(출발)</strong>에서 출발해 시계 반대 방향으로 2번 → 3번 → 4번 모서리를 돌아 1번으로 돌아와요.
|
||||
{o?.mode === 'team' ? ' 팀전은 청팀·홍팀이 번갈아 던지고, 팀 안에서는 자리 순서대로 돌아가요.' : ''}
|
||||
</p>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(96px, 1fr))', gap: 8 }}>
|
||||
@@ -1218,17 +1222,17 @@ function Rules({ options }: { options?: YutOptions }) {
|
||||
</p>
|
||||
<MiniBoard />
|
||||
<p>
|
||||
<strong>지름길</strong>: 모서리(모·뒷모)나 가운데 방에 <strong>멈췄다가</strong> 다음에 출발하면 안쪽 대각선으로 꺾어요. 지나가기만 하면 그대로 직진해요.{' '}
|
||||
<strong>지름길</strong>: 2번·3번 모서리나 가운데 방에 <strong>멈췄다가</strong> 다음에 출발하면 안쪽 대각선으로 꺾어요. 지나가기만 하면 그대로 직진해요.{' '}
|
||||
{o?.forkRule === 'choose'
|
||||
? '이 방은 갈 길을 고르는 규칙이라, 멈췄던 말을 움직일 때 지름길과 다른 길 중에서 골라요(방에서는 참먹이 쪽과 찌모 쪽).'
|
||||
: '방에서 출발하면 언제나 참먹이 쪽으로 가요.'}
|
||||
? '이 방은 갈 길을 고르는 규칙이라, 멈췄던 말을 움직일 때 지름길과 다른 길 중에서 골라요(방에서는 1번 쪽과 4번 쪽).'
|
||||
: '방에서 출발하면 언제나 1번(출발) 쪽으로 가요.'}
|
||||
</p>
|
||||
<p>
|
||||
<strong>업기</strong>: 내 말이 있는 자리에 멈추면 {o?.stacking === 'choose' ? '업어서 같이 움직일지, 따로 둘지 골라요(따로 둬도 잡힐 때는 함께 잡혀요)' : '함께 업혀서 같이 움직여요'}. <strong>잡기</strong>: 상대 말이 있는 자리에 멈추면 그 말들을 처음으로 돌려보내고 한 번 더 던져요
|
||||
{o && !o.backdoCaptureBonus ? '(빽도로 잡을 때는 빼고)' : ''}. 지나가기만 해서는 잡지 않아요.
|
||||
</p>
|
||||
<p>
|
||||
<strong>날</strong>: {o?.finishRule === 'reach' ? '한 바퀴 돈 말이 참먹이에 도착하면 바로 나요.' : '한 바퀴 돈 말이 참먹이를 지나가야 나요. 참먹이에 딱 멈추면 아직 판 위라서 잡힐 수 있어요.'}
|
||||
<strong>날</strong>: {o?.finishRule === 'reach' ? '한 바퀴 돈 말이 1번(출발)에 도착하면 바로 나요.' : '한 바퀴 돈 말이 1번(출발)을 지나가야 나요. 1번에 딱 멈추면 아직 판 위라서 잡힐 수 있어요.'}
|
||||
</p>
|
||||
{o?.backdo !== false && (
|
||||
<p>
|
||||
@@ -1236,9 +1240,9 @@ function Rules({ options }: { options?: YutOptions }) {
|
||||
{o?.backdoNoPiece === 'rethrow'
|
||||
? '판 위에 내 말이 없을 때 나온 빽도는 없던 걸로 하고 다시 던져요.'
|
||||
: o?.backdoNoPiece === 'enter'
|
||||
? '판 위에 내 말이 없을 때 빽도가 나오면 새 말이 참먹이 한 칸 뒤(날윷)에 올라가요.'
|
||||
? '판 위에 내 말이 없을 때 빽도가 나오면 새 말이 1번(출발) 바로 앞 칸(4번 다음 4칸)에 올라가요.'
|
||||
: '판 위에 말이 없으면 빽도는 버려져요.'}{' '}
|
||||
{o?.backdoFromDo === 'finish' ? '도 자리에 있는 말이 빽도를 받으면 바로 나요.' : '도 자리에 있는 말이 빽도를 받으면 참먹이로 가고, 다음 전진에서 바로 나요.'}
|
||||
{o?.backdoFromDo === 'finish' ? '도 자리에 있는 말이 빽도를 받으면 바로 나요.' : '도 자리에 있는 말이 빽도를 받으면 1번(출발)으로 가고, 다음 전진에서 바로 나요.'}
|
||||
</p>
|
||||
)}
|
||||
{!!o?.nakPercent && (
|
||||
|
||||
@@ -121,8 +121,8 @@ export const quickStart: QuickCard[] = [
|
||||
<Label n={22} text="방" dy={-7} />
|
||||
</Board>
|
||||
),
|
||||
alt: '오른쪽 위 모서리에서 가운데 방을 지나 출발점으로 가는 지름길',
|
||||
alt: '오른쪽 위 2번 모서리에서 가운데 방을 지나 1번(출발)으로 가는 지름길',
|
||||
title: '지름길로 빨리 나가요',
|
||||
text: '모서리나 가운데 방에 멈췄다가 출발하면 안쪽 지름길로 가요. 내 말을 모두 먼저 판 밖으로 내보내면 이겨요.',
|
||||
text: '2번·3번 모서리나 가운데 방에 멈췄다가 출발하면 안쪽 지름길로 가요. 내 말을 모두 먼저 판 밖으로 내보내면 이겨요.',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
- 첫 선택은 범용 + 시작 전용, 마지막은 범용 + 마무리 전용, 그 사이는 범용 + 중간 전용. `augOff`에 든 증강은 나오지 않는다.
|
||||
- 혼돈 모드(`augChaos`): 한 번에 두 번 고른다(두 번째는 새 후보).
|
||||
- 모두 고르면 공개되고, 차례 순서대로 효과가 난다. 명탐정이 먼저 적용된다.
|
||||
- 이의있음!: 고르면 새 후보(이의있음 제외)로 바로 다시 고른다. 가진 증강으로 남지 않는다.
|
||||
- 이의있음!: 고른 것은 다른 것처럼 비밀이고, 혼돈 모드라도 그 사람의 선택은 거기서 끝난다. 모두 고르면 공개 대신 화면 전체에 "이의있음!"이 크게 뜨고(누가 냈는지 함께), 이번에 모두가 고른 증강은 하나도 받지 않은 채 살아 있는 모두가 새 후보로 같은 선택을 처음부터 다시 한다. 다시 고를 때는 이의있음!이 후보에 없어서 한 선택에 한 번만 일어난다. 배달로 주문해 둔 증강은 다시 고를 때도 후보에 나온다. 가진 증강으로 남지 않는다.
|
||||
- 고를 것이 없으면(후보 0개) 그 사람은 건너뛴다. 시간 제한은 max(30초, 행동 시간×2), 넘기면 첫 후보(이의있음 제외, 대상은 첫 항목).
|
||||
- **질문(prompt)**: 효과에 선택이 필요한 증강(거머리·접기·돌림판·착각·계획·승부·손버릇은 주인, 나 누구게?는 다른 모두, 내려는 모두)은 공개 직후 차례로 묻는다. 시간 초과는 첫 선택지.
|
||||
- **순위**: 말을 모두 내거나 특수 승리 조건을 이루면 그 즉시 비어 있는 가장 높은 순위(공동 순위는 같은 숫자, 다음은 +1)를 받고 빠진다. 탈락하면 판 위 말이 빠지고 꼴찌 쪽(늦게 탈락할수록 위). `ranking=first`면 첫 승자가 나오면 끝(동메달은 '승자'가 아님), `all`이면 한 명 남을 때까지. 끝날 때 남은 사람은 난 말 수·남은 거리로 순위를 매긴다.
|
||||
@@ -82,7 +82,7 @@
|
||||
| `illusion` | 언제부터 착각한 거지? | 즉시 | 다른 사람의 증강 하나를 3라운드 동안 고양이로 바꿔요. | 이미 다 쓴 증강은 고를 수 없어요. |
|
||||
| `throwyut` | 윷을 잘 던져봐 | 사용·1회 | 윷을 던져 한 사람을 맞혀요. 맞은 사람은 차례를 두 번 건너뛰어요. | |
|
||||
| `dual` | 이도류 | 규칙 | 윷가락을 2개씩 두 번 던져서 결과를 두 개 받아요. 모(둘 다 등)는 도로 바뀌어요. | 도·개·빽도만 나와서 한 번 더 던지는 일은 없어요. |
|
||||
| `objection` | 이의있음! | 즉시 | 이번 증강 선택을 없던 걸로 하고 새 후보 중에서 다시 골라요. | |
|
||||
| `objection` | 이의있음! | 즉시 | 이번 증강 선택을 없던 걸로 해요. 모두 고르고 나면 모두가 고른 증강이 사라지고, 모두 새 후보 중에서 다시 골라요. | 다시 고를 때는 이의있음!이 나오지 않아요. |
|
||||
| `jajinmori` | 자진모리 장단 | 규칙 | 걸이 두 번 나올 때마다 개를 하나 더 받아요. | |
|
||||
| `moonwalk` | 천마군림보 - 달걸음 | 규칙 | 내 말은 모두 반대 방향(시계 방향)으로 돌아요. | 참먹이에서 날윷 쪽으로 출발하고, 찌모·뒷모·방에 멈추면 지름길로 꺾어요. |
|
||||
| `shield` | 천상의 보호막 | 사용·1회 | 내 말뭉치 하나에 보호막을 씌워요. 보호막은 잡힐 때 한 번 막아 줘요. | 막아 낸 말은 그 자리에 그대로 남아요. |
|
||||
|
||||
@@ -77,6 +77,10 @@
|
||||
| 28 | 안찌 | | | | | | |
|
||||
|
||||
배치(말은 반시계 방향으로 돈다): 참먹이(0)는 오른쪽 아래 모서리, 모(5) 오른쪽 위, 뒷모(10) 왼쪽 위, 찌모(15) 왼쪽 아래.
|
||||
|
||||
**화면 표기(2026-11-08)**: 전통 명칭이 어렵다는 요청으로 화면·기록·설명에는 숫자를 쓴다(`board.ts`의 `NODE_NAMES`).
|
||||
모서리는 가는 순서대로 1번(출발·참먹이 0) → 2번(모 5) → 3번(뒷모 10) → 4번(찌모 15)이고, 판에는 큰 숫자(1번 칸에는 작은 "출발")와 가운데 "방"만 적는다.
|
||||
바깥 칸은 `N번 다음 k칸`(1~4: 1번 다음, 6~9: 2번 다음, 11~14: 3번 다음, 16~19: 4번 다음), 대각선 칸은 그 모서리에서 방 쪽으로 센 `N번 지름길 k칸`(20·21: 2번, 25·26: 3번, 24·23: 4번, 28·27: 1번)이다.
|
||||
- 대각선 1 (모 → 찌모): 5 → 20 → 21 → 22(방) → 23 → 24 → 15
|
||||
- 대각선 2 (뒷모 → 참먹이): 10 → 25 → 26 → 22(방) → 27 → 28 → 0
|
||||
|
||||
|
||||
@@ -1747,6 +1747,53 @@ const PLANS: Record<string, Plan> = {
|
||||
seen.add('objs');
|
||||
await host.locator('.yut-board').screenshot({ path: join(SHOTS, 'yut-aug-objs-board.png') });
|
||||
}
|
||||
// 증강 칩 설명은 브라우저 title 대신 팝업 카드: PC는 마우스를 올리면, 휴대폰은 칩을 누르면 뜬다(남의 증강도)
|
||||
if (!seen.has('chip-pop') && !(await host.getByRole('dialog').count()) && (await host.locator('.aug-chip').count()) >= 2) {
|
||||
seen.add('chip-pop');
|
||||
const pop = (p: Page) => p.locator('.aug-pop[role="tooltip"]');
|
||||
for (const p of [host, guest]) {
|
||||
const chips = p.locator('.aug-chip');
|
||||
if ((await chips.count()) < 2) throw new Error('augment chips missing');
|
||||
for (const i of [0, 1]) {
|
||||
const chip = chips.nth(i);
|
||||
if (await chip.getAttribute('title')) throw new Error('augment chip still uses a title tooltip');
|
||||
if (p === host) await chip.hover();
|
||||
else await chip.tap();
|
||||
await pop(p).waitFor({ timeout: 3000 });
|
||||
const name = await pop(p).getByRole('heading').innerText();
|
||||
if (!(await chip.getAttribute('aria-label'))?.startsWith(name)) throw new Error(`popup shows ${name}, not the chip's augment`);
|
||||
if ((await pop(p).count()) !== 1) throw new Error('more than one augment popup');
|
||||
if ((await chip.getAttribute('aria-describedby')) !== (await pop(p).getAttribute('id'))) throw new Error('popup not linked to chip');
|
||||
const box = (await pop(p).boundingBox())!;
|
||||
const vp = p.viewportSize()!;
|
||||
if (box.x < 0 || box.y < 0 || box.x + box.width > vp.width || box.y + box.height > vp.height) throw new Error(`augment popup off screen ${JSON.stringify(box)}`);
|
||||
if (i === 0) {
|
||||
await p.waitForTimeout(250);
|
||||
await p.screenshot({ path: join(SHOTS, `yut-aug-chip-pop-${tag(p)}.png`) });
|
||||
}
|
||||
}
|
||||
if (p === host) await p.mouse.move(2, 2);
|
||||
else await p.locator('.aug-bar').first().tap();
|
||||
await pop(p).waitFor({ state: 'detached', timeout: 3000 });
|
||||
}
|
||||
// a short landscape window (844×390): every chip's card stays fully on screen, whichever side it opens on
|
||||
const vp0 = host.viewportSize()!;
|
||||
await host.setViewportSize({ width: 844, height: 390 });
|
||||
const chips = host.locator('.aug-chip');
|
||||
for (let i = 0; i < (await chips.count()); i++) {
|
||||
for (const block of ['start', 'center', 'end'] as const) {
|
||||
await chips.nth(i).evaluate((el, b) => el.scrollIntoView({ block: b }), block);
|
||||
await host.mouse.move(2, 2);
|
||||
await chips.nth(i).hover();
|
||||
await pop(host).waitFor({ timeout: 3000 });
|
||||
const box = (await pop(host).boundingBox())!;
|
||||
if (box.y < 0 || box.y + box.height > 390 || box.x < 0 || box.x + box.width > 844) throw new Error(`augment popup off a 844×390 screen ${JSON.stringify(box)}`);
|
||||
}
|
||||
}
|
||||
await host.mouse.move(2, 2);
|
||||
await host.setViewportSize(vp0);
|
||||
console.log(' yut-aug: chip popups ok (hover on PC, tap on phone, 844×390)');
|
||||
}
|
||||
if (steps === 30 || steps === 120 || steps === 200) {
|
||||
await host.screenshot({ path: join(SHOTS, `yut-aug-mid${steps}-pc.png`) });
|
||||
await guest.screenshot({ path: join(SHOTS, `yut-aug-mid${steps}-phone.png`), fullPage: true });
|
||||
|
||||
@@ -107,15 +107,74 @@ describe('증강 윷놀이: options and selection', () => {
|
||||
expect(yut.view(t, 'A').aug!.sides[1]!.augs[0]!.voided).toBe(true);
|
||||
});
|
||||
|
||||
test('이의있음! rerolls the offers and is not kept', () => {
|
||||
const s = yut.setup({ players: ['A', 'B'], options: yut.optionsSchema.parse({ augmented: true }), rng: SeededRng.fromSeed(seedN(2)), now: 0 });
|
||||
s.aug!.select!.offers['0'] = ['objection', 'cat', 'fog'];
|
||||
const t = act(s, 'A', { type: 'AUG_PICK', aug: 'objection' });
|
||||
const offers = t.aug!.select!.offers['0']!;
|
||||
expect(offers).toHaveLength(3);
|
||||
expect(offers).not.toContain('objection');
|
||||
expect(offers).not.toContain('cat');
|
||||
expect(t.aug!.select!.left['0']).toBe(1);
|
||||
test('이의있음!: kept secret until everyone has picked, then every pick is called off and everyone picks again', () => {
|
||||
const s = yut.setup({ players: ['A', 'B', 'C'], options: yut.optionsSchema.parse({ augmented: true }), rng: SeededRng.fromSeed(seedN(2)), now: 0 });
|
||||
s.aug!.select!.offers = { '0': ['objection', 'cat', 'fog'], '1': ['shield', 'cat', 'fog'], '2': ['tiger', 'cat', 'fog'] };
|
||||
let t = act(s, 'A', { type: 'AUG_PICK', aug: 'objection' });
|
||||
t = act(t, 'B', { type: 'AUG_PICK', aug: 'shield' });
|
||||
// not revealed yet: no log line / popup, A just waits like anyone who picked
|
||||
expect(JSON.stringify(t.log)).not.toContain('이의');
|
||||
expect(t.aug!.fx.some((f) => f.kind === 'objection')).toBe(false);
|
||||
expect(yut.view(t, 'C').aug!.select!.waiting).toEqual([2]);
|
||||
expect(yut.view(t, 'A').aug!.select!.offers).toEqual([]);
|
||||
t = act(t, 'C', { type: 'AUG_PICK', aug: 'tiger' });
|
||||
// everyone picked → 이의있음!: nobody gets anything, the same selection starts over for all
|
||||
expect(t.phase).toBe('aug');
|
||||
expect(t.aug!.sides.every((x) => x.augs.length === 0)).toBe(true);
|
||||
const sel = t.aug!.select!;
|
||||
expect(sel.no).toBe(s.aug!.select!.no);
|
||||
expect(sel.picks).toEqual([]);
|
||||
expect(sel.left).toEqual({ '0': 1, '1': 1, '2': 1 });
|
||||
for (const k of ['0', '1', '2']) {
|
||||
expect(sel.offers[k]).toHaveLength(3);
|
||||
expect(sel.offers[k]).not.toContain('objection');
|
||||
}
|
||||
const fx = t.aug!.fx.filter((f) => f.kind === 'objection');
|
||||
expect(fx).toHaveLength(1);
|
||||
expect(fx[0]).toMatchObject({ side: 0, aug: 'objection' });
|
||||
expect(fx[0]!.text).toContain('빨강');
|
||||
expect(yut.view(t, 'B').aug!.fx.some((f) => f.kind === 'objection')).toBe(true);
|
||||
// the second round of picks counts normally
|
||||
const pick = (st: YutState, who: string, k: string) => act(st, who, { type: 'AUG_PICK', aug: st.aug!.select!.offers[k]!.find((x) => x !== 'detective' && x !== 'delivery' && x !== 'cat')! });
|
||||
t = pick(pick(pick(t, 'A', '0'), 'B', '1'), 'C', '2');
|
||||
expect(t.aug!.select).toBeNull();
|
||||
expect(t.aug!.sides.map((x) => x.augs.length)).toEqual([1, 1, 1]);
|
||||
expect(t.aug!.sides.some((x) => x.augs.some((o) => o.id === 'objection'))).toBe(false);
|
||||
});
|
||||
|
||||
test('이의있음! in 혼돈 mode ends that person\'s picking; a 배달 order is offered again in the redo', () => {
|
||||
const s = yut.setup({ players: ['A', 'B'], options: yut.optionsSchema.parse({ augmented: true, augChaos: true }), rng: SeededRng.fromSeed(seedN(2)), now: 0 });
|
||||
const sel = s.aug!.select!;
|
||||
sel.offers = { '0': ['objection', 'cat', 'fog'], '1': ['shield', 'cat', 'fog'] };
|
||||
sel.ordered = { '1': ['shield'] };
|
||||
let t = act(s, 'A', { type: 'AUG_PICK', aug: 'objection' });
|
||||
expect(t.aug!.select!.left['0']).toBe(0);
|
||||
t = act(t, 'B', { type: 'AUG_PICK', aug: 'shield' });
|
||||
t = act(t, 'B', { type: 'AUG_PICK', aug: t.aug!.select!.offers['1']![0]! });
|
||||
expect(t.aug!.select!.left).toEqual({ '0': 2, '1': 2 });
|
||||
expect(t.aug!.select!.offers['1']).toContain('shield');
|
||||
expect(t.aug!.delivery['1']).toEqual([]);
|
||||
});
|
||||
|
||||
test('이의있음! happens once per selection: the redo never offers it, 혼돈 mode\'s second offers included', () => {
|
||||
const on: AugId[] = ['cat', 'shield', 'objection'];
|
||||
const augOff = AUG_IDS.filter((id) => !on.includes(id));
|
||||
const s = yut.setup({ players: ['A', 'B'], options: yut.optionsSchema.parse({ augmented: true, augChaos: true, augOff }), rng: SeededRng.fromSeed(seedN(2)), now: 0 });
|
||||
s.aug!.select!.offers = { '0': ['objection', 'cat', 'shield'], '1': ['cat', 'shield'] };
|
||||
let t = act(s, 'A', { type: 'AUG_PICK', aug: 'objection' });
|
||||
t = act(t, 'B', { type: 'AUG_PICK', aug: 'cat' });
|
||||
t = act(t, 'B', { type: 'AUG_PICK', aug: t.aug!.select!.offers['1']![0]! });
|
||||
expect(t.aug!.select!.redo).toBe(true);
|
||||
for (const who of ['A', 'B']) {
|
||||
const key = who === 'A' ? '0' : '1';
|
||||
expect(t.aug!.select!.offers[key]).not.toContain('objection');
|
||||
t = act(t, who, { type: 'AUG_PICK', aug: t.aug!.select!.offers[key]![0]! });
|
||||
expect(t.aug!.select!.offers[key]).not.toContain('objection');
|
||||
t = act(t, who, { type: 'AUG_PICK', aug: t.aug!.select!.offers[key]![0]! });
|
||||
}
|
||||
expect(t.aug!.select).toBeNull();
|
||||
expect(t.log.filter((e) => e.type === 'augEffect' && (e as { aug?: string }).aug === 'objection')).toHaveLength(1);
|
||||
expect(t.aug!.sides.map((x) => x.augs.map((o) => o.id).sort())).toEqual([['cat', 'shield'], ['cat', 'shield']]);
|
||||
});
|
||||
|
||||
test('간택: a 고양이 among the offers must be taken', () => {
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
MIRROR_LR,
|
||||
MIRROR_TB,
|
||||
NEIGHBOURS,
|
||||
NODE_NAMES,
|
||||
NODE_POS,
|
||||
ROTATE_CW,
|
||||
STRAIGHT_LINES,
|
||||
@@ -131,12 +132,16 @@ export interface AugSelect {
|
||||
offers: Record<string, AugId[]>;
|
||||
left: Record<string, number>;
|
||||
picks: { side: SideId; id: AugId; target?: AugId }[];
|
||||
/** 배달 orders this selection was made with, so an 이의있음! redo offers them again. */
|
||||
ordered?: Record<string, AugId[]>;
|
||||
/** This is the 이의있음! redo: 이의있음! is never offered again (혼돈 mode's second offers included). */
|
||||
redo?: boolean;
|
||||
}
|
||||
|
||||
/** Something the screen should show once (popup / animation); `no` increases. */
|
||||
export interface AugFx {
|
||||
no: number;
|
||||
kind: 'win' | 'out' | 'effect' | 'flick' | 'pick' | 'bronze';
|
||||
kind: 'win' | 'out' | 'effect' | 'flick' | 'pick' | 'bronze' | 'objection';
|
||||
side: SideId;
|
||||
aug?: AugId;
|
||||
text: string;
|
||||
@@ -1287,6 +1292,8 @@ function openSelection(s: YutState, ctx: Ctx): void {
|
||||
const a = A(s);
|
||||
const tier = selectionTier(a.selNo, a.rounds.length);
|
||||
const sel: AugSelect = { no: a.selNo + 1, tier, offers: {}, left: {}, picks: [] };
|
||||
const ordered = Object.entries(a.delivery).filter(([, ids]) => ids.length);
|
||||
if (ordered.length) sel.ordered = Object.fromEntries(ordered.map(([k, ids]) => [k, [...ids]]));
|
||||
for (const x of liveSides(s)) {
|
||||
const offers = genOffers(s, x.id, tier, ctx.rng, []);
|
||||
if (!offers.length) continue;
|
||||
@@ -1336,13 +1343,15 @@ function applyPick(s: YutState, ctx: Ctx, side: SideId, act: AugPick): void {
|
||||
const sel = a.select!;
|
||||
const key = String(side);
|
||||
if (act.aug === 'objection') {
|
||||
log(s, ctx, { type: 'augEffect', side, aug: 'objection', text: `${nm(side)}: 이의있음! 다시 골라요` });
|
||||
sel.offers[key] = genOffers(s, side, sel.tier, ctx.rng, ['objection', ...sel.offers[key]!, ...sel.picks.filter((p) => p.side === side).map((p) => p.id)]);
|
||||
if (!sel.offers[key]!.length) sel.left[key] = 0;
|
||||
// kept secret like any pick; when everyone is done the whole selection is called off (resolveSelection)
|
||||
sel.picks.push({ side, id: 'objection' });
|
||||
sel.left[key] = 0;
|
||||
sel.offers[key] = [];
|
||||
} else {
|
||||
sel.picks.push({ side, id: act.aug, ...(act.target ? { target: act.target } : {}) });
|
||||
sel.left[key]! -= 1;
|
||||
sel.offers[key] = sel.left[key]! > 0 ? genOffers(s, side, sel.tier, ctx.rng, sel.picks.filter((p) => p.side === side).map((p) => p.id)) : [];
|
||||
const mine = sel.picks.filter((p) => p.side === side).map((p) => p.id);
|
||||
sel.offers[key] = sel.left[key]! > 0 ? genOffers(s, side, sel.tier, ctx.rng, sel.redo ? ['objection', ...mine] : mine) : [];
|
||||
if (!sel.offers[key]!.length) sel.left[key] = 0;
|
||||
}
|
||||
if (Object.values(sel.left).every((n) => n <= 0)) resolveSelection(s, ctx);
|
||||
@@ -1352,10 +1361,12 @@ function resolveSelection(s: YutState, ctx: Ctx): void {
|
||||
const a = A(s);
|
||||
const sel = a.select!;
|
||||
a.select = null;
|
||||
const objectors = [...new Set(sel.picks.filter((p) => p.id === 'objection').map((p) => p.side))].filter((k) => sideActive(s.sides[k]!));
|
||||
if (objectors.length && redoSelection(s, ctx, sel, objectors)) return;
|
||||
const voidIds = new Map<AugId, SideId>();
|
||||
for (const p of sel.picks) if (p.id === 'detective' && p.target) voidIds.set(p.target, p.side);
|
||||
const n = s.sides.length;
|
||||
const order = [...sel.picks].sort((p, q) => ((p.side - s.turnSide + n) % n) - ((q.side - s.turnSide + n) % n));
|
||||
const order = sel.picks.filter((p) => p.id !== 'objection').sort((p, q) => ((p.side - s.turnSide + n) % n) - ((q.side - s.turnSide + n) % n));
|
||||
for (const p of order) {
|
||||
const by = voidIds.get(p.id);
|
||||
if (by !== undefined && by !== p.side) {
|
||||
@@ -1373,6 +1384,32 @@ function resolveSelection(s: YutState, ctx: Ctx): void {
|
||||
afterInterlude(s, ctx);
|
||||
}
|
||||
|
||||
/**
|
||||
* 이의있음!: nobody gets what they picked in this selection; every live side picks again from new offers
|
||||
* (이의있음! is not offered again, so it happens at most once per selection). False when nobody has anything to pick.
|
||||
*/
|
||||
function redoSelection(s: YutState, ctx: Ctx, sel: AugSelect, objectors: SideId[]): boolean {
|
||||
const a = A(s);
|
||||
const who = objectors.map((k) => nm(k)).join(', ');
|
||||
const text = `${josa(who, '이/가')} 이의를 제기했어요. 이번에 고른 증강을 모두 없애고 다시 골라요`;
|
||||
log(s, ctx, { type: 'augEffect', side: objectors[0]!, aug: 'objection', text: `이의있음! ${text}` });
|
||||
addFx(s, { kind: 'objection', side: objectors[0]!, aug: 'objection', text });
|
||||
const next: AugSelect = { no: sel.no, tier: sel.tier, offers: {}, left: {}, picks: [], redo: true, ...(sel.ordered ? { ordered: sel.ordered } : {}) };
|
||||
for (const x of liveSides(s)) {
|
||||
const key = String(x.id);
|
||||
a.delivery[key] = [...(sel.ordered?.[key] ?? [])];
|
||||
const offers = genOffers(s, x.id, sel.tier, ctx.rng, ['objection']);
|
||||
a.delivery[key] = [];
|
||||
if (!offers.length) continue;
|
||||
next.offers[key] = offers;
|
||||
next.left[key] = s.options.augChaos ? 2 : 1;
|
||||
}
|
||||
if (!Object.keys(next.offers).length) return false;
|
||||
a.select = next;
|
||||
s.phase = 'aug';
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Random empty node (no pieces, no objects), never 참먹이. */
|
||||
function randomEmptyNode(s: YutState, rng: Rng, avoid: NodeId[] = []): NodeId | null {
|
||||
const a = A(s);
|
||||
@@ -1503,7 +1540,7 @@ function acquire(s: YutState, ctx: Ctx, side: SideId, id: AugId, target?: AugId)
|
||||
}
|
||||
owned.n = 0;
|
||||
as.queenLives = 1;
|
||||
say('중전마마가 뒷모에 섰어요. 12번 던질 때까지 지켜 주세요');
|
||||
say('중전마마가 3번(왼쪽 위)에 섰어요. 12번 던질 때까지 지켜 주세요');
|
||||
break;
|
||||
}
|
||||
case 'bear':
|
||||
@@ -2318,8 +2355,7 @@ function pieceLabel(s: YutState, side: SideId, ps: Piece[]): string {
|
||||
return `${where} ${kind}${ps.length > 1 ? ` ${ps.length}개` : ''}`;
|
||||
}
|
||||
const THROW_NAME: Record<Throw, string> = { backdo: '빽도', do: '도', gae: '개', geol: '걸', yut: '윷', mo: '모' };
|
||||
const NODE_KO = ['참먹이', '도', '개', '걸', '윷', '모', '뒷도', '뒷개', '뒷걸', '뒷윷', '뒷모', '찌도', '찌개', '찌걸', '찌윷', '찌모', '날도', '날개', '날걸', '날윷', '앞모도', '앞모개', '방', '속윷', '속모', '뒷모도', '뒷모개', '사려', '안찌'];
|
||||
const nodeKo = (n: NodeId) => NODE_KO[n] ?? String(n);
|
||||
const nodeKo = (n: NodeId) => NODE_NAMES[n] ?? String(n);
|
||||
|
||||
/**
|
||||
* 8톤 트럭 route: the first step leaves like a normal move (shortcut at a fork), then it keeps going while the road is
|
||||
|
||||
@@ -49,7 +49,7 @@ export type AugId = (typeof AUG_IDS)[number];
|
||||
|
||||
const L: Omit<AugInfo, 'id'>[] = [
|
||||
// ---------------------------------------------------------------- 범용
|
||||
{ name: '8톤 트럭', tier: 'any', kind: 'active', once: true, wholeTurn: true, text: '말이 2개 이상 업힌 내 말뭉치 하나가 꺾이는 곳까지 앞으로 쭉 달려요. 지나가는 길의 다른 편 말은 모두 잡아요.', note: '차례를 다 써요(던지기 전에만). 모서리·방에 서 있었다면 지름길로 출발하고, 모서리·참먹이에 닿으면 멈춰요.' },
|
||||
{ name: '8톤 트럭', tier: 'any', kind: 'active', once: true, wholeTurn: true, text: '말이 2개 이상 업힌 내 말뭉치 하나가 꺾이는 곳까지 앞으로 쭉 달려요. 지나가는 길의 다른 편 말은 모두 잡아요.', note: '차례를 다 써요(던지기 전에만). 2번·3번 모서리나 방에 서 있었다면 지름길로 출발하고, 모서리(1~4번)에 닿으면 멈춰요.' },
|
||||
{ name: '3단 합체 필살기!!!', tier: 'any', kind: 'active', once: true, wholeTurn: true, text: '말이 3개 이상 업힌 내 말뭉치를 골라요. 그 말뭉치를 뺀 판 위의 모든 말뭉치를 잡아요(내 다른 말도요).', note: '차례를 다 써요(던지기 전에만).' },
|
||||
{ name: '간택', tier: 'any', kind: 'passive', text: '이제 모든 사람은 증강 후보에 고양이가 나오면 꼭 고양이를 골라야 해요.' },
|
||||
{ name: '게임 접어라', tier: 'any', kind: 'instant', text: '윷판을 반으로 접어요. 접는 방향을 고르면, 접히는 쪽 말이 반대쪽 같은 자리로 옮겨져요.', note: '옮겨진 말이 다른 편 말 위에 떨어지면 그 말을 잡아요. 내 말끼리는 업혀요.' },
|
||||
@@ -69,7 +69,7 @@ const L: Omit<AugInfo, 'id'>[] = [
|
||||
{ name: '배달', tier: 'any', kind: 'instant', text: '증강 하나를 주문해요. 다음 증강 선택 때 그 증강이 내 후보에 꼭 나와요.' },
|
||||
{ name: '변환: 도깨비', tier: 'any', kind: 'active', once: true, text: '내 일반 말 하나를 도깨비로 바꿔요. 도깨비는 내 차례마다 한 번, 던지지 않고 앞이나 뒤로 1칸 갈 수 있어요.' },
|
||||
{ name: '변환: 선봉장', tier: 'any', kind: 'active', once: true, text: '내 일반 말 하나를 선봉장으로 바꿔요. 선봉장이 판 위에 있는 동안 내 말은 앞으로 갈 때마다 1칸 더 가요.' },
|
||||
{ name: '변환: 포', tier: 'any', kind: 'active', once: true, text: '내 판 위 일반 말 하나를 포로 바꿔요. 포는 내 차례마다 한 번, 말이 있는 칸 하나를 넘어 한 줄로 원하는 만큼 갈 수 있어요.', note: '넘은 뒤 처음 만나는 말이 다른 편이면 잡을 수 있어요. 참먹이에는 내려앉지 못해요.' },
|
||||
{ name: '변환: 포', tier: 'any', kind: 'active', once: true, text: '내 판 위 일반 말 하나를 포로 바꿔요. 포는 내 차례마다 한 번, 말이 있는 칸 하나를 넘어 한 줄로 원하는 만큼 갈 수 있어요.', note: '넘은 뒤 처음 만나는 말이 다른 편이면 잡을 수 있어요. 1번(출발)에는 내려앉지 못해요.' },
|
||||
{ name: '변환: 폰', tier: 'any', kind: 'active', once: true, text: '내 일반 말 하나를 폰으로 바꿔요. 폰은 직접 움직일 수 없지만 내가 던질 때마다 1칸씩 앞으로 가요.' },
|
||||
{ name: '사목', tier: 'any', kind: 'win', win: true, text: '내 말이 한 줄로 이어진 네 칸을 차지하거나, 내 말 4개가 한 말뭉치가 되면 이겨요.' },
|
||||
{ name: '소 뒷걸음질', tier: 'any', kind: 'win', win: true, text: '빽도로 말을 두 번 잡으면 이겨요.' },
|
||||
@@ -83,9 +83,9 @@ const L: Omit<AugInfo, 'id'>[] = [
|
||||
{ name: '언제부터 착각한 거지?', tier: 'any', kind: 'instant', text: '다른 사람의 증강 하나를 3라운드 동안 고양이로 바꿔요.', note: '이미 다 쓴 증강은 고를 수 없어요.' },
|
||||
{ name: '윷을 잘 던져봐', tier: 'any', kind: 'active', once: true, text: '윷을 던져 한 사람을 맞혀요. 맞은 사람은 차례를 두 번 건너뛰어요.' },
|
||||
{ name: '이도류', tier: 'any', kind: 'passive', text: '윷가락을 2개씩 두 번 던져서 결과를 두 개 받아요. 모(둘 다 등)는 도로 바뀌어요.', note: '도·개·빽도만 나와서 한 번 더 던지는 일은 없어요.' },
|
||||
{ name: '이의있음!', tier: 'any', kind: 'instant', text: '이번 증강 선택을 없던 걸로 하고 새 후보 중에서 다시 골라요.' },
|
||||
{ name: '이의있음!', tier: 'any', kind: 'instant', text: '이번 증강 선택을 없던 걸로 해요. 모두 고르고 나면 모두가 고른 증강이 사라지고, 모두 새 후보 중에서 다시 골라요.', note: '다시 고를 때는 이의있음!이 나오지 않아요.' },
|
||||
{ name: '자진모리 장단', tier: 'any', kind: 'passive', text: '걸이 두 번 나올 때마다 개를 하나 더 받아요.' },
|
||||
{ name: '천마군림보 - 달걸음', tier: 'any', kind: 'passive', text: '내 말은 모두 반대 방향(시계 방향)으로 돌아요.', note: '참먹이에서 날윷 쪽으로 출발하고, 찌모·뒷모·방에 멈추면 지름길로 꺾어요.' },
|
||||
{ name: '천마군림보 - 달걸음', tier: 'any', kind: 'passive', text: '내 말은 모두 반대 방향(시계 방향)으로 돌아요.', note: '1번(출발)에서 4번 쪽으로 출발하고, 4번·3번 모서리나 방에 멈추면 지름길로 꺾어요.' },
|
||||
{ name: '천상의 보호막', tier: 'any', kind: 'active', once: true, text: '내 말뭉치 하나에 보호막을 씌워요. 보호막은 잡힐 때 한 번 막아 줘요.', note: '막아 낸 말은 그 자리에 그대로 남아요.' },
|
||||
{ name: '크고 빨간 버튼', tier: 'any', kind: 'instant', text: '두 대각선 지름길(방 포함, 모서리 제외)에 있는 모든 말을 잡아요. 내 말도요.' },
|
||||
{ name: '프랜드 실드', tier: 'any', kind: 'passive', text: '내 말뭉치가 잡힐 때 말 1개만 잡히고 나머지는 남아요.' },
|
||||
@@ -96,7 +96,7 @@ const L: Omit<AugInfo, 'id'>[] = [
|
||||
{ name: '말이오? 파티', tier: 'start', kind: 'instant', text: '판에 함정 6개와 선물 4개를 깔아요. 딱 멈춘 말은 잡히거나 옮겨져요. 내가 깐 함정에는 걸리지 않아요.', note: '해골: 잡힘 · 마녀 모자: 뒤로 2칸 · 선물: 앞으로 2칸(누구나).' },
|
||||
{ name: '스겜', tier: 'start', kind: 'instant', text: '모든 사람의 말이 2개가 되고, 내 말은 도와 개 자리에서 시작해요.' },
|
||||
{ name: '시작 변환: 김첨지', tier: 'start', kind: 'instant', win: true, text: '내 말 하나가 김첨지가 돼요. 김첨지가 내 차례 6번 안에 나면 이겨요.', note: '6번이 지나면 보통 말처럼 움직여요.' },
|
||||
{ name: '시작 변환: 중전마마', tier: 'start', kind: 'instant', win: true, text: '내 말 하나가 중전마마가 되어 뒷모(왼쪽 위)에 서요. 내가 12번 던질 때까지 지키면 이기고, 목숨이 다 떨어지면 탈락해요.', note: '중전마마는 날 수 없어요. 목숨은 1개로 시작하고, 다른 말이 날 때마다 1개 늘어요. 잡히면 목숨을 잃고 대기로 돌아가요.' },
|
||||
{ name: '시작 변환: 중전마마', tier: 'start', kind: 'instant', win: true, text: '내 말 하나가 중전마마가 되어 3번 모서리(왼쪽 위)에 서요. 내가 12번 던질 때까지 지키면 이기고, 목숨이 다 떨어지면 탈락해요.', note: '중전마마는 날 수 없어요. 목숨은 1개로 시작하고, 다른 말이 날 때마다 1개 늘어요. 잡히면 목숨을 잃고 대기로 돌아가요.' },
|
||||
{ name: '웅녀', tier: 'start', kind: 'instant', win: true, text: '무작위 칸 3곳에 마늘이 놓여요. 내 말이 마늘 칸에 멈춰 3개를 모두 모으면 이겨요.' },
|
||||
{ name: '이리 오너라 업고 놀자', tier: 'start', kind: 'instant', text: '내 말을 모두 업은 채 도 자리에서 시작해요.' },
|
||||
{ name: '짐덩이와 복덩이', tier: 'start', kind: 'instant', text: '내 말 1개와 윷가락 1개를 더하고 시작해요.', note: '윷가락 5개로 던져요. 배가 4~5개면 윷이에요.' },
|
||||
@@ -133,7 +133,7 @@ const L: Omit<AugInfo, 'id'>[] = [
|
||||
{ name: '호랑이 기운', tier: 'any', kind: 'passive', custom: true, text: '걸이 나와도 윷·모처럼 한 번 더 던져요.' },
|
||||
{ name: '쌍둥이', tier: 'any', kind: 'active', once: true, custom: true, text: '대기 중인 내 말 하나를 판 위 내 말뭉치에 바로 업혀요.' },
|
||||
{ name: '자리 바꾸기', tier: 'any', kind: 'active', once: true, custom: true, text: '내 말뭉치 하나와 다른 사람 말뭉치 하나의 자리를 맞바꿔요.' },
|
||||
{ name: '회오리', tier: 'mid', kind: 'instant', custom: true, text: '판 위의 모든 말뭉치가 회오리에 휩쓸려 무작위 칸으로 흩어져요.', note: '참먹이에는 떨어지지 않고, 말뭉치끼리 겹치지 않아요.' },
|
||||
{ name: '회오리', tier: 'mid', kind: 'instant', custom: true, text: '판 위의 모든 말뭉치가 회오리에 휩쓸려 무작위 칸으로 흩어져요.', note: '1번(출발)에는 떨어지지 않고, 말뭉치끼리 겹치지 않아요.' },
|
||||
{ name: '다시 던지기', tier: 'any', kind: 'active', custom: true, text: '내 차례마다 한 번, 갖고 있는 윷 결과 하나를 버리고 다시 던져요.' },
|
||||
{ name: '곱빼기', tier: 'any', kind: 'active', once: true, custom: true, text: '갖고 있는 윷 결과 하나를 하나 더 받아요.' },
|
||||
{ name: '올인', tier: 'any', kind: 'active', once: true, custom: true, text: '반반 확률로 던지기 3번을 더 받거나, 모아 둔 결과를 모두 잃고 차례가 끝나요.' },
|
||||
@@ -142,17 +142,17 @@ const L: Omit<AugInfo, 'id'>[] = [
|
||||
{ name: '자석', tier: 'any', kind: 'active', once: true, custom: true, text: '내 말뭉치 하나를 골라요. 바로 옆 칸(선으로 이어진 칸)에 있는 다른 사람 말을 모두 끌어와 잡아요.' },
|
||||
{ name: '뒤로 돌아', tier: 'any', kind: 'active', once: true, custom: true, text: '다른 사람 말뭉치 하나를 뒤로 3칸 보내요.', note: '밀려난 칸에 다른 말이 있으면 마녀 모자 함정처럼 그 말을 잡아요.' },
|
||||
{ name: '꼴찌의 반란', tier: 'any', kind: 'passive', custom: true, text: '내 차례가 시작될 때 내가 혼자 꼴찌면 한 번 더 던져요.', note: '난 말이 가장 적고, 같으면 남은 거리가 가장 먼 사람이 꼴찌예요.' },
|
||||
{ name: '텃세', tier: 'any', kind: 'passive', custom: true, text: '참먹이로 들어가기 바로 전 칸들(날도~날윷, 사려·안찌)에 선 내 말은 잡히지 않아요.', note: '달걸음이 있으면 반대쪽(뒷도 쪽) 칸들이에요.' },
|
||||
{ name: '텃세', tier: 'any', kind: 'passive', custom: true, text: '1번(출발)으로 들어가기 바로 전 칸들(4번 다음 1~4칸, 1번 지름길 1·2칸)에 선 내 말은 잡히지 않아요.', note: '달걸음이 있으면 4번 다음 칸들 대신 반대쪽 1번 다음 1~4칸이에요.' },
|
||||
{ name: '따라쟁이', tier: 'any', kind: 'instant', custom: true, text: '다른 사람이 가진 증강 하나를 골라 똑같은 것을 하나 얻어요.', note: '즉시 효과 증강과 고양이는 따라 할 수 없어요.' },
|
||||
{ name: '청개구리', tier: 'any', kind: 'passive', custom: true, text: '내가 던져서 빽도가 나오면 모가 돼요. 대신 한 번 더 던지지는 않아요.' },
|
||||
{ name: '사냥꾼', tier: 'any', kind: 'passive', custom: true, text: '윷을 던져 말을 움직여 잡으면 한 번이 아니라 두 번 더 던져요.' },
|
||||
{ name: '줍줍', tier: 'any', kind: 'passive', custom: true, text: '앞으로 갈 때 지나가는 칸에 있는 내 말을 모두 주워 업고 가요.' },
|
||||
{ name: '도장 깨기', tier: 'any', kind: 'win', win: true, custom: true, text: '윷을 던져 움직인 내 말이 모·뒷모·찌모·방에 한 번씩 멈추면 이겨요.', note: '이 증강을 얻은 뒤부터 세요.' },
|
||||
{ name: '도장 깨기', tier: 'any', kind: 'win', win: true, custom: true, text: '윷을 던져 움직인 내 말이 2번·3번·4번 모서리와 방에 한 번씩 멈추면 이겨요.', note: '이 증강을 얻은 뒤부터 세요.' },
|
||||
{ name: '스타트 대시', tier: 'start', kind: 'instant', custom: true, text: '대기 중인 내 말 하나가 걸 자리에서 시작해요.' },
|
||||
{ name: '방공호', tier: 'start', kind: 'instant', custom: true, text: '내 말이 모두 보호막을 하나씩 두르고 시작해요.', note: '보호막은 잡힐 때 한 번 막아 줘요.' },
|
||||
{ name: '벼락', tier: 'mid', kind: 'instant', custom: true, text: '판 위 말뭉치 중 무작위 2개에 벼락이 떨어져 잡혀요. 내 말도 맞을 수 있어요.' },
|
||||
{ name: '블랙홀', tier: 'mid', kind: 'instant', custom: true, text: '방(판 가운데)이 블랙홀이 돼요. 방에 있던 말은 모두 빨려 들어가고, 이제 다른 사람 말이 방에 멈추면 잡혀요.' },
|
||||
{ name: '로켓 발사', tier: 'final', kind: 'active', once: true, custom: true, text: '내 말뭉치 하나(또는 대기 말 하나)를 참먹이 바로 앞 칸(날윷)으로 보내요.', note: '그 칸에 있던 다른 사람 말은 잡아요.' },
|
||||
{ name: '로켓 발사', tier: 'final', kind: 'active', once: true, custom: true, text: '내 말뭉치 하나(또는 대기 말 하나)를 1번(출발) 바로 앞 칸(4번 다음 4칸)으로 보내요.', note: '그 칸에 있던 다른 사람 말은 잡아요.' },
|
||||
{ name: '최후의 일격', tier: 'final', kind: 'instant', custom: true, text: '다른 사람 말뭉치 중 가장 앞선 것 하나를 잡아요.' },
|
||||
];
|
||||
|
||||
|
||||
@@ -12,10 +12,18 @@ export type Sticks = [boolean, boolean, boolean, boolean];
|
||||
export const NODE_COUNT = 29;
|
||||
export const GOAL = 'goal' as const;
|
||||
|
||||
/**
|
||||
* Screen names (2026-11-08: plain numbers instead of 참먹이·모·뒷모·찌모): the corners are 1번(출발) → 2번 → 3번 → 4번
|
||||
* in the moving direction, `N번 다음 k칸` is the k-th spot after corner N on the outer ring, `N번 지름길 k칸` the k-th
|
||||
* spot from corner N toward 방 on a diagonal.
|
||||
*/
|
||||
export const NODE_NAMES: readonly string[] = [
|
||||
'참먹이', '도', '개', '걸', '윷', '모', '뒷도', '뒷개', '뒷걸', '뒷윷',
|
||||
'뒷모', '찌도', '찌개', '찌걸', '찌윷', '찌모', '날도', '날개', '날걸', '날윷',
|
||||
'앞모도', '앞모개', '방', '속윷', '속모', '뒷모도', '뒷모개', '사려', '안찌',
|
||||
'1번(출발)', '1번 다음 1칸', '1번 다음 2칸', '1번 다음 3칸', '1번 다음 4칸',
|
||||
'2번', '2번 다음 1칸', '2번 다음 2칸', '2번 다음 3칸', '2번 다음 4칸',
|
||||
'3번', '3번 다음 1칸', '3번 다음 2칸', '3번 다음 3칸', '3번 다음 4칸',
|
||||
'4번', '4번 다음 1칸', '4번 다음 2칸', '4번 다음 3칸', '4번 다음 4칸',
|
||||
'2번 지름길 1칸', '2번 지름길 2칸', '방', '4번 지름길 2칸', '4번 지름길 1칸',
|
||||
'3번 지름길 1칸', '3번 지름길 2칸', '1번 지름길 2칸', '1번 지름길 1칸',
|
||||
];
|
||||
|
||||
export const THROW_STEPS: Record<Throw, number> = { do: 1, gae: 2, geol: 3, yut: 4, mo: 5, backdo: -1 };
|
||||
|
||||
@@ -52,11 +52,11 @@ export const yutOptionsSchema = z.object({
|
||||
backdoFromDo: z
|
||||
.enum(['chammeogi', 'finish'])
|
||||
.default('chammeogi')
|
||||
.meta({ title: '도 자리 말이 빽도를 받으면', labels: { chammeogi: '참먹이로 감(다음 전진에서 남)', finish: '바로 남' } }),
|
||||
.meta({ title: '도 자리 말이 빽도를 받으면', labels: { chammeogi: '1번(출발)으로 감(다음 전진에서 남)', finish: '바로 남' } }),
|
||||
finishRule: z
|
||||
.enum(['pass', 'reach'])
|
||||
.default('pass')
|
||||
.meta({ title: '날(완주) 판정', labels: { pass: '참먹이를 지나야 남', reach: '참먹이에 도착하면 남' } }),
|
||||
.meta({ title: '날(완주) 판정', labels: { pass: '1번(출발)을 지나야 남', reach: '1번(출발)에 도착하면 남' } }),
|
||||
nakPercent: z
|
||||
.union([z.literal(0), z.literal(3), z.literal(5), z.literal(10)])
|
||||
.default(0)
|
||||
@@ -72,7 +72,7 @@ export const yutOptionsSchema = z.object({
|
||||
.default('discard')
|
||||
.meta({
|
||||
title: '판에 내 말이 없을 때 빽도가 나오면',
|
||||
labels: { discard: '쓸 곳이 없어 버림', rethrow: '다시 던짐', enter: '새 말이 참먹이 뒤(날윷)로 감' },
|
||||
labels: { discard: '쓸 곳이 없어 버림', rethrow: '다시 던짐', enter: '새 말이 1번(출발) 바로 앞 칸으로 감' },
|
||||
}),
|
||||
nakRule: z
|
||||
.enum(['keep', 'lose'])
|
||||
@@ -89,7 +89,7 @@ export const yutOptionsSchema = z.object({
|
||||
forkRule: z
|
||||
.enum(['shortcut', 'choose'])
|
||||
.default('shortcut')
|
||||
.meta({ title: '모서리·방에 멈췄다가 출발할 때', labels: { shortcut: '늘 지름길(방에서는 참먹이 쪽)', choose: '갈 길을 고름' } }),
|
||||
.meta({ title: '모서리·방에 멈췄다가 출발할 때', labels: { shortcut: '늘 지름길(방에서는 1번 쪽)', choose: '갈 길을 고름' } }),
|
||||
turnSeconds: z
|
||||
.union([z.literal(15), z.literal(30), z.literal(60), z.literal(null)])
|
||||
.default(30)
|
||||
|
||||
Reference in New Issue
Block a user