Show counted dice and clarify movement result confirmation
This commit is contained in:
parent
6787f767d6
commit
2db30cb8e4
3 changed files with 74 additions and 6 deletions
|
|
@ -568,7 +568,10 @@
|
|||
{#if !me.resolved}<button class="primary" onclick={() => store.dispatch({ action: "beginMovement" })}
|
||||
>Resolve my journey <span>→</span></button
|
||||
>{:else}<p class="confirmed">✓ Your journey is resolved.</p>{/if}
|
||||
{:else if s.activeResolution === seat && result}<div class="comparison">
|
||||
{:else if s.activeResolution === seat && result}{@const criterion = terrain(
|
||||
cell(s, me.path.at(-1)!).terrain
|
||||
).requirement}
|
||||
<div class="comparison">
|
||||
<span class="eyebrow">{result.success ? "YOU CAN MOVE" : "YOU MUST STAY"}</span><strong
|
||||
>{result.own}<small> vs </small>{Math.max(...result.peers.map((p) => p.total))}</strong
|
||||
>
|
||||
|
|
@ -577,12 +580,35 @@
|
|||
? `Lead of ${result.margin} · lose ${result.loss} stamina`
|
||||
: `Tie or lower · lose ${result.loss} stamina`}
|
||||
</p>
|
||||
{#each result.peers as peer}<div>
|
||||
<span>{peer.seat === -1 ? "Neutral dice" : s.players[peer.seat]!.name}</span><span>{peer.total}</span>
|
||||
</div>{/each}
|
||||
<span class="muted small">Dice matching {terrain(cell(s, me.path.at(-1)!).terrain).name}</span>
|
||||
{#each [{ seat: seat!, total: result.own }, ...result.peers] as peer}
|
||||
{@const counted = (peer.seat === -1 ? s.ghost : s.players[peer.seat]!.dice).filter(
|
||||
(d) => !d.aside && matches(face(d), criterion)
|
||||
)}
|
||||
<div class="comparison-player">
|
||||
<div class="comparison-name">
|
||||
<span
|
||||
>{peer.seat === seat
|
||||
? "You"
|
||||
: peer.seat === -1
|
||||
? "Neutral dice"
|
||||
: s.players[peer.seat]!.name}</span
|
||||
><strong>{peer.total}</strong>
|
||||
</div>
|
||||
<div class="comparison-dice">
|
||||
{#each counted as d}<Die die={d} colorblind={store.colorblind} disabled />{:else}<span
|
||||
>No matching dice</span
|
||||
>{/each}
|
||||
</div>
|
||||
{#if peer.seat === seat && me.bonus}<span>+{me.bonus} bonus</span>{/if}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{#if s.players.some((p) => hasSkill(p, "gatherer") && p.powerBars > 0)}<p class="muted small">
|
||||
The Gatherer can still add +1 per power bar before you confirm.
|
||||
</p>{/if}
|
||||
<button class="primary" onclick={() => store.dispatch({ action: "resolve" })}
|
||||
>Continue journey <span>→</span></button
|
||||
>Confirm result <span>→</span></button
|
||||
>
|
||||
{:else}<p class="instruction">{s.players[s.activeResolution]!.name} is resolving their journey.</p>{/if}
|
||||
{#if s.activeResolution !== null && hasSkill(me, "gatherer") && me.powerBars}<button
|
||||
|
|
|
|||
|
|
@ -579,7 +579,9 @@ h3 {
|
|||
line-height: 1.5;
|
||||
}
|
||||
.comparison > strong {
|
||||
display: block;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 12px;
|
||||
font:
|
||||
46px Georgia,
|
||||
serif;
|
||||
|
|
@ -1277,3 +1279,32 @@ h3 {
|
|||
flex-basis: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.comparison > .comparison-player {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
.comparison-name {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
.comparison-dice {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 7px;
|
||||
}
|
||||
.comparison .comparison-dice .die {
|
||||
width: 35px;
|
||||
height: 40px;
|
||||
padding: 4px;
|
||||
border-radius: 7px;
|
||||
}
|
||||
.comparison .comparison-dice .pips {
|
||||
grid-template-columns: repeat(3, 4px);
|
||||
grid-template-rows: repeat(3, 4px);
|
||||
gap: 3px;
|
||||
}
|
||||
.comparison .comparison-dice .die-caption {
|
||||
font-size: 6px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,6 +85,17 @@ import path from "node:path";
|
|||
if (await page.locator(".tool-form").count()) throw Error("Discarded equipment left a stale action panel");
|
||||
if (await machete.count()) throw Error("Discarded machete remains usable");
|
||||
if (s.players[0].cards.some((c) => c.id === "machete")) throw Error("Machete was not consumed");
|
||||
s.phase = "movement";
|
||||
s.activeResolution = 0;
|
||||
await page.evaluate((v) => window.bridge.emit("state", v), stripSecret(s, 0));
|
||||
await page.getByRole("button", { name: "Confirm result" }).waitFor();
|
||||
if ((await page.locator(".comparison-player").count()) !== 3) throw Error("Comparison must show every participant");
|
||||
if (await page.locator(".comparison-dice .die.aside").count()) throw Error("Set-aside dice must not count");
|
||||
const countedBeforeHover = await page.locator(".comparison").innerText();
|
||||
await page.locator(".location").last().hover();
|
||||
if ((await page.locator(".comparison").innerText()) !== countedBeforeHover)
|
||||
throw Error("Hover changed the resolution criterion");
|
||||
await page.screenshot({ path: "work/browser/fuji-comparison.png", fullPage: true });
|
||||
await page.evaluate((v) => {
|
||||
window.bridge.emit("player", {});
|
||||
window.bridge.emit("state", v);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue