사과 게임 무제한: 스톱워치(시작부터 더 지울 사과가 없거나 여기까지 할 때까지, 0.1초 단위)와 💡 힌트(합 10 묶음 하나를 나에게만 노란 점선 상자로), 결과창·순위·요약에 걸린 시간과 힌트 횟수
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2950,6 +2950,51 @@ const PLANS: Record<string, Plan> = {
|
||||
console.log(` apple: ${st.pc} mouse + ${st.key} keyboard clears on PC, ${st.phone}+ touch clears on the phone, ${st.miss} miss; final PC ${await appleScore(host)} / phone ${await appleScore(guest)}`);
|
||||
},
|
||||
},
|
||||
appleUnlimited: {
|
||||
// 2026-10-14: 무제한 — the stopwatch runs (tenths) and stops when I finish; 💡 힌트 shows a glowing box that adds up
|
||||
// to 10 (button off while it shows), using it clears the box; the result shows 걸린 시간 and 힌트 N번.
|
||||
game: 'apple',
|
||||
lobby: async (host) => {
|
||||
await host.getByRole('group', { name: '제한 시간' }).getByRole('button', { name: '무제한', exact: true }).click();
|
||||
await host.getByText(/제한 시간 무제한/).first().waitFor();
|
||||
},
|
||||
drive: async (pages) => {
|
||||
const [host, guest] = pages as [Page, Page];
|
||||
for (const p of pages) await p.waitForFunction(() => !document.querySelector('.ap-over.count') && document.querySelector('svg.ap-board > g[transform]'), null, { timeout: 10_000 });
|
||||
const watchText = () => host.locator('.ap-top .ap-pill').first().innerText();
|
||||
const w1 = await watchText();
|
||||
await host.waitForTimeout(1200);
|
||||
const w2 = await watchText();
|
||||
if (!/⏱\s*\d+:\d\d\.\d/.test(w2) || w1 === w2) throw new Error(`stopwatch not running: "${w1}" → "${w2}"`);
|
||||
const hintBtn = host.getByRole('button', { name: /^💡 힌트/ });
|
||||
await hintBtn.click();
|
||||
const box = host.locator('svg.ap-board rect[data-hint]');
|
||||
await box.waitFor({ timeout: 3000 });
|
||||
if (await hintBtn.isEnabled()) throw new Error('hint button should be off while a hint shows');
|
||||
if (await guest.locator('svg.ap-board rect[data-hint]').count()) throw new Error('the other player sees my hint');
|
||||
await host.screenshot({ path: join(SHOTS, 'apple-hint-pc.png') });
|
||||
const r = await box.evaluate((el) => ['x', 'y', 'width', 'height'].map((k) => Number(el.getAttribute(k))));
|
||||
const rect: [number, number, number, number] = [Math.floor(r[1]! / 40), Math.floor(r[0]! / 40), Math.floor((r[1]! + r[3]!) / 40), Math.floor((r[0]! + r[2]!) / 40)];
|
||||
const before = await appleScore(host);
|
||||
await appleDrag(host, rect, false);
|
||||
await host.waitForFunction((b) => Number(document.querySelector('.ap-top')?.textContent?.match(/🍎\s*(\d+)/)?.[1] ?? -1) > b, before, { timeout: 3000 });
|
||||
await box.waitFor({ state: 'detached', timeout: 3000 });
|
||||
await host.getByRole('button', { name: '💡 힌트 (1번 받음)' }).waitFor();
|
||||
// 여기까지 (two presses): my stopwatch stops.
|
||||
for (const p of pages) {
|
||||
await p.getByRole('button', { name: /^여기까지 할래요/ }).click();
|
||||
await p.getByRole('button', { name: '한 번 더 누르면 여기까지 해요' }).click();
|
||||
await host.waitForTimeout(300);
|
||||
}
|
||||
for (const p of pages) await p.getByRole('dialog', { name: '게임 결과' }).waitFor({ timeout: 10_000 });
|
||||
await host.waitForTimeout(600);
|
||||
await host.screenshot({ path: join(SHOTS, 'apple-unlimited-result-pc.png') });
|
||||
const text = await host.getByRole('dialog', { name: '게임 결과' }).innerText();
|
||||
if (!/사과 \d+개 · 걸린 시간 [\d분 .]+초 · 힌트 1번/.test(text)) throw new Error(`no time / hints in the result: ${text.replace(/\n/g, ' ')}`);
|
||||
if (!/사과 0개 · 걸린 시간 [\d분 .]+초(?! · 힌트)/.test(text)) throw new Error(`guest line: ${text.replace(/\n/g, ' ')}`);
|
||||
console.log(` apple 무제한: stopwatch ${w1} → ${w2}; result: ${text.replace(/\n/g, ' ').slice(0, 160)}`);
|
||||
},
|
||||
},
|
||||
clue: {
|
||||
// PC host + 2 phones, dice movement, 30-second turns. Real turns through the UI: roll (PC once by keyboard), a secret
|
||||
// passage, rooms picked on the map, suggestions from the chips, cards shown from the refute panel. Only the suggester
|
||||
|
||||
Reference in New Issue
Block a user