Limit solo badge catalog to hosted normal difficulty

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

View file

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

View file

@ -32,9 +32,7 @@ final inventories.
| ID | Requirement at a completed game |
| --- | --- |
| island-victory | Outright multiplayer win |
| puertoma-easy | Outright hosted solo win on easy |
| 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-personal-achievements | Complete all owned personal cards |
| 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
results are draws, not outright-win badges. Hosted solo returns **only seat 0**,
but explicitly compares against both virtual Puertomas. Hosted creation currently
fixes **normal** difficulty. Easy/hard badges are reserved for genuine supported
engine configurations; they are not selectable in the released host, and no
picker has been added. Ordinary multiplayer never earns a solo badge.
fixes **normal** difficulty. The 14-badge MVP therefore includes only the normal
solo victory badge. Easy/hard are supported by the core engine but absent from
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
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();
achievementManifestSchema.parse(manifest);
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]) {
const before = structuredClone(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);
}
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", () => {
@ -107,7 +112,12 @@ test("solo outcomes explicitly compare both virtual opponents including tie brea
s.players[0].vp = 1000;
assert.equal(host.achievements(s).length, 1);
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"));
s.players[1].vp = 2000;
assert.equal(host.achievements(s)[0].outcome, "loss");