Limit solo badge catalog to hosted normal difficulty

This commit is contained in:
coyotte508 2026-11-14 01:20:54 +00:00
commit 0ba5034dd4
3 changed files with 27 additions and 18 deletions

View file

@ -7,11 +7,11 @@ const manifest = {
revision: 1, revision: 1,
achievements: [ achievements: [
["island-victory", "Island victory", "Win a multiplayer game outright."], ["island-victory", "Island victory", "Win a multiplayer game outright."],
...["easy", "normal", "hard"].map((level) => [ [
`puertoma-${level}`, "puertoma-normal",
`Puertoma: ${level}`, "Puertoma: normal",
`Win outright against both Puertomas on ${level} difficulty.`, "Win outright against both Puertomas on normal difficulty.",
]), ],
[ [
"all-festival-objectives", "all-festival-objectives",
"Festival sweep", "Festival sweep",
@ -119,11 +119,10 @@ export function achievements(s) {
if (condition) earned.push(id); if (condition) earned.push(id);
}; };
award("island-victory", !s.puertoma && outcome === "win"); award("island-victory", !s.puertoma && outcome === "win");
for (const level of ["easy", "normal", "hard"]) award(
award( "puertoma-normal",
`puertoma-${level}`, solo && s.puertoma.difficulty === "normal" && outcome === "win",
solo && s.puertoma.difficulty === level && outcome === "win", );
);
const festivals = festival ? (s.festivals ?? []) : []; const festivals = festival ? (s.festivals ?? []) : [];
const cards = s.expansions.includes("achievements") const cards = s.expansions.includes("achievements")
? (a.achievements ?? []) ? (a.achievements ?? [])

View file

@ -32,9 +32,7 @@ final inventories.
| ID | Requirement at a completed game | | ID | Requirement at a completed game |
| --- | --- | | --- | --- |
| island-victory | Outright multiplayer win | | island-victory | Outright multiplayer win |
| puertoma-easy | Outright hosted solo win on easy |
| puertoma-normal | Outright hosted solo win on normal | | puertoma-normal | Outright hosted solo win on normal |
| puertoma-hard | Outright hosted solo win on hard |
| all-festival-objectives | Personally claim all active Festival objectives | | all-festival-objectives | Personally claim all active Festival objectives |
| all-personal-achievements | Complete all owned personal cards | | all-personal-achievements | Complete all owned personal cards |
| festival-claim | Claim at least one Festival | | festival-claim | Claim at least one Festival |
@ -72,9 +70,11 @@ use normal human rules, not Puertoma rules.
Outcomes compare all players' final total, then coins plus crates. Shared best Outcomes compare all players' final total, then coins plus crates. Shared best
results are draws, not outright-win badges. Hosted solo returns **only seat 0**, results are draws, not outright-win badges. Hosted solo returns **only seat 0**,
but explicitly compares against both virtual Puertomas. Hosted creation currently but explicitly compares against both virtual Puertomas. Hosted creation currently
fixes **normal** difficulty. Easy/hard badges are reserved for genuine supported fixes **normal** difficulty. The 14-badge MVP therefore includes only the normal
engine configurations; they are not selectable in the released host, and no solo victory badge. Easy/hard are supported by the core engine but absent from
picker has been added. Ordinary multiplayer never earns a solo badge. the manifest because hosted creation does not expose them. Adding a new setup
option is outside this badge change; no picker has been added. Ordinary
multiplayer never earns a solo badge.
Tests: `test/platform-achievements.test.js` plays real completed multiplayer and Tests: `test/platform-achievements.test.js` plays real completed multiplayer and
hosted solo games, validates official runtime schemas, checks deterministic hosted solo games, validates official runtime schemas, checks deterministic

View file

@ -26,7 +26,12 @@ test("official schemas, stable manifest, real completed fixtures, replay and pur
const manifest = host.achievementDefinitions(); const manifest = host.achievementDefinitions();
achievementManifestSchema.parse(manifest); achievementManifestSchema.parse(manifest);
assert.equal(manifest.revision, 1); assert.equal(manifest.revision, 1);
assert.equal(manifest.achievements.length, 16); assert.equal(manifest.achievements.length, 14);
assert(
!manifest.achievements.some(({ id }) =>
["puertoma-easy", "puertoma-hard"].includes(id),
),
);
for (const s of [completed, solo]) { for (const s of [completed, solo]) {
const before = structuredClone(s); const before = structuredClone(s);
const results = host.achievements(s); const results = host.achievements(s);
@ -36,7 +41,7 @@ test("official schemas, stable manifest, real completed fixtures, replay and pur
assert.deepEqual(s, before); assert.deepEqual(s, before);
} }
manifest.achievements.length = 0; manifest.achievements.length = 0;
assert.equal(host.achievementDefinitions().achievements.length, 16); assert.equal(host.achievementDefinitions().achievements.length, 14);
}); });
test("all means this seat's entire nonempty active set, not the table or the deck", () => { test("all means this seat's entire nonempty active set, not the table or the deck", () => {
@ -107,7 +112,12 @@ test("solo outcomes explicitly compare both virtual opponents including tie brea
s.players[0].vp = 1000; s.players[0].vp = 1000;
assert.equal(host.achievements(s).length, 1); assert.equal(host.achievements(s).length, 1);
assert.equal(host.achievements(s)[0].outcome, "win"); assert.equal(host.achievements(s)[0].outcome, "win");
assert(has(s, `puertoma-${difficulty}`)); assert.equal(has(s, "puertoma-normal"), difficulty === "normal");
assert(!has(s, "puertoma-easy"));
assert(!has(s, "puertoma-hard"));
achievementResultsSchema(host.achievementDefinitions(), 1).parse(
host.achievements(s),
);
assert(!has(s, "island-victory")); assert(!has(s, "island-victory"));
s.players[1].vp = 2000; s.players[1].vp = 2000;
assert.equal(host.achievements(s)[0].outcome, "loss"); assert.equal(host.achievements(s)[0].outcome, "loss");