diff --git a/bgs/viewer.js b/bgs/viewer.js
index f88809b..ea864d6 100644
--- a/bgs/viewer.js
+++ b/bgs/viewer.js
@@ -11,7 +11,7 @@ registerViewer("SpaceAlert", (context) => {
style.textContent =
css +
`
- .bgs-hosted #setup,.bgs-hosted #lessons,.bgs-hosted #create-explorer,.bgs-hosted #seat,.bgs-hosted #ready-all,.bgs-hosted #next-event,.bgs-hosted #footer,.bgs-hosted #open-setup {display:none!important}
+ .bgs-hosted #setup,.bgs-hosted #lessons,.bgs-hosted #create-explorer,.bgs-hosted #seat,.bgs-hosted #ready-all,.bgs-hosted #next-event,.bgs-hosted #open-setup {display:none!important}
.bgs-hosted #career-manager:has(#explorers:empty) {display:none}
`;
target.innerHTML = html
diff --git a/docs/artwork.json b/docs/artwork.json
new file mode 100644
index 0000000..f87abdf
--- /dev/null
+++ b/docs/artwork.json
@@ -0,0 +1,44 @@
+{
+ "generator": "Built-in image_gen tool",
+ "usage": "Original illustrative equipment and threat art; live values and rules remain HTML overlays, never baked into images.",
+ "encoding": "WebP quality 84, original dimensions and alpha preserved.",
+ "assets": [
+ {
+ "file": "preview/assets/fighter.webp",
+ "prompt": "Use case: stylized-concept. Asset type: polished illustrated object for a science-fiction cooperative board-game UI on a dark navy background. Primary request: One enemy fighter spacecraft, shown whole in a dynamic three-quarter top view, nose pointing down-left toward the viewer. Angular silver armor, burnt-orange wing panels, twin blazing cyan engines, threatening but readable silhouette, a faint translucent blue defensive shield arc around the hull. No other ships. Style: colorful hand-painted 3D game inventory illustration, premium tabletop game art, clear large shapes, crisp silhouette, bright ivory highlights and vivid cyan/amber accents, strong readable contrast at 120 pixels. Composition: one centered object filling 85 percent of a square image, generous clean edge margin, three-quarter isometric perspective. Background: uniform very dark navy #0b1722, no room or scenery, no star field. Lighting: bright soft key light and cyan edge light so the entire object remains readable; avoid muddy darkness. No text, UI, panels, labels, logos, watermark or border. Original design, not copied from an existing franchise."
+ },
+ {
+ "file": "preview/assets/laser.webp",
+ "prompt": "Use case: stylized-concept. Asset type: polished illustrated object for a science-fiction cooperative board-game UI on a dark navy background. Primary request: One heavy shipboard laser turret: a large futuristic twin-barrel cannon on a circular rotating mount, ivory armor, brass mechanics, glowing amber energy chamber, two bright short red targeting beams pointing toward the upper right. The whole isolated object is visible. Style: colorful hand-painted 3D game inventory illustration, premium tabletop game art, clear large shapes, crisp silhouette, bright ivory highlights and vivid cyan/amber accents, strong readable contrast at 120 pixels. Composition: one centered object filling 85 percent of a square image, generous clean edge margin, three-quarter isometric perspective. Background: uniform very dark navy #0b1722, no room or scenery, no star field. Lighting: bright soft key light and cyan edge light so the entire object remains readable; avoid muddy darkness. No text, UI, panels, labels, logos, watermark or border. Original design, not copied from an existing franchise."
+ },
+ {
+ "file": "preview/assets/computer.webp",
+ "prompt": "Use case: stylized-concept. Asset type: polished illustrated object for a science-fiction cooperative board-game UI on a dark navy background. Primary request: One shipboard command computer console: a broad physical workstation with two angled glowing turquoise displays, tactile amber buttons and an ivory armored pedestal. Screen graphics are abstract radar circles and blocks, absolutely no letters or numbers. The whole isolated object is visible. Style: colorful hand-painted 3D game inventory illustration, premium tabletop game art, clear large shapes, crisp silhouette, bright ivory highlights and vivid cyan/amber accents, strong readable contrast at 120 pixels. Composition: one centered object filling 85 percent of a square image, generous clean edge margin, three-quarter isometric perspective. Background: uniform very dark navy #0b1722, no room or scenery, no star field. Lighting: bright soft key light and cyan edge light so the entire object remains readable; avoid muddy darkness. No text, UI, panels, labels, logos, watermark or border. Original design, not copied from an existing franchise."
+ },
+ {
+ "file": "preview/assets/battlebots.webp",
+ "prompt": "Use case: stylized-concept. Asset type: polished illustrated object for a science-fiction cooperative board-game UI on a dark navy background. Primary request: One sturdy friendly battle robot, full body, three-quarter front view, ivory armor over dark mechanical joints, bright cyan visor, two short heavy arm cannons, gold shoulder plates, stocky clear silhouette. The whole isolated robot is visible. Style: colorful hand-painted 3D game inventory illustration, premium tabletop game art, clear large shapes, crisp silhouette, bright ivory highlights and vivid cyan/amber accents, strong readable contrast at 120 pixels. Composition: one centered object filling 85 percent of a square image, generous clean edge margin, three-quarter isometric perspective. Background: uniform very dark navy #0b1722, no room or scenery, no star field. Lighting: bright soft key light and cyan edge light so the entire object remains readable; avoid muddy darkness. No text, UI, panels, labels, logos, watermark or border. Original design, not copied from an existing franchise."
+ },
+ {
+ "file": "preview/assets/shield.webp",
+ "prompt": "Use case: stylized-concept. Asset type: isolated illustrated equipment for a science-fiction board-game UI on dark navy. One shipboard defensive shield generator: a squat circular ivory-and-brass projector emitting a vivid turquoise transparent hexagonal shield dome, clear protective shield silhouette. Match premium hand-painted 3D game inventory art: bright ivory armor, brass mechanisms, crisp large shapes and strong cyan/amber edge lighting. One centered object fills 85% of a square image, three-quarter isometric view, generous clean edge margin. Plain very dark navy #0b1722 backdrop without room or scenery. Readable at 80px. No text, UI, numbers, labels, logo, watermark or border. Original design."
+ },
+ {
+ "file": "preview/assets/reactor.webp",
+ "prompt": "Use case: stylized-concept. Asset type: isolated illustrated equipment for a science-fiction board-game UI on dark navy. One shipboard power reactor: a cylindrical glowing golden-orange energy core in an ivory armored housing, heavy copper connectors and three clearly readable illuminated energy cells. Match premium hand-painted 3D game inventory art: bright ivory armor, brass mechanisms, crisp large shapes and strong cyan/amber edge lighting. One centered object fills 85% of a square image, three-quarter isometric view, generous clean edge margin. Plain very dark navy #0b1722 backdrop without room or scenery. Readable at 80px. No text, UI, numbers, labels, logo, watermark or border. Original design."
+ },
+ {
+ "file": "preview/assets/pulse.webp",
+ "prompt": "Use case: stylized-concept. Asset type: isolated illustrated equipment for a science-fiction board-game UI on dark navy. One shipboard omnidirectional pulse cannon: a round ivory-and-brass emitter on a rotating mount with a vivid violet-blue plasma sphere and two broad luminous concentric shockwave rings. It must look different from a barrel-shaped laser cannon. Match premium hand-painted 3D game inventory art: bright ivory armor, brass mechanisms, crisp large shapes and strong cyan/amber edge lighting. One centered object fills 85% of a square image, three-quarter isometric view, generous clean edge margin. Plain very dark navy #0b1722 backdrop without room or scenery. Readable at 80px. No text, UI, numbers, labels, logo, watermark or border. Original design."
+ },
+ {
+ "file": "preview/assets/rocket.webp",
+ "prompt": "Use case: stylized-concept. Asset type: isolated illustrated equipment for a science-fiction board-game UI on dark navy. One futuristic ship-launched missile on a small rack: an ivory rocket with orange fins, metallic body and brilliant cyan exhaust, angled diagonally up-right, whole object visible. Match premium hand-painted 3D game inventory art: bright ivory armor, brass mechanisms, crisp large shapes and strong cyan/amber edge lighting. One centered object fills 85% of a square image, three-quarter isometric view, generous clean edge margin. Plain very dark navy #0b1722 backdrop without room or scenery. Readable at 80px. No text, UI, numbers, labels, logo, watermark or border. Original design."
+ }
+ ],
+ "currentRendering": {
+ "equipment": "Flat, original SVG drawings in preview/icons.js (equipmentPicture). These replace the detailed equipment bitmaps on the ship, cards and inspectors.",
+ "ship": "HTML rooms and original SVG/CSS hull, doors, lifts and energy conduits in preview/tactical.js and preview/style.css.",
+ "threats": "Flat, original SVG silhouettes in preview/icons.js, grouped by threat family in preview/art.js. All previous bitmap illustrations are retained as design sources but are no longer displayed or bundled."
+ }
+}
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..3d71c47
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,724 @@
+{
+ "name": "@boardgamers/space-alert",
+ "version": "0.1.4",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "@boardgamers/space-alert",
+ "version": "0.1.4",
+ "license": "AGPL-3.0-only",
+ "devDependencies": {
+ "@boardgamers/protocol": "0.8.1",
+ "esbuild": "^0.28.2"
+ },
+ "engines": {
+ "node": ">=24"
+ }
+ },
+ "../boardgamers-mono/node_modules/.pnpm/@types+node@24.11.0/node_modules/@types/node": {
+ "version": "24.11.0",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~7.16.0"
+ }
+ },
+ "../boardgamers-mono/node_modules/.pnpm/oxfmt@0.61.0_svelte@5.56.8_@typescript-eslint+types@8.56.1_/node_modules/oxfmt": {
+ "version": "0.61.0",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tinypool": "2.1.0"
+ },
+ "bin": {
+ "oxfmt": "bin/oxfmt"
+ },
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/Boshen"
+ },
+ "optionalDependencies": {
+ "@oxfmt/binding-android-arm-eabi": "0.61.0",
+ "@oxfmt/binding-android-arm64": "0.61.0",
+ "@oxfmt/binding-darwin-arm64": "0.61.0",
+ "@oxfmt/binding-darwin-x64": "0.61.0",
+ "@oxfmt/binding-freebsd-x64": "0.61.0",
+ "@oxfmt/binding-linux-arm-gnueabihf": "0.61.0",
+ "@oxfmt/binding-linux-arm-musleabihf": "0.61.0",
+ "@oxfmt/binding-linux-arm64-gnu": "0.61.0",
+ "@oxfmt/binding-linux-arm64-musl": "0.61.0",
+ "@oxfmt/binding-linux-ppc64-gnu": "0.61.0",
+ "@oxfmt/binding-linux-riscv64-gnu": "0.61.0",
+ "@oxfmt/binding-linux-riscv64-musl": "0.61.0",
+ "@oxfmt/binding-linux-s390x-gnu": "0.61.0",
+ "@oxfmt/binding-linux-x64-gnu": "0.61.0",
+ "@oxfmt/binding-linux-x64-musl": "0.61.0",
+ "@oxfmt/binding-openharmony-arm64": "0.61.0",
+ "@oxfmt/binding-win32-arm64-msvc": "0.61.0",
+ "@oxfmt/binding-win32-ia32-msvc": "0.61.0",
+ "@oxfmt/binding-win32-x64-msvc": "0.61.0"
+ },
+ "peerDependencies": {
+ "svelte": "^5.0.0",
+ "vite-plus": "*"
+ },
+ "peerDependenciesMeta": {
+ "svelte": {
+ "optional": true
+ },
+ "vite-plus": {
+ "optional": true
+ }
+ }
+ },
+ "../boardgamers-mono/node_modules/.pnpm/oxlint-tsgolint@0.16.0/node_modules/oxlint-tsgolint": {
+ "version": "0.16.0",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "tsgolint": "bin/tsgolint.js"
+ },
+ "optionalDependencies": {
+ "@oxlint-tsgolint/darwin-arm64": "0.16.0",
+ "@oxlint-tsgolint/darwin-x64": "0.16.0",
+ "@oxlint-tsgolint/linux-arm64": "0.16.0",
+ "@oxlint-tsgolint/linux-x64": "0.16.0",
+ "@oxlint-tsgolint/win32-arm64": "0.16.0",
+ "@oxlint-tsgolint/win32-x64": "0.16.0"
+ }
+ },
+ "../boardgamers-mono/node_modules/.pnpm/oxlint@1.51.0_oxlint-tsgolint@0.16.0/node_modules/oxlint": {
+ "version": "1.51.0",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "oxlint": "bin/oxlint"
+ },
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/Boshen"
+ },
+ "optionalDependencies": {
+ "@oxlint/binding-android-arm-eabi": "1.51.0",
+ "@oxlint/binding-android-arm64": "1.51.0",
+ "@oxlint/binding-darwin-arm64": "1.51.0",
+ "@oxlint/binding-darwin-x64": "1.51.0",
+ "@oxlint/binding-freebsd-x64": "1.51.0",
+ "@oxlint/binding-linux-arm-gnueabihf": "1.51.0",
+ "@oxlint/binding-linux-arm-musleabihf": "1.51.0",
+ "@oxlint/binding-linux-arm64-gnu": "1.51.0",
+ "@oxlint/binding-linux-arm64-musl": "1.51.0",
+ "@oxlint/binding-linux-ppc64-gnu": "1.51.0",
+ "@oxlint/binding-linux-riscv64-gnu": "1.51.0",
+ "@oxlint/binding-linux-riscv64-musl": "1.51.0",
+ "@oxlint/binding-linux-s390x-gnu": "1.51.0",
+ "@oxlint/binding-linux-x64-gnu": "1.51.0",
+ "@oxlint/binding-linux-x64-musl": "1.51.0",
+ "@oxlint/binding-openharmony-arm64": "1.51.0",
+ "@oxlint/binding-win32-arm64-msvc": "1.51.0",
+ "@oxlint/binding-win32-ia32-msvc": "1.51.0",
+ "@oxlint/binding-win32-x64-msvc": "1.51.0"
+ },
+ "peerDependencies": {
+ "oxlint-tsgolint": ">=0.15.0"
+ },
+ "peerDependenciesMeta": {
+ "oxlint-tsgolint": {
+ "optional": true
+ }
+ }
+ },
+ "../boardgamers-mono/node_modules/.pnpm/playwright@1.62.1/node_modules/playwright": {
+ "version": "1.62.1",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "playwright-core": "1.62.1"
+ },
+ "bin": {
+ "playwright": "cli.js"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "optionalDependencies": {
+ "fsevents": "2.3.2"
+ }
+ },
+ "../boardgamers-mono/node_modules/.pnpm/typescript@7.0.2/node_modules/typescript": {
+ "version": "7.0.2",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "tsc": "bin/tsc"
+ },
+ "engines": {
+ "node": ">=16.20.0"
+ },
+ "optionalDependencies": {
+ "@typescript/typescript-aix-ppc64": "7.0.2",
+ "@typescript/typescript-darwin-arm64": "7.0.2",
+ "@typescript/typescript-darwin-x64": "7.0.2",
+ "@typescript/typescript-freebsd-arm64": "7.0.2",
+ "@typescript/typescript-freebsd-x64": "7.0.2",
+ "@typescript/typescript-linux-arm": "7.0.2",
+ "@typescript/typescript-linux-arm64": "7.0.2",
+ "@typescript/typescript-linux-loong64": "7.0.2",
+ "@typescript/typescript-linux-mips64el": "7.0.2",
+ "@typescript/typescript-linux-ppc64": "7.0.2",
+ "@typescript/typescript-linux-riscv64": "7.0.2",
+ "@typescript/typescript-linux-s390x": "7.0.2",
+ "@typescript/typescript-linux-x64": "7.0.2",
+ "@typescript/typescript-netbsd-arm64": "7.0.2",
+ "@typescript/typescript-netbsd-x64": "7.0.2",
+ "@typescript/typescript-openbsd-arm64": "7.0.2",
+ "@typescript/typescript-openbsd-x64": "7.0.2",
+ "@typescript/typescript-sunos-x64": "7.0.2",
+ "@typescript/typescript-win32-arm64": "7.0.2",
+ "@typescript/typescript-win32-x64": "7.0.2"
+ }
+ },
+ "../boardgamers-mono/node_modules/.pnpm/zod@4.3.6/node_modules/zod": {
+ "version": "4.3.6",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/colinhacks"
+ }
+ },
+ "../boardgamers-mono/packages/protocol": {
+ "name": "@boardgamers/protocol",
+ "version": "0.8.1",
+ "dev": true,
+ "license": "AGPL-3.0-only",
+ "dependencies": {
+ "zod": "^4.3.6"
+ },
+ "devDependencies": {
+ "@types/node": "catalog:",
+ "oxfmt": "catalog:",
+ "oxlint": "^1.51.0",
+ "oxlint-tsgolint": "^0.16.0",
+ "playwright": "1.62.1",
+ "typescript": "catalog:"
+ }
+ },
+ "../boardgamers-mono/packages/protocol/node_modules/@types/node": {
+ "resolved": "../boardgamers-mono/node_modules/.pnpm/@types+node@24.11.0/node_modules/@types/node",
+ "link": true
+ },
+ "../boardgamers-mono/packages/protocol/node_modules/oxfmt": {
+ "resolved": "../boardgamers-mono/node_modules/.pnpm/oxfmt@0.61.0_svelte@5.56.8_@typescript-eslint+types@8.56.1_/node_modules/oxfmt",
+ "link": true
+ },
+ "../boardgamers-mono/packages/protocol/node_modules/oxlint": {
+ "resolved": "../boardgamers-mono/node_modules/.pnpm/oxlint@1.51.0_oxlint-tsgolint@0.16.0/node_modules/oxlint",
+ "link": true
+ },
+ "../boardgamers-mono/packages/protocol/node_modules/oxlint-tsgolint": {
+ "resolved": "../boardgamers-mono/node_modules/.pnpm/oxlint-tsgolint@0.16.0/node_modules/oxlint-tsgolint",
+ "link": true
+ },
+ "../boardgamers-mono/packages/protocol/node_modules/playwright": {
+ "resolved": "../boardgamers-mono/node_modules/.pnpm/playwright@1.62.1/node_modules/playwright",
+ "link": true
+ },
+ "../boardgamers-mono/packages/protocol/node_modules/typescript": {
+ "resolved": "../boardgamers-mono/node_modules/.pnpm/typescript@7.0.2/node_modules/typescript",
+ "link": true
+ },
+ "../boardgamers-mono/packages/protocol/node_modules/zod": {
+ "resolved": "../boardgamers-mono/node_modules/.pnpm/zod@4.3.6/node_modules/zod",
+ "link": true
+ },
+ "node_modules/@boardgamers/protocol": {
+ "resolved": "../boardgamers-mono/packages/protocol",
+ "link": true
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz",
+ "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz",
+ "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz",
+ "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz",
+ "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz",
+ "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz",
+ "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz",
+ "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz",
+ "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz",
+ "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz",
+ "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz",
+ "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz",
+ "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz",
+ "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz",
+ "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz",
+ "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz",
+ "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.28.2",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz",
+ "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz",
+ "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz",
+ "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz",
+ "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz",
+ "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz",
+ "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz",
+ "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz",
+ "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz",
+ "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/esbuild": {
+ "version": "0.28.2",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.28.2",
+ "@esbuild/android-arm": "0.28.2",
+ "@esbuild/android-arm64": "0.28.2",
+ "@esbuild/android-x64": "0.28.2",
+ "@esbuild/darwin-arm64": "0.28.2",
+ "@esbuild/darwin-x64": "0.28.2",
+ "@esbuild/freebsd-arm64": "0.28.2",
+ "@esbuild/freebsd-x64": "0.28.2",
+ "@esbuild/linux-arm": "0.28.2",
+ "@esbuild/linux-arm64": "0.28.2",
+ "@esbuild/linux-ia32": "0.28.2",
+ "@esbuild/linux-loong64": "0.28.2",
+ "@esbuild/linux-mips64el": "0.28.2",
+ "@esbuild/linux-ppc64": "0.28.2",
+ "@esbuild/linux-riscv64": "0.28.2",
+ "@esbuild/linux-s390x": "0.28.2",
+ "@esbuild/linux-x64": "0.28.2",
+ "@esbuild/netbsd-arm64": "0.28.2",
+ "@esbuild/netbsd-x64": "0.28.2",
+ "@esbuild/openbsd-arm64": "0.28.2",
+ "@esbuild/openbsd-x64": "0.28.2",
+ "@esbuild/openharmony-arm64": "0.28.2",
+ "@esbuild/sunos-x64": "0.28.2",
+ "@esbuild/win32-arm64": "0.28.2",
+ "@esbuild/win32-ia32": "0.28.2",
+ "@esbuild/win32-x64": "0.28.2"
+ }
+ }
+ }
+}
diff --git a/package.json b/package.json
index f506d11..478c84f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@boardgamers/space-alert",
- "version": "0.1.3",
+ "version": "0.1.4",
"private": true,
"type": "module",
"description": "Space Alert and The New Frontier: deterministic game engine and local playtest",
@@ -19,7 +19,7 @@
"url": "git+https://github.com/boardgamers/space-alert.git"
},
"devDependencies": {
- "@boardgamers/protocol": "^0.8.0",
+ "@boardgamers/protocol": "0.8.1",
"esbuild": "^0.28.2"
},
"exports": {
diff --git a/preview/app.js b/preview/app.js
index cb8930f..0e4afce 100644
--- a/preview/app.js
+++ b/preview/app.js
@@ -1,8 +1,14 @@
+import { mountNavigation } from "./navigation.js";
+import { pictogram, shipLocator, specializationIcons } from "./icons.js";
+import { createTacticalView } from "./tactical.js";
+import { illustration } from "./art.js";
import {
specialDescription,
traitDescriptions,
effectDescription,
eventDescription,
+ zoneLabel,
+ stationLabel,
} from "./text.js";
export function mountConsole(root, host = null) {
const $ = (s) => root.querySelector(s);
@@ -40,15 +46,18 @@ export function mountConsole(root, host = null) {
combine = false,
lastSpoken = 0;
const t = (fr, en) => (locale === "fr" ? fr : en);
+ const navigation = mountNavigation(root, {
+ locale: () => locale,
+ hosted: !!host,
+ });
+ let appearance = {};
+ const playerBadge = (i) => {
+ const badge = appearance.players?.[i]?.pro && appearance.supporterBadge;
+ return badge ? ` ` : "";
+ };
const playerName = (i) =>
esc(view?.players[i]?.name ?? `${t("Joueur", "Player")} ${i + 1}`);
- const zones = ["red", "white", "blue"];
- const zoneName = (z) =>
- ({
- red: t("Rouge", "Red"),
- white: t("Blanc", "White"),
- blue: t("Bleu", "Blue"),
- })[z] ?? z;
+ const zoneName = (z) => zoneLabel(z, locale);
const names = {
rocketeer: ["Artilleur", "Rocketeer"],
"data-analyst": ["Analyste", "Data Analyst"],
@@ -74,28 +83,52 @@ export function mountConsole(root, host = null) {
"C · Station system or repair",
),
bots: t("Attaquer avec les robots", "Battlebot attack"),
- red: t("Aller vers le rouge", "Move red"),
- blue: t("Aller vers le bleu", "Move blue"),
+ red: t("Aller à gauche", "Move left"),
+ blue: t("Aller à droite", "Move right"),
lift: t("Changer de pont", "Change deck"),
})[a] ??
(a.startsWith("special:")
? `${specialName(a.split(":")[1])} · ${a.endsWith("advanced") ? t("avancé", "advanced") : t("basique", "basic")}`
: a.startsWith("teleport:")
- ? t("Déplacement héroïque · ", "Heroic move · ") + a.slice(9)
+ ? t("Déplacement héroïque · ", "Heroic move · ") +
+ stationLabel(a.slice(9), locale)
: a.startsWith("hero:")
? t("Héroïque · ", "Heroic · ") + label(a.slice(5))
: a);
function icon(a) {
+ if (a === "bots")
+ return `${illustration("battlebots")} `;
if (a.startsWith("special:"))
- return `✦ ${esc(specialName(a.split(":")[1]))} ${a.endsWith("advanced") ? "Ⅱ" : "Ⅰ"} `;
- if (a.startsWith("hero:")) return "★" + icon(a.slice(5));
+ return `${pictogram(specializationIcons[a.split(":")[1]])}${a.endsWith("advanced") ? "Ⅱ" : "Ⅰ"} `;
+ if (a.startsWith("hero:"))
+ return `${pictogram("star")}${icon(a.slice(5))} `;
if (a.startsWith("teleport:"))
- return `↗ ${esc(zoneName(a.split(":")[1].split("-")[0]))} ${a.endsWith("upper") ? "↑" : "↓"} `;
- return (
- { A: "A", B: "B", C: "C", bots: "♟", red: "←", blue: "→", lift: "↕" }[
- a
- ] ?? esc(a)
- );
+ return `${pictogram("teleport")}${shipLocator([a.slice(9)])} `;
+ const actionIcon = {
+ bots: "bots",
+ red: "left",
+ blue: "right",
+ lift: "lift",
+ }[a];
+ return actionIcon ? pictogram(actionIcon) : esc(a);
+ }
+ const symbol = (name, description, content = "") =>
+ `${pictogram(name)}${content} `;
+ const { shipCutaway, threatPortrait } = createTacticalView({
+ t,
+ esc,
+ symbol,
+ zoneName,
+ });
+ function updateSound() {
+ const button = $("#sound");
+ const description = sound
+ ? t("Désactiver les annonces vocales", "Mute voice announcements")
+ : t("Activer les annonces vocales", "Enable voice announcements");
+ button.title = description;
+ button.setAttribute("aria-label", description);
+ button.setAttribute("aria-pressed", String(sound));
+ button.innerHTML = pictogram(sound ? "speaker" : "muted");
}
const duration = (ms) => {
const s = Math.max(0, Math.ceil(ms / 1000));
@@ -135,12 +168,28 @@ export function mountConsole(root, host = null) {
);
}
function button(command, text, disabled = false, extra = "") {
- return `${text} `;
+ const name = {
+ ready: "check",
+ unready: "close",
+ "advance-phase": "step",
+ "finish-planning": "lock",
+ draw: "cards",
+ "draw-android": "android",
+ resolve: "step",
+ "resolve-all": "forward",
+ }[command];
+ return `${name ? pictogram(name) : ""}${text} `;
}
function phaseFor(turn) {
return turn <= 3 ? 1 : turn <= 7 ? 2 : 3;
}
function localizeSetup() {
+ updateSound();
+ $("#seat").setAttribute("aria-label", t("Point de vue", "Viewpoint"));
+ $("#program-crew").setAttribute(
+ "aria-label",
+ t("Équipier à programmer", "Crew to program"),
+ );
const fields = {
players: ["Joueurs", "Players"],
"crew-size": ["Équipage", "Crew"],
@@ -194,27 +243,21 @@ export function mountConsole(root, host = null) {
],
};
options.difficulty = options["serious-difficulty"] = [
- ["Blanches", "White"],
- ["Blanches + jaunes", "White + yellow"],
- ["Jaunes", "Yellow"],
- ["Toutes", "All"],
- ["Jaunes + rouges", "Yellow + red"],
- ["Rouges", "Red"],
+ ["Niveau 1", "Level 1"],
+ ["Niveaux 1 + 2", "Levels 1 + 2"],
+ ["Niveau 2", "Level 2"],
+ ["Tous les niveaux", "All levels"],
+ ["Niveaux 2 + 3", "Levels 2 + 3"],
+ ["Niveau 3", "Level 3"],
];
for (const [id, values] of Object.entries(options))
[...$("#" + id).options].forEach(
(o, i) => (o.textContent = t(...values[i])),
);
for (const [id, words] of Object.entries({
- "new-button": ["Nouvelle session locale", "New local session"],
- "ready-all": [
- "Confirmer tous les joueurs · test local",
- "Ready all players · local test",
- ],
- "next-event": [
- "Prochaine annonce · test local",
- "Next announcement · local test",
- ],
+ "new-button": ["Préparer la mission", "Prepare mission"],
+ "ready-all": ["Tout l’équipage est prêt", "Ready all crew"],
+ "next-event": ["Prochaine annonce", "Next announcement"],
"create-explorer-button": ["Créer un explorateur", "Create explorer"],
}))
$("#" + id).textContent = t(...words);
@@ -230,12 +273,6 @@ export function mountConsole(root, host = null) {
if (crew >= view.crewSize) crew = seat;
root.lang = locale;
localizeSetup();
- $("#locale").value = locale;
- const openThreats = new Set(
- [...root.querySelectorAll("details[data-threat][open]")].map(
- (el) => el.dataset.threat,
- ),
- );
const g = view.game,
own = view.players[seat] ?? {
ready: true,
@@ -266,30 +303,12 @@ export function mountConsole(root, host = null) {
$("#crew").innerHTML = view.players
.map(
(p) =>
- `${playerName(p.seat)} · ${p.planningPhase ? `${p.finishedPlanning ? "🔒" : t("Phase", "Phase")} ${p.planningPhase}` : p.ready ? t("présent", "ready") : t("attente", "waiting")} `,
+ `${playerName(p.seat)}${playerBadge(p.seat)} · ${p.planningPhase ? `${p.finishedPlanning ? "🔒" : t("Phase", "Phase")} ${p.planningPhase}` : p.ready ? t("présent", "ready") : t("attente", "waiting")} `,
)
.join("");
$("#ship-title").textContent = t("Le vaisseau", "The ship");
$("#threat-title").textContent = t("Menaces détectées", "Detected threats");
$("#program-title").textContent = t("Programme de vol", "Flight program");
- $("#journal-title").textContent = t("Journal de mission", "Mission log");
- $("#setup-title").textContent = t(
- "Session locale · configuration",
- "Local session · setup",
- );
- $("#help-title").textContent = t("Guide de bord", "Flight guide");
- $("#notice").textContent = t(
- "Jeu de base et The New Frontier · version locale en cours de validation.",
- "Base game and The New Frontier · local playtest under rules review.",
- );
- $("#scope").textContent = t(
- "103 menaces, doubles actions, spécialisations et carrières disponibles. Choisissez une mission courte pour débuter.",
- "103 threats, double actions, specializations and careers available. Choose a short mission to start.",
- );
- $("#lessons-title").textContent = t(
- "École de vol · exercices libres",
- "Flight school · untimed exercises",
- );
$("#lesson-list").innerHTML = lessons
.map(
(l) =>
@@ -298,55 +317,45 @@ export function mountConsole(root, host = null) {
.join(" ");
$("#lesson-guide").hidden = !view.tutorial;
$("#lesson-guide").innerHTML = view.tutorial
- ? `
${esc(view.tutorial.title[locale === "fr" ? 0 : 1])} ${view.tutorial.instructions.map((p) => `${esc(p[locale === "fr" ? 0 : 1])} `).join("")} ${view.stage === "programming" ? `${view.phase === 1 ? t("Phase 2 →", "Phase 2 →") : t("Terminer la programmation", "Finish programming")} ` : ""} ${t("Recommencer", "Restart")} `
+ ? `${view.tutorial.instructions.map((p) => `${esc(p[locale === "fr" ? 0 : 1])} `).join("")} ${view.stage === "programming" ? `${pictogram(view.phase === 1 ? "step" : "lock")}${view.phase === 1 ? t("Phase 2", "Phase 2") : t("Terminer la programmation", "Finish programming")} ` : ""} ${pictogram("restart")} `
: "";
- $("#footer").textContent = t(
- "Adaptation en cours · Space Alert, Vlaada Chvátil / Czech Games Edition. Hôte local de test ; aucune connexion à BGS.",
- "Adaptation in progress · Space Alert, Vlaada Chvátil / Czech Games Edition. Local test host; no BGS connection.",
+ $("#comms").innerHTML = symbol(
+ view.communicationsAvailable ? "comms" : "muted",
+ view.communicationsAvailable
+ ? t("Communications disponibles", "Communications online")
+ : t(
+ "Communications interrompues : gardez le silence",
+ "Communications down: stay silent",
+ ),
+ view.communicationsAvailable
+ ? ""
+ : `${t("Silence", "Silence")} `,
);
- $("#comms").textContent = view.communicationsAvailable
- ? t("COMMS · OK", "COMMS · ONLINE")
- : t("COMMS · SILENCE", "COMMS · BLACKOUT");
$("#comms").classList.toggle("offline", !view.communicationsAvailable);
$("#phase").textContent = view.phase
? `${t("PHASE", "PHASE")} ${view.phase}`
: "";
if (ship) {
- $("#ship").innerHTML = ["upper", "lower"]
- .flatMap((deck) =>
- zones.map((z) => {
- const station = `${z}-${deck}`,
- s = ship.zones[z],
- crewHere = ship.crew.filter(
- (p) => p.station === station && !p.space,
- );
- const system = deck === "upper" ? "shield" : "reactor",
- capacity =
- (system === "shield"
- ? z === "white"
- ? 3
- : 2
- : z === "white"
- ? 5
- : 3) - Number(s.damage.includes(system));
- const c = {
- "red-upper": t("Intercepteurs", "Interceptors"),
- "white-upper": t("Ordinateur", "Computer"),
- "blue-upper": t("Robots", "Battlebots"),
- "red-lower": t("Robots", "Battlebots"),
- "white-lower": t("Observation", "Visual confirmation"),
- "blue-lower": t("Roquette", "Rocket"),
- }[station];
- return `${esc(zoneName(z))} ${deck === "upper" ? "↑" : "↓"}
${deck === "lower" && z === "white" ? "◎" : "⌁"} ${(deck === "upper" ? (z === "white" ? 5 : 4) : z === "white" ? 1 : 2) - Number(s.damage.includes(`${deck}-weapon`) && station !== "white-lower")}
A ${deck === "lower" && z === "white" ? t("Impulsion", "Pulse") : t("Laser", "Laser")}
B ${system === "shield" ? "⛨" : "⚡"} ${s[system]}/${capacity}
C ${esc(c)}
${crewHere.map((p) => `${p.id + 1} `).join("")}
${s.damage.length ? `
${t("Dégâts", "Damage")} ${s.damage.length}/6
` : ""}
`;
- }),
- )
- .join("");
+ $("#ship").innerHTML = shipCutaway({
+ ship,
+ selectedCrew: crew,
+ canPlan:
+ view.stage === "programming" &&
+ seat >= 0 &&
+ (g?.solo || crew === seat || crew >= view.players.length) &&
+ !own.finishedPlanning,
+ crewLabel: (id) =>
+ view.players[id]?.name ?? `${t("Androïde", "Android")} ${id + 1}`,
+ });
$("#resources").innerHTML =
- `⚡ ${t("Combustible", "Fuel")} ${ship.fuel} ↗ ${t("Roquettes", "Rockets")} ${ship.rockets} ⌨ ${ship.computer.map((x) => (x ? "●" : "○")).join(" ")} ♟ ${ship.bots.filter((b) => b.owner === null && b.station && !b.disabled).length} ${t("disponibles", "available")} ${ship.crew
+ `${symbol("fuel", `${t("Combustible", "Fuel")} : ${ship.fuel}`, `${ship.fuel} `)}${symbol("rocket", `${t("Roquettes", "Rockets")} : ${ship.rockets}`, `${ship.rockets} `)}${symbol("computer", t("Ordinateur", "Computer") + " · " + ship.computer.map((x, i) => `${t("Phase", "Phase")} ${i + 1} : ${x ? t("entretenu", "maintained") : t("à entretenir", "not maintained")}`).join(" · "), ship.computer.map((x, i) => `${i + 1} `).join(""))}${symbol("bots", `${t("Robots disponibles", "Available battlebots")} : ${ship.bots.filter((b) => b.owner === null && b.station && !b.disabled).length}`, `${ship.bots.filter((b) => b.owner === null && b.station && !b.disabled).length} `)}${ship.crew
.filter((p) => p.space)
- .map(
- (p) =>
- `↗ ${t("Équipier", "Crew")} ${p.id + 1} · ${t("portée", "range")} ${p.space}${p.knockedOut ? " †" : ""} `,
+ .map((p) =>
+ symbol(
+ "interceptor",
+ `${t("Équipier", "Crew")} ${p.id + 1} · ${t("portée", "range")} ${p.space}${p.knockedOut ? " · " + t("hors combat", "knocked out") : ""}`,
+ `${p.id + 1} · ${p.space}${p.knockedOut ? " †" : ""}`,
+ ),
)
.join("")}`;
}
@@ -359,7 +368,7 @@ export function mountConsole(root, host = null) {
threats
.map(
(th) =>
- `T+${th.turn} ${esc(th.name)} ${th.status === "destroyed" ? "✓" : th.status === "survived" ? "↘" : `${Math.max(0, th.hp - (th.damage ?? 0))} ♥ · ${th.shield} ⛨`} ${th.position === "internal" ? esc(th.stations.join(", ")) + " · " + esc(label(th.repair)) : esc(zoneName(th.zone))} · ${t("Vitesse", "Speed")} ${th.speed}
${traitDescriptions(
+ ` stationLabel(s, locale)).join(", ") : zoneName(th.zone))} · ${t("Détails", "Details")}">${esc(th.name)} T+${th.turn} ${threatPortrait(th)} ${(th.track ?? g.tracks[th.zone ?? "internal"]) ? trackHtml(th, g) : ""}${threatPortrait(th)}${symbol("speed", `${t("Vitesse", "Speed")} : ${th.speed}`, th.speed)}
${th.position === "internal" ? esc(th.stations.map((s) => stationLabel(s, locale)).join(", ")) + " · " + esc(label(th.repair)) : esc(zoneName(th.zone))}
${traitDescriptions(
th,
locale,
)
@@ -371,7 +380,7 @@ export function mountConsole(root, host = null) {
)
.join(
"",
- )}${calledHtml(th.calledCard)}${(th.track ?? g.tracks[th.zone ?? "internal"]) ? trackHtml(th, g) : ""} `,
+ )}${calledHtml(th.calledCard)}${(th.track ?? g.tracks[th.zone ?? "internal"]) ? trackHtml(th, g) : ""}`,
)
.join("") ||
`${t("En attente des premières détections.", "Awaiting the first detections.")}
`;
@@ -401,7 +410,7 @@ export function mountConsole(root, host = null) {
$("#program-crew").innerHTML = Array.from(
{ length: view.crewSize },
(_, i) =>
- `${g?.solo || i >= view.players.length ? `${t("Androïde", "Android")} ${i + 1}` : playerName(i)}${g?.specializations[i] ? " · " + esc(specialName(g.specializations[i].name)) : ""} `,
+ `${g?.solo || i >= view.players.length ? `${t("Androïde", "Android")} ${i + 1}` : playerName(i)}${g?.specializations[i] ? " · " + esc(specialName(g.specializations[i].name)) : ""} `,
).join("");
const planning = view.stage === "programming",
canOwn =
@@ -416,7 +425,8 @@ export function mountConsole(root, host = null) {
canOwn &&
!own.finishedPlanning &&
phaseFor(slot.turn) === ownPhase;
- return ` ownPhase ? "future" : ""}" data-turn="${slot.turn}" ${editable ? "" : "disabled"} title="T+${slot.turn}">T+${slot.turn} ${phaseFor(slot.turn) < ownPhase ? "🔒" : ""} ${slot.cards.map((c) => (c.sides ? c.sides[c.side].map(icon).join(" ") : c.category === "movement" ? "↔" : "◆")).join(" + ") || "·"} `;
+ const description = `T+${slot.turn} · ${slot.cards.map((c) => (c.sides ? c.sides[c.side].map(label).join(" → ") : c.category === "movement" ? t("Déplacement", "Movement") : t("Action", "Action"))).join(" + ") || t("Vide", "Empty")}`;
+ return ` ownPhase ? "future" : ""}" data-turn="${slot.turn}" ${editable ? "" : "disabled"} title="${esc(description)}" aria-label="${esc(description)}">T+${slot.turn} ${phaseFor(slot.turn) < ownPhase ? pictogram("lock") : ""} ${slot.cards.map((c) => (c.sides ? c.sides[c.side].map(icon).join(" ") : pictogram(c.category === "movement" ? "move" : "cards"))).join(" + ") || "·"} `;
})
.join("");
$("#player-help").textContent = planning
@@ -426,8 +436,8 @@ export function mountConsole(root, host = null) {
"Choose a turn for this card.",
)
: t(
- "Choisissez une moitié de carte, puis un tour. Cliquez sur un tour rempli pour reprendre sa carte.",
- "Choose a card half, then a turn. Click a filled turn to retrieve its card.",
+ "Choisissez une carte, puis un tour.",
+ "Choose a card, then a turn.",
)
: view.stage === "presence"
? t(
@@ -469,7 +479,10 @@ export function mountConsole(root, host = null) {
$("#ready-controls").replaceChildren(
...(preparing ? [...$("#controls").childNodes] : []),
);
- if (preparing && host) $("#notice").textContent = view.mission.title;
+ if (preparing)
+ $("#ready-help").textContent =
+ view.mission.title + " · " + $("#ready-help").textContent;
+ $("#crew").hidden = view.players.length === 1 && !preparing;
const hand = [
...(g?.hand ?? []),
...(g?.androidCards ?? []).filter((c) => c.owner === crew),
@@ -491,7 +504,7 @@ export function mountConsole(root, host = null) {
g.specializations.some(
(s) => s && ["medic", "special-ops"].includes(s.name),
)
- ? `${t("Combiner deux cartes", "Combine two cards")} ${combine ? "●" : ""} `
+ ? `${pictogram("combine")} `
: "";
$("#card-help").textContent = selected
.map((choice) => {
@@ -528,11 +541,11 @@ export function mountConsole(root, host = null) {
.join("")
: "";
$("#hand-filter").innerHTML =
- planning && canOwn && grouped.length > 12
+ planning && canOwn && (grouped.length > 12 || handFilter !== "all")
? ["all", "A", "B", "C", "bots", "move"]
.map(
(f) =>
- `${f === "all" ? t("Tout", "All") : f === "bots" ? "♟" : f === "move" ? "↔" : f} `,
+ `${f === "all" ? pictogram("cards") : f === "bots" ? pictogram("bots") : f === "move" ? pictogram("move") : f} `,
)
.join("")
: "";
@@ -569,15 +582,36 @@ export function mountConsole(root, host = null) {
$("#ready-all").disabled = view.stage !== "presence";
$("#next-event").disabled =
!!view.tutorial || !["programming", "countdown"].includes(view.stage);
- $("#help").innerHTML = t(
- "Planifier. A utilise l’arme, B l’énergie, C le système indiqué dans la station. Les flèches déplacent votre équipier. Les déplacements planifiés ne déplacent pas encore les pions : tout sera exécuté pendant la résolution.
Coordonner. Chaque arme ne tire qu’une fois par tour. Le réacteur de la zone alimente le laser lourd et l’impulsion ; les petits lasers ont leur propre batterie. Deux équipiers prenant le même ascenseur retardent le second.
Ordinateur. Quelqu’un doit faire C sur la passerelle pendant les deux premiers tours de chaque phase (1–2, 4–5, 8–9), sinon les actions suivantes sont retardées.
Menaces. Les tirs se combinent avant de retirer le bouclier adverse. Une roquette touche au tour suivant. Les ennemis avancent après les actions et exécutent X, Y, Z en les franchissant.
Coopérer à distance. Utilisez une conversation vocale externe. Pendant une panne de communication, gardez le silence : cette page ne peut pas couper votre appel.
",
- "Plan. A operates a weapon, B transfers energy, C uses the station system. Arrows move your crew member. Planning does not move the real ship pieces; programs execute during resolution.
Coordinate. Each weapon fires once per turn. Heavy lasers and pulse draw from the zone reactor; light lasers have their own battery. A second crew member using the same lift is delayed.
Computer. Someone must perform C on the bridge within the first two turns of each phase (1–2, 4–5, 8–9), or the next actions are delayed.
Threats. Combine fire before subtracting enemy shields. Rockets hit on the following turn. Threats move after crew actions and execute X, Y and Z as they cross them.
Remote cooperation. Use external voice chat. Stay silent during communications blackouts; this page cannot mute your call.
",
- );
+ $("#ready-all").hidden = $("#ready-all").disabled;
+ $("#next-event").hidden = $("#next-event").disabled;
+ $("#help").innerHTML =
+ `${[
+ ["laser", t("Laser", "Laser")],
+ ["pulse", t("Impulsion", "Pulse")],
+ ["shield", t("Bouclier", "Shield")],
+ ["reactor", t("Réacteur", "Reactor")],
+ ["fuel", t("Combustible", "Fuel")],
+ ["computer", t("Ordinateur", "Computer")],
+ ["bots", t("Robots", "Battlebots")],
+ ["android", t("Androïde", "Android")],
+ ["interceptor", t("Intercepteurs", "Interceptors")],
+ ["observation", t("Observation", "Visual confirmation")],
+ ["rocket", t("Roquette", "Rocket")],
+ ["hull", t("Points de vie", "Hit points")],
+ ]
+ .map(([name, text]) => `${pictogram(name)}${esc(text)} `)
+ .join("")}
` +
+ `${t("Les zones gauche, centre et droite correspondent aux zones rouge, blanche et bleue des annonces originales. Le petit plan sur chaque menace indique sa trajectoire ou les salles touchées.", "Left, center and right correspond to red, white and blue in the original announcements. Each threat’s miniature map shows its trajectory or affected rooms.")}
` +
+ t(
+ "Planifier. Choisissez une carte puis un tour ; cliquez sur un tour rempli pour reprendre la carte. A utilise l’arme, B l’énergie, C le système indiqué dans la station. Les flèches déplacent votre équipier. Les déplacements planifiés ne déplacent pas encore les pions : tout sera exécuté pendant la résolution.
Coordonner. Chaque arme ne tire qu’une fois par tour. Le réacteur de la zone alimente le laser lourd et l’impulsion ; les petits lasers ont leur propre batterie. Deux équipiers prenant le même ascenseur retardent le second.
Ordinateur. Quelqu’un doit faire C sur la passerelle pendant les deux premiers tours de chaque phase (1–2, 4–5, 8–9), sinon les actions suivantes sont retardées.
Menaces. Les tirs se combinent avant de retirer le bouclier adverse. Une roquette touche au tour suivant. Les ennemis avancent après les actions et exécutent X, Y, Z en les franchissant.
Coopérer à distance. Utilisez une conversation vocale externe. Pendant une panne de communication, gardez le silence : cette page ne peut pas couper votre appel.
",
+ "Plan. Choose a card then a turn; click a filled turn to retrieve its card. A operates a weapon, B transfers energy, C uses the station system. Arrows move your crew member. Planning does not move the real ship pieces; programs execute during resolution.
Coordinate. Each weapon fires once per turn. Heavy lasers and pulse draw from the zone reactor; light lasers have their own battery. A second crew member using the same lift is delayed.
Computer. Someone must perform C on the bridge within the first two turns of each phase (1–2, 4–5, 8–9), or the next actions are delayed.
Threats. Combine fire before subtracting enemy shields. Rockets hit on the following turn. Threats move after crew actions and execute X, Y and Z as they cross them.
Remote cooperation. Use external voice chat. Stay silent during communications blackouts; this page cannot mute your call.
",
+ );
+ navigation.sync();
}
function calledHtml(data) {
if (!data) return "";
const c = data.card;
- return `${t("Renfort", "Reinforcement")} · ${esc(c.name)} ${c.hp} ♥ · ${c.shield} ⛨ · ${t("Vitesse", "Speed")} ${c.speed}${c.stations ? " · " + esc(c.stations.join(", ")) + " · " + esc(label(c.repair)) : ""}
${traitDescriptions(
+ return `
${t("Renfort", "Reinforcement")} · ${esc(c.name)} ${c.hp} ♥ · ${c.shield} ⛨ · ${t("Vitesse", "Speed")} ${c.speed}${c.stations ? " · " + esc(c.stations.map((s) => stationLabel(s, locale)).join(", ")) + " · " + esc(label(c.repair)) : ""}
${traitDescriptions(
c,
locale,
)
@@ -591,15 +625,16 @@ export function mountConsole(root, host = null) {
}
function trackHtml(th, g) {
const track = th.track ?? g.tracks[th.zone ?? "internal"];
- return `
${Array.from(
+ const pending = ["pending", "announced", "waiting"].includes(th.status);
+ return `
${pending ? t("À l’arrivée", "On arrival") : t("Approche", "Approach")} ${Array.from(
{ length: track.length },
(_, i) => track.length - i,
)
.map(
(n) =>
- ` x[0] === n) ? "mark" : ""}">${track.marks.find((x) => x[0] === n)?.[1] ?? ""} `,
+ ` x[0] === n)[1] : ""}" class="${!pending && th.positionOnTrack === n ? "current" : ""} ${pending && n === track.length ? "entry" : ""} ${track.marks.some((x) => x[0] === n) ? "mark" : ""}">${track.marks.find((x) => x[0] === n)?.[1] ?? (!pending && th.positionOnTrack === n ? "●" : "")} `,
)
- .join("")}
`;
+ .join("")}
${pictogram("ship")}
`;
}
function logText(e) {
return eventDescription(
@@ -625,7 +660,7 @@ export function mountConsole(root, host = null) {
? Array.from(
{ length: Number($("#players").value) },
(_, id) =>
- `
${t("Joueur", "Player")} ${id + 1}${t("Choisir un explorateur", "Choose explorer")} ${(
+ `${t("Joueur", "Player")} ${id + 1}${t("Choisir un explorateur", "Choose explorer")} ${(
view?.explorers ?? []
)
.filter((e) => !e.dead && !e.activeRun)
@@ -663,9 +698,10 @@ export function mountConsole(root, host = null) {
.filter((s) => s.level);
}
const selected = previous[id] ?? (careers ? "" : choices[id]?.name);
- return `${t("Équipier", "Crew")} ${id + 1}${careers ? `${t("Aucune spécialisation", "No specialization")} ` : ""}${choices.map((s) => `${esc(specialName(s.name))} ${careers ? s.level : ""} `).join("")} `;
+ return `${t("Équipier", "Crew")} ${id + 1}${careers ? `${t("Aucune spécialisation", "No specialization")} ` : ""}${choices.map((s) => `${esc(specialName(s.name))} ${careers ? s.level : ""} `).join("")} `;
}).join("")
: "";
+ navigation.syncChoices();
}
for (const id of [
"players",
@@ -728,7 +764,7 @@ export function mountConsole(root, host = null) {
)
.join("")} `;
if (c.stage === "ready")
- content += `${t("Prochaine mission : celle sélectionnée dans la configuration.", "Next mission: the one selected in setup.")}
${t("Si une seule escouade reste :", "If one battlebot squad remains:")}${t("Rouge ↓", "Red ↓")} ${t("Bleu ↑", "Blue ↑")} ${t("Mission suivante", "Next mission")} `;
+ content += `${t("Prochaine mission : celle sélectionnée dans la configuration.", "Next mission: the one selected in setup.")}
${t("Si une seule escouade reste :", "If one battlebot squad remains:")}${stationLabel("red-lower", locale)} ${stationLabel("blue-upper", locale)} ${t("Mission suivante", "Next mission")} `;
if (c.outcome)
content += `${t("Score de campagne", "Campaign score")} : ${c.outcome.score}
`;
$("#campaign").innerHTML = content;
@@ -737,15 +773,6 @@ export function mountConsole(root, host = null) {
const k = JSON.stringify([locale, next.explorers]);
if (k === careerKey) return;
careerKey = k;
- $("#career-title").textContent = t(
- host ? "Explorateurs · cette table" : "Explorateurs · carrières locales",
- host ? "Explorers · this table" : "Explorers · local careers",
- );
- const opened = new Set(
- [...root.querySelectorAll("details[data-explorer][open]")].map(
- (d) => d.dataset.explorer,
- ),
- );
$("#explorers").innerHTML = (next.explorers ?? [])
.map((e) => {
const spent = Object.values(e.specializations).reduce(
@@ -766,9 +793,9 @@ export function mountConsole(root, host = null) {
: "";
const claims =
!e.activeRun && !e.dead && e.eligible.length && (!host || e.editable)
- ? `${t("Conditions officielles des succès", "Official achievement requirements")}
${t("Conditions vérifiées ; accord de l’équipage si nécessaire.", "Requirements checked; crew agrees where required.")}${e.eligible.map((a) => `${esc(a.name)} · +${a.xp} `).join("")} ${t("Valider le succès", "Record achievement")} `
+ ? `${t("Conditions officielles des succès", "Official achievement requirements")}
${t("Conditions vérifiées ; accord de l’équipage si nécessaire.", "Requirements checked; crew agrees where required.")}${e.eligible.map((a) => `${esc(a.name)} · +${a.xp} `).join("")} ${t("Valider le succès", "Record achievement")} `
: "";
- return `${esc(e.name)} · ${t("Niveau", "Level")} ${e.level} · ${e.xp} XP ${e.dead ? "†" : e.activeRun ? "· " + t("en mission", "on mission") : ""} ${e.cloning ? t("Clonage autorisé", "Cloning enabled") : t("Hardcore", "Hardcore")} · ${e.clones} ${t("clone(s)", "clone(s)")}
${Object.entries(
+ return `${esc(e.name)} · ${t("Niveau", "Level")} ${e.level} · ${e.xp} XP ${e.dead ? "†" : e.activeRun ? "· " + t("en mission", "on mission") : ""} ${e.cloning ? t("Clonage autorisé", "Cloning enabled") : t("Hardcore", "Hardcore")} · ${e.clones} ${t("clone(s)", "clone(s)")}
${Object.entries(
e.specializations,
)
.map(([n, l]) => `${esc(specialName(n))} ${l}`)
@@ -794,7 +821,7 @@ export function mountConsole(root, host = null) {
(r) =>
`
${r.survived ? "✓" : "✕"} ${r.score} · +${r.xp} XP `,
)
- .join("")}
`;
+ .join("")}`;
})
.join("");
setupSpecialists();
@@ -854,7 +881,7 @@ export function mountConsole(root, host = null) {
try {
const next = await fetch(`/api/state?seat=${seat}`).then((r) => r.json());
render(next);
- $("#connection").textContent = t("HÔTE LOCAL", "LOCAL HOST");
+ $("#connection").textContent = "";
} catch {
$("#connection").textContent = t("RECONNEXION", "RECONNECTING");
}
@@ -868,8 +895,7 @@ export function mountConsole(root, host = null) {
return;
if (!el || pending) return;
if (el.id === "open-setup") {
- $("#setup").open = true;
- $("#setup").scrollIntoView({ block: "start" });
+ navigation.openPanel("setup");
return;
}
if (el.dataset.lesson) {
@@ -879,7 +905,7 @@ export function mountConsole(root, host = null) {
selected = [];
replayFrame = null;
await localPost("/api/lesson", { lesson: el.dataset.lesson });
- $("#lessons").open = false;
+ navigation.closePanel();
$("#lesson-guide").scrollIntoView({ block: "start" });
});
return;
@@ -893,6 +919,14 @@ export function mountConsole(root, host = null) {
rerender();
return;
}
+ if (el.dataset.pickAction) {
+ handFilter = el.dataset.pickAction;
+ selected = [];
+ navigation.closePanel();
+ rerender();
+ $("#hand-filter").scrollIntoView({ block: "center" });
+ return;
+ }
if (el.id === "campaign-continue" || el.id === "campaign-return") {
perform(() =>
command("campaign-vote", { continue: el.id === "campaign-continue" }),
@@ -1070,8 +1104,7 @@ export function mountConsole(root, host = null) {
}
if (el.id === "sound") {
sound = !sound;
- el.setAttribute("aria-pressed", sound);
- el.textContent = sound ? "♫" : "♪";
+ updateSound();
if (sound) speak(t("Annonces activées", "Announcements enabled"));
else speechSynthesis.cancel();
}
@@ -1095,10 +1128,6 @@ export function mountConsole(root, host = null) {
rerender();
}
});
- $("#locale").addEventListener("change", (e) => {
- locale = e.target.value;
- rerender();
- });
$("#seat").addEventListener("change", (e) => {
seat = Number(e.target.value);
crew = seat;
@@ -1167,7 +1196,7 @@ export function mountConsole(root, host = null) {
selected = [];
crew = seat;
render(next);
- $("#setup").open = false;
+ navigation.closePanel();
});
});
if (!host) intervals.push(setInterval(refresh, 650));
@@ -1211,7 +1240,7 @@ export function mountConsole(root, host = null) {
if (host) {
root.classList.add("bgs-hosted");
fillMissions(host.missions);
- $("#connection").textContent = "BGS";
+ $("#connection").textContent = "";
$(".brand").removeAttribute("href");
} else {
void (async () => {
@@ -1231,7 +1260,7 @@ export function mountConsole(root, host = null) {
"1,2";
}
render(next);
- if (host) $("#connection").textContent = "BGS";
+ if (host) $("#connection").textContent = "";
},
setPlayer(index) {
seat = index ?? -1;
@@ -1240,11 +1269,13 @@ export function mountConsole(root, host = null) {
rerender();
},
setPreferences(prefs) {
+ appearance = prefs.bgs ?? {};
if (prefs.locale) locale = prefs.locale;
if (prefs.sound !== undefined) sound = !!prefs.sound;
rerender();
},
destroy() {
+ navigation.destroy();
for (const id of intervals) clearInterval(id);
for (const [type, fn] of rootListeners)
root.removeEventListener(type, fn);
diff --git a/preview/art.js b/preview/art.js
new file mode 100644
index 0000000..99f6720
--- /dev/null
+++ b/preview/art.js
@@ -0,0 +1,28 @@
+import { equipmentPicture, pictogram } from "./icons.js";
+
+export function illustration(name) {
+ return (
+ equipmentPicture(name) ??
+ `${pictogram(name)} `
+ );
+}
+
+export function threatIllustration(threat) {
+ if (threat.position === "internal")
+ return illustration(threat.repair === "bots" ? "battlebots" : "computer");
+ // Canonical catalogue names do not change with the viewer's language.
+ const family =
+ [
+ [/asteroid|meteoroid|planetoid/i, "asteroid"],
+ [/swarm/i, "swarm"],
+ [/satellite|saucer/i, "satellite"],
+ [/capsule/i, "capsule"],
+ [/amoeba|jellyfish|octopus|crab|spider|snake|dragon/i, "organism"],
+ [/cloud|maelstrom|pulse ball|phasing pulser/i, "energy-cloud"],
+ [
+ /destroyer|frigate|man-of-war|tanker|carrier|juggernaut|behemoth|overlord/i,
+ "cruiser",
+ ],
+ ].find(([pattern]) => pattern.test(threat.name))?.[1] ?? "fighter";
+ return illustration(family);
+}
diff --git a/preview/assets/battlebots.webp b/preview/assets/battlebots.webp
new file mode 100644
index 0000000..2199989
Binary files /dev/null and b/preview/assets/battlebots.webp differ
diff --git a/preview/assets/computer.webp b/preview/assets/computer.webp
new file mode 100644
index 0000000..0b8b4c6
Binary files /dev/null and b/preview/assets/computer.webp differ
diff --git a/preview/assets/fighter.webp b/preview/assets/fighter.webp
new file mode 100644
index 0000000..447446f
Binary files /dev/null and b/preview/assets/fighter.webp differ
diff --git a/preview/assets/laser.webp b/preview/assets/laser.webp
new file mode 100644
index 0000000..eec2586
Binary files /dev/null and b/preview/assets/laser.webp differ
diff --git a/preview/assets/pulse.webp b/preview/assets/pulse.webp
new file mode 100644
index 0000000..45639f7
Binary files /dev/null and b/preview/assets/pulse.webp differ
diff --git a/preview/assets/reactor.webp b/preview/assets/reactor.webp
new file mode 100644
index 0000000..0a59837
Binary files /dev/null and b/preview/assets/reactor.webp differ
diff --git a/preview/assets/rocket.webp b/preview/assets/rocket.webp
new file mode 100644
index 0000000..d0120a2
Binary files /dev/null and b/preview/assets/rocket.webp differ
diff --git a/preview/assets/shield.webp b/preview/assets/shield.webp
new file mode 100644
index 0000000..a6eeaf8
Binary files /dev/null and b/preview/assets/shield.webp differ
diff --git a/preview/icons.js b/preview/icons.js
new file mode 100644
index 0000000..61a562c
--- /dev/null
+++ b/preview/icons.js
@@ -0,0 +1,107 @@
+// Shared silhouettes keep the ship, cards and controls visually consistent.
+const paths = {
+ journal: "M5 3h14v18H5zM9 7h6M9 11h6M9 15h4",
+ training: "m3 9 9-6 9 6-9 6-9-6Zm4 3v6l5 3 5-3v-6",
+ ship: "m4 20 4-11L20 4l-5 12-11 4Zm4-11 7 7M3 15l6 6",
+ crew: "M8 8a4 4 0 1 0 8 0 4 4 0 1 0-8 0ZM4 21v-3a8 8 0 0 1 16 0v3",
+ guide: "M4 4h6l2 2 2-2h6v16h-6l-2 2-2-2H4V4Zm8 2v16",
+ android: "M5 7h14v13H5zM12 3v4M10 3h4M8 11h1m6 0h1M8 16h8M2 10v6m20-6v6",
+ bots: "m5 4 7-2 7 2v9l-7 4-7-4V4ZM8 8h2m4 0h2M9 12h6M4 21l2-6m14 6-2-6M9 17v4m6-4v4",
+ laser: "M3 14h8v6H3zM6 14V9h4v5M9 9l8-6M14 10l7-5M17 13l5-4",
+ pulse:
+ "M9 12a3 3 0 1 0 6 0 3 3 0 1 0-6 0ZM6 6a8.5 8.5 0 0 0 0 12m12-12a8.5 8.5 0 0 1 0 12M3 3a13 13 0 0 0 0 18m18-18a13 13 0 0 1 0 18",
+ shield: "m12 2 8 3v6c0 5-4 8-8 11-4-3-8-6-8-11V5l8-3Z",
+ reactor: "m13 2-8 11h6l-1 9 9-12h-6l1-8Z",
+ fuel: "M7 3h8v3H7zM5 6h14v15H5zM5 10h4m6 0h4M13 11l-4 5h3l-1 4 5-6h-3v-3Z",
+ computer: "M3 3h18v13H3zM8 21h8m-4-5v5M6 7l3 2-3 2m6 1h5",
+ observation:
+ "M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12Zm7 0a3 3 0 1 0 6 0 3 3 0 1 0-6 0Z",
+ rocket:
+ "M9 15C7 7 13 2 21 3c1 8-4 14-12 12ZM9 9H5l-3 6h6m7 0v4l-6 3v-6M5 18l-3 4m13-14h2v2h-2z",
+ interceptor: "m12 2 3 9 7 5v3l-8-3v5h-4v-5l-8 3v-3 7-5 3-9Z",
+ left: "M21 12H3m7-7-7 7 7 7",
+ right: "M3 12h18m-7-7 7 7-7 7",
+ up: "M12 21V3m-7 7 7-7 7 7",
+ down: "M12 3v18m-7-7 7 7 7-7",
+ lift: "M8 21V3L3 8m14-5v18l5-5",
+ move: "M3 12h18M8 7l-5 5 5 5m8-10 5 5-5 5",
+ lock: "M6 10h12v11H6zM8 10V6a4 4 0 0 1 8 0v4m-4 5v2",
+ step: "m5 4 11 8L5 20V4Zm14 0v16",
+ forward: "m2 5 9 7-9 7V5Zm10 0 9 7-9 7V5Z",
+ restart: "M4 10a8 8 0 1 1 1 8M4 3v7h7",
+ check: "m4 12 5 5L20 6",
+ close: "m5 5 14 14M5 19 19 5",
+ cards: "M7 7h13v15H7zM4 18H2V2h13v2",
+ combine: "M2 6h7v12H2zM15 6h7v12h-7zM9 12h6m-3-3v6",
+ speaker: "M3 9h4l5-5v16l-5-5H3V9Zm13-2a7 7 0 0 1 0 10m3-13a11 11 0 0 1 0 16",
+ muted: "M3 9h4l5-5v16l-5-5H3V9Zm13 0 6 6m-6 0 6-6",
+ comms:
+ "M12 12v9m-4 0h8M8 7a6 6 0 0 0 0 8m8-8a6 6 0 0 1 0 8M5 3a11 11 0 0 0 0 16M19 3a11 11 0 0 1 0 16M11 10h2v2h-2z",
+ warning: "m12 2 10 19H2L12 2Zm0 6v6m0 3v1",
+ hull: "m12 2 9 5v10l-9 5-9-5V7l9-5Zm-5 6h10v8H7z",
+ speed: "M3 18a9 9 0 1 1 18 0M12 14l5-7M10 16a2 2 0 1 0 4 0 2 2 0 1 0-4 0Z",
+ star: "m12 2 3 7 7 1-5 5 1 7-6-4-6 4 1-7-5-5 7-1 3-7Z",
+ medic: "M9 3h6v6h6v6h-6v6H9v-6H3V9h6V3Z",
+ teleport: "M7 2C1 5 1 19 7 22m10-20c6 3 6 17 0 20M5 12h14m-5-5 5 5-5 5",
+ compass: "M2 12a10 10 0 1 0 20 0 10 10 0 1 0-20 0Zm14-5-3 7-6 3 3-7 6-3Z",
+ spy: "M3 8h18M5 8l3-6 4 2 4-2 3 6M4 13h6v4H4zM14 13h6v4h-6zM10 14h4",
+ leader: "M6 3h12v18H6zM9 8l3-3 3 3m-6 5 3-3 3 3m-6 5 3-3 3 3",
+ wrench: "m15 3-3 3 1 5 5 1 3-3a7 7 0 0 1-9 9l-6 5-4-4 6-6a7 7 0 0 1 7-10Z",
+};
+
+export const specializationIcons = {
+ rocketeer: "rocket",
+ "data-analyst": "cards",
+ "energy-technician": "reactor",
+ "pulse-gunner": "pulse",
+ medic: "medic",
+ teleporter: "teleport",
+ hypernavigator: "compass",
+ "special-ops": "spy",
+ "squad-leader": "leader",
+ mechanic: "wrench",
+};
+
+export function pictogram(name) {
+ return ` `;
+}
+
+// A miniature of the actual six-room plan, readable without colour.
+export function shipLocator(stations, incomingZone = null) {
+ const zones = ["red", "white", "blue"];
+ const incoming = zones.includes(incomingZone);
+ const offset = incoming ? 22 : 0;
+ const x = zones.indexOf(incomingZone) * 20 + 13;
+ return `${incoming ? ` ` : ""} ${["upper", "lower"].flatMap((deck, row) => zones.map((zone, col) => ` `)).join("")} `;
+}
+
+// Large, flat equipment drawings stay readable on the cutaway's smallest rooms.
+// Colours, silhouettes and action letters provide independent visual cues.
+const equipment = {
+ laser: ` `,
+ "light-laser": ` `,
+ pulse: ` `,
+ shield: ` `,
+ reactor: ` `,
+ computer: ` `,
+ battlebots: ` `,
+ interceptor: ` `,
+ observation: ` `,
+ rocket: ` `,
+ fuel: ` `,
+ fighter: ` `,
+ cruiser: ` `,
+ asteroid: ` `,
+ "energy-cloud": ` `,
+ organism: ` `,
+ swarm: ` `,
+ satellite: ` `,
+ capsule: ` `,
+};
+
+export function equipmentPicture(name) {
+ const drawing = equipment[name === "bots" ? "battlebots" : name];
+ return drawing
+ ? `${drawing} `
+ : null;
+}
diff --git a/preview/index.html b/preview/index.html
index 9d42e97..1f0b064 100644
--- a/preview/index.html
+++ b/preview/index.html
@@ -9,14 +9,10 @@
+
- LOCAL
+
Space Alert
@@ -43,7 +40,6 @@
-
-
+
@@ -63,11 +59,8 @@
-
+
@@ -81,117 +74,131 @@
-
-
-
-
-
- École de vol · exercices libres
-
-
-
-
-
-
-
- Confirmer tous les joueurs · test local
- Prochaine annonce · test local
-
-
-
- Explorateurs · carrières locales
-
-
-
-
-
-
-
-
+
+