Match the printed board footprint and add a full-board overview
This commit is contained in:
parent
5323537d84
commit
3b0360740f
26 changed files with 1549 additions and 56 deletions
|
|
@ -11,17 +11,16 @@
|
|||
|
||||
The engine covers eight rounds, 2–5 players, all eleven characters, the official two-player rules, optional play without characters for 3–5 players, and Rising Waters. It automates setup, replenishment, income conversion, turn order, mandatory retrieval when no decision remains, floods and final scoring. Free treasure sales and the Beggar remain available out of turn.
|
||||
|
||||
The viewer uses a large interactive map, a compact action dock and player supplies below the board. It supports tap-based mobile play, legal destination highlights, character bonuses, resource pictograms, shared sound/color-blind preferences, English game text by default, with an optional French translation, BGS chat with translation and editing, journal, replay, finished-game analysis, player hover cards, fullscreen and board-thumbnail rendering. Tutorial text is currently English.
|
||||
The viewer uses a large interactive map, a compact action dock and player supplies below the board. It supports tap-based mobile play, legal destination highlights, character bonuses, resource pictograms, shared sound/color-blind preferences, English game text by default, with fourteen other languages available, BGS chat with translation and editing, journal, replay, finished-game analysis, player hover cards, fullscreen and board-thumbnail rendering. Tutorials are translated into the same languages.
|
||||
|
||||
## Points requiring publisher confirmation
|
||||
|
||||
These are explicit beta assumptions, **not resolved official errata**. They should be checked before a public release; changing a tile value or board footprint may require starting fresh beta games.
|
||||
These are explicit beta assumptions, **not resolved official errata**. They should be checked before a public release; changing a tile value may require starting fresh beta games.
|
||||
|
||||
| Question | Evidence | Implemented choice |
|
||||
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Fish and treasure quantities | The rulebook lists 14 fish tiles (8×1, 4×2, 2×3) and 10 treasure tiles (4×1, 4×2, 2×3). The supplied cut-tile faces instead total **16 fish markers and 8 treasure markers**. | Use the readable values on the supplied tile faces. Fish/treasure rewards follow the remaining count on the ocean tile; no artificial shortage of reward tiles. |
|
||||
| Exact outer board outline | The supplied board has faint, irregular tile outlines. The rules establish 15 placed tiles plus the fixed island, but do not enumerate their coordinates. | A 16-location footprint traced from that board, rendered as regular hexagons. In particular, the far upper-right location (`3,0` in the source) remains provisional. Please compare against a physical final board. |
|
||||
| Governor during Rising Waters | The Governor moves markers **instead of** performing an action. The flood rule counts performed actions; no explicit Governor exception was found. | Governor transfers and discarded stacks do **not** decrease the flood die. Normal actions do. |
|
||||
| Question | Evidence | Implemented choice |
|
||||
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Fish and treasure quantities | The rulebook lists 14 fish tiles (8×1, 4×2, 2×3) and 10 treasure tiles (4×1, 4×2, 2×3). The supplied cut-tile faces instead total **16 fish markers and 8 treasure markers**. | Use the readable values on the supplied tile faces. Fish/treasure rewards follow the remaining count on the ocean tile; no artificial shortage of reward tiles. |
|
||||
| Governor during Rising Waters | The Governor moves markers **instead of** performing an action. The flood rule counts performed actions; no explicit Governor exception was found. | Governor transfers and discarded stacks do **not** decrease the flood die. Normal actions do. |
|
||||
|
||||
The supplied demand art also contains repeated patterns: cards 1/10 have one of each good; cards 2/8 have two kava and one copra. Duplicates can be intentional; they are preserved, not “corrected” speculatively.
|
||||
|
||||
|
|
@ -49,8 +48,8 @@ The fixed starting island is additional to this table. Two tiles of each letter
|
|||
|
||||
## Validation
|
||||
|
||||
- 22 focused engine/tutorial tests: majorities, prerequisites, optional powers, money conversion, two-player blocking, illegal-move immutability, hidden information, dropped players, deterministic replay, floods and complete tutorials.
|
||||
- 80 full simulated games (14,653 moves in the final sweep), across 2/3/4/5 players with and without Rising Waters. Both purposeful bots and varied legal choices exercise all nine actions and the Governor. These check termination, resource invariants and deterministic reconstruction; they do not establish strategic bot strength or resolve component discrepancies.
|
||||
- 32 focused engine/tutorial tests: majorities, prerequisites, optional powers, money conversion, two-player blocking, illegal-move immutability, hidden information, dropped players, deterministic replay, legacy saves, the 4/5/6/1 footprint, floods and complete tutorials.
|
||||
- 80 full simulated games (14,622 moves in the latest sweep), across 2/3/4/5 players with and without Rising Waters. Both purposeful bots and varied legal choices exercise all nine actions and the Governor. These check termination, resource invariants and deterministic reconstruction; they do not establish strategic bot strength or resolve component discrepancies.
|
||||
- Browser checks at **1440 px** and **390 px**: all nine actions, planning, tile placement, final scores, no page-width overflow, color symbols, replay, analysis chat hiding, player hover, board thumbnails, chat scroll-to-bottom, translation controls and ↑ editing.
|
||||
- The installed production engine completed an eight-round bot game and reconstructed its history. The uploaded viewer is checked through a protocol harness. A real multi-account online session remains a useful beta playtest.
|
||||
|
||||
|
|
@ -65,3 +64,7 @@ Rules take precedence over artwork where they specify the behavior. Supplied com
|
|||
- [BGG discussion of fish sales and optional treasure sales](https://boardgamegeek.com/thread/1883649/fish-price-and-treasure), consistent with the English rulebook: the market decreases once per sale action; treasure liquidation is optional.
|
||||
|
||||
Artwork remains the property of its rights holders. Public access to the repository does not grant a license to redistribute the supplied materials.
|
||||
|
||||
## Resolved: exact outer board outline
|
||||
|
||||
The printed board has rows of **4, 5, 6, 1** spaces. The lone bottom space adjoins the second and third spaces in the row above. New games use this footprint (`boardLayout: 2`). Existing beta saves retain the previous 5/5/5/1 footprint so their placements and replays remain valid. The viewer follows the game’s layout, tilts the grid approximately 20° clockwise like the printed board, and offers a full-board overview including unplaced spaces. This resolves the former “exact outer board outline” question.
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@ export const CELLS = [
|
|||
[0, 0],
|
||||
[1, 0],
|
||||
[2, 0],
|
||||
[3, 0],
|
||||
[-1, 1],
|
||||
[0, 1],
|
||||
[1, 1],
|
||||
|
|
@ -100,8 +99,14 @@ export const CELLS = [
|
|||
[1, 2],
|
||||
[2, 2],
|
||||
[3, 2],
|
||||
[4, 2],
|
||||
[1, 3],
|
||||
].map(([q, r]) => ({ id: `${q},${r}`, q, r }));
|
||||
// Preserve the provisional footprint for saved beta games and their replays.
|
||||
const LEGACY_CELLS = CELLS.filter(({ id }) => id !== "4,2");
|
||||
LEGACY_CELLS.splice(4, 0, { id: "3,0", q: 3, r: 0 });
|
||||
export const boardCells = (state) =>
|
||||
state && state.boardLayout !== 2 ? LEGACY_CELLS : CELLS;
|
||||
export const DIRECTIONS = [
|
||||
[1, 0],
|
||||
[1, 1],
|
||||
|
|
@ -111,10 +116,10 @@ export const DIRECTIONS = [
|
|||
[0, -1],
|
||||
];
|
||||
export const START_CELLS = ["1,0", "0,1", "1,1"];
|
||||
export function neighbors(id) {
|
||||
export function neighbors(id, state) {
|
||||
const [q, r] = id.split(",").map(Number);
|
||||
return DIRECTIONS.map(([a, b]) => `${q + a},${r + b}`).filter((c) =>
|
||||
CELLS.some((x) => x.id === c),
|
||||
boardCells(state).some((x) => x.id === c),
|
||||
);
|
||||
}
|
||||
export function tileState(id) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
REST,
|
||||
TILES,
|
||||
DEMANDS,
|
||||
CELLS,
|
||||
boardCells,
|
||||
START_CELLS,
|
||||
neighbors,
|
||||
tileState,
|
||||
|
|
@ -56,7 +56,7 @@ function pay(s, p, n) {
|
|||
s.players[p].money -= n;
|
||||
}
|
||||
function adjacentIslands(s, p) {
|
||||
return neighbors(s.players[p].boat).filter(
|
||||
return neighbors(s.players[p].boat, s).filter(
|
||||
(c) => s.board[c]?.type === "island" && !s.board[c].submerged,
|
||||
);
|
||||
}
|
||||
|
|
@ -77,6 +77,9 @@ function saveFrame(s) {
|
|||
s._frames.push(capture(s));
|
||||
}
|
||||
export function init(count, expansions = [], options = {}, seed = "vanuatu") {
|
||||
return initialize(count, expansions, options, seed, 2);
|
||||
}
|
||||
function initialize(count, expansions, options, seed, boardLayout) {
|
||||
check(
|
||||
Number.isInteger(count) && count >= 2 && count <= 5,
|
||||
"Vanuatu is for 2–5 players",
|
||||
|
|
@ -87,6 +90,7 @@ export function init(count, expansions = [], options = {}, seed = "vanuatu") {
|
|||
);
|
||||
const s = {
|
||||
version: 1,
|
||||
boardLayout,
|
||||
round: 1,
|
||||
phase: "character",
|
||||
actor: 0,
|
||||
|
|
@ -241,7 +245,7 @@ export function sailOptions(s, p, bonus = false) {
|
|||
}
|
||||
}
|
||||
if (path.length === max) return;
|
||||
for (const next of neighbors(c)) {
|
||||
for (const next of neighbors(c, s)) {
|
||||
if (s.board[next]?.type === "sea" && !s.board[next].submerged)
|
||||
visit(next, [...path, next]);
|
||||
}
|
||||
|
|
@ -285,7 +289,7 @@ export function actionOptions(s, p, action) {
|
|||
a.money >= (bonus ? 1 : 3);
|
||||
if (hut) out.push({ ...base, cell, hut: true });
|
||||
if (s.options.risingWaters && s.dikesLeft && a.money >= 1)
|
||||
for (const edge of neighbors(cell).filter(
|
||||
for (const edge of neighbors(cell, s).filter(
|
||||
(c) =>
|
||||
s.board[c]?.type === "sea" &&
|
||||
!s.board[c].submerged &&
|
||||
|
|
@ -527,13 +531,16 @@ function canPlanUncached(s, p, target, markers) {
|
|||
}
|
||||
export function placementOptions(s) {
|
||||
const candidates = s.upcoming.flatMap((id) =>
|
||||
CELLS.filter(
|
||||
(c) =>
|
||||
!s.board[c.id] && neighbors(c.id).filter((n) => s.board[n]).length >= 2,
|
||||
).map((c) => ({ type: "place", tile: id, cell: c.id })),
|
||||
boardCells(s)
|
||||
.filter(
|
||||
(c) =>
|
||||
!s.board[c.id] &&
|
||||
neighbors(c.id, s).filter((n) => s.board[n]).length >= 2,
|
||||
)
|
||||
.map((c) => ({ type: "place", tile: id, cell: c.id })),
|
||||
);
|
||||
const strict = candidates.filter((m) => {
|
||||
const adj = neighbors(m.cell)
|
||||
const adj = neighbors(m.cell, s)
|
||||
.map((c) => s.board[c])
|
||||
.filter(Boolean);
|
||||
return TILES[m.tile].type === "island"
|
||||
|
|
@ -672,7 +679,7 @@ function flood(s) {
|
|||
say(s, "flood");
|
||||
for (const [cell, t] of Object.entries(s.board)) {
|
||||
if (t.type !== "island" || t.submerged) continue;
|
||||
const n = neighbors(cell).filter(
|
||||
const n = neighbors(cell, s).filter(
|
||||
(c) =>
|
||||
s.board[c]?.type === "sea" &&
|
||||
!s.board[c].submerged &&
|
||||
|
|
@ -1019,7 +1026,13 @@ export function replay(s, { to = logLength(s) } = {}) {
|
|||
"Invalid replay position",
|
||||
);
|
||||
const b = s._setup;
|
||||
let r = init(b.count, b.expansions, b.options, b.seed);
|
||||
let r = initialize(
|
||||
b.count,
|
||||
b.expansions,
|
||||
b.options,
|
||||
b.seed,
|
||||
s.boardLayout ?? 1,
|
||||
);
|
||||
for (const h of s._history.slice(0, to - 1)) r = applyMove(r, h.move, h.p);
|
||||
s.players.forEach((p, i) => {
|
||||
r.players[i].name = p.name;
|
||||
|
|
@ -1042,7 +1055,7 @@ function chooseAI(s, p) {
|
|||
return a.money < 3 ? sum(m.values) * 0.5 - 1 : -30;
|
||||
if (m.type === "beg") return a.money < 3 ? 1 : -30;
|
||||
if (m.type === "place") {
|
||||
const adj = neighbors(m.cell)
|
||||
const adj = neighbors(m.cell, s)
|
||||
.map((c) => s.board[c])
|
||||
.filter(Boolean);
|
||||
return TILES[m.tile].type === "island"
|
||||
|
|
@ -1112,7 +1125,7 @@ function chooseAI(s, p) {
|
|||
if (m.action === "sail") {
|
||||
const cell = m.path.at(-1),
|
||||
t = s.board[cell];
|
||||
const lands = neighbors(cell)
|
||||
const lands = neighbors(cell, s)
|
||||
.map((c) => s.board[c])
|
||||
.filter((t) => t?.type === "island" && !t.submerged);
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@boardgamers/vanuatu",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "dist/engine.js",
|
||||
|
|
|
|||
|
|
@ -44,6 +44,16 @@ const page = await browser.newPage({
|
|||
page.on("pageerror", (e) => errors.push(e.message));
|
||||
await page.goto(base + "/?new&hotseat");
|
||||
await page.waitForSelector("[data-character-choice]");
|
||||
// The overview remains reachable above the taller character-selection tray.
|
||||
for (const width of [390, 1440]) {
|
||||
await page.setViewportSize({ width, height: 1000 });
|
||||
await page.locator("[data-overview]").click();
|
||||
assert.equal(
|
||||
await page.locator("[data-overview]").getAttribute("aria-pressed"),
|
||||
"true",
|
||||
);
|
||||
await page.locator("[data-overview]").click();
|
||||
}
|
||||
// Empty action stacks do not leave labels above their icons or shift columns.
|
||||
const actionLayout = await page
|
||||
.locator(".action-dock > button")
|
||||
|
|
@ -225,6 +235,48 @@ for (const width of [1440, 390]) {
|
|||
path: `.local/qa/actions-${width}.png`,
|
||||
fullPage: true,
|
||||
});
|
||||
const closeView = await page.locator(".archipelago").getAttribute("viewBox");
|
||||
const position = await page.evaluate(() =>
|
||||
JSON.stringify(window.vanuatuDemo.state),
|
||||
);
|
||||
await page.locator("[data-overview]").click();
|
||||
assert.equal(
|
||||
await page.locator("[data-overview]").getAttribute("aria-pressed"),
|
||||
"true",
|
||||
);
|
||||
assert.ok(
|
||||
await page.locator(".archipelago").evaluate((svg) => {
|
||||
const box = svg.viewBox.baseVal;
|
||||
return [...svg.querySelectorAll(".cell-surface")].every((path) => {
|
||||
const cell = path.getBBox();
|
||||
return (
|
||||
cell.x >= box.x &&
|
||||
cell.y >= box.y &&
|
||||
cell.x + cell.width <= box.x + box.width &&
|
||||
cell.y + cell.height <= box.y + box.height
|
||||
);
|
||||
});
|
||||
}),
|
||||
"Overview must include every empty space",
|
||||
);
|
||||
assert.equal(await page.locator(".map-cell").count(), 16);
|
||||
assert.equal(
|
||||
await page.evaluate(() => JSON.stringify(window.vanuatuDemo.state)),
|
||||
position,
|
||||
);
|
||||
await page.screenshot({
|
||||
path: `.local/qa/overview-${width}.png`,
|
||||
fullPage: true,
|
||||
});
|
||||
await page.locator("[data-overview]").click();
|
||||
assert.equal(
|
||||
await page.locator(".archipelago").getAttribute("viewBox"),
|
||||
closeView,
|
||||
);
|
||||
await page.locator("[data-zoom]").click();
|
||||
await page.locator("[data-overview]").click();
|
||||
assert.equal(await page.locator(".map-scroll.zoomed").count(), 0);
|
||||
await page.locator("[data-overview]").click();
|
||||
await page.locator("[data-help]").first().click();
|
||||
await page.locator('[data-pref="colorBlind"]').check();
|
||||
await page.locator("[data-close]").click();
|
||||
|
|
@ -370,7 +422,13 @@ assert.ok(
|
|||
(el) => Math.abs(el.scrollHeight - el.scrollTop - el.clientHeight) < 2,
|
||||
),
|
||||
);
|
||||
await page.locator(".chat-composer input").focus();
|
||||
await page.locator(".chat-composer input").press("ArrowUp");
|
||||
await page.waitForFunction(
|
||||
() =>
|
||||
document.querySelector(".chat-composer input").value ===
|
||||
"Practice message 79",
|
||||
);
|
||||
assert.equal(
|
||||
await page.locator(".chat-composer input").inputValue(),
|
||||
"Practice message 79",
|
||||
|
|
|
|||
|
|
@ -245,3 +245,50 @@ test("Governor marker movement does not perform an action or advance the flood d
|
|||
assert.equal(s.waterCountdown, 1);
|
||||
assert.equal(s.waterTriggered, false);
|
||||
});
|
||||
|
||||
test("printed footprint has 4/5/6/1 cells and the bottom touches row-three spaces 2 and 3", () => {
|
||||
const s = E.init(3, [], {}, "printed-board");
|
||||
const rows = [0, 1, 2, 3].map((r) =>
|
||||
E.boardCells(s).filter((c) => c.r === r),
|
||||
);
|
||||
assert.deepEqual(
|
||||
rows.map((row) => row.length),
|
||||
[4, 5, 6, 1],
|
||||
);
|
||||
assert.deepEqual(
|
||||
E.neighbors(rows[3][0].id, s).sort(),
|
||||
[rows[2][1].id, rows[2][2].id].sort(),
|
||||
);
|
||||
s.phase = "expand";
|
||||
s.upcoming = ["startFish"];
|
||||
s.board["3,1"] = E.tileState("a1");
|
||||
s.board["3,2"] = E.tileState("startBoat");
|
||||
assert.ok(E.placementOptions(s).some((m) => m.cell === "4,2"));
|
||||
assert.ok(!E.placementOptions(s).some((m) => m.cell === "3,0"));
|
||||
const old = structuredClone(s);
|
||||
delete old.boardLayout;
|
||||
assert.ok(!E.placementOptions(old).some((m) => m.cell === "4,2"));
|
||||
assert.ok(E.boardCells(old).some((c) => c.id === "3,0"));
|
||||
});
|
||||
|
||||
test("saved beta history replays on its original footprint", async () => {
|
||||
const { readFile } = await import("node:fs/promises");
|
||||
const fixture = JSON.parse(
|
||||
await readFile(
|
||||
new URL("./fixtures/legacy-board.json", import.meta.url),
|
||||
"utf8",
|
||||
),
|
||||
);
|
||||
const saved = {
|
||||
_setup: fixture.setup,
|
||||
_history: fixture.history,
|
||||
_frames: Array(fixture.history.length + 1),
|
||||
players: fixture.players,
|
||||
};
|
||||
const replayed = E.replay(saved);
|
||||
assert.equal(replayed.boardLayout, 1);
|
||||
assert.equal(replayed.finished, true);
|
||||
assert.deepEqual(replayed.board, fixture.board);
|
||||
assert.deepEqual(E.scores(replayed), fixture.scores);
|
||||
assert.ok(E.stripSecret(replayed, 0).board["3,0"]);
|
||||
});
|
||||
|
|
|
|||
1280
test/fixtures/legacy-board.json
vendored
Normal file
1280
test/fixtures/legacy-board.json
vendored
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -7,7 +7,7 @@ export const esc = (x) =>
|
|||
],
|
||||
);
|
||||
const paths = {
|
||||
sail: '<path d="M3 17h26l-5 8H9z" fill="currentColor"/><path d="M16 3v13H5z" fill="#f8e3a4" stroke="currentColor"/><path d="M18 4v12h9z" fill="#fcf5df" stroke="currentColor"/>',
|
||||
sail: '<path d="M12 3Q24 6 28 19L12 21Z" fill="currentColor" stroke="#244e53" stroke-width=".8"/><path d="M11 2v21M11 5v14" fill="none" stroke="#244e53" stroke-width="1.4"/><path d="m3 24 27-5-7 10H10Z" fill="currentColor" stroke="#244e53" stroke-width=".8"/><path d="m5 24 23-4" fill="none" stroke="#fff5d5" stroke-width="1.2"/>',
|
||||
fish: '<path d="M4 16C10 4 21 5 26 12l5-5v18l-5-5C18 28 10 27 4 16Z" fill="#df83a4" stroke="#a6426a"/><circle cx="10" cy="14" r="1.5" fill="#713847"/>',
|
||||
sell: '<path d="M3 10h26l-2 17H5z" fill="#d3a163" stroke="#754627"/><path d="M8 5h16l4 6H4z" fill="#f4bc65"/><path d="M8 16h16M8 21h16" stroke="#805938"/>',
|
||||
explore:
|
||||
|
|
@ -39,6 +39,8 @@ const paths = {
|
|||
colorBlind:
|
||||
'<g transform="scale(1.25)" fill="none" stroke="currentColor" stroke-width="1.6"><circle cx="6" cy="7" r="4"/><path d="m17 3 5 9H12Z"/><rect x="3" y="15" width="8" height="7" rx="1"/><path d="m18 15 4 4-4 4-4-4Z"/></g>',
|
||||
help: '<circle cx="16" cy="16" r="13" fill="none" stroke="currentColor" stroke-width="2"/><path d="M11 10c0-6 13-6 12 1 0 4-7 4-7 8M16 23v2" fill="none" stroke="currentColor" stroke-width="2.5"/>',
|
||||
overview:
|
||||
'<path d="M3 11V3h8m10 0h8v8M3 21v8h8m10 0h8v-8" fill="none" stroke="currentColor" stroke-width="2"/><path d="m16 7 8 5v9l-8 5-8-5v-9Z" fill="none" stroke="currentColor" stroke-width="2"/>',
|
||||
fullscreen:
|
||||
'<path d="M3 12V3h9m8 0h9v9M3 20v9h9m8 0h9v-9" fill="none" stroke="currentColor" stroke-width="2.5"/>',
|
||||
close:
|
||||
|
|
|
|||
|
|
@ -1,9 +1,15 @@
|
|||
import { CELLS, TILES, COLORS, DIRECTIONS } from "../engine/catalog.js";
|
||||
import { boardCells, TILES, COLORS } from "../engine/catalog.js";
|
||||
import { esc, svgIcon, iconLabel } from "./art.js";
|
||||
import { boardArt } from "./board-assets.js";
|
||||
const tilt = (20 * Math.PI) / 180;
|
||||
const rotate = (x, y) => ({
|
||||
x: x * Math.cos(tilt) - y * Math.sin(tilt),
|
||||
y: x * Math.sin(tilt) + y * Math.cos(tilt),
|
||||
});
|
||||
export const center = (id) => {
|
||||
const [q, r] = id.split(",").map(Number);
|
||||
return { x: 355 + q * 162 - r * 81, y: 150 + r * 140.3 };
|
||||
const p = rotate(q * 162 - r * 81, r * 140.3);
|
||||
return { x: 355 + p.x, y: 150 + p.y };
|
||||
};
|
||||
// Opposite sides share the same S-curve, so neighbouring tiles interlock.
|
||||
// Use the board spacing directly to keep their vertices and curves identical.
|
||||
|
|
@ -16,7 +22,10 @@ function tilePath(x, y) {
|
|||
[-81, h],
|
||||
[-81, -h],
|
||||
[0, -2 * h],
|
||||
].map(([dx, dy]) => ({ x: x + dx, y: y + dy }));
|
||||
].map(([dx, dy]) => {
|
||||
const p = rotate(dx, dy);
|
||||
return { x: x + p.x, y: y + p.y };
|
||||
});
|
||||
let path = `M${vertices[0].x},${vertices[0].y}`;
|
||||
for (let i = 0; i < 6; i++) {
|
||||
const a = vertices[i],
|
||||
|
|
@ -29,6 +38,15 @@ function tilePath(x, y) {
|
|||
return path + "Z";
|
||||
}
|
||||
const symbols = ["●", "◆", "▲", "■", "✦"];
|
||||
function tileImage(spec, c, ghost = false) {
|
||||
const clip = `url(#cell-${c.q + 2}-${c.r})`;
|
||||
const ocean = `<image href="${boardArt({ type: "sea" })}" x="${c.x - 111}" y="${c.y - 111}" width="222" height="222"/>`;
|
||||
const art =
|
||||
spec.type === "island"
|
||||
? `<image href="${boardArt(spec)}" x="${c.x - 88}" y="${c.y - 88}" width="176" height="176"/>`
|
||||
: "";
|
||||
return `<g ${ghost ? 'class="tile-ghost"' : ""} clip-path="${clip}" pointer-events="none">${ocean}${art}</g>`;
|
||||
}
|
||||
function resourceBadge(x, y, items) {
|
||||
const widths = items.map(({ value }) => 34 + String(value).length * 11);
|
||||
const width = widths.reduce((a, b) => a + b, 0) + 8;
|
||||
|
|
@ -49,14 +67,17 @@ export function boardSvg(
|
|||
hoverTile,
|
||||
player,
|
||||
colorBlind = false,
|
||||
overview = false,
|
||||
language = "en",
|
||||
t,
|
||||
} = {},
|
||||
) {
|
||||
const label = (name) => iconLabel(name, language);
|
||||
const targetSet = new Set(targets);
|
||||
const all = CELLS.map((c) => ({ ...c, ...center(c.id) }));
|
||||
const visible = all.filter((c) => s.board[c.id] || targetSet.has(c.id));
|
||||
const all = boardCells(s).map((c) => ({ ...c, ...center(c.id) }));
|
||||
const visible = overview
|
||||
? all
|
||||
: all.filter((c) => s.board[c.id] || targetSet.has(c.id));
|
||||
const x0 = Math.min(...visible.map((c) => c.x)) - 120,
|
||||
x1 = Math.max(...visible.map((c) => c.x)) + 120,
|
||||
y0 = Math.min(...visible.map((c) => c.y)) - 120,
|
||||
|
|
@ -67,7 +88,7 @@ export function boardSvg(
|
|||
`<clipPath id="cell-${c.q + 2}-${c.r}"><path d="${tilePath(c.x, c.y)}"/></clipPath>`,
|
||||
)
|
||||
.join("");
|
||||
let svg = `<svg class="archipelago" viewBox="${x0} ${y0} ${x1 - x0} ${y1 - y0}" role="group" aria-label="Vanuatu"><defs>${defs}<filter id="boat-shadow"><feDropShadow dx="0" dy="2" stdDeviation="2" flood-opacity=".3"/></filter></defs>`;
|
||||
let svg = `<svg class="archipelago${overview ? " overview" : ""}" viewBox="${x0} ${y0} ${x1 - x0} ${y1 - y0}" role="group" aria-label="Vanuatu"><defs>${defs}<filter id="boat-shadow" x="-25%" y="-25%" width="150%" height="150%"><feDropShadow dx="0" dy="0" stdDeviation=".9" flood-color="#fff9df" flood-opacity="1"/><feDropShadow dx="0" dy="2" stdDeviation="1.5" flood-opacity=".45"/></filter></defs>`;
|
||||
for (const c of all) {
|
||||
const tile = s.board[c.id],
|
||||
legal = targetSet.has(c.id),
|
||||
|
|
@ -75,7 +96,7 @@ export function boardSvg(
|
|||
svg += `<g class="map-cell ${tile ? "occupied" : ""} ${legal ? "legal" : ""} ${selected === c.id ? "selected" : ""}" data-cell="${c.id}" ${legal ? `role="button" tabindex="0" aria-label="${esc(t(tile?.type === "island" ? "island" : "sea"))} ${c.id}"` : ""}>`;
|
||||
svg += `<title>${esc(tile ? `${t(tile.type === "island" ? "island" : "sea")} · ${c.id}${tile.submerged ? ` · ${"Submerged"}` : ""}` : "Tile space")}</title><path class="cell-surface" d="${tilePath(c.x, c.y)}"/>`;
|
||||
if (tile) {
|
||||
svg += `<image href="${boardArt(spec)}" x="${c.x - 111}" y="${c.y - 111}" width="222" height="222" clip-path="url(#cell-${c.q + 2}-${c.r})"/>`;
|
||||
svg += tileImage(spec, c);
|
||||
if (tile.submerged) {
|
||||
svg += `<path d="${tilePath(c.x, c.y)}" fill="#1c708ca6"/>${svgIcon("water", c.x - 25, c.y - 25, 50)}`;
|
||||
} else if (tile.type === "sea") {
|
||||
|
|
@ -154,8 +175,7 @@ export function boardSvg(
|
|||
svg += `<g><title>${esc(label("dike"))}</title><line x1="${mx - (dy / l) * 22}" y1="${my + (dx / l) * 22}" x2="${mx + (dy / l) * 22}" y2="${my - (dx / l) * 22}" stroke="#654429" stroke-width="9" stroke-linecap="round"/><line x1="${mx - (dy / l) * 22}" y1="${my + (dx / l) * 22}" x2="${mx + (dy / l) * 22}" y2="${my - (dx / l) * 22}" stroke="#d1aa67" stroke-width="5" stroke-linecap="round"/></g>`;
|
||||
}
|
||||
}
|
||||
} else if (hoverTile && legal)
|
||||
svg += `<image class="tile-ghost" href="${boardArt(TILES[hoverTile])}" x="${c.x - 103}" y="${c.y - 103}" width="206" height="206" clip-path="url(#cell-${c.q + 2}-${c.r})"/>`;
|
||||
} else if (hoverTile && legal) svg += tileImage(TILES[hoverTile], c, true);
|
||||
if (!tile)
|
||||
svg += `<text x="${c.x}" y="${c.y + 7}" class="empty-label">${legal ? "+" : "·"}</text>`;
|
||||
svg += `<path class="cell-ring" d="${tilePath(c.x, c.y)}"/>`;
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "Du må ikke bare vente. Har du intet flertal nogen steder, skal du fjerne en af dine stakke uden at handle. Har du flertallet, men handlingen er umulig, skal du også fjerne den stak. Når du afvikler en stak, skal du udføre handlingen, hvis den er mulig.",
|
||||
"Finish your planned actions": "Afslut dine planlagte handlinger",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "Afvikl dine resterende stakke. Hold øje med, hvilke handlinger der bliver tilgængelige, når modstanderne fjerner deres markører. En planlagt handling er ikke garanteret: nogen kan tage den sidste fisk eller den sidste plads før dig.",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Spred markørerne for flere handlinger, eller saml dem i stakke for prioritet. Planlæg forudsætningerne, og vælg så rækkefølgen af dine handlinger undervejs i runden."
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Spred markørerne for flere handlinger, eller saml dem i stakke for prioritet. Planlæg forudsætningerne, og vælg så rækkefølgen af dine handlinger undervejs i runden.",
|
||||
"Show full board": "Vis hele brættet",
|
||||
"Focus on placed tiles": "Fokusér på lagte brikker"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "Du darfst nicht einfach warten. Hast du nirgends die Mehrheit, entferne einen deiner Stapel ohne Aktion. Hast du die Mehrheit, aber die Aktion ist unmöglich, entferne diesen Stapel ebenfalls. Beim Auflösen eines Stapels musst du eine mögliche Aktion ausführen.",
|
||||
"Finish your planned actions": "Führe deine geplanten Aktionen zu Ende",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "Löse deine übrigen Stapel auf. Achte darauf, welche Aktionen verfügbar werden, wenn die anderen ihre Marker entfernen. Eine geplante Aktion ist nicht garantiert: Jemand könnte vorher den letzten Fisch oder den letzten Platz nehmen.",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Verteile deine Marker für mehr Aktionen oder bündele sie für Vorrang. Plane die Voraussetzungen ein und wähle die Reihenfolge deiner Aktionen im Verlauf der Runde."
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Verteile deine Marker für mehr Aktionen oder bündele sie für Vorrang. Plane die Voraussetzungen ein und wähle die Reihenfolge deiner Aktionen im Verlauf der Runde.",
|
||||
"Show full board": "Gesamtes Spielbrett anzeigen",
|
||||
"Focus on placed tiles": "Auf ausgelegte Plättchen zentrieren"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "Δεν μπορείς απλώς να περιμένεις. Αν δεν έχεις πουθενά πλειοψηφία, αφαίρεσε μία στοίβα σου χωρίς ενέργεια. Αν έχεις πλειοψηφία αλλά η ενέργεια είναι αδύνατη, αφαίρεσε και αυτή τη στοίβα. Όταν επιλύεις μια στοίβα, πρέπει να εκτελέσεις την ενέργεια αν είναι δυνατή.",
|
||||
"Finish your planned actions": "Ολοκλήρωσε τις προγραμματισμένες ενέργειες",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "Επίλυσε τις υπόλοιπες στοίβες σου. Πρόσεχε ποιες ενέργειες γίνονται διαθέσιμες όταν οι αντίπαλοι αφαιρούν τους δείκτες τους. Ο προγραμματισμός δεν εγγυάται την ενέργεια: κάποιος μπορεί να πάρει το τελευταίο ψάρι ή την τελευταία θέση πρώτος.",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Μοίρασε τους δείκτες για περισσότερες ενέργειες ή στοίβαξέ τους για προτεραιότητα. Σχεδίασε τις προϋποθέσεις και διάλεξε τη σειρά των ενεργειών καθώς εξελίσσεται ο γύρος."
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Μοίρασε τους δείκτες για περισσότερες ενέργειες ή στοίβαξέ τους για προτεραιότητα. Σχεδίασε τις προϋποθέσεις και διάλεξε τη σειρά των ενεργειών καθώς εξελίσσεται ο γύρος.",
|
||||
"Show full board": "Εμφάνιση ολόκληρου του ταμπλό",
|
||||
"Focus on placed tiles": "Εστίαση στα τοποθετημένα πλακίδια"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.",
|
||||
"Finish your planned actions": "Finish your planned actions",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds."
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.",
|
||||
"Show full board": "Show full board",
|
||||
"Focus on placed tiles": "Focus on placed tiles"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "Vous ne pouvez pas simplement attendre. Sans majorité nulle part, retirez une de vos piles sans agir. Si vous avez la majorité mais que l’action est impossible, retirez aussi cette pile. Lorsque vous résolvez une pile dont l’action est possible, vous devez l’effectuer.",
|
||||
"Finish your planned actions": "Terminez vos actions prévues",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "Résolvez vos piles restantes. Observez les actions qui se libèrent lorsque vos adversaires retirent leurs marqueurs. Prévoir une action ne la garantit pas : quelqu’un peut prendre le dernier poisson ou occuper la dernière place avant vous.",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Répartissez vos marqueurs pour effectuer plus d’actions, ou empilez-les pour obtenir la priorité. Prévoyez les prérequis, puis choisissez l’ordre de vos actions selon l’évolution du tour."
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Répartissez vos marqueurs pour effectuer plus d’actions, ou empilez-les pour obtenir la priorité. Prévoyez les prérequis, puis choisissez l’ordre de vos actions selon l’évolution du tour.",
|
||||
"Show full board": "Voir tout le plateau",
|
||||
"Focus on placed tiles": "Recentrer sur les tuiles posées"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "आप बस इंतज़ार नहीं कर सकते। यदि कहीं भी आपकी बढ़त नहीं है, तो बिना क्रिया किए अपना एक ढेर हटाएँ। बढ़त होने पर भी यदि क्रिया असंभव है, तो वह ढेर भी हटाएँ। किसी ढेर को निपटाते समय उसकी क्रिया संभव हो, तो उसे करना अनिवार्य है।",
|
||||
"Finish your planned actions": "नियोजित क्रियाएँ पूरी करें",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "अपने बचे हुए ढेर निपटाएँ। देखें कि विरोधियों के मार्कर हटने से कौन-सी क्रियाएँ उपलब्ध होती हैं। क्रिया की योजना बना लेना उसकी गारंटी नहीं है: कोई पहले ही आखिरी मछली ले सकता है या आखिरी जगह भर सकता है।",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "अधिक क्रियाओं के लिए मार्कर फैलाएँ, या प्राथमिकता के लिए ढेर बनाएँ। आवश्यक शर्तों की योजना बनाएँ, फिर दौर की स्थिति के अनुसार क्रियाओं का क्रम चुनें।"
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "अधिक क्रियाओं के लिए मार्कर फैलाएँ, या प्राथमिकता के लिए ढेर बनाएँ। आवश्यक शर्तों की योजना बनाएँ, फिर दौर की स्थिति के अनुसार क्रियाओं का क्रम चुनें।",
|
||||
"Show full board": "पूरा बोर्ड दिखाएँ",
|
||||
"Focus on placed tiles": "रखी हुई टाइलों पर केंद्रित करें"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "Non puoi semplicemente aspettare. Se non hai la maggioranza da nessuna parte, rimuovi una delle tue pile senza agire. Se hai la maggioranza ma l’azione è impossibile, rimuovi anche quella pila. Quando risolvi una pila, devi eseguire l’azione se è possibile.",
|
||||
"Finish your planned actions": "Completa le azioni pianificate",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "Risolvi le pile rimaste. Osserva quali azioni diventano disponibili quando gli avversari rimuovono i loro segnalini. Pianificare un’azione non la garantisce: qualcuno potrebbe prendere prima l’ultimo pesce o l’ultimo posto.",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Distribuisci i segnalini per più azioni o impilali per la priorità. Pianifica i prerequisiti, poi scegli l’ordine delle azioni durante il round."
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Distribuisci i segnalini per più azioni o impilali per la priorità. Pianifica i prerequisiti, poi scegli l’ordine delle azioni durante il round.",
|
||||
"Show full board": "Mostra tutto il tabellone",
|
||||
"Focus on placed tiles": "Centra sulle tessere piazzate"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "그냥 기다릴 수는 없습니다. 어느 행동에서도 우선권이 없다면 내 더미 하나를 행동 없이 회수하세요. 우선권이 있어도 그 행동이 불가능하면 해당 더미를 회수합니다. 더미를 처리할 때 행동이 가능하다면 반드시 실행해야 합니다.",
|
||||
"Finish your planned actions": "계획한 행동 마무리",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "남은 더미를 처리하세요. 상대가 마커를 회수할 때 어떤 행동에 우선권이 생기는지 살펴보세요. 계획했다고 실행이 보장되지는 않습니다. 누군가 마지막 물고기를 잡거나 마지막 자리를 먼저 차지할 수 있습니다.",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "더 많은 행동을 하려면 마커를 나누고, 우선권을 원하면 쌓으세요. 필요한 조건을 미리 계획한 뒤 라운드 상황에 따라 행동 순서를 정하세요."
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "더 많은 행동을 하려면 마커를 나누고, 우선권을 원하면 쌓으세요. 필요한 조건을 미리 계획한 뒤 라운드 상황에 따라 행동 순서를 정하세요.",
|
||||
"Show full board": "전체 보드 보기",
|
||||
"Focus on placed tiles": "놓인 타일에 맞추기"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "Je mag niet gewoon wachten. Heb je nergens de meerderheid, haal dan één van je stapels weg zonder actie. Heb je de meerderheid maar is de actie onmogelijk, haal die stapel dan ook weg. Bij het afhandelen van een stapel moet je de actie uitvoeren als die mogelijk is.",
|
||||
"Finish your planned actions": "Rond je geplande acties af",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "Handel je resterende stapels af. Let op welke acties beschikbaar komen wanneer tegenstanders hun markers weghalen. Een geplande actie is niet gegarandeerd: iemand kan eerder de laatste vis of de laatste plek nemen.",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Verspreid je markers voor meer acties of stapel ze voor voorrang. Plan wat je vooraf nodig hebt en bepaal de volgorde van je acties tijdens de ronde."
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Verspreid je markers voor meer acties of stapel ze voor voorrang. Plan wat je vooraf nodig hebt en bepaal de volgorde van je acties tijdens de ronde.",
|
||||
"Show full board": "Toon het hele speelbord",
|
||||
"Focus on placed tiles": "Richt op geplaatste tegels"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "Nie możesz po prostu czekać. Jeśli nigdzie nie masz przewagi, usuń jeden ze swoich stosów bez wykonywania akcji. Jeśli masz przewagę, ale akcja jest niemożliwa, również usuń ten stos. Rozpatrując stos, musisz wykonać akcję, jeśli jest możliwa.",
|
||||
"Finish your planned actions": "Dokończ zaplanowane akcje",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "Rozpatrz pozostałe stosy. Obserwuj, które akcje stają się dostępne po usunięciu znaczników przeciwników. Zaplanowanie akcji jej nie gwarantuje: ktoś może wcześniej zabrać ostatnią rybę lub zająć ostatnie miejsce.",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Rozdziel znaczniki, by wykonać więcej akcji, lub układaj stosy, by zyskać pierwszeństwo. Uwzględnij wymagania akcji, a ich kolejność wybieraj w trakcie rundy."
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Rozdziel znaczniki, by wykonać więcej akcji, lub układaj stosy, by zyskać pierwszeństwo. Uwzględnij wymagania akcji, a ich kolejność wybieraj w trakcie rundy.",
|
||||
"Show full board": "Pokaż całą planszę",
|
||||
"Focus on placed tiles": "Skup widok na wyłożonych kafelkach"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "Você não pode simplesmente esperar. Se não tiver maioria em nenhuma ação, retire uma de suas pilhas sem agir. Se tiver maioria, mas a ação for impossível, retire essa pilha também. Ao resolver uma pilha, você deve realizar a ação se ela for possível.",
|
||||
"Finish your planned actions": "Conclua suas ações planejadas",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "Resolva as pilhas restantes. Observe quais ações ficam disponíveis quando os adversários retiram seus marcadores. Planejar uma ação não a garante: alguém pode pegar o último peixe ou ocupar o último espaço antes de você.",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Distribua seus marcadores para realizar mais ações ou empilhe-os para ter prioridade. Planeje os pré-requisitos e escolha a ordem das ações conforme a rodada se desenrola."
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Distribua seus marcadores para realizar mais ações ou empilhe-os para ter prioridade. Planeje os pré-requisitos e escolha a ordem das ações conforme a rodada se desenrola.",
|
||||
"Show full board": "Mostrar todo o tabuleiro",
|
||||
"Focus on placed tiles": "Focar nas peças colocadas"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "Nu poți pur și simplu să aștepți. Dacă nu ai majoritatea nicăieri, retrage unul dintre teancurile tale fără a acționa. Dacă ai majoritatea, dar acțiunea este imposibilă, retrage și acel teanc. Când rezolvi un teanc, trebuie să efectuezi acțiunea dacă este posibilă.",
|
||||
"Finish your planned actions": "Încheie acțiunile planificate",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "Rezolvă teancurile rămase. Urmărește ce acțiuni devin disponibile când adversarii își retrag marcatorii. Planificarea unei acțiuni nu o garantează: cineva poate lua ultimul pește sau ocupa ultimul loc înaintea ta.",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Împarte marcatorii pentru mai multe acțiuni sau suprapune-i pentru prioritate. Planifică cerințele prealabile, apoi alege ordinea acțiunilor pe parcursul rundei."
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Împarte marcatorii pentru mai multe acțiuni sau suprapune-i pentru prioritate. Planifică cerințele prealabile, apoi alege ordinea acțiunilor pe parcursul rundei.",
|
||||
"Show full board": "Arată întreaga tablă",
|
||||
"Focus on placed tiles": "Centrează pe piesele plasate"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "Просто ждать нельзя. Если у вас нигде нет преимущества, уберите одну свою стопку без действия. Если преимущество есть, но действие невозможно, эту стопку тоже нужно убрать. Разыгрывая стопку, вы обязаны выполнить действие, если оно возможно.",
|
||||
"Finish your planned actions": "Завершите запланированные действия",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "Разыграйте оставшиеся стопки. Следите, какие действия становятся доступны после того, как соперники убирают свои маркеры. План не гарантирует действие: кто-то может раньше забрать последнюю рыбу или занять последнее место.",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Распределяйте маркеры ради большего числа действий или собирайте стопки ради приоритета. Учитывайте необходимые условия, а порядок действий выбирайте по ходу раунда."
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Распределяйте маркеры ради большего числа действий или собирайте стопки ради приоритета. Учитывайте необходимые условия, а порядок действий выбирайте по ходу раунда.",
|
||||
"Show full board": "Показать всё поле",
|
||||
"Focus on placed tiles": "Сосредоточиться на выложенных тайлах"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "Bạn không được chỉ chờ đợi. Nếu không có ưu thế ở đâu, hãy thu lại một chồng quân mà không hành động. Nếu có ưu thế nhưng hành động không thể thực hiện, cũng thu lại chồng quân đó. Khi giải quyết một chồng quân, bạn phải thực hiện hành động nếu nó khả thi.",
|
||||
"Finish your planned actions": "Hoàn tất các hành động đã lên kế hoạch",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "Giải quyết các chồng quân còn lại. Theo dõi hành động nào trở nên khả thi khi đối thủ thu quân. Lên kế hoạch không bảo đảm sẽ thực hiện được: ai đó có thể lấy con cá cuối cùng hoặc chiếm chỗ trống cuối cùng trước bạn.",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Phân tán quân để có thêm hành động, hoặc chồng quân để giành ưu tiên. Tính trước các điều kiện cần, rồi chọn thứ tự hành động theo diễn biến của vòng."
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "Phân tán quân để có thêm hành động, hoặc chồng quân để giành ưu tiên. Tính trước các điều kiện cần, rồi chọn thứ tự hành động theo diễn biến của vòng.",
|
||||
"Show full board": "Xem toàn bộ bàn chơi",
|
||||
"Focus on placed tiles": "Tập trung vào các ô đã đặt"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,5 +789,7 @@
|
|||
"You cannot simply wait. If you have no majority anywhere, remove one of your stacks without acting. If you have a majority but that action is impossible, remove that stack too. You must perform a possible action when resolving its stack.": "你不能只是等待。若所有行動都沒有數量優勢,就收回自己的一疊標記,不執行行動。若有數量優勢但行動無法執行,也要收回那疊標記。結算一疊標記時,只要行動可執行,就必須執行。",
|
||||
"Finish your planned actions": "完成規劃的行動",
|
||||
"Resolve your remaining stacks. Watch which actions become available when opponents remove theirs. Planning an action does not guarantee it: someone may take the last fish or use the last space first.": "結算剩餘的標記堆。注意對手收回標記後,哪些行動變得可用。規劃不保證能執行:有人可能先捕走最後的魚,或佔用最後的空位。",
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "分散標記以執行更多行動,或堆疊以爭取優先權。先考慮必要條件,再隨回合變化決定行動順序。"
|
||||
"Spread your markers for more actions, or stack them for priority. Plan prerequisites first, then choose your action order as the round unfolds.": "分散標記以執行更多行動,或堆疊以爭取優先權。先考慮必要條件,再隨回合變化決定行動順序。",
|
||||
"Show full board": "顯示整個圖板",
|
||||
"Focus on placed tiles": "聚焦已放置的板塊"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -448,21 +448,27 @@
|
|||
color: #356658;
|
||||
}
|
||||
.vanuatu .map-tools {
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
bottom: 85px;
|
||||
bottom: calc(var(--tray-height, 73px) + 12px);
|
||||
z-index: 2;
|
||||
}
|
||||
.vanuatu .map-tools button {
|
||||
background: #fff8dfcf;
|
||||
}
|
||||
.vanuatu .map-tools button[aria-pressed="true"] {
|
||||
background: #fff8df;
|
||||
box-shadow: inset 0 0 0 2px #356658;
|
||||
}
|
||||
.vanuatu .sea-dashboard > * {
|
||||
pointer-events: auto;
|
||||
}
|
||||
.vanuatu .upcoming {
|
||||
position: absolute;
|
||||
right: 13px;
|
||||
bottom: 87px;
|
||||
bottom: calc(var(--tray-height, 73px) + 14px);
|
||||
display: flex;
|
||||
gap: 0;
|
||||
}
|
||||
|
|
@ -1178,11 +1184,11 @@ body {
|
|||
width: 39px;
|
||||
}
|
||||
.vanuatu .map-tools {
|
||||
bottom: 107px;
|
||||
bottom: calc(var(--tray-height, 95px) + 12px);
|
||||
left: 6px;
|
||||
}
|
||||
.vanuatu .upcoming {
|
||||
bottom: 106px;
|
||||
bottom: calc(var(--tray-height, 95px) + 11px);
|
||||
right: 7px;
|
||||
}
|
||||
.vanuatu .upcoming img {
|
||||
|
|
@ -1269,6 +1275,11 @@ body {
|
|||
.vanuatu .map-cell:not(.legal) .cell-surface {
|
||||
stroke: #e2fff830;
|
||||
}
|
||||
.vanuatu .archipelago.overview .map-cell:not(.occupied) .cell-surface {
|
||||
stroke: #28697388;
|
||||
stroke-width: 1;
|
||||
vector-effect: non-scaling-stroke;
|
||||
}
|
||||
@media (max-width: 700px) {
|
||||
.vanuatu .map-scroll {
|
||||
padding-bottom: 125px;
|
||||
|
|
|
|||
26
viewer/ui.js
26
viewer/ui.js
|
|
@ -47,6 +47,7 @@ export function mountGame(target, options = {}) {
|
|||
tile = null,
|
||||
bonus = true,
|
||||
zoom = false,
|
||||
overview = false,
|
||||
lang = resolveLocale(options.language ?? "en"),
|
||||
hostedLocale = false,
|
||||
colorBlind = false,
|
||||
|
|
@ -66,6 +67,17 @@ export function mountGame(target, options = {}) {
|
|||
const moveSound = createMoveSound();
|
||||
const events = new AbortController();
|
||||
const listener = { signal: events.signal };
|
||||
const trayObserver = new ResizeObserver(([entry]) => {
|
||||
entry.target.parentElement?.style.setProperty(
|
||||
"--tray-height",
|
||||
`${entry.target.getBoundingClientRect().height}px`,
|
||||
);
|
||||
});
|
||||
function observeTray() {
|
||||
trayObserver.disconnect();
|
||||
const tray = play.querySelector(".turn-tray");
|
||||
if (tray) trayObserver.observe(tray);
|
||||
}
|
||||
const activity = mountActivity(root.querySelector(".activity-root"), {
|
||||
chat: options.chat,
|
||||
openPlayer: options.onOpenPlayer,
|
||||
|
|
@ -285,6 +297,7 @@ export function mountGame(target, options = {}) {
|
|||
const focus = document.activeElement?.getAttribute("data-action");
|
||||
play.querySelector(".action-dock").outerHTML = dock();
|
||||
play.querySelector(".turn-tray").outerHTML = tray();
|
||||
observeTray();
|
||||
if (focus)
|
||||
play
|
||||
.querySelector(`[data-action="${focus}"]`)
|
||||
|
|
@ -309,7 +322,8 @@ export function mountGame(target, options = {}) {
|
|||
.map((m) => m.cell)
|
||||
: actualTargets();
|
||||
play.innerHTML = `<header class="game-header"><div class="brand">${btn("🏝️ Vanuatu", "data-boardgame", "wordmark")}<span>Alain Epron · Quined Games</span></div><div class="round-track" aria-label="${t("round")} ${s.round}/8">${Array.from({ length: 8 }, (_, i) => `<span title="${t("round")} ${i + 1}/8" class="${i + 1 === s.round ? "current" : i + 1 < s.round ? "past" : ""}">${i + 1}</span>`).join("")}</div><nav class="header-tools">${analysis || !options.chat ? "" : titled(t("chat"), `${icon("chat")}<span class="unread-badge" hidden></span>`, 'data-activity="chat"', "icon-button")}${titled(t("journal"), icon("journal"), 'data-activity="journal"', "icon-button")}${titled(t("colorBlind"), icon("colorBlind"), `data-color-blind aria-pressed="${colorBlind}"`, "icon-button")}${titled(t("help"), icon("help"), "data-help", "icon-button")}${titled(t("full"), icon("fullscreen"), "data-fullscreen", "icon-button")}</nav></header>
|
||||
<div class="table">${dock()}<section class="sea-board" style="--ocean:url('${assets.ocean}')"><div class="sea-dashboard"><div class="market-info"><span title="${t("market")}">${icon("fish", t("market"))} = ${token("coin", s.market, `${t("market")}: ${s.market} ${"vatus per fish value"}`)}</span><span title="${t("tourist")}">${token("tourist", s.tourists, `${"Tourists available this round"}: ${s.tourists}`)}</span>${s.waterCountdown !== null ? `<span title="${t("waterLeft")}">${token("water", s.waterCountdown, `${t("waterLeft")}: ${s.waterCountdown}`)}</span>` : ""}</div>${tradeShips()}</div><div class="map-scroll ${zoom ? "zoomed" : ""}">${boardSvg(s, { player, colorBlind, language: lang, selected, targets, hoverTile: s.phase === "expand" ? tile : null, t })}</div><div class="map-tools">${titled(zoom ? t("fit") : t("zoom"), icon(zoom ? "eye" : "zoom"), "data-zoom", "icon-button")}</div>${s.upcoming.length && s.phase !== "expand" ? `<div class="upcoming" title="${t("next")}">${s.upcoming.map((id) => `<img src="${assets[TILES[id].art]}" alt="${t(TILES[id].type === "island" ? "island" : "sea")}">`).join("")}</div>` : ""}${trayHtml}</section></div><section class="players">${s.players.map(playerCard).join("")}</section><footer class="play-footer"><span title="${"Automatic conversion"}">${token("coin", 10)} → ${token("point", 5)}</span>${btn(t("help"), "data-help", "text-button")}</footer>`;
|
||||
<div class="table">${dock()}<section class="sea-board" style="--ocean:url('${assets.ocean}')"><div class="sea-dashboard"><div class="market-info"><span title="${t("market")}">${icon("fish", t("market"))} = ${token("coin", s.market, `${t("market")}: ${s.market} ${"vatus per fish value"}`)}</span><span title="${t("tourist")}">${token("tourist", s.tourists, `${"Tourists available this round"}: ${s.tourists}`)}</span>${s.waterCountdown !== null ? `<span title="${t("waterLeft")}">${token("water", s.waterCountdown, `${t("waterLeft")}: ${s.waterCountdown}`)}</span>` : ""}</div>${tradeShips()}</div><div class="map-scroll ${zoom ? "zoomed" : ""}">${boardSvg(s, { player, colorBlind, overview, language: lang, selected, targets, hoverTile: s.phase === "expand" ? tile : null, t })}</div><div class="map-tools">${titled(overview ? "Focus on placed tiles" : "Show full board", icon("overview"), `data-overview aria-pressed="${overview}"`, "icon-button")}${titled(zoom ? t("fit") : t("zoom"), icon(zoom ? "eye" : "zoom"), "data-zoom", "icon-button")}</div>${s.upcoming.length && s.phase !== "expand" ? `<div class="upcoming" title="${t("next")}">${s.upcoming.map((id) => `<img src="${assets[TILES[id].art]}" alt="${t(TILES[id].type === "island" ? "island" : "sea")}">`).join("")}</div>` : ""}${trayHtml}</section></div><section class="players">${s.players.map(playerCard).join("")}</section><footer class="play-footer"><span title="${"Automatic conversion"}">${token("coin", 10)} → ${token("point", 5)}</span>${btn(t("help"), "data-help", "text-button")}</footer>`;
|
||||
observeTray();
|
||||
const newScroll = play.querySelector(".map-scroll");
|
||||
if (newScroll) {
|
||||
newScroll.scrollLeft = sx;
|
||||
|
|
@ -444,9 +458,18 @@ export function mountGame(target, options = {}) {
|
|||
render();
|
||||
return;
|
||||
}
|
||||
if ("overview" in d) {
|
||||
overview = !overview;
|
||||
zoom = false;
|
||||
render();
|
||||
play.querySelector("[data-overview]").focus({ preventScroll: true });
|
||||
return;
|
||||
}
|
||||
if ("zoom" in d) {
|
||||
zoom = !zoom;
|
||||
if (zoom) overview = false;
|
||||
render();
|
||||
play.querySelector("[data-zoom]").focus({ preventScroll: true });
|
||||
return;
|
||||
}
|
||||
if ("characterChoice" in d) {
|
||||
|
|
@ -652,6 +675,7 @@ export function mountGame(target, options = {}) {
|
|||
},
|
||||
destroy() {
|
||||
events.abort();
|
||||
trayObserver.disconnect();
|
||||
moveSound.destroy();
|
||||
offChat?.();
|
||||
activity.destroy();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue