Refresh the ship console and adopt protocol 0.8.1
|
|
@ -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
|
||||
|
|
|
|||
44
docs/artwork.json
Normal file
|
|
@ -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."
|
||||
}
|
||||
}
|
||||
724
package-lock.json
generated
Normal file
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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": {
|
||||
|
|
|
|||
321
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 ? `<img class="supporter-badge" src="${esc(badge.url)}" alt="${esc(badge.label)}" title="${esc(badge.label)}" width="14" height="14">` : "";
|
||||
};
|
||||
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 `<span class="card-art">${illustration("battlebots")}</span>`;
|
||||
if (a.startsWith("special:"))
|
||||
return `<span class="tiny">✦ ${esc(specialName(a.split(":")[1]))}<br>${a.endsWith("advanced") ? "Ⅱ" : "Ⅰ"}</span>`;
|
||||
if (a.startsWith("hero:")) return "★" + icon(a.slice(5));
|
||||
return `<span class="special-action">${pictogram(specializationIcons[a.split(":")[1]])}<small>${a.endsWith("advanced") ? "Ⅱ" : "Ⅰ"}</small></span>`;
|
||||
if (a.startsWith("hero:"))
|
||||
return `<span class="hero-action">${pictogram("star")}${icon(a.slice(5))}</span>`;
|
||||
if (a.startsWith("teleport:"))
|
||||
return `<span class="tiny">↗ ${esc(zoneName(a.split(":")[1].split("-")[0]))}<br>${a.endsWith("upper") ? "↑" : "↓"}</span>`;
|
||||
return (
|
||||
{ A: "A", B: "B", C: "C", bots: "♟", red: "←", blue: "→", lift: "↕" }[
|
||||
a
|
||||
] ?? esc(a)
|
||||
);
|
||||
return `<span class="teleport-action" style="--zone:var(--${esc(a.slice(9).split("-")[0])})">${pictogram("teleport")}${shipLocator([a.slice(9)])}</span>`;
|
||||
const actionIcon = {
|
||||
bots: "bots",
|
||||
red: "left",
|
||||
blue: "right",
|
||||
lift: "lift",
|
||||
}[a];
|
||||
return actionIcon ? pictogram(actionIcon) : esc(a);
|
||||
}
|
||||
const symbol = (name, description, content = "") =>
|
||||
`<span class="symbol-stat" role="img" title="${esc(description)}" aria-label="${esc(description)}">${pictogram(name)}${content}</span>`;
|
||||
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 `<button data-command="${command}" ${disabled ? "disabled" : ""} ${extra}>${text}</button>`;
|
||||
const name = {
|
||||
ready: "check",
|
||||
unready: "close",
|
||||
"advance-phase": "step",
|
||||
"finish-planning": "lock",
|
||||
draw: "cards",
|
||||
"draw-android": "android",
|
||||
resolve: "step",
|
||||
"resolve-all": "forward",
|
||||
}[command];
|
||||
return `<button data-command="${command}" ${disabled ? "disabled" : ""} ${extra}>${name ? pictogram(name) : ""}<span>${text}</span></button>`;
|
||||
}
|
||||
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) =>
|
||||
`<span class="crew-member ${p.ready ? "ready" : ""} ${p.seat === seat ? "own" : ""}">${playerName(p.seat)} · ${p.planningPhase ? `${p.finishedPlanning ? "🔒" : t("Phase", "Phase")} ${p.planningPhase}` : p.ready ? t("présent", "ready") : t("attente", "waiting")}</span>`,
|
||||
`<span class="crew-member ${p.ready ? "ready" : ""} ${p.seat === seat ? "own" : ""}">${playerName(p.seat)}${playerBadge(p.seat)} · ${p.planningPhase ? `${p.finishedPlanning ? "🔒" : t("Phase", "Phase")} ${p.planningPhase}` : p.ready ? t("présent", "ready") : t("attente", "waiting")}</span>`,
|
||||
)
|
||||
.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
|
||||
? `<h2>${esc(view.tutorial.title[locale === "fr" ? 0 : 1])}</h2><ol>${view.tutorial.instructions.map((p) => `<li>${esc(p[locale === "fr" ? 0 : 1])}</li>`).join("")}</ol>${view.stage === "programming" ? `<button id="lesson-next">${view.phase === 1 ? t("Phase 2 →", "Phase 2 →") : t("Terminer la programmation", "Finish programming")}</button>` : ""} <button data-lesson="${view.tutorial.id}" class="quiet">${t("Recommencer", "Restart")}</button>`
|
||||
? `<ol>${view.tutorial.instructions.map((p) => `<li>${esc(p[locale === "fr" ? 0 : 1])}</li>`).join("")}</ol>${view.stage === "programming" ? `<button id="lesson-next" class="icon-label">${pictogram(view.phase === 1 ? "step" : "lock")}<span>${view.phase === 1 ? t("Phase 2", "Phase 2") : t("Terminer la programmation", "Finish programming")}</span></button>` : ""} <button data-lesson="${view.tutorial.id}" class="quiet icon-button" title="${t("Recommencer", "Restart")}" aria-label="${t("Recommencer", "Restart")}">${pictogram("restart")}</button>`
|
||||
: "";
|
||||
$("#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
|
||||
? ""
|
||||
: `<span>${t("Silence", "Silence")}</span>`,
|
||||
);
|
||||
$("#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 `<div class="station" style="--zone:var(--${z})"><div class="station-title">${esc(zoneName(z))} ${deck === "upper" ? "↑" : "↓"}</div><div class="weapon">${deck === "lower" && z === "white" ? "◎" : "⌁"} <small>${(deck === "upper" ? (z === "white" ? 5 : 4) : z === "white" ? 1 : 2) - Number(s.damage.includes(`${deck}-weapon`) && station !== "white-lower")}</small></div><div class="systems"><div><b>A</b> ${deck === "lower" && z === "white" ? t("Impulsion", "Pulse") : t("Laser", "Laser")}</div><div><b>B</b> ${system === "shield" ? "⛨" : "⚡"} ${s[system]}/${capacity}</div><div><b>C</b> ${esc(c)}</div></div><div class="occupants">${crewHere.map((p) => `<span class="pawn ${p.knockedOut ? "out" : ""}" title="${t("Équipier", "Crew")} ${p.id + 1}${p.bots !== null ? " · ♟" : ""}">${p.id + 1}</span>`).join("")}</div>${s.damage.length ? `<div class="damage">${t("Dégâts", "Damage")} ${s.damage.length}/6</div>` : ""}</div>`;
|
||||
}),
|
||||
)
|
||||
.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 =
|
||||
`<span>⚡ ${t("Combustible", "Fuel")} <b>${ship.fuel}</b></span><span>↗ ${t("Roquettes", "Rockets")} <b>${ship.rockets}</b></span><span>⌨ ${ship.computer.map((x) => (x ? "●" : "○")).join(" ")}</span><span>♟ ${ship.bots.filter((b) => b.owner === null && b.station && !b.disabled).length} ${t("disponibles", "available")}</span>${ship.crew
|
||||
`${symbol("fuel", `${t("Combustible", "Fuel")} : ${ship.fuel}`, `<b>${ship.fuel}</b>`)}${symbol("rocket", `${t("Roquettes", "Rockets")} : ${ship.rockets}`, `<b>${ship.rockets}</b>`)}${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) => `<span class="computer-phase ${x ? "maintained" : ""}">${i + 1}</span>`).join(""))}${symbol("bots", `${t("Robots disponibles", "Available battlebots")} : ${ship.bots.filter((b) => b.owner === null && b.station && !b.disabled).length}`, `<b>${ship.bots.filter((b) => b.owner === null && b.station && !b.disabled).length}</b>`)}${ship.crew
|
||||
.filter((p) => p.space)
|
||||
.map(
|
||||
(p) =>
|
||||
`<span>↗ ${t("Équipier", "Crew")} ${p.id + 1} · ${t("portée", "range")} ${p.space}${p.knockedOut ? " †" : ""}</span>`,
|
||||
.map((p) =>
|
||||
symbol(
|
||||
"interceptor",
|
||||
`${t("Équipier", "Crew")} ${p.id + 1} · ${t("portée", "range")} ${p.space}${p.knockedOut ? " · " + t("hors combat", "knocked out") : ""}`,
|
||||
`<b>${p.id + 1}</b> · ${p.space}${p.knockedOut ? " †" : ""}`,
|
||||
),
|
||||
)
|
||||
.join("")}`;
|
||||
}
|
||||
|
|
@ -359,7 +368,7 @@ export function mountConsole(root, host = null) {
|
|||
threats
|
||||
.map(
|
||||
(th) =>
|
||||
`<details data-threat="${th.instance}" ${openThreats.has(String(th.instance)) ? "open" : ""} class="threat" style="--zone:var(--${th.zone ?? "gold"})"><summary><span>T+${th.turn}</span><strong>${esc(th.name)}</strong><span class="stats">${th.status === "destroyed" ? "✓" : th.status === "survived" ? "↘" : `${Math.max(0, th.hp - (th.damage ?? 0))} ♥ · ${th.shield} ⛨`}</span></summary><p>${th.position === "internal" ? esc(th.stations.join(", ")) + " · " + esc(label(th.repair)) : esc(zoneName(th.zone))} · ${t("Vitesse", "Speed")} ${th.speed}</p>${traitDescriptions(
|
||||
`<article class="threat illustrated-threat" style="--zone:var(--${th.zone ?? "gold"})"><button class="threat-card" data-inspect="${th.instance}" data-inspect-title="${esc(th.name)} · T+${th.turn}" aria-haspopup="dialog" aria-label="${esc(th.name)} · ${t("Tour", "Turn")} ${th.turn} · ${esc(th.position === "internal" ? th.stations.map((s) => stationLabel(s, locale)).join(", ") : zoneName(th.zone))} · ${t("Détails", "Details")}"><span class="threat-heading"><strong>${esc(th.name)}</strong><span class="threat-timing" title="${t("Arrivée au tour", "Arrival on turn")} ${th.turn}">T+${th.turn}</span></span>${threatPortrait(th)}<span class="threat-footer">${symbol("speed", `${t("Vitesse", "Speed")} : ${th.speed}`, th.speed)}<span>${t("Détails", "Details")}</span></span></button>${(th.track ?? g.tracks[th.zone ?? "internal"]) ? trackHtml(th, g) : ""}<template>${threatPortrait(th)}<div class="threat-facts">${symbol("speed", `${t("Vitesse", "Speed")} : ${th.speed}`, th.speed)}</div><p>${th.position === "internal" ? esc(th.stations.map((s) => stationLabel(s, locale)).join(", ")) + " · " + esc(label(th.repair)) : esc(zoneName(th.zone))}</p>${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) : ""}</details>`,
|
||||
)}${calledHtml(th.calledCard)}${(th.track ?? g.tracks[th.zone ?? "internal"]) ? trackHtml(th, g) : ""}</template></article>`,
|
||||
)
|
||||
.join("") ||
|
||||
`<p class="empty">${t("En attente des premières détections.", "Awaiting the first detections.")}</p>`;
|
||||
|
|
@ -401,7 +410,7 @@ export function mountConsole(root, host = null) {
|
|||
$("#program-crew").innerHTML = Array.from(
|
||||
{ length: view.crewSize },
|
||||
(_, i) =>
|
||||
`<option value="${i}" ${crew === i ? "selected" : ""}>${g?.solo || i >= view.players.length ? `${t("Androïde", "Android")} ${i + 1}` : playerName(i)}${g?.specializations[i] ? " · " + esc(specialName(g.specializations[i].name)) : ""}</option>`,
|
||||
`<option value="${i}" data-kind="${g?.solo || i >= view.players.length ? "android" : "crew"}" data-short-label="${g?.solo || i >= view.players.length ? i + 1 : playerName(i)}" data-specialization="${g?.specializations[i]?.name ?? ""}" ${crew === i ? "selected" : ""}>${g?.solo || i >= view.players.length ? `${t("Androïde", "Android")} ${i + 1}` : playerName(i)}${g?.specializations[i] ? " · " + esc(specialName(g.specializations[i].name)) : ""}</option>`,
|
||||
).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 `<button class="slot ${phaseFor(slot.turn) < ownPhase ? "locked" : ""} ${phaseFor(slot.turn) > ownPhase ? "future" : ""}" data-turn="${slot.turn}" ${editable ? "" : "disabled"} title="T+${slot.turn}"><span class="turn">T+${slot.turn} ${phaseFor(slot.turn) < ownPhase ? "🔒" : ""}</span><span class="action">${slot.cards.map((c) => (c.sides ? c.sides[c.side].map(icon).join(" ") : c.category === "movement" ? "↔" : "◆")).join(" + ") || "·"}</span></button>`;
|
||||
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 `<button class="slot ${phaseFor(slot.turn) < ownPhase ? "locked" : ""} ${phaseFor(slot.turn) > ownPhase ? "future" : ""}" data-turn="${slot.turn}" ${editable ? "" : "disabled"} title="${esc(description)}" aria-label="${esc(description)}"><span class="turn">T+${slot.turn} ${phaseFor(slot.turn) < ownPhase ? pictogram("lock") : ""}</span><span class="action">${slot.cards.map((c) => (c.sides ? c.sides[c.side].map(icon).join(" ") : pictogram(c.category === "movement" ? "move" : "cards"))).join(" + ") || "·"}</span></button>`;
|
||||
})
|
||||
.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),
|
||||
)
|
||||
? `<button id="combine" class="quiet" aria-pressed="${combine}">${t("Combiner deux cartes", "Combine two cards")} ${combine ? "●" : ""}</button>`
|
||||
? `<button id="combine" class="quiet icon-button" title="${t("Combiner deux cartes", "Combine two cards")}" aria-label="${t("Combiner deux cartes", "Combine two cards")}" aria-pressed="${combine}">${pictogram("combine")}</button>`
|
||||
: "";
|
||||
$("#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) =>
|
||||
`<button data-filter="${f}" class="quiet" aria-pressed="${handFilter === f}">${f === "all" ? t("Tout", "All") : f === "bots" ? "♟" : f === "move" ? "↔" : f}</button>`,
|
||||
`<button data-filter="${f}" class="quiet icon-button" aria-pressed="${handFilter === f}" title="${esc(f === "all" ? t("Toutes les cartes", "All cards") : f === "move" ? t("Déplacements", "Movement") : label(f))}" aria-label="${esc(f === "all" ? t("Toutes les cartes", "All cards") : f === "move" ? t("Déplacements", "Movement") : label(f))}">${f === "all" ? pictogram("cards") : f === "bots" ? pictogram("bots") : f === "move" ? pictogram("move") : f}</button>`,
|
||||
)
|
||||
.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(
|
||||
"<p><b>Planifier.</b> 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.</p><p><b>Coordonner.</b> 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.</p><p><b>Ordinateur.</b> 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.</p><p><b>Menaces.</b> 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.</p><p><b>Coopérer à distance.</b> Utilisez une conversation vocale externe. Pendant une panne de communication, gardez le silence : cette page ne peut pas couper votre appel.</p>",
|
||||
"<p><b>Plan.</b> 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.</p><p><b>Coordinate.</b> 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.</p><p><b>Computer.</b> 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.</p><p><b>Threats.</b> 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.</p><p><b>Remote cooperation.</b> Use external voice chat. Stay silent during communications blackouts; this page cannot mute your call.</p>",
|
||||
);
|
||||
$("#ready-all").hidden = $("#ready-all").disabled;
|
||||
$("#next-event").hidden = $("#next-event").disabled;
|
||||
$("#help").innerHTML =
|
||||
`<div class="pictogram-legend">${[
|
||||
["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]) => `<span>${pictogram(name)}${esc(text)}</span>`)
|
||||
.join("")}</div>` +
|
||||
`<p>${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.")}</p>` +
|
||||
t(
|
||||
"<p><b>Planifier.</b> 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.</p><p><b>Coordonner.</b> 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.</p><p><b>Ordinateur.</b> 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.</p><p><b>Menaces.</b> 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.</p><p><b>Coopérer à distance.</b> Utilisez une conversation vocale externe. Pendant une panne de communication, gardez le silence : cette page ne peut pas couper votre appel.</p>",
|
||||
"<p><b>Plan.</b> 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.</p><p><b>Coordinate.</b> 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.</p><p><b>Computer.</b> 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.</p><p><b>Threats.</b> 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.</p><p><b>Remote cooperation.</b> Use external voice chat. Stay silent during communications blackouts; this page cannot mute your call.</p>",
|
||||
);
|
||||
navigation.sync();
|
||||
}
|
||||
function calledHtml(data) {
|
||||
if (!data) return "";
|
||||
const c = data.card;
|
||||
return `<div class="called-threat"><h4>${t("Renfort", "Reinforcement")} · ${esc(c.name)}</h4><p>${c.hp} ♥ · ${c.shield} ⛨ · ${t("Vitesse", "Speed")} ${c.speed}${c.stations ? " · " + esc(c.stations.join(", ")) + " · " + esc(label(c.repair)) : ""}</p>${traitDescriptions(
|
||||
return `<div class="called-threat"><h4>${t("Renfort", "Reinforcement")} · ${esc(c.name)}</h4><p>${c.hp} ♥ · ${c.shield} ⛨ · ${t("Vitesse", "Speed")} ${c.speed}${c.stations ? " · " + esc(c.stations.map((s) => stationLabel(s, locale)).join(", ")) + " · " + esc(label(c.repair)) : ""}</p>${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 `<div class="track">${Array.from(
|
||||
const pending = ["pending", "announced", "waiting"].includes(th.status);
|
||||
return `<div class="approach-track"><span class="track-caption">${pending ? t("À l’arrivée", "On arrival") : t("Approche", "Approach")}</span><div class="track" aria-label="${t("Piste d’approche", "Approach track")}">${Array.from(
|
||||
{ length: track.length },
|
||||
(_, i) => track.length - i,
|
||||
)
|
||||
.map(
|
||||
(n) =>
|
||||
`<span class="${th.positionOnTrack === n ? "current" : ""} ${track.marks.some((x) => x[0] === n) ? "mark" : ""}">${track.marks.find((x) => x[0] === n)?.[1] ?? ""}</span>`,
|
||||
`<span title="${n}${track.marks.find((x) => x[0] === n)?.[1] ? " · " + track.marks.find((x) => 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 ? "●" : "")}</span>`,
|
||||
)
|
||||
.join("")}</div>`;
|
||||
.join("")}</div>${pictogram("ship")}</div>`;
|
||||
}
|
||||
function logText(e) {
|
||||
return eventDescription(
|
||||
|
|
@ -625,7 +660,7 @@ export function mountConsole(root, host = null) {
|
|||
? Array.from(
|
||||
{ length: Number($("#players").value) },
|
||||
(_, id) =>
|
||||
`<label>${t("Joueur", "Player")} ${id + 1}<select data-career-seat="${id}"><option value="">${t("Choisir un explorateur", "Choose explorer")}</option>${(
|
||||
`<label>${t("Joueur", "Player")} ${id + 1}<select id="career-seat-${id}" data-career-seat="${id}"><option value="">${t("Choisir un explorateur", "Choose explorer")}</option>${(
|
||||
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 `<label>${t("Équipier", "Crew")} ${id + 1}<select>${careers ? `<option value="">${t("Aucune spécialisation", "No specialization")}</option>` : ""}${choices.map((s) => `<option value="${s.name}" data-level="${s.level}" ${selected === s.name ? "selected" : ""}>${esc(specialName(s.name))} ${careers ? s.level : ""}</option>`).join("")}</select></label>`;
|
||||
return `<label>${t("Équipier", "Crew")} ${id + 1}<select id="specialist-${id}">${careers ? `<option value="">${t("Aucune spécialisation", "No specialization")}</option>` : ""}${choices.map((s) => `<option value="${s.name}" data-level="${s.level}" ${selected === s.name ? "selected" : ""}>${esc(specialName(s.name))} ${careers ? s.level : ""}</option>`).join("")}</select></label>`;
|
||||
}).join("")
|
||||
: "";
|
||||
navigation.syncChoices();
|
||||
}
|
||||
for (const id of [
|
||||
"players",
|
||||
|
|
@ -728,7 +764,7 @@ export function mountConsole(root, host = null) {
|
|||
)
|
||||
.join("")}</select></label>`;
|
||||
if (c.stage === "ready")
|
||||
content += `<p>${t("Prochaine mission : celle sélectionnée dans la configuration.", "Next mission: the one selected in setup.")}</p><label>${t("Si une seule escouade reste :", "If one battlebot squad remains:")}<select id="campaign-bots"><option value="red-lower">${t("Rouge ↓", "Red ↓")}</option><option value="blue-upper">${t("Bleu ↑", "Blue ↑")}</option></select></label><button id="campaign-next" ${seat === 0 ? "" : "disabled"}>${t("Mission suivante", "Next mission")}</button>`;
|
||||
content += `<p>${t("Prochaine mission : celle sélectionnée dans la configuration.", "Next mission: the one selected in setup.")}</p><label>${t("Si une seule escouade reste :", "If one battlebot squad remains:")}<select id="campaign-bots"><option value="red-lower">${stationLabel("red-lower", locale)}</option><option value="blue-upper">${stationLabel("blue-upper", locale)}</option></select></label><button id="campaign-next" ${seat === 0 ? "" : "disabled"}>${t("Mission suivante", "Next mission")}</button>`;
|
||||
if (c.outcome)
|
||||
content += `<p>${t("Score de campagne", "Campaign score")} : <strong>${c.outcome.score}</strong></p>`;
|
||||
$("#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)
|
||||
? `<p><a target="_blank" rel="noopener" href="https://filemanager.czechgames.com/storage/files/space-alert-the-new-frontier/other-downloads/achievements/space-alert-2-achievements-${locale === "fr" ? "fr" : "en"}.pdf">${t("Conditions officielles des succès", "Official achievement requirements")}</a></p><label><input type="checkbox" data-agrees="${e.id}">${t("Conditions vérifiées ; accord de l’équipage si nécessaire.", "Requirements checked; crew agrees where required.")}</label><select data-claim-choice="${e.id}">${e.eligible.map((a) => `<option value="${a.id}">${esc(a.name)} · +${a.xp}</option>`).join("")}</select><button data-claim="${e.id}">${t("Valider le succès", "Record achievement")}</button>`
|
||||
? `<p><a target="_blank" rel="noopener" href="https://filemanager.czechgames.com/storage/files/space-alert-the-new-frontier/other-downloads/achievements/space-alert-2-achievements-${locale === "fr" ? "fr" : "en"}.pdf">${t("Conditions officielles des succès", "Official achievement requirements")}</a></p><label><input type="checkbox" data-agrees="${e.id}">${t("Conditions vérifiées ; accord de l’équipage si nécessaire.", "Requirements checked; crew agrees where required.")}</label><select id="claim-${e.id}" aria-label="${t("Succès", "Achievement")}" data-claim-choice="${e.id}">${e.eligible.map((a) => `<option value="${a.id}">${esc(a.name)} · +${a.xp}</option>`).join("")}</select><button data-claim="${e.id}">${t("Valider le succès", "Record achievement")}</button>`
|
||||
: "";
|
||||
return `<details data-explorer="${e.id}" ${opened.has(e.id) ? "open" : ""}><summary>${esc(e.name)} · ${t("Niveau", "Level")} ${e.level} · ${e.xp} XP ${e.dead ? "†" : e.activeRun ? "· " + t("en mission", "on mission") : ""}</summary><p>${e.cloning ? t("Clonage autorisé", "Cloning enabled") : t("Hardcore", "Hardcore")} · ${e.clones} ${t("clone(s)", "clone(s)")}</p><p>${Object.entries(
|
||||
return `<article class="explorer-card" data-explorer="${e.id}"><h3>${esc(e.name)} · ${t("Niveau", "Level")} ${e.level} · ${e.xp} XP ${e.dead ? "†" : e.activeRun ? "· " + t("en mission", "on mission") : ""}</h3><p>${e.cloning ? t("Clonage autorisé", "Cloning enabled") : t("Hardcore", "Hardcore")} · ${e.clones} ${t("clone(s)", "clone(s)")}</p><p>${Object.entries(
|
||||
e.specializations,
|
||||
)
|
||||
.map(([n, l]) => `${esc(specialName(n))} ${l}`)
|
||||
|
|
@ -794,7 +821,7 @@ export function mountConsole(root, host = null) {
|
|||
(r) =>
|
||||
`<li>${r.survived ? "✓" : "✕"} ${r.score} · +${r.xp} XP</li>`,
|
||||
)
|
||||
.join("")}</ol></details>`;
|
||||
.join("")}</ol></article>`;
|
||||
})
|
||||
.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);
|
||||
|
|
|
|||
28
preview/art.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { equipmentPicture, pictogram } from "./icons.js";
|
||||
|
||||
export function illustration(name) {
|
||||
return (
|
||||
equipmentPicture(name) ??
|
||||
`<span class="equipment-symbol">${pictogram(name)}</span>`
|
||||
);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
BIN
preview/assets/battlebots.webp
Normal file
|
After Width: | Height: | Size: 159 KiB |
BIN
preview/assets/computer.webp
Normal file
|
After Width: | Height: | Size: 173 KiB |
BIN
preview/assets/fighter.webp
Normal file
|
After Width: | Height: | Size: 206 KiB |
BIN
preview/assets/laser.webp
Normal file
|
After Width: | Height: | Size: 173 KiB |
BIN
preview/assets/pulse.webp
Normal file
|
After Width: | Height: | Size: 364 KiB |
BIN
preview/assets/reactor.webp
Normal file
|
After Width: | Height: | Size: 178 KiB |
BIN
preview/assets/rocket.webp
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
preview/assets/shield.webp
Normal file
|
After Width: | Height: | Size: 239 KiB |
107
preview/icons.js
Normal file
|
|
@ -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 `<svg class="pictogram" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="${paths[name] ?? paths.star}"/></svg>`;
|
||||
}
|
||||
|
||||
// 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 `<svg class="ship-locator" viewBox="0 0 66 ${36 + offset}" aria-hidden="true" focusable="false">${incoming ? `<path class="incoming-arrow" d="M33 2v5L${x} 15v5m-4-5 4 5 4-5"/>` : ""}<path class="locator-hull" d="m7 ${2 + offset} 52 0 6 6v20l-6 6H7l-6-6v-20Z"/>${["upper", "lower"].flatMap((deck, row) => zones.map((zone, col) => `<rect x="${5 + col * 20}" y="${6 + row * 13 + offset}" width="16" height="10" rx="1" class="${stations.includes(`${zone}-${deck}`) ? "located" : ""}"/>`)).join("")}</svg>`;
|
||||
}
|
||||
|
||||
// Large, flat equipment drawings stay readable on the cutaway's smallest rooms.
|
||||
// Colours, silhouettes and action letters provide independent visual cues.
|
||||
const equipment = {
|
||||
laser: `<path fill="#79949f" d="M12 48h40l6 10H6z"/><circle cx="32" cy="42" r="14" fill="#dbe7dd"/><path fill="#e6b66b" d="M20 29h24v18H20z"/><path fill="#dbe7dd" d="M23 8h7v28h-7zm13 0h7v28h-7z"/><path stroke="#ff806c" stroke-width="4" d="M26 3v11m14-11v11"/><path stroke="#243947" d="M26 41h13"/>`,
|
||||
"light-laser": `<path fill="#79949f" d="M15 47h34l5 11H10z"/><circle cx="32" cy="40" r="14" fill="#dbe7dd"/><path fill="#e6b66b" d="M23 28h18v17H23z"/><path fill="#dbe7dd" d="M28 7h8v29h-8z"/><path stroke="#ff806c" stroke-width="4" d="M32 2v11"/>`,
|
||||
pulse: `<path fill="#79949f" d="M14 46h36l6 11H8z"/><path fill="#dbe7dd" d="M23 36h18v16H23z"/><circle cx="32" cy="28" r="12" fill="#c7a1ff"/><path stroke="#c7a1ff" fill="none" stroke-width="3" d="M16 12a23 23 0 0 0 0 32m32-32a23 23 0 0 1 0 32"/><path stroke="#f2e6ff" d="M25 28h14m-7-7v14"/>`,
|
||||
shield: `<path fill="#447286" d="M10 44h44v12H10z"/><path fill="#b7edf0" d="M23 44h18v11H23z"/><path fill="#3b8f9e" stroke="#b4f7f5" d="M32 5 53 13v14c0 13-12 20-21 24-9-4-21-11-21-24V13z"/><path fill="#a4f2f1" stroke="none" d="m33 14-12 17h9l-1 11 13-19h-9z"/>`,
|
||||
reactor: `<path fill="#7f97a0" d="M14 11h36v45H14z"/><path fill="#e6b66b" d="M22 6h20v52H22z"/><path fill="#ffe9a3" stroke="none" d="M26 12h12v9H26zm0 13h12v9H26zm0 13h12v9H26z"/><path stroke="#dbe7dd" stroke-width="5" d="M14 20H7m7 20H7m43-20h7m-7 20h7"/><path fill="#dbe7dd" d="M18 3h28v7H18zm0 49h28v8H18z"/>`,
|
||||
computer: `<path fill="#dbe7dd" d="M7 8h50v33H7z"/><path fill="#285469" d="M12 13h40v23H12z"/><path stroke="#91eff1" stroke-width="3" d="m17 20 5 4-5 4m12 0h15"/><path fill="#7f97a0" d="M13 41h38l8 14H5z"/><path stroke="#dbe7dd" d="M19 47h26m-19 5h12"/>`,
|
||||
battlebots: `<path fill="#7f97a0" d="M19 43h10v16H17zm16 0h10l2 16H35zM7 25h10v23H7zm40 0h10v23H47z"/><path fill="#dbe7dd" d="M17 23h30v23H17zM21 6h22v18H21z"/><path fill="#59cedc" d="M24 11h16v6H24z"/><path fill="#e6b66b" d="M25 28h14v10H25z"/><path stroke="#dbe7dd" d="M24 3h16"/>`,
|
||||
interceptor: `<path fill="#dbe7dd" d="m32 4 8 24 17 15v9l-21-7v14h-8V45L7 52v-9l17-15z"/><path fill="#59cedc" d="m32 16 4 14h-8z"/><path stroke="#e6b66b" stroke-width="4" d="m18 41 7-5m21 5-7-5"/>`,
|
||||
observation: `<path fill="#dbe7dd" d="M4 32s10-19 28-19 28 19 28 19-10 19-28 19S4 32 4 32Z"/><circle cx="32" cy="32" r="13" fill="#59cedc"/><circle cx="32" cy="32" r="6" fill="#183447"/><circle cx="36" cy="27" r="3" fill="#f0fcff" stroke="none"/>`,
|
||||
rocket: `<path fill="#e6b66b" d="m24 34-13 12v12l17-9m12-15 13 12v12l-17-9"/><path fill="#dbe7dd" d="M24 49V22Q24 9 32 3q8 6 8 19v27z"/><path fill="#e6b66b" d="M24 23h16v9H24z"/><path fill="#59cedc" d="m27 52 5 9 5-9z"/>`,
|
||||
fuel: `<path fill="#dbe7dd" d="M22 5h20v8H22zM15 13h34v44H15z"/><path fill="#e6b66b" d="M21 22h22v26H21z"/><path fill="#fff0b8" stroke="none" d="m34 24-11 14h8l-2 9 13-17h-9z"/>`,
|
||||
fighter: `<path fill="#81959f" d="M23 13h18v20H23z"/><path fill="#dbe7dd" d="m27 12-4 16L6 39v10l20-7 6 17 6-17 20 7V39L41 28l-4-16z"/><path fill="#cc917b" d="m8 40 15-10-2 8-13 6zm48 0L41 30l2 8 13 6z"/><path fill="#6fced6" d="m32 27 4 11-4 7-4-7z"/><path stroke="#a9d8dc" stroke-width="4" d="M27 8v7m10-7v7"/>`,
|
||||
cruiser: `<path fill="#81959f" d="M5 18h12v32H5zm42 0h12v32H47z"/><path fill="#dbe7dd" d="m23 7 18 0 8 17-4 25-13 10-13-10-4-25z"/><path fill="#cc917b" d="M20 20h7v24h-7zm17 0h7v24h-7z"/><path fill="#6fced6" d="M28 14h8v15h-8z"/><path stroke="#dbe7dd" stroke-width="3" d="M9 38h4m38 0h4M9 44h4m38 0h4"/>`,
|
||||
asteroid: `<path fill="#b7ae92" d="m21 6 23 3 13 16-3 22-18 12-22-7L6 32l4-17z"/><path fill="#8c8776" d="m22 14 10 3 2 9-9 6-9-7zm17 24 10 2-2 10-12-2z"/><path stroke="#ded3b5" d="m13 35 5 10m23-28 7 7"/>`,
|
||||
"energy-cloud": `<path fill="#7b739a" stroke="#c0b4de" d="M16 18c-2-13 21-17 27-5 15-1 21 18 11 27 0 15-20 21-29 13C7 59-3 35 10 27c-2-4 0-8 6-9Z"/><path fill="#e3d3f6" stroke="none" d="m36 13-17 24h12l-4 17 18-27H33z"/>`,
|
||||
organism: `<path fill="#8eae91" stroke="#cae2bd" d="M11 23c-8-14 11-26 20-13 10-14 30-5 22 11 16 8 4 28-9 22-1 21-26 20-27 3C0 46-4 29 11 23Z"/><path fill="#314f50" stroke="#c4dfb8" d="M21 28a12 12 0 1 0 24 0 12 12 0 1 0-24 0Z"/><circle fill="#d6b477" stroke="none" cx="33" cy="28" r="5"/>`,
|
||||
swarm: `<g fill="#dbe7dd"><path d="m19 5 4 11 10 9v7l-12-4-2 9-2-9-12 4v-7l10-9zM45 9l4 11 10 9v7l-12-4-2 9-2-9-12 4v-7l10-9zM32 31l4 11 10 9v7l-12-4-2 9-2-9-12 4v-7l10-9z"/></g><path stroke="#cc917b" stroke-width="3" d="M19 18v7m26-3v7M32 44v7"/>`,
|
||||
satellite: `<path fill="#708d9e" d="M4 13h15v38H4zm41 0h15v38H45z"/><path stroke="#b9d6de" d="M5 26h13M5 38h13m28-12h13M46 38h13M19 32h26"/><path fill="#dbe7dd" d="M25 22h14v24H25z"/><path fill="#cc917b" d="M20 10h24c0 16-24 16-24 0Z"/><path stroke="#dbe7dd" d="M32 8V3m0 43v11"/>`,
|
||||
capsule: `<path fill="#dbe7dd" d="m22 5 20 0 8 12v30l-8 12H22l-8-12V17z"/><path fill="#81959f" d="M21 16h22v32H21z"/><path fill="#cc917b" d="M15 26h34v12H15z"/><path stroke="#dbe7dd" d="M27 19h10m-10 26h10"/>`,
|
||||
};
|
||||
|
||||
export function equipmentPicture(name) {
|
||||
const drawing = equipment[name === "bots" ? "battlebots" : name];
|
||||
return drawing
|
||||
? `<svg class="equipment-art equipment-drawing" viewBox="0 0 64 64" fill="none" stroke="#162e3d" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${drawing}</svg>`
|
||||
: null;
|
||||
}
|
||||
|
|
@ -9,14 +9,10 @@
|
|||
<body>
|
||||
<header>
|
||||
<a class="brand" href="/"
|
||||
>✦
|
||||
<span>SPACE ALERT<small>SITTING DUCK · FLIGHT CONSOLE</small></span></a
|
||||
>✦ <span>SPACE ALERT<small>SITTING DUCK</small></span></a
|
||||
>
|
||||
<div class="header-tools">
|
||||
<select id="locale" aria-label="Langue">
|
||||
<option value="fr">FR</option>
|
||||
<option value="en">EN</option></select
|
||||
><select id="seat" aria-label="Joueur"></select
|
||||
<select id="seat" aria-label="Joueur"></select
|
||||
><button
|
||||
id="sound"
|
||||
class="quiet"
|
||||
|
|
@ -27,10 +23,11 @@
|
|||
</button>
|
||||
</div>
|
||||
</header>
|
||||
<nav id="console-nav" class="console-nav" aria-label="Menu"></nav>
|
||||
<main>
|
||||
<div class="mission-line">
|
||||
<div>
|
||||
<span id="connection">LOCAL</span>
|
||||
<span id="connection"></span>
|
||||
<h1 id="status">Space Alert</h1>
|
||||
</div>
|
||||
<div class="timer">
|
||||
|
|
@ -43,7 +40,6 @@
|
|||
<div id="ready-controls" class="controls"></div>
|
||||
</section>
|
||||
<div id="error" role="alert"></div>
|
||||
<div id="notice" class="notice"></div>
|
||||
<section id="lesson-guide" hidden></section>
|
||||
<div class="flight-layout">
|
||||
<section class="tactical">
|
||||
|
|
@ -51,7 +47,7 @@
|
|||
<h2 id="ship-title"></h2>
|
||||
<span id="comms"></span>
|
||||
</div>
|
||||
<div id="ship" class="ship"></div>
|
||||
<div id="ship" class="ship cutaway"></div>
|
||||
<div id="resources" class="resources"></div>
|
||||
<div class="section-heading">
|
||||
<h2 id="threat-title"></h2>
|
||||
|
|
@ -63,11 +59,8 @@
|
|||
<section id="planning">
|
||||
<div class="section-heading">
|
||||
<h2 id="program-title"></h2>
|
||||
<select
|
||||
id="program-crew"
|
||||
aria-label="Équipier à programmer"
|
||||
></select>
|
||||
</div>
|
||||
<select id="program-crew" aria-label="Équipier à programmer"></select>
|
||||
<div id="program" class="program"></div>
|
||||
<p id="player-help"></p>
|
||||
<div id="controls" class="controls"></div>
|
||||
|
|
@ -81,117 +74,131 @@
|
|||
<div id="campaign"></div>
|
||||
</section>
|
||||
</div>
|
||||
<details id="journal">
|
||||
<summary id="journal-title"></summary>
|
||||
<ol id="announcements"></ol>
|
||||
</details>
|
||||
<details id="lessons">
|
||||
<summary id="lessons-title">École de vol · exercices libres</summary>
|
||||
<div id="lesson-list"></div>
|
||||
</details>
|
||||
<details id="setup">
|
||||
<summary id="setup-title"></summary>
|
||||
<form id="new-session">
|
||||
<label id="players-label"
|
||||
>Joueurs
|
||||
<select id="players">
|
||||
<option value="1">Solo · 4 androïdes</option>
|
||||
<option value="2">2 + 2 androïdes</option>
|
||||
<option value="3">3 + 1 androïde</option>
|
||||
<option value="4" selected>4</option>
|
||||
<option value="5">5</option>
|
||||
</select></label
|
||||
><label
|
||||
>Équipage<select id="crew-size">
|
||||
<option value="0">Standard</option>
|
||||
<option value="5">5 équipiers (androïde supplémentaire)</option>
|
||||
<option value="3">3 joueurs sans androïde</option>
|
||||
</select></label
|
||||
><label
|
||||
>Mission
|
||||
<select id="mission"></select></label
|
||||
><label id="special-label"
|
||||
>Spécialisations
|
||||
<select id="specialization">
|
||||
<option value="">Aucune</option>
|
||||
<option value="1">Niveau 1</option>
|
||||
<option value="2">Niveau 2</option>
|
||||
<option value="3">Niveau 3</option>
|
||||
</select></label
|
||||
><label
|
||||
>Menaces<select id="threat-expansion">
|
||||
<option value="0">Jeu de base</option>
|
||||
<option value="1">+ The New Frontier</option>
|
||||
</select></label
|
||||
>
|
||||
<label
|
||||
>Menaces communes<select id="difficulty">
|
||||
<option value="1">Blanches</option>
|
||||
<option value="1,2">Blanches + jaunes</option>
|
||||
<option value="2">Jaunes</option>
|
||||
<option value="1,2,3">Toutes</option>
|
||||
<option value="2,3">Jaunes + rouges</option>
|
||||
<option value="3">Rouges</option>
|
||||
</select></label
|
||||
>
|
||||
<label
|
||||
>Menaces sérieuses<select id="serious-difficulty">
|
||||
<option value="1">Blanches</option>
|
||||
<option value="1,2">Blanches + jaunes</option>
|
||||
<option value="2">Jaunes</option>
|
||||
<option value="1,2,3">Toutes</option>
|
||||
<option value="2,3">Jaunes + rouges</option>
|
||||
<option value="3">Rouges</option>
|
||||
</select></label
|
||||
>
|
||||
<label
|
||||
>Format<select id="campaign-limit">
|
||||
<option value="0">Mission unique</option>
|
||||
<option value="3">Campagne · 3 missions</option>
|
||||
<option value="5">Campagne · 5 missions</option>
|
||||
</select></label
|
||||
>
|
||||
<label
|
||||
>Expérience<select id="careers-enabled">
|
||||
<option value="0">Partie libre</option>
|
||||
<option value="1">Carrières enregistrées</option>
|
||||
</select></label
|
||||
>
|
||||
<div id="career-seats" class="token-controls"></div>
|
||||
<div id="specialists" class="token-controls"></div>
|
||||
<button type="submit" id="new-button">Nouvelle session locale</button>
|
||||
</form>
|
||||
<p id="scope"></p>
|
||||
<button id="ready-all" class="quiet">
|
||||
Confirmer tous les joueurs · test local</button
|
||||
><button id="next-event" class="quiet">
|
||||
Prochaine annonce · test local
|
||||
</button>
|
||||
</details>
|
||||
<details id="career-manager">
|
||||
<summary id="career-title">Explorateurs · carrières locales</summary>
|
||||
<form id="create-explorer">
|
||||
<label
|
||||
>Nom<input
|
||||
id="explorer-name"
|
||||
required
|
||||
maxlength="80"
|
||||
autocomplete="off" /></label
|
||||
><label
|
||||
>Clonage<select id="explorer-cloning">
|
||||
<option value="1">Autorisé</option>
|
||||
<option value="0">Hardcore · mort définitive</option>
|
||||
</select></label
|
||||
><button id="create-explorer-button">Créer un explorateur</button>
|
||||
</form>
|
||||
<div id="explorers"></div>
|
||||
</details>
|
||||
<details>
|
||||
<summary id="help-title"></summary>
|
||||
<div id="help"></div>
|
||||
</details>
|
||||
<footer id="footer"></footer>
|
||||
</main>
|
||||
<dialog
|
||||
id="console-menu"
|
||||
class="console-dialog"
|
||||
aria-labelledby="menu-title"
|
||||
>
|
||||
<div class="dialog-header">
|
||||
<h2 id="menu-title"></h2>
|
||||
<button type="button" data-close-dialog aria-label="Fermer">×</button>
|
||||
</div>
|
||||
<div class="dialog-body">
|
||||
<section id="journal" data-panel-content hidden>
|
||||
<ol id="announcements"></ol>
|
||||
</section>
|
||||
<section id="lessons" data-panel-content hidden>
|
||||
<div id="lesson-list"></div>
|
||||
</section>
|
||||
<section id="setup" data-panel-content hidden>
|
||||
<form id="new-session">
|
||||
<label id="players-label"
|
||||
>Joueurs
|
||||
<select id="players">
|
||||
<option value="1">Solo · 4 androïdes</option>
|
||||
<option value="2">2 + 2 androïdes</option>
|
||||
<option value="3">3 + 1 androïde</option>
|
||||
<option value="4" selected>4</option>
|
||||
<option value="5">5</option>
|
||||
</select></label
|
||||
><label
|
||||
>Équipage<select id="crew-size">
|
||||
<option value="0">Standard</option>
|
||||
<option value="5">5 équipiers (androïde supplémentaire)</option>
|
||||
<option value="3">3 joueurs sans androïde</option>
|
||||
</select></label
|
||||
><label
|
||||
>Mission
|
||||
<select id="mission"></select></label
|
||||
><label id="special-label"
|
||||
>Spécialisations
|
||||
<select id="specialization">
|
||||
<option value="">Aucune</option>
|
||||
<option value="1">Niveau 1</option>
|
||||
<option value="2">Niveau 2</option>
|
||||
<option value="3">Niveau 3</option>
|
||||
</select></label
|
||||
><label
|
||||
>Menaces<select id="threat-expansion">
|
||||
<option value="0">Jeu de base</option>
|
||||
<option value="1">+ The New Frontier</option>
|
||||
</select></label
|
||||
>
|
||||
<label
|
||||
>Menaces communes<select id="difficulty">
|
||||
<option value="1">Niveau 1</option>
|
||||
<option value="1,2">Niveaux 1 + 2</option>
|
||||
<option value="2">Niveau 2</option>
|
||||
<option value="1,2,3">Tous les niveaux</option>
|
||||
<option value="2,3">Niveaux 2 + 3</option>
|
||||
<option value="3">Niveau 3</option>
|
||||
</select></label
|
||||
>
|
||||
<label
|
||||
>Menaces sérieuses<select id="serious-difficulty">
|
||||
<option value="1">Niveau 1</option>
|
||||
<option value="1,2">Niveaux 1 + 2</option>
|
||||
<option value="2">Niveau 2</option>
|
||||
<option value="1,2,3">Tous les niveaux</option>
|
||||
<option value="2,3">Niveaux 2 + 3</option>
|
||||
<option value="3">Niveau 3</option>
|
||||
</select></label
|
||||
>
|
||||
<label
|
||||
>Format<select id="campaign-limit">
|
||||
<option value="0">Mission unique</option>
|
||||
<option value="3">Campagne · 3 missions</option>
|
||||
<option value="5">Campagne · 5 missions</option>
|
||||
</select></label
|
||||
>
|
||||
<label
|
||||
>Expérience<select id="careers-enabled">
|
||||
<option value="0">Partie libre</option>
|
||||
<option value="1">Carrières enregistrées</option>
|
||||
</select></label
|
||||
>
|
||||
<div id="career-seats" class="token-controls"></div>
|
||||
<div id="specialists" class="token-controls"></div>
|
||||
<button type="submit" id="new-button">Préparer la mission</button>
|
||||
</form>
|
||||
<button id="ready-all" class="quiet">Tout l’équipage est prêt</button
|
||||
><button id="next-event" class="quiet">Prochaine annonce</button>
|
||||
</section>
|
||||
<section id="career-manager" data-panel-content hidden>
|
||||
<form id="create-explorer">
|
||||
<label
|
||||
>Nom<input
|
||||
id="explorer-name"
|
||||
required
|
||||
maxlength="80"
|
||||
autocomplete="off" /></label
|
||||
><label
|
||||
>Clonage<select id="explorer-cloning">
|
||||
<option value="1">Autorisé</option>
|
||||
<option value="0">Hardcore · mort définitive</option>
|
||||
</select></label
|
||||
><button id="create-explorer-button">Créer un explorateur</button>
|
||||
</form>
|
||||
<div id="explorers"></div>
|
||||
</section>
|
||||
<section id="guide" data-panel-content hidden>
|
||||
<div id="help"></div>
|
||||
</section>
|
||||
<section id="inspection" data-panel-content hidden></section>
|
||||
</div>
|
||||
</dialog>
|
||||
<dialog
|
||||
id="choice-menu"
|
||||
class="console-dialog choice-dialog"
|
||||
aria-labelledby="choice-title"
|
||||
>
|
||||
<div class="dialog-header">
|
||||
<h2 id="choice-title"></h2>
|
||||
<button type="button" data-close-dialog aria-label="Fermer">×</button>
|
||||
</div>
|
||||
<div id="choice-list" class="dialog-body choice-list"></div>
|
||||
</dialog>
|
||||
<script type="module" src="/local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
251
preview/navigation.js
Normal file
|
|
@ -0,0 +1,251 @@
|
|||
import { pictogram, specializationIcons } from "./icons.js";
|
||||
|
||||
const navIcons = {
|
||||
journal: "journal",
|
||||
lessons: "training",
|
||||
setup: "ship",
|
||||
"career-manager": "crew",
|
||||
guide: "guide",
|
||||
};
|
||||
const labels = {
|
||||
journal: ["Journal", "Log"],
|
||||
lessons: ["Entraînement", "Training"],
|
||||
setup: ["Missions", "Missions"],
|
||||
"career-manager": ["Équipage", "Crew"],
|
||||
guide: ["Guide", "Guide"],
|
||||
};
|
||||
export function mountNavigation(root, { locale, hosted }) {
|
||||
const $ = (s) => root.querySelector(s);
|
||||
const t = (fr, en) => (locale() === "fr" ? fr : en);
|
||||
const menu = $("#console-menu");
|
||||
const picker = $("#choice-menu");
|
||||
const error = $("#error");
|
||||
const errorAnchor = document.createComment("mission errors");
|
||||
error.before(errorAnchor);
|
||||
const controls = new WeakMap();
|
||||
let activePanel = null,
|
||||
choiceId = null,
|
||||
inspected = null,
|
||||
navLocale = null;
|
||||
function openPanel(id, title) {
|
||||
if (hosted && ["setup", "lessons"].includes(id)) return;
|
||||
activePanel = id;
|
||||
for (const panel of root.querySelectorAll("[data-panel-content]"))
|
||||
panel.hidden = panel.id !== id;
|
||||
$("#menu-title").textContent = title ?? t(...labels[id]);
|
||||
for (const button of root.querySelectorAll("[data-panel]"))
|
||||
button.setAttribute("aria-expanded", String(button.dataset.panel === id));
|
||||
menu.querySelector(".dialog-header").after(error);
|
||||
if (!menu.open) menu.showModal();
|
||||
$(".dialog-body").scrollTop = 0;
|
||||
}
|
||||
function closePanel() {
|
||||
if (picker.open) picker.close();
|
||||
if (menu.open) menu.close();
|
||||
}
|
||||
function labelFor(select) {
|
||||
return (
|
||||
select.getAttribute("aria-label") ??
|
||||
select.parentElement.firstChild?.textContent.trim() ??
|
||||
""
|
||||
);
|
||||
}
|
||||
function optionButton(option, select, pickerOption = false) {
|
||||
const button = document.createElement("button");
|
||||
button.type = "button";
|
||||
button.textContent = option.textContent;
|
||||
if (select.id === "program-crew") {
|
||||
button.innerHTML = pictogram(option.dataset.kind);
|
||||
const name = document.createElement("span");
|
||||
name.textContent = option.dataset.shortLabel;
|
||||
button.append(name);
|
||||
if (option.dataset.specialization) {
|
||||
const badge = document.createElement("span");
|
||||
badge.className = "crew-specialization";
|
||||
badge.innerHTML = pictogram(
|
||||
specializationIcons[option.dataset.specialization],
|
||||
);
|
||||
button.append(badge);
|
||||
}
|
||||
button.title = option.textContent;
|
||||
button.setAttribute("aria-label", option.textContent);
|
||||
}
|
||||
button.disabled = option.disabled || select.disabled;
|
||||
button.dataset.choiceValue = option.value;
|
||||
button.dataset.choiceFor = select.id;
|
||||
button.setAttribute("aria-pressed", String(option.selected));
|
||||
if (pickerOption) button.dataset.pickerOption = "";
|
||||
return button;
|
||||
}
|
||||
function syncChoices() {
|
||||
for (const select of root.querySelectorAll("select")) {
|
||||
if (!select.id) continue;
|
||||
let control = controls.get(select);
|
||||
if (!control) {
|
||||
// The native select remains the form's state, while visible controls use buttons.
|
||||
const parent = select.parentElement;
|
||||
if (parent.tagName === "LABEL") {
|
||||
const field = document.createElement("div");
|
||||
for (const attr of parent.attributes)
|
||||
field.setAttribute(attr.name, attr.value);
|
||||
field.classList.add("field");
|
||||
field.append(...parent.childNodes);
|
||||
parent.replaceWith(field);
|
||||
}
|
||||
select.hidden = true;
|
||||
select.tabIndex = -1;
|
||||
control = document.createElement("div");
|
||||
control.className = "choice-control";
|
||||
control.setAttribute("role", "group");
|
||||
select.after(control);
|
||||
controls.set(select, control);
|
||||
}
|
||||
const text = labelFor(select);
|
||||
control.hidden =
|
||||
(hosted && select.id === "seat") ||
|
||||
(select.id === "seat" && select.options.length < 2);
|
||||
control.setAttribute("aria-label", text);
|
||||
control.classList.toggle("crew-tabs", select.id === "program-crew");
|
||||
const signature = JSON.stringify([
|
||||
text,
|
||||
select.value,
|
||||
select.disabled,
|
||||
[...select.options].map((o) => [
|
||||
o.value,
|
||||
o.textContent,
|
||||
o.disabled,
|
||||
{ ...o.dataset },
|
||||
]),
|
||||
]);
|
||||
if (control.dataset.signature === signature) continue;
|
||||
control.dataset.signature = signature;
|
||||
const focused = control.contains(root.ownerDocument.activeElement)
|
||||
? root.ownerDocument.activeElement.dataset.choiceValue
|
||||
: null;
|
||||
const inline = select.options.length <= 5 && select.id !== "seat";
|
||||
control.classList.toggle("segmented", inline);
|
||||
control.replaceChildren();
|
||||
if (inline) {
|
||||
for (const option of select.options)
|
||||
control.append(optionButton(option, select));
|
||||
} else {
|
||||
const trigger = document.createElement("button");
|
||||
trigger.type = "button";
|
||||
trigger.className = "choice-trigger";
|
||||
trigger.dataset.choose = select.id;
|
||||
trigger.disabled = select.disabled || !select.options.length;
|
||||
trigger.setAttribute("aria-haspopup", "dialog");
|
||||
trigger.setAttribute(
|
||||
"aria-label",
|
||||
`${text} : ${select.selectedOptions[0]?.textContent ?? ""}`,
|
||||
);
|
||||
const value = document.createElement("span");
|
||||
value.textContent = select.selectedOptions[0]?.textContent ?? "—";
|
||||
trigger.append(value);
|
||||
const symbol = document.createElement("span");
|
||||
symbol.className = "choice-symbol";
|
||||
symbol.textContent = "↗";
|
||||
symbol.setAttribute("aria-hidden", "true");
|
||||
trigger.append(symbol);
|
||||
control.append(trigger);
|
||||
}
|
||||
if (focused !== null)
|
||||
[...control.querySelectorAll("button")]
|
||||
.find((b) => b.dataset.choiceValue === focused)
|
||||
?.focus({ preventScroll: true });
|
||||
}
|
||||
}
|
||||
function inspect(key) {
|
||||
const card = [...root.querySelectorAll("[data-inspect]")].find(
|
||||
(el) => el.dataset.inspect === key,
|
||||
);
|
||||
if (!card) return;
|
||||
inspected = key;
|
||||
$("#inspection").replaceChildren(
|
||||
card.parentElement.querySelector("template").content.cloneNode(true),
|
||||
);
|
||||
openPanel(
|
||||
"inspection",
|
||||
card.dataset.inspectTitle ?? card.querySelector("strong").textContent,
|
||||
);
|
||||
}
|
||||
function sync() {
|
||||
if (navLocale !== locale()) {
|
||||
navLocale = locale();
|
||||
$("#console-nav").innerHTML = Object.entries(labels)
|
||||
.filter(([id]) => !hosted || !["setup", "lessons"].includes(id))
|
||||
.map(
|
||||
([id, words]) =>
|
||||
`<button type="button" data-panel="${id}" aria-haspopup="dialog" aria-expanded="${menu.open && activePanel === id}">${pictogram(navIcons[id])}<span>${t(...words)}</span></button>`,
|
||||
)
|
||||
.join("");
|
||||
for (const close of root.querySelectorAll("[data-close-dialog]"))
|
||||
close.setAttribute("aria-label", t("Fermer", "Close"));
|
||||
if (activePanel && activePanel !== "inspection")
|
||||
$("#menu-title").textContent = t(...labels[activePanel]);
|
||||
}
|
||||
syncChoices();
|
||||
if (hosted)
|
||||
$('[data-panel="career-manager"]').hidden =
|
||||
!$("#explorers").childElementCount;
|
||||
if (menu.open && activePanel === "inspection" && inspected) {
|
||||
const card = [...root.querySelectorAll("[data-inspect]")].find(
|
||||
(el) => el.dataset.inspect === inspected,
|
||||
);
|
||||
if (card) {
|
||||
const template = card.parentElement.querySelector("template");
|
||||
if ($("#inspection").innerHTML !== template.innerHTML)
|
||||
$("#inspection").innerHTML = template.innerHTML;
|
||||
}
|
||||
}
|
||||
if (picker.open && !root.querySelector(`#${CSS.escape(choiceId)}`))
|
||||
picker.close();
|
||||
}
|
||||
function click(event) {
|
||||
const button = event.target.closest("button");
|
||||
if (!button || !root.contains(button)) return;
|
||||
if (button.hasAttribute("data-close-dialog"))
|
||||
button.closest("dialog").close();
|
||||
else if (button.dataset.panel) openPanel(button.dataset.panel);
|
||||
else if (button.dataset.inspect) inspect(button.dataset.inspect);
|
||||
else if (button.dataset.choose) {
|
||||
choiceId = button.dataset.choose;
|
||||
const select = root.querySelector(`#${CSS.escape(choiceId)}`);
|
||||
$("#choice-title").textContent = labelFor(select);
|
||||
$("#choice-list").replaceChildren(
|
||||
...[...select.options].map((o) => optionButton(o, select, true)),
|
||||
);
|
||||
picker.showModal();
|
||||
} else if (button.dataset.choiceFor) {
|
||||
const select = root.querySelector(
|
||||
`#${CSS.escape(button.dataset.choiceFor)}`,
|
||||
);
|
||||
if (!select || select.disabled) return;
|
||||
if (button.hasAttribute("data-picker-option")) picker.close();
|
||||
select.value = button.dataset.choiceValue;
|
||||
select.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
sync();
|
||||
}
|
||||
}
|
||||
function closed() {
|
||||
errorAnchor.after(error);
|
||||
activePanel = null;
|
||||
inspected = null;
|
||||
for (const button of root.querySelectorAll("[data-panel]"))
|
||||
button.setAttribute("aria-expanded", "false");
|
||||
}
|
||||
root.addEventListener("click", click);
|
||||
menu.addEventListener("close", closed);
|
||||
sync();
|
||||
return {
|
||||
sync,
|
||||
syncChoices,
|
||||
openPanel,
|
||||
closePanel,
|
||||
destroy() {
|
||||
closePanel();
|
||||
root.removeEventListener("click", click);
|
||||
menu.removeEventListener("close", closed);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
@ -397,11 +397,28 @@ export function createPreviewServer({ clock = Date.now, storagePath } = {}) {
|
|||
view: viewFor(seat),
|
||||
});
|
||||
}
|
||||
if (
|
||||
req.method === "GET" &&
|
||||
/^\/assets\/(fighter|laser|computer|battlebots|shield|reactor|pulse|rocket)\.webp$/.test(
|
||||
url.pathname,
|
||||
)
|
||||
) {
|
||||
res.writeHead(200, {
|
||||
"Content-Type": "image/webp",
|
||||
"Cache-Control": "no-store",
|
||||
});
|
||||
res.end(await readFile(new URL(`.${url.pathname}`, import.meta.url)));
|
||||
return;
|
||||
}
|
||||
const file = {
|
||||
"/": "index.html",
|
||||
"/app.js": "app.js",
|
||||
"/local.js": "local.js",
|
||||
"/text.js": "text.js",
|
||||
"/navigation.js": "navigation.js",
|
||||
"/icons.js": "icons.js",
|
||||
"/art.js": "art.js",
|
||||
"/tactical.js": "tactical.js",
|
||||
"/style.css": "style.css",
|
||||
}[url.pathname];
|
||||
if (req.method === "GET" && file) {
|
||||
|
|
|
|||
1518
preview/style.css
180
preview/tactical.js
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
import { illustration, threatIllustration } from "./art.js";
|
||||
import { pictogram, shipLocator } from "./icons.js";
|
||||
|
||||
export function createTacticalView({ t, esc, symbol, zoneName }) {
|
||||
const meter = (value, capacity) =>
|
||||
`<span class="charge-pips" aria-hidden="true">${Array.from({ length: capacity }, (_, i) => `<i class="${i < value ? "filled" : ""}"></i>`).join("")}</span>`;
|
||||
|
||||
function stationControls({
|
||||
station,
|
||||
zone,
|
||||
deck,
|
||||
ship,
|
||||
power,
|
||||
capacity,
|
||||
system,
|
||||
cIcon,
|
||||
c,
|
||||
canPlan,
|
||||
}) {
|
||||
const s = ship.zones[zone];
|
||||
const pulse = station === "white-lower";
|
||||
const light = deck === "lower" && !pulse;
|
||||
const energyName =
|
||||
system === "shield" ? t("Bouclier", "Shield") : t("Réacteur", "Reactor");
|
||||
const charge =
|
||||
system === "shield"
|
||||
? t("Charger le bouclier", "Charge the shield")
|
||||
: t("Recharger le réacteur", "Refill the reactor");
|
||||
const centralRefuel = station === "white-lower";
|
||||
const sourceValue = centralRefuel
|
||||
? ship.fuel
|
||||
: system === "shield"
|
||||
? s.reactor
|
||||
: ship.zones.white.reactor;
|
||||
const sourceName = centralRefuel
|
||||
? t("Combustible", "Fuel")
|
||||
: `${t("Réacteur", "Reactor")} ${zoneName(system === "shield" ? zone : "white")}`;
|
||||
const sourceIcon = centralRefuel ? "fuel" : "reactor";
|
||||
const weapon = pulse
|
||||
? t("Canon à impulsion", "Pulse cannon")
|
||||
: light
|
||||
? t("Laser léger", "Light laser")
|
||||
: t("Laser lourd", "Heavy laser");
|
||||
const weaponArt = pulse ? "pulse" : light ? "light-laser" : "laser";
|
||||
const fireText = light
|
||||
? t(
|
||||
"Le laser léger utilise sa propre batterie : aucune énergie du réacteur n’est dépensée.",
|
||||
"The light laser has its own battery: it spends no reactor energy.",
|
||||
)
|
||||
: t(
|
||||
"Un tir consomme 1 énergie du réacteur de cette zone. Sans énergie au moment du tir, l’arme ne tire pas.",
|
||||
"Firing uses 1 energy from this zone’s reactor. With no energy when the shot resolves, the weapon does not fire.",
|
||||
);
|
||||
const chargeText = centralRefuel
|
||||
? t(
|
||||
"Une capsule de combustible remplit le réacteur central jusqu’à sa capacité.",
|
||||
"One fuel capsule fills the central reactor to capacity.",
|
||||
)
|
||||
: system === "shield"
|
||||
? t(
|
||||
"B transfère l’énergie du réacteur de cette zone vers son bouclier, jusqu’à sa capacité. Cette énergie absorbera les prochaines attaques.",
|
||||
"B transfers energy from this zone’s reactor into its shield, up to capacity. That energy absorbs incoming attacks.",
|
||||
)
|
||||
: t(
|
||||
"B transfère l’énergie du réacteur central vers ce réacteur, jusqu’à sa capacité.",
|
||||
"B transfers energy from the central reactor into this reactor, up to capacity.",
|
||||
);
|
||||
const cText = {
|
||||
"white-upper": t(
|
||||
"Faites C ici aux tours 1–2, 4–5 et 8–9 pour entretenir l’ordinateur à chaque phase et éviter de retarder les programmes.",
|
||||
"Perform C here on turns 1–2, 4–5 and 8–9 to maintain the computer each phase and avoid delaying programs.",
|
||||
),
|
||||
"blue-upper": t(
|
||||
"C prend les robots de cette salle, ou réactive ceux que vous portez déjà.",
|
||||
"C takes this room’s battlebots, or reactivates the team you already carry.",
|
||||
),
|
||||
"red-lower": t(
|
||||
"C prend les robots de cette salle, ou réactive ceux que vous portez déjà.",
|
||||
"C takes this room’s battlebots, or reactivates the team you already carry.",
|
||||
),
|
||||
"red-upper": t(
|
||||
"Avec des robots actifs, C vous fait décoller en intercepteur. Un seul équipier peut être dans l’espace à la fois.",
|
||||
"With active battlebots, C launches you in an interceptor. Only one crew member can be in space at a time.",
|
||||
),
|
||||
"white-lower": t(
|
||||
"C effectue une observation visuelle, qui peut rapporter des points à la fin de la mission.",
|
||||
"C performs visual confirmation, which can earn points at the end of the mission.",
|
||||
),
|
||||
"blue-lower": t(
|
||||
"C lance une roquette : elle attaque au tour suivant. Une seule roquette peut être lancée par tour.",
|
||||
"C launches a rocket: it attacks on the following turn. Only one rocket can launch each turn.",
|
||||
),
|
||||
}[station];
|
||||
const flow = `<div class="energy-flow"><span>${illustration(sourceIcon)}<b>${sourceValue}</b><small>${esc(sourceName)}</small></span>${pictogram("right")}<span>${illustration(system)}<b>${s[system]}/${capacity}</b><small>${esc(energyName)}</small></span></div>`;
|
||||
const details = (key, art, text, extra = "") =>
|
||||
`<template>${key === "B" ? "" : `<div class="system-detail-art">${illustration(art)}</div>`}<p class="room-location">${esc(zoneName(zone))} · ${deck === "upper" ? t("Pont supérieur", "Upper deck") : t("Pont inférieur", "Lower deck")}</p>${extra}<p>${esc(text)}</p><p class="planning-note">${t(`Programmez ${key} à un tour où votre équipier sera dans cette salle. Une panne de ce système fait utiliser l’action pour la réparer.`, `Program ${key} on a turn when your crew member will be in this room. A malfunction of this system makes the action repair it instead.`)}</p>${canPlan ? `<button class="primary icon-label" data-pick-action="${key}"><span class="action-key">${key}</span>${t(`Voir mes cartes ${key}`, `Show my ${key} cards`)}</button>` : ""}</template>`;
|
||||
return `<div class="systems illustrated-systems">
|
||||
<div class="system-card weapon-system"><button title="${esc(weapon)}" data-inspect="system-${station}-A" data-inspect-title="${esc(weapon)}" aria-haspopup="dialog" aria-label="${esc(`${weapon} · A · ${t("Puissance", "Power")} ${power}`)}"><span class="action-key">A</span>${illustration(weaponArt)}<span class="system-caption"><strong>${t("Tirer", "Fire")}</strong><span class="power-value">${symbol("hull", t("Puissance de tir", "Firepower"), power)}</span></span></button>${details("A", weaponArt, fireText, `<div class="weapon-facts">${symbol("hull", `${t("Puissance", "Power")} ${power}`, power)}${symbol(light ? "check" : "reactor", light ? t("Batterie autonome", "Own battery") : t("Coût : 1 énergie", "Cost: 1 energy"), light ? t("Autonome", "Own battery") : "−1")}</div>`)}</div>
|
||||
<div class="system-card energy-system ${s[system] === 0 ? "depleted" : ""}"><button data-inspect="system-${station}-B" data-inspect-title="${esc(charge)}" aria-haspopup="dialog" aria-label="${esc(`${charge} · B · ${s[system]}/${capacity}`)}"><span class="action-key">B</span>${illustration(system)}<span class="system-caption"><strong>${t("Charger", "Charge")}</strong><b class="energy-value">${s[system]}/${capacity}</b>${meter(s[system], capacity)}</span></button>${details("B", system, chargeText, flow)}</div>
|
||||
<div class="system-card special-system"><button title="${esc(c)}" data-inspect="system-${station}-C" data-inspect-title="${esc(c)}" aria-haspopup="dialog" aria-label="C · ${esc(c)}"><span class="action-key">C</span>${illustration(cIcon)}<span class="system-caption"><strong>${esc(c)}</strong></span></button>${details("C", cIcon, cText)}</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
function shipCutaway({ ship, selectedCrew, canPlan, crewLabel }) {
|
||||
const zones = ["red", "white", "blue"];
|
||||
const movementHelp = (lift) =>
|
||||
`<template><div class="passage-explanation">${pictogram(lift ? "lift" : "move")}</div><p>${lift ? t("Programmez une carte ↑↓ pour changer de pont dans cette zone.", "Program an ↑↓ card to change deck in this zone.") : t("Programmez une flèche gauche ou droite pour passer dans la salle voisine du même pont.", "Program a left or right arrow to enter the next room on the same deck.")}</p>${canPlan ? `<button class="primary icon-label" data-pick-action="move">${pictogram("move")}${t("Voir mes déplacements", "Show my movement cards")}</button>` : ""}</template>`;
|
||||
const deck = (level) =>
|
||||
`<div class="ship-deck deck-${level}">${zones
|
||||
.map((zone) => {
|
||||
const station = `${zone}-${level}`,
|
||||
s = ship.zones[zone];
|
||||
const system = level === "upper" ? "shield" : "reactor";
|
||||
const capacity =
|
||||
(system === "shield"
|
||||
? zone === "white"
|
||||
? 3
|
||||
: 2
|
||||
: zone === "white"
|
||||
? 5
|
||||
: 3) - Number(s.damage.includes(system));
|
||||
const [cIcon, c] = {
|
||||
"red-upper": ["interceptor", t("Intercepteurs", "Interceptors")],
|
||||
"white-upper": ["computer", t("Ordinateur", "Computer")],
|
||||
"blue-upper": ["bots", t("Robots", "Battlebots")],
|
||||
"red-lower": ["bots", t("Robots", "Battlebots")],
|
||||
"white-lower": [
|
||||
"observation",
|
||||
t("Observation", "Visual confirmation"),
|
||||
],
|
||||
"blue-lower": ["rocket", t("Roquette", "Rocket")],
|
||||
}[station];
|
||||
const pulse = station === "white-lower";
|
||||
const power =
|
||||
(level === "upper" ? (zone === "white" ? 5 : 4) : pulse ? 1 : 2) -
|
||||
Number(s.damage.includes(`${level}-weapon`) && !pulse);
|
||||
const occupants = ship.crew.filter(
|
||||
(p) => p.station === station && !p.space,
|
||||
);
|
||||
const deckName =
|
||||
level === "upper"
|
||||
? t("Pont supérieur", "Upper deck")
|
||||
: t("Pont inférieur", "Lower deck");
|
||||
return `<section class="station ${occupants.some((p) => p.id === selectedCrew) ? "selected-station" : ""}" data-station="${station}" style="--zone:var(--${zone})" aria-label="${esc(zoneName(zone))} · ${deckName}"><div class="station-title">${esc(zoneName(zone))}${symbol(level === "upper" ? "up" : "down", deckName)}${level === "upper" && s.damage.length ? `<span class="damage">${symbol("warning", `${t("Dégâts de la zone", "Zone damage")} : ${s.damage.length}/6`, `${s.damage.length}/6`)}</span>` : ""}</div>${stationControls({ station, zone, deck: level, ship, power, capacity, system, cIcon, c, canPlan })}<div class="occupants">${occupants.map((p) => `<span class="crew-pawn ${p.id === selectedCrew ? "selected" : ""} ${p.knockedOut ? "out" : ""}" role="img" title="${esc(crewLabel(p.id))}${p.knockedOut ? " · " + t("Hors combat", "Knocked out") : ""}${p.bots !== null ? " · " + t("Robots", "Battlebots") : ""}" aria-label="${esc(crewLabel(p.id))}${p.knockedOut ? " · " + t("Hors combat", "Knocked out") : ""}${p.bots !== null ? " · " + t("Robots", "Battlebots") : ""}"><svg viewBox="0 0 24 30" aria-hidden="true"><path d="M4 28v-9a8 8 0 0 1 16 0v9Z"/><circle cx="12" cy="8" r="7"/><path class="visor" d="M7 6h10v5H7z"/></svg><b>${p.id + 1}</b>${p.bots !== null ? `<i>${pictogram("bots")}</i>` : ""}</span>`).join("")}</div></section>`;
|
||||
})
|
||||
.join(
|
||||
"",
|
||||
)}${[1, 2].map((i) => `<div class="ship-passage passage-${i}"><button data-inspect="door-${level}-${i}" data-inspect-title="${t("Portes · Même pont", "Doors · Same deck")}" aria-label="${t("Passage", "Passage")} ${esc(zoneName(zones[i - 1]))} ↔ ${esc(zoneName(zones[i]))} · ${level === "upper" ? t("Pont supérieur", "Upper deck") : t("Pont inférieur", "Lower deck")}" aria-haspopup="dialog">${pictogram("move")}</button>${movementHelp(false)}</div>`).join("")}</div>`;
|
||||
return `<div class="ship-bow" aria-hidden="true"><svg viewBox="0 0 600 46" preserveAspectRatio="none"><path class="hull-shell" d="M8 45 40 24 200 12 240 3h120l40 9 160 12 32 21Z"/><path class="bridge-window" d="m237 16 11-6h104l11 6-13 12H250Z"/><path d="M275 11v16m50-16v16M32 39h135m266 0h135"/></svg></div>${deck("upper")}<div class="between-decks"><svg class="energy-conduits" viewBox="0 0 600 44" preserveAspectRatio="none" aria-hidden="true"><path class="conduit-back" d="M300 44V28H120V44m180-16h180v16M100 44V0M300 28V0M500 44V0"/><path d="M300 44V28H120V44m180-16h180v16M100 44V0M300 28V0M500 44V0"/><path d="m96 6 4-4 4 4m192 0 4-4 4 4m192 0 4-4 4 4M116 38l4 4 4-4m352 0 4 4 4-4M193 24l-5 4 5 4m214-8 5 4-5 4"/></svg>${zones.map((z) => `<div class="lift-bay"><button class="lift-control ${ship.zones[z].damage.includes("lift") ? "damaged-lift" : ""}" data-inspect="lift-${z}" data-inspect-title="${t("Ascenseur", "Gravolift")} · ${esc(zoneName(z))}" aria-label="${t("Ascenseur", "Gravolift")} · ${esc(zoneName(z))}${ship.zones[z].damage.includes("lift") ? " · " + t("Endommagé", "Damaged") : ""}" aria-haspopup="dialog">${pictogram("lift")}</button>${movementHelp(true)}</div>`).join("")}</div>${deck("lower")}<div class="ship-stern" aria-hidden="true">${zones.map(() => `<span><i></i><i></i><i></i></span>`).join("")}</div><div class="ship-key"><span><b>A</b>${t("Tirer", "Fire")}</span><span><b>B</b>${t("Énergie", "Energy")}</span><span><b>C</b>${t("Systèmes", "Systems")}</span></div>`;
|
||||
}
|
||||
|
||||
function threatPortrait(th) {
|
||||
const hp = Math.max(0, th.hp - (th.damage ?? 0));
|
||||
const gone = ["destroyed", "survived", "discarded"].includes(th.status);
|
||||
const status =
|
||||
th.status === "destroyed"
|
||||
? t("Détruite", "Destroyed")
|
||||
: th.status === "survived"
|
||||
? t("Échappée", "Escaped")
|
||||
: th.status === "discarded"
|
||||
? t("Écartée", "Discarded")
|
||||
: null;
|
||||
const visual = threatIllustration(th);
|
||||
const internal = th.position === "internal";
|
||||
const stations = internal
|
||||
? (th.stations ?? [])
|
||||
: [`${th.zone}-upper`, `${th.zone}-lower`];
|
||||
const targetName = internal
|
||||
? `${t("Salles touchées", "Affected rooms")} : ${stations
|
||||
.map((s) => {
|
||||
const [z, d] = s.split("-");
|
||||
return `${zoneName(z)} ${d === "upper" ? "↑" : "↓"}`;
|
||||
})
|
||||
.join(", ")}`
|
||||
: `${t("Trajectoire", "Trajectory")} : ${zoneName(th.zone)}`;
|
||||
const target = `<span class="threat-target" style="--zone:var(--${["red", "white", "blue"].includes(th.zone) ? th.zone : "cyan"})" role="img" aria-label="${esc(targetName)}" title="${esc(targetName)}">${shipLocator(stations, internal ? null : th.zone)}</span>`;
|
||||
return `<span class="threat-portrait ${gone ? "resolved-threat" : ""}">${visual}<span class="threat-hud"><span class="hull-gauge"><span>${symbol("hull", `${t("Points de vie", "Hit points")} : ${hp}/${th.hp}`, `<b>${hp}<small>/${th.hp}</small></b>`)}</span><span class="hull-bar"><i style="width:${Math.max(0, Math.min(100, (hp / Math.max(1, th.hp)) * 100))}%"></i></span></span>${target}<span class="shield-badge">${symbol("shield", `${t("Bouclier", "Shield")} : ${th.shield}`, `<b>${th.shield}</b>`)}</span></span>${status ? `<span class="threat-outcome">${esc(status)}</span>` : ""}</span>`;
|
||||
}
|
||||
return { shipCutaway, threatPortrait };
|
||||
}
|
||||
|
|
@ -1,4 +1,12 @@
|
|||
const choose = (pair, locale) => pair?.[locale === "fr" ? 0 : 1];
|
||||
const zoneLabels = {
|
||||
red: ["Gauche", "Left"],
|
||||
white: ["Centre", "Center"],
|
||||
blue: ["Droite", "Right"],
|
||||
};
|
||||
export function zoneLabel(zone, locale) {
|
||||
return choose(zoneLabels[zone], locale) ?? zone;
|
||||
}
|
||||
const specials = {
|
||||
rocketeer: [
|
||||
[
|
||||
|
|
@ -7,7 +15,7 @@ const specials = {
|
|||
],
|
||||
[
|
||||
"En bas à droite : lance deux roquettes en un tir de force 5. Ailleurs : effectue C.",
|
||||
"Lower blue: launch two rockets as a strength-5 shot. Elsewhere: perform C.",
|
||||
"Lower right: launch two rockets as a strength-5 shot. Elsewhere: perform C.",
|
||||
],
|
||||
],
|
||||
"data-analyst": [
|
||||
|
|
@ -67,7 +75,7 @@ const specials = {
|
|||
],
|
||||
[
|
||||
"En bas au centre, au tour 10 ou 11 : termine ce tour puis passe au dernier tour sans actions d’équipage.",
|
||||
"Lower white on turn 10 or 11: finish this turn, then skip to the final turn without crew actions.",
|
||||
"Lower center on turn 10 or 11: finish this turn, then skip to the final turn without crew actions.",
|
||||
],
|
||||
],
|
||||
"special-ops": [
|
||||
|
|
@ -87,7 +95,7 @@ const specials = {
|
|||
],
|
||||
[
|
||||
"Avec des robots actifs, sauf en bas à droite : rejoint les intercepteurs et décolle. Déjà en vol : attaque héroïque.",
|
||||
"With active battlebots, except in lower blue: reach the interceptors and launch. Already in space: heroic attack.",
|
||||
"With active battlebots, except in lower right: reach the interceptors and launch. Already in space: heroic attack.",
|
||||
],
|
||||
],
|
||||
mechanic: [
|
||||
|
|
@ -162,7 +170,7 @@ const traits = {
|
|||
],
|
||||
deathKnockout: [
|
||||
"Réparation terminée : assomme les équipiers en bas dans les zones latérales.",
|
||||
"Final repair knocks out crew in lower red and lower blue.",
|
||||
"Final repair knocks out crew in lower left and lower right.",
|
||||
],
|
||||
deathKnocksAttacker: [
|
||||
"Détruite : assomme son attaquant et désactive ses robots, même avec une attaque héroïque.",
|
||||
|
|
@ -219,16 +227,16 @@ Object.assign(traits, {
|
|||
"The final repair consumes 1 local reactor energy; it cannot finish with an empty reactor.",
|
||||
],
|
||||
parityStation: [
|
||||
"Station initiale : rouge supérieur sur un numéro impair, bleu supérieur sur un numéro pair.",
|
||||
"Starts in upper red on an odd threat number, upper blue on an even number.",
|
||||
"Station initiale : haut à gauche sur un numéro impair, haut à droite sur un numéro pair.",
|
||||
"Starts in upper left on an odd threat number, upper right on an even number.",
|
||||
],
|
||||
shortCircuit: [
|
||||
"Bloque l’impulsion. Chaque tir du laser lourd central provoque une attaque 1 sur chaque zone.",
|
||||
"Blocks pulse. Every central heavy-laser shot triggers an attack 1 on every zone.",
|
||||
],
|
||||
poison: [
|
||||
"Dès son apparition, le Ninja empoisonne les mouvements commençant ou finissant en bleu supérieur ou blanc inférieur. Après sa destruction, seuls les déjà empoisonnés restent menacés jusqu’à Z.",
|
||||
"From appearance, Ninja poisons movements starting or ending in upper blue or lower white. After destruction, only already-poisoned crew remain threatened until Z.",
|
||||
"Dès son apparition, le Ninja empoisonne les mouvements commençant ou finissant en haut à droite ou bas au centre. Après sa destruction, seuls les déjà empoisonnés restent menacés jusqu’à Z.",
|
||||
"From appearance, Ninja poisons movements starting or ending in upper right or lower center. After destruction, only already-poisoned crew remain threatened until Z.",
|
||||
],
|
||||
infection: [
|
||||
"Les infections déjà transmises restent actives jusqu’à Z, même après sa destruction.",
|
||||
|
|
@ -243,8 +251,8 @@ Object.assign(traits, {
|
|||
"At Z, a surprise common internal threat resolves all its actions.",
|
||||
],
|
||||
teleportsOnHit: [
|
||||
"Après un dégât, se téléporte en rouge supérieur.",
|
||||
"After taking damage, teleports to upper red.",
|
||||
"Après un dégât, se téléporte en haut à gauche.",
|
||||
"After taking damage, teleports to upper left.",
|
||||
],
|
||||
gremlin: [
|
||||
"Si non détruit avant le saut, assomme tout l’équipage. Les systèmes sabotés se réparent séparément.",
|
||||
|
|
@ -326,9 +334,9 @@ export function traitDescriptions(th, locale) {
|
|||
return result;
|
||||
}
|
||||
const dictionary = {
|
||||
red: ["rouge", "red"],
|
||||
white: ["blanc", "white"],
|
||||
blue: ["bleu", "blue"],
|
||||
red: ["gauche", "left"],
|
||||
white: ["centre", "center"],
|
||||
blue: ["droite", "right"],
|
||||
shield: ["bouclier", "shield"],
|
||||
reactor: ["réacteur", "reactor"],
|
||||
speed: ["vitesse", "speed"],
|
||||
|
|
@ -372,8 +380,8 @@ const dictionary = {
|
|||
"+1 shield to all external threats until destroyed",
|
||||
],
|
||||
"double-red": [
|
||||
"double les dégâts à la zone rouge",
|
||||
"double damage to red zone",
|
||||
"double les dégâts à la zone de gauche",
|
||||
"double damage to left zone",
|
||||
],
|
||||
"double-all": [
|
||||
"double les dégâts à toutes les zones",
|
||||
|
|
@ -422,16 +430,16 @@ Object.assign(dictionary, {
|
|||
"subsequent attacks ignore shields",
|
||||
],
|
||||
"poison-entry": [
|
||||
"empoisonne ceux qui commencent ou terminent un déplacement en bleu supérieur ou blanc inférieur",
|
||||
"poisons crew starting or ending a movement in upper blue or lower white",
|
||||
"empoisonne ceux qui commencent ou terminent un déplacement en haut à droite ou bas au centre",
|
||||
"poisons crew starting or ending a movement in upper right or lower center",
|
||||
],
|
||||
"sealed-red": [
|
||||
"portes vers la zone rouge scellées",
|
||||
"doors to red zone sealed",
|
||||
"portes vers la zone de gauche scellées",
|
||||
"doors to left zone sealed",
|
||||
],
|
||||
"sealed-blue": [
|
||||
"portes vers la zone bleue scellées",
|
||||
"doors to blue zone sealed",
|
||||
"portes vers la zone de droite scellées",
|
||||
"doors to right zone sealed",
|
||||
],
|
||||
"sealed-door": ["porte scellée", "sealed door"],
|
||||
"cyber-gremlin": [
|
||||
|
|
@ -442,12 +450,12 @@ Object.assign(dictionary, {
|
|||
function word(x, locale) {
|
||||
return choose(dictionary[x], locale) ?? String(x ?? "");
|
||||
}
|
||||
function station(x, locale) {
|
||||
export function stationLabel(x, locale) {
|
||||
if (x && typeof x === "object" && x.zone && x.deck) x = `${x.zone}-${x.deck}`;
|
||||
if (typeof x !== "string" || !/^(red|white|blue)-(upper|lower)$/.test(x))
|
||||
return "";
|
||||
const [z, d] = x.split("-");
|
||||
return `${word(z, locale)} ${d === "upper" ? "↑" : "↓"}`;
|
||||
return `${zoneLabel(z, locale)} ${d === "upper" ? "↑" : "↓"}`;
|
||||
}
|
||||
export function effectDescription(e, locale) {
|
||||
const t = (fr, en) => (locale === "fr" ? fr : en),
|
||||
|
|
@ -502,7 +510,7 @@ export function effectDescription(e, locale) {
|
|||
case "disable-stored-bots":
|
||||
text = t(
|
||||
"Désactive les robots en réserve en bas à gauche.",
|
||||
"Disable stored battlebots in lower red.",
|
||||
"Disable stored battlebots in lower left.",
|
||||
);
|
||||
break;
|
||||
case "fuel-lost":
|
||||
|
|
@ -597,8 +605,8 @@ export function effectDescription(e, locale) {
|
|||
break;
|
||||
case "drill-move":
|
||||
text = t(
|
||||
"Avance d’une station vers la zone la plus endommagée ; égalité : vers le blanc.",
|
||||
"Move one station toward the most damaged zone; ties: toward white.",
|
||||
"Avance d’une station vers la zone la plus endommagée ; égalité : vers le centre.",
|
||||
"Move one station toward the most damaged zone; ties: toward the center.",
|
||||
);
|
||||
break;
|
||||
case "shambler":
|
||||
|
|
@ -609,8 +617,8 @@ export function effectDescription(e, locale) {
|
|||
break;
|
||||
case "blind":
|
||||
text = t(
|
||||
`Obstrue la visée ${e.zone === "lateral" ? "d’une zone latérale" : "du blanc"}. Observation ou intercepteurs requis pour y tirer au laser.`,
|
||||
`Obscure ${e.zone === "lateral" ? "a side zone" : "white"} targeting. Visual confirmation or interceptors are required for laser fire there.`,
|
||||
`Obstrue la visée ${e.zone === "lateral" ? "d’une zone latérale" : "du centre"}. Observation ou intercepteurs requis pour y tirer au laser.`,
|
||||
`Obscure ${e.zone === "lateral" ? "a side zone" : "center"} targeting. Visual confirmation or interceptors are required for laser fire there.`,
|
||||
);
|
||||
break;
|
||||
case "mine":
|
||||
|
|
@ -639,8 +647,8 @@ export function effectDescription(e, locale) {
|
|||
break;
|
||||
case "poison-detonate":
|
||||
text = t(
|
||||
"Assomme les empoisonnés. Si le Ninja vit encore : chaque roquette restante provoque une attaque 2 en rouge, puis est détruite.",
|
||||
"Knock out poisoned crew. If Ninja is still alive, each remaining rocket causes an attack 2 on red, then is destroyed.",
|
||||
"Assomme les empoisonnés. Si le Ninja vit encore : chaque roquette restante provoque une attaque 2 à gauche, puis est détruite.",
|
||||
"Knock out poisoned crew. If Ninja is still alive, each remaining rocket causes an attack 2 on the left, then is destroyed.",
|
||||
);
|
||||
break;
|
||||
case "repeat-action":
|
||||
|
|
@ -651,8 +659,8 @@ export function effectDescription(e, locale) {
|
|||
break;
|
||||
case "swap-zones":
|
||||
text = t(
|
||||
"Les équipiers en zones latérales échangent rouge / bleu, sans changer de pont.",
|
||||
"Crew in side zones swap red / blue without changing deck.",
|
||||
"Les équipiers en zones latérales échangent gauche / droite, sans changer de pont.",
|
||||
"Crew in side zones swap left / right without changing deck.",
|
||||
);
|
||||
break;
|
||||
case "vortex-draw":
|
||||
|
|
@ -687,8 +695,8 @@ export function effectDescription(e, locale) {
|
|||
break;
|
||||
case "parasite-attack":
|
||||
text = t(
|
||||
"5 dégâts directs dans la zone de l’hôte ; hôte en vol : attaque 5 en blanc.",
|
||||
"5 direct damage to the host’s zone; host in space: attack 5 on white.",
|
||||
"5 dégâts directs dans la zone de l’hôte ; hôte en vol : attaque 5 au centre.",
|
||||
"5 direct damage to the host’s zone; host in space: attack 5 in the center.",
|
||||
);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -742,20 +750,20 @@ export function eventDescription(e, locale, threats) {
|
|||
),
|
||||
"cryoshield-broken": t("Cryobouclier détruit", "Cryoshield broken"),
|
||||
move: t(
|
||||
`${station(e.from, locale)} → ${station(e.to, locale)}`,
|
||||
`${station(e.from, locale)} → ${station(e.to, locale)}`,
|
||||
`${stationLabel(e.from, locale)} → ${stationLabel(e.to, locale)}`,
|
||||
`${stationLabel(e.from, locale)} → ${stationLabel(e.to, locale)}`,
|
||||
),
|
||||
teleport: t(
|
||||
`Téléportation → ${station(e.to, locale)}`,
|
||||
`Teleport → ${station(e.to, locale)}`,
|
||||
`Téléportation → ${stationLabel(e.to, locale)}`,
|
||||
`Teleport → ${stationLabel(e.to, locale)}`,
|
||||
),
|
||||
fire: t(
|
||||
`Tir ${station(e.station, locale)}, force ${e.strength}, portée ${e.range}`,
|
||||
`Fire ${station(e.station, locale)}, strength ${e.strength}, range ${e.range}`,
|
||||
`Tir ${stationLabel(e.station, locale)}, force ${e.strength}, portée ${e.range}`,
|
||||
`Fire ${stationLabel(e.station, locale)}, strength ${e.strength}, range ${e.range}`,
|
||||
),
|
||||
energy: t(
|
||||
`Transfert de ${e.amount} énergie · ${station(e.station, locale)} · ${w(e.system)}`,
|
||||
`Transfer ${e.amount} energy · ${station(e.station, locale)} · ${w(e.system)}`,
|
||||
`Transfert de ${e.amount} énergie · ${stationLabel(e.station, locale)} · ${w(e.system)}`,
|
||||
`Transfer ${e.amount} energy · ${stationLabel(e.station, locale)} · ${w(e.system)}`,
|
||||
),
|
||||
computer: t(
|
||||
`Ordinateur entretenu · phase ${e.phase}`,
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ export const LESSONS = [
|
|||
["Énergie et coordination", "Energy and coordination"],
|
||||
[
|
||||
[
|
||||
"Le réacteur blanc commence avec 3 énergies. Le laser lourd et l’impulsion utilisent cette même réserve ; B à l’étage recharge le bouclier, pas le réacteur.",
|
||||
"White starts with 3 reactor energy. Heavy laser and pulse share it; B upstairs fills the shield, not the reactor.",
|
||||
"Le réacteur central commence avec 3 énergies. Le laser lourd et l’impulsion utilisent cette même réserve ; B à l’étage recharge le bouclier, pas le réacteur.",
|
||||
"The central reactor starts with 3 energy. Heavy laser and pulse share it; B upstairs fills the shield, not the reactor.",
|
||||
],
|
||||
[
|
||||
"Androïde 1 : A, A, A aux tours 1–3, puis A au tour 4. Sans ravitaillement, ce dernier tir échouera. Essayez ensuite : androïde 3, ascenseur au tour 1 puis B au tour 2.",
|
||||
|
|
@ -51,12 +51,12 @@ export const LESSONS = [
|
|||
["Réparer une panne", "Repairing a malfunction"],
|
||||
[
|
||||
[
|
||||
"La panne apparaît en bleu supérieur au tour 2. Une panne détourne le bouton indiqué : il répare au lieu d’utiliser le système.",
|
||||
"The malfunction appears in upper blue on turn 2. It overrides the indicated button: that button repairs instead of using the system.",
|
||||
"La panne apparaît en haut à droite au tour 2. Une panne détourne le bouton indiqué : il répare au lieu d’utiliser le système.",
|
||||
"The malfunction appears in upper right on turn 2. It overrides the indicated button: that button repairs instead of using the system.",
|
||||
],
|
||||
[
|
||||
"Androïde 1 : flèche bleue au tour 1, puis B aux tours 2, 3 et 4. Inspectez la carte de menace pour lire ses vies et ses actions X/Y/Z.",
|
||||
"Android 1: blue arrow on turn 1, then B on turns 2, 3 and 4. Inspect the threat card for hit points and X/Y/Z effects.",
|
||||
"Androïde 1 : flèche droite au tour 1, puis B aux tours 2, 3 et 4. Inspectez la carte de menace pour lire ses vies et ses actions X/Y/Z.",
|
||||
"Android 1: right arrow on turn 1, then B on turns 2, 3 and 4. Inspect the threat card for hit points and X/Y/Z effects.",
|
||||
],
|
||||
[
|
||||
"Un B joué avant l’apparition aurait chargé le bouclier au lieu de réparer. Comparez les résultats en modifiant le programme après avoir recommencé.",
|
||||
|
|
@ -70,12 +70,12 @@ export const LESSONS = [
|
|||
["Robots et intercepteurs", "Battlebots and interceptors"],
|
||||
[
|
||||
[
|
||||
"Les robots attendent en bleu supérieur et rouge inférieur. C prend une escouade ; le symbole robot est une action distincte qui combat les intrus.",
|
||||
"Battlebots wait in upper blue and lower red. C picks up a squad; the battlebot symbol is a separate action for fighting intruders.",
|
||||
"Les robots attendent en haut à droite et en bas à gauche. C prend une escouade ; le symbole robot est une action distincte qui combat les intrus.",
|
||||
"Battlebots wait in upper right and lower left. C picks up a squad; the battlebot symbol is a separate action for fighting intruders.",
|
||||
],
|
||||
[
|
||||
"Androïde 1 : flèche bleue, C, flèche rouge aux tours 1–3. En phase 2 : flèche rouge puis C pour décoller depuis le rouge supérieur avec vos robots.",
|
||||
"Android 1: blue arrow, C, red arrow on turns 1–3. In phase 2: red arrow, then C to launch from upper red with your battlebots.",
|
||||
"Androïde 1 : flèche droite, C, flèche gauche aux tours 1–3. En phase 2 : flèche gauche puis C pour décoller depuis la salle en haut à gauche avec vos robots.",
|
||||
"Android 1: right arrow, C, left arrow on turns 1–3. In phase 2: left arrow, then C to launch from upper left with your battlebots.",
|
||||
],
|
||||
[
|
||||
"En vol : robot pour rester et tirer ; une case vide vous fait rentrer. Une autre action est retardée au retour. Les robots désactivés ne permettent pas de décoller.",
|
||||
|
|
@ -92,8 +92,8 @@ export const LESSONS = [
|
|||
"This deck has double-action cards. Choose a half normally: its two symbols execute left to right.",
|
||||
],
|
||||
[
|
||||
"Comparez flèche bleue + A avec A + flèche bleue au tour 2 : le laser utilisé change. Vous ne pouvez pas volontairement ignorer une moitié réalisable.",
|
||||
"Compare blue arrow + A with A + blue arrow on turn 2: they fire different lasers. You cannot voluntarily skip a performable half.",
|
||||
"Comparez flèche droite + A avec A + flèche droite au tour 2 : le laser utilisé change. Vous ne pouvez pas volontairement ignorer une moitié réalisable.",
|
||||
"Compare right arrow + A with A + right arrow on turn 2: they fire different lasers. You cannot voluntarily skip a performable half.",
|
||||
],
|
||||
[
|
||||
"Si la première moitié provoque un retard (ascenseur occupé, Slime), la seconde passe au tour suivant. Les intercepteurs peuvent désormais changer de portée avec les doubles actions.",
|
||||
|
|
|
|||