Add Vanuatu per-game achievements with protocol 0.11.0

This commit is contained in:
coyotte508 2026-11-14 00:46:38 +00:00
commit 891320d234
11 changed files with 574 additions and 12 deletions

View file

@ -18,6 +18,8 @@ Marker retrieval is manual by default, including the last unusable action stack.
Supported scope: 2–5 players, all eleven characters, the official two-player variant, optional Rising Waters, replay and finished-game analysis, bots, BGS chat, player hover cards and board thumbnails.
Per-game achievements: see the [revision-1 manifest, eligibility semantics, and release prerequisites](docs/achievements.md). `pnpm check` includes official protocol contract typechecks.
## References
- [Publisher and rules](https://www.quined.nl/featured_item/vanuatu-2nd-edition/)

72
docs/achievements.md Normal file
View file

@ -0,0 +1,72 @@
# Per-game achievements
The optional `achievementDefinitions()` and `achievements(data)` exports use the
published `@boardgamers/protocol` **0.11.0** engine contract. Revision **1** has
16 stable game-local IDs. Icons are omitted (platform generic presentation); no
asset uploads or external image URLs are required. The JavaScript implementation
uses official JSDoc types; `pnpm test:achievements:types` also checks its exported
hooks against `Engine`. Tests validate results with the official runtime schemas.
## Manifest
| ID | Name | Requirement |
| --------------------- | ------------------ | ------------------------------------------------------------ |
| island-victory | Island Victory | Outright win |
| duel-victory | Duel Victory | Outright win, 2 players |
| trio-victory | Trio Victory | Outright win, 3 players |
| quartet-victory | Quartet Victory | Outright win, 4 players |
| full-table-victory | Full Table Victory | Outright win, 5 players |
| rising-waters-victory | Against the Tide | Outright win with Rising Waters |
| no-characters-victory | On Your Own Merits | Outright win with Characters disabled |
| fifty-points | Island Prosperity | Final score at least 50 |
| seventy-five-points | Island Renown | Final score at least 75 |
| nine-vatus | Full Purse | Retain 9 vatus after final scoring |
| four-huts | Village Builder | At least 4 surviving huts |
| three-islands | Island Network | Surviving huts on at least 3 islands |
| tourism-twelve | Welcoming Shores | At least 12 final hut-tourism points |
| treasure-six | Treasure Keeper | At least 6 final retained-treasure points |
| treasure-twelve | Sunken Riches | At least 12 final retained-treasure points |
| weather-the-waters | Weather the Waters | Complete round 8 with Rising Waters, without collective loss |
## Result semantics and trust boundary
- Evaluate only authoritative completed serialized engine data. The engine's save
format is a plain object: JSON serialization/hydration requires no special class
reconstruction. Evaluation reads it without mutation, randomness, replay, or I/O.
Each call returns fresh objects; callers cannot mutate the stored manifest.
- A normally finished game must have final-scoring details and round 8. Unfinished
games, public/stripped views, known tutorials, local practice, and analysis games
return no results. New practice/tutorial setups carry explicit flags. Loaded
local practice saves are marked too. Analysis markers survive replay. Old local
saves without these markers cannot be identified if supplied outside that flow.
- Vanuatu has 2–5 seats, no solo/automa mode. Official `rankings` compares score,
then surviving huts, then money. Only a unique rank-1 seat wins. Multiple rank-1
seats draw; all lower seats lose. Disabling Characters is only possible for 3–5
players (two-player rules force Characters on).
- Rising Waters' collective catastrophe is a real completed loss, **not** a
cancellation or shared win despite identical rankings. Every seat gets `loss`
and no feats: final scoring never runs in this case.
- Normal-game non-win feats are not gated on victory: losers and drawers can earn
them. Tourism and treasure use the engine's final scoring breakdown, not action
history guesses. Submerged huts do not count. Money is the retained balance
after fish liquidation; 10 vatus converts automatically into 5 points. Treasure
is worth twice its retained value; tourism is 2 points per hut per tourist.
- The engine metadata contract only supplies names, not account IDs or bot flags.
`moveAI` is also used for recommendations and does not identify seat ownership.
Hooks therefore describe **all seats**, without guessing human status from
names, AI moves or dropped-player flags. BGS must map eligible human seats to
accounts, filter bots, and invoke awards only for authoritative completed,
non-cancelled games. Platform cancellation is not stored in this engine's state.
Dropped seats retain their actual game outcome; platform eligibility is separate.
No historical backfill or cross-game counters are implemented.
## Release prerequisites
This branch is for independent review only; no BGS upload or release-branch push
is part of this change. Before publication, deploy platform achievement support
and verify authoritative completion/cancellation and human-seat eligibility in
integration. Run `pnpm check`, review the manifest, and follow the repository's BGS
release workflow (including required version bumps, latest release-branch
integration, source/lockfile commit, release-branch push and public mirror update).
Do not repurpose IDs. Any future definition changes require a manifest revision
bump. No new protocol release or artwork is needed for this manifest.

127
engine/achievements.js Normal file
View file

@ -0,0 +1,127 @@
// @ts-check
/** @type {import('@boardgamers/protocol/engine').AchievementManifest} */
const manifest = {
revision: 1,
achievements: [
["island-victory", "Island Victory", "Win a game outright."],
["duel-victory", "Duel Victory", "Win a two-player game outright."],
["trio-victory", "Trio Victory", "Win a three-player game outright."],
["quartet-victory", "Quartet Victory", "Win a four-player game outright."],
[
"full-table-victory",
"Full Table Victory",
"Win a five-player game outright.",
],
[
"rising-waters-victory",
"Against the Tide",
"Win a Rising Waters game outright.",
],
[
"no-characters-victory",
"On Your Own Merits",
"Win outright with Characters disabled.",
],
["fifty-points", "Island Prosperity", "Finish with at least 50 points."],
["seventy-five-points", "Island Renown", "Finish with at least 75 points."],
["nine-vatus", "Full Purse", "Retain 9 vatus after final scoring."],
[
"four-huts",
"Village Builder",
"Finish with at least four surviving huts.",
],
[
"three-islands",
"Island Network",
"Finish with huts on at least three islands.",
],
[
"tourism-twelve",
"Welcoming Shores",
"Earn at least 12 final-scoring points from hut tourism.",
],
[
"treasure-six",
"Treasure Keeper",
"Retain treasure worth at least 6 final-scoring points.",
],
[
"treasure-twelve",
"Sunken Riches",
"Retain treasure worth at least 12 final-scoring points.",
],
[
"weather-the-waters",
"Weather the Waters",
"Complete all eight rounds of Rising Waters without the collective flood loss.",
],
].map(([id, name, description]) => ({ id, name, description })),
};
export function achievementDefinitions() {
return structuredClone(manifest);
}
/**
* Plain JSON is the engine's serialized format; no hydration or replay is needed.
* Account eligibility, cancellation and bot-seat filtering belong to BGS.
* @param {any} s
* @param {number[]} ranks Official engine rankings, including hut/vatu tiebreaks.
* @returns {import('@boardgamers/protocol/engine').SeatAchievements[]}
*/
export function evaluateAchievements(s, ranks) {
if (
!s?.finished ||
s.phase !== "ended" ||
s.achievementMode ||
s._setup?.options?.practice ||
s._setup?.options?.tutorial ||
s._analysisPublicDraws ||
!s._setup ||
!s._history ||
s.players.length < 2 ||
s.players.length > 5
)
return [];
// Catastrophe does not run final scoring and is not a tied victory.
if (s.lost)
return s.players.map((_, seat) => ({ seat, earned: [], outcome: "loss" }));
if (s.round !== 8 || !s.players.every((p) => p.final)) return [];
const leaders = ranks.filter((rank) => rank === 1).length;
return s.players.map((p, seat) => {
const win = ranks[seat] === 1 && leaders === 1;
const islands = Object.values(s.board).filter(
(t) => t.type === "island" && !t.submerged,
);
const huts = islands.map((t) => t.huts.filter((q) => q === seat).length);
const earned = [];
if (win) {
earned.push(
"island-victory",
[
"duel-victory",
"trio-victory",
"quartet-victory",
"full-table-victory",
][s.players.length - 2],
);
if (s.options.risingWaters) earned.push("rising-waters-victory");
if (!s.options.characters) earned.push("no-characters-victory");
}
if (p.score >= 50) earned.push("fifty-points");
if (p.score >= 75) earned.push("seventy-five-points");
if (p.money === 9) earned.push("nine-vatus");
if (huts.reduce((a, b) => a + b, 0) >= 4) earned.push("four-huts");
if (huts.filter((n) => n > 0).length >= 3) earned.push("three-islands");
if (p.final.tourists >= 12) earned.push("tourism-twelve");
if (p.final.treasure >= 6) earned.push("treasure-six");
if (p.final.treasure >= 12) earned.push("treasure-twelve");
if (s.options.risingWaters) earned.push("weather-the-waters");
return {
seat,
earned,
outcome: win ? "win" : ranks[seat] === 1 ? "draw" : "loss",
};
});
}

View file

@ -18,6 +18,13 @@ import {
tileState,
} from "./catalog.js";
export * from "./catalog.js";
export { achievementDefinitions } from "./achievements.js";
import { evaluateAchievements } from "./achievements.js";
/** @type {NonNullable<import('@boardgamers/protocol/engine').Engine<any>['achievements']>} */
export function achievements(s) {
return evaluateAchievements(s, s?.finished ? rankings(s) : []);
}
export const hashSeed = true;
const copy = (x) => structuredClone(x);
const check = (b, m = "Illegal move") => {
@ -1143,6 +1150,7 @@ export function replay(s, { to = logLength(s) } = {}) {
// Replay owns this fresh state; cloning its accumulated frames per move is quadratic.
applyMoveInPlace(r, h.move, h.p);
}
if (s.achievementMode) r.achievementMode = s.achievementMode;
s.players.forEach((p, i) => {
r.players[i].name = p.name;
r.players[i].dropped = p.dropped;
@ -1152,11 +1160,13 @@ export function replay(s, { to = logLength(s) } = {}) {
}
export function createAnalysis(s, { to }) {
const r = replay(s, { to });
r.achievementMode = "analysis";
r.players.forEach((p) => (p.dropped = false));
return r;
}
export function createAnalysisScenario(s, { player, seed }) {
const r = publicFrame(capture(s), player, false);
r.achievementMode = "analysis";
delete r.restAvailable;
delete r.lastEvents;
r.events = [];

View file

@ -10,14 +10,15 @@
"scripts": {
"build": "node scripts/build.mjs",
"test": "node --test test/*.test.js",
"test:achievements:types": "tsc --allowJs --noEmit --skipLibCheck --noImplicitAny false --target es2022 --module nodenext engine/achievements.js test/achievements-contract.ts",
"dev": "node scripts/dev.mjs",
"test:browser": "node test/browser.mjs && node test/undo-browser.mjs && node test/journal-browser.mjs && node test/map-zoom-browser.mjs && node test/map-drag-browser.mjs && node test/redraw-browser.mjs && node test/mobile-layout-browser.mjs && node test/prose-browser.mjs && node test/effects-browser.mjs && node test/three-viewer-browser.mjs",
"check": "pnpm test:locales && pnpm build && pnpm test && pnpm test:browser && pnpm test:tutorial:browser",
"check": "pnpm test:achievements:types && pnpm test:locales && pnpm build && pnpm test && pnpm test:browser && pnpm test:tutorial:browser",
"test:locales": "node scripts/check-locales.mjs viewer/localization && node --test scripts/localization.test.mjs",
"test:tutorial:browser": "node test/tutorial-browser.mjs && node test/tutorial-walkthrough-browser.mjs && node test/tutorial-errors-browser.mjs"
},
"dependencies": {
"@boardgamers/protocol": "0.10.0",
"@boardgamers/protocol": "0.11.0",
"@noble/hashes": "2.0.1",
"morphdom": "2.7.8",
"three": "0.186.1"
@ -25,7 +26,8 @@
"devDependencies": {
"esbuild": "0.25.12",
"playwright": "1.62.1",
"prettier": "3.6.2"
"prettier": "3.6.2",
"typescript": "5.9.3"
},
"repository": {
"type": "git",

20
pnpm-lock.yaml generated
View file

@ -9,8 +9,8 @@ importers:
.:
dependencies:
'@boardgamers/protocol':
specifier: 0.10.0
version: 0.10.0
specifier: 0.11.0
version: 0.11.0
'@noble/hashes':
specifier: 2.0.1
version: 2.0.1
@ -30,11 +30,14 @@ importers:
prettier:
specifier: 3.6.2
version: 3.6.2
typescript:
specifier: 5.9.3
version: 5.9.3
packages:
'@boardgamers/protocol@0.10.0':
resolution: {integrity: sha512-U+nOK8xeQANvjzwacHirBW+ItDf9AOmHLtkoyTI/XYFCOpL6lPsEgCbmcxnmkXv2a1/lgtVN3WpSERHUqkQkXw==}
'@boardgamers/protocol@0.11.0':
resolution: {integrity: sha512-YQ54+aVOIZvxUJvFmUbZR7xSBEgQaemstPdmYKVGCUHCviRX2UXRLgqLSQl6PFhr++lUT+Nynbf+p7h19zN+/g==}
'@esbuild/aix-ppc64@0.25.12':
resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==}
@ -227,12 +230,17 @@ packages:
three@0.186.1:
resolution: {integrity: sha512-blFeqb49wRCSGUGj7gtpfnSGHy2lwDk94RhUmS1c/hTby70kvChbWpkJ4Pm1390LqzzvTmzgXKHPEafJwCb8jA==}
typescript@5.9.3:
resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}
engines: {node: '>=14.17'}
hasBin: true
zod@4.6.5:
resolution: {integrity: sha512-v5l/aFXZQeai4awLbOpSoHecE9UiMrnfx75tEXLjNonXVARxQ5mOeipTjROUchszUNCqnE+hqAMujRsRHsut2Q==}
snapshots:
'@boardgamers/protocol@0.10.0':
'@boardgamers/protocol@0.11.0':
dependencies:
zod: 4.6.5
@ -362,4 +370,6 @@ snapshots:
three@0.186.1: {}
typescript@5.9.3: {}
zod@4.6.5: {}

View file

@ -1,4 +1,4 @@
allowBuilds:
esbuild: true
minimumReleaseAgeExclude:
- "@boardgamers/protocol@0.6.1 || 0.6.2 || 0.8.1 || 0.10.0"
- "@boardgamers/protocol@0.6.1 || 0.6.2 || 0.8.1 || 0.10.0 || 0.11.0"

View file

@ -0,0 +1,9 @@
import type { Engine } from "@boardgamers/protocol/engine";
import { achievementDefinitions, achievements } from "../engine/index.js";
// Compile against the published engine contract, not a local schema copy.
const hooks = { achievementDefinitions, achievements } satisfies Pick<
Engine,
"achievementDefinitions" | "achievements"
>;
void hooks;

329
test/achievements.test.js Normal file
View file

@ -0,0 +1,329 @@
import test from "node:test";
import assert from "node:assert/strict";
import {
achievementManifestSchema,
achievementResultsSchema,
} from "@boardgamers/protocol/achievements";
import * as E from "../engine/index.js";
const json = (value) => JSON.parse(JSON.stringify(value));
const countAwards = [
"duel-victory",
"trio-victory",
"quartet-victory",
"full-table-victory",
];
const ids = [
"island-victory",
...countAwards,
"rising-waters-victory",
"no-characters-victory",
"fifty-points",
"seventy-five-points",
"nine-vatus",
"four-huts",
"three-islands",
"tourism-twelve",
"treasure-six",
"treasure-twelve",
"weather-the-waters",
];
const fixtures = new Map();
function completed(count = 3, expansions = []) {
const key = `${count}/${expansions}`;
if (!fixtures.has(key)) {
let s = E.init(count, expansions, {}, "bot-full-game");
for (let turn = 0; !s.finished && turn < 1000; turn++) {
// moveAI uses the engine's legal move application, not fabricated history.
s = E.moveAI(s, s.actor);
}
assert.equal(s.finished, true);
assert.equal(s.phase, "ended");
fixtures.set(key, s);
}
return json(fixtures.get(key));
}
function results(s) {
const before = structuredClone(s);
const result = E.achievements(s);
assert.deepEqual(s, before, "evaluation must not mutate persisted state");
achievementResultsSchema(E.achievementDefinitions(), s.players.length).parse(
result,
);
return result;
}
// Synthetic boundary fixtures intentionally start with a real completed game.
// Scores and final-scoring components are independent here: these are predicate
// tests, not claims that these modified totals could arise from that history.
function boundary(count = 3) {
const s = completed(count);
assert.equal(s.lost, false);
assert.equal(s.round, 8);
s.options.risingWaters = false;
s.options.characters = true;
for (const tile of Object.values(s.board)) tile.huts = [];
for (const p of s.players) {
p.score = 0;
p.money = 0;
p.final.tourists = 0;
p.final.treasure = 0;
}
s.players[1].score = 100; // seat 0 loses, so thresholds cannot hide behind wins.
return s;
}
const earned = (s, seat = 0) => results(s)[seat].earned;
function islands(s) {
return Object.values(s.board).filter(
(t) => t.type === "island" && !t.submerged,
);
}
test("manifest passes the official runtime schema and is independently owned", () => {
const manifest = E.achievementDefinitions();
achievementManifestSchema.parse(manifest);
assert.equal(manifest.revision, 1);
assert.deepEqual(
manifest.achievements.map((a) => a.id),
ids,
);
manifest.achievements[0].name = "changed";
manifest.achievements.pop();
assert.equal(E.achievementDefinitions().achievements.length, 16);
assert.equal(
E.achievementDefinitions().achievements[0].name,
"Island Victory",
);
});
test("real legal AI games serialize, evaluate and replay without mutation", () => {
for (const count of [2, 3, 4, 5]) {
for (const expansions of [[], ["rising-waters"]]) {
const s = completed(count, expansions);
const before = json(s);
const awards = results(s);
assert.equal(awards.length, count);
assert.deepEqual(
awards.map((r) => r.seat),
Array.from({ length: count }, (_, i) => i),
);
assert.deepEqual(results(json(s)), awards);
assert.deepEqual(results(E.replay(s)), awards);
assert.deepEqual(
s,
before,
"replay and evaluation preserve source history/frames",
);
if (s.lost) {
assert.ok(
awards.every((r) => r.outcome === "loss" && r.earned.length === 0),
);
} else {
const ranks = E.rankings(s);
const leaders = ranks.filter((r) => r === 1).length;
awards.forEach((r, seat) => {
assert.equal(
r.outcome,
ranks[seat] !== 1 ? "loss" : leaders === 1 ? "win" : "draw",
);
assert.equal(
r.earned.includes("weather-the-waters"),
expansions.length > 0,
);
});
}
}
}
});
test("outright wins award exactly the correct table-size predicate for 2–5 seats", () => {
for (const count of [2, 3, 4, 5]) {
const s = boundary(count);
assert.deepEqual(earned(s, 1), [
"island-victory",
countAwards[count - 2],
"fifty-points",
"seventy-five-points",
]);
assert.deepEqual(earned(s), []);
s.players[0].score = 100;
for (const seat of [0, 1]) {
const r = results(s)[seat];
assert.equal(r.outcome, "draw");
assert.ok(!r.earned.some((id) => id.endsWith("victory")));
}
}
});
test("expansion and character predicates require outright victory; survival does not", () => {
for (const risingWaters of [false, true]) {
for (const characters of [false, true]) {
const s = boundary();
Object.assign(s.options, { risingWaters, characters });
const r = results(s);
assert.equal(r[1].earned.includes("rising-waters-victory"), risingWaters);
assert.equal(r[1].earned.includes("no-characters-victory"), !characters);
assert.equal(r[0].earned.includes("rising-waters-victory"), false);
assert.equal(r[0].earned.includes("no-characters-victory"), false);
assert.ok(
r.every(
(a) => a.earned.includes("weather-the-waters") === risingWaters,
),
);
s.players[0].score = 100;
assert.ok(
results(s).every((a) => !a.earned.some((id) => id.endsWith("victory"))),
);
}
}
});
for (const [id, field, threshold, final] of [
["fifty-points", "score", 50, false],
["seventy-five-points", "score", 75, false],
["nine-vatus", "money", 9, false],
["tourism-twelve", "tourists", 12, true],
["treasure-six", "treasure", 6, true],
["treasure-twelve", "treasure", 12, true],
]) {
test(`synthetic boundary: ${id}`, () => {
for (const value of [threshold - 1, threshold, threshold + 1]) {
const s = boundary();
(final ? s.players[0].final : s.players[0])[field] = value;
assert.equal(
earned(s).includes(id),
id === "nine-vatus" ? value === 9 : value >= threshold,
`${field}=${value}`,
);
}
});
}
test("surviving huts and distinct islands have separate inclusive boundaries", () => {
for (const count of [3, 4, 5]) {
const s = boundary();
islands(s)[0].huts = Array(count).fill(0);
assert.equal(earned(s).includes("four-huts"), count >= 4);
assert.equal(earned(s).includes("three-islands"), false);
}
for (const count of [2, 3, 4]) {
const s = boundary();
assert.ok(islands(s).length >= count);
islands(s)
.slice(0, count)
.forEach((t) => {
t.huts = [0];
});
assert.equal(earned(s).includes("three-islands"), count >= 3);
assert.equal(earned(s).includes("four-huts"), count >= 4);
}
const s = boundary();
const tiles = islands(s);
tiles.slice(0, 2).forEach((t) => {
t.huts = [0];
});
tiles[2].huts = [0, 0, 0, 1];
tiles[2].submerged = true;
Object.values(s.board).find((t) => t.type !== "island").huts = [0, 0];
assert.deepEqual(
earned(s),
[],
"submerged, non-island and opponents' huts do not count",
);
});
test("official ranking uses huts then money; tied leaders draw and lower seats lose", () => {
const s = boundary();
s.players[0].score = s.players[1].score = 40;
s.players[0].money = 8;
islands(s)[0].huts = [1];
assert.deepEqual(E.rankings(s), [2, 1, 3]);
assert.equal(results(s)[1].outcome, "win");
assert.ok(earned(s, 1).includes("island-victory"));
islands(s)[0].huts = [0, 1];
assert.deepEqual(E.rankings(s), [1, 2, 3]);
assert.equal(results(s)[0].outcome, "win");
assert.ok(earned(s).includes("island-victory"));
s.players[1].money = 8;
assert.deepEqual(E.rankings(s), [1, 1, 3]);
assert.deepEqual(
results(s).map((r) => r.outcome),
["draw", "draw", "loss"],
);
assert.ok(results(s).every((r) => r.earned.length === 0));
});
test("collective loss overrides rankings and every otherwise qualifying award", () => {
const s = boundary();
Object.assign(s.options, { risingWaters: true, characters: false });
s.lost = true;
s.players.forEach((p, seat) => {
Object.assign(p, {
score: 100,
money: 9,
final: { tourists: 12, treasure: 12 },
});
islands(s)
.slice(0, 3)
.forEach((t) => {
t.huts.push(seat, seat);
});
});
assert.deepEqual(E.rankings(s), [1, 1, 1]);
assert.deepEqual(
results(s),
s.players.map((_, seat) => ({ seat, earned: [], outcome: "loss" })),
);
});
test("unfinished, non-final, practice, tutorial, analysis and public states award nothing", () => {
assert.deepEqual(results(E.init(3, [], {}, "unfinished")), []);
const variants = [
(s) => {
s.finished = false;
},
(s) => {
s.phase = "actions";
},
(s) => {
s.round = 7;
},
(s) => {
delete s.players[0].final;
},
(s) => {
s._setup.options.practice = true;
},
(s) => {
s._setup.options.tutorial = true;
},
...["practice", "tutorial", "analysis"].map((mode) => (s) => {
s.achievementMode = mode;
}),
(s) => {
s._analysisPublicDraws = {};
},
(s) => {
delete s._setup;
},
(s) => {
delete s._history;
},
];
for (const mutate of variants) {
const s = completed();
mutate(s);
assert.deepEqual(results(s), [], String(mutate));
}
const s = completed();
const analysis = E.createAnalysis(s, { to: E.logLength(s) });
assert.deepEqual(results(analysis), []);
const replayedAnalysis = E.replay(analysis);
assert.equal(replayedAnalysis.achievementMode, "analysis");
assert.deepEqual(results(replayedAnalysis), []);
for (const seat of [undefined, 0, 1, 2]) {
const publicState = E.stripSecret(s, seat);
assert.equal(publicState._setup, undefined);
assert.equal(publicState._history, undefined);
assert.deepEqual(results(publicState), []);
}
});

View file

@ -41,9 +41,10 @@ if (params.has("lesson")) {
state = engine.init(
count,
params.has("water") ? ["rising-waters"] : [],
{},
{ practice: true },
params.get("seed") ?? "island-breeze",
);
state.achievementMode = "practice";
state.players.forEach(
(p, i) => (p.name = ["You", "Maya", "Noa", "Leo", "Nina"][i]),
);
@ -122,7 +123,7 @@ if (params.has("lesson")) {
state = engine.init(
Number(control.querySelector("[data-count]").value),
control.querySelector("[data-water]").checked ? ["rising-waters"] : [],
{},
{ practice: true },
crypto.randomUUID(),
);
state.players.forEach(

View file

@ -49,7 +49,7 @@ export const chapterMetadata = [
},
];
function prepared(phase = "actions") {
const s = E.init(3, [], {}, "vanuatu-lesson");
const s = E.init(3, [], { tutorial: true }, "vanuatu-lesson");
s.actor = 0;
s.first = 0;
s.phase = phase;