Add the Broken Mirror puzzle to the Guild

A daily puzzle: a card illustration cut into pieces, rebuilt by swapping
two pieces of the same row or column within a limited number of swaps.
The normal picture is a square card in 4 x 4, drawn for each player, with
placed pieces outlined in green; the hard one is a 5 x 7 portrait shared
by everyone each day, with a result to copy. The limit is the computer's
best result (beam search) plus a margin, and every swap left adds
stardust. Two companions of the daily team can each give one help, by
specialty; a double specialty picks one when used.

The server keeps the piece positions, sends the picture already shuffled
and checks every swap. Uniform illustrations are left out, from measures
written by scripts/mirror-illustrations.mjs. The Guild gets its quest and
a Codex tile, the administration a tab (opening, rewards, margins, the
day's summary), and migration 30 its tables. New collections must plan at
least one double-specialty character, counted by
scripts/team-specialties.mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-28 13:38:46 +01:00
parent 5210503922
commit 9cf48ea0d0
36 changed files with 3124 additions and 20 deletions

View file

@ -3,7 +3,7 @@
import { useEffect, useState } from "react";
import { dailyQuestStatus, fillTemplate, formatStreak } from "./dailyShare.js";
import { expeditionQuestStatus } from "./expeditionFormat.js";
import { guildGreeting, guildQuests, questDone } from "./guildQuests.js";
import { guildGreeting, guildQuests, mirrorDone, questDone } from "./guildQuests.js";
import { TeamTable } from "./TeamTable.jsx";
const ART = {
@ -11,6 +11,7 @@ const ART = {
clerk: "/static/img/cards/guild-veilleurs.webp",
daily: "/static/img/cards/guild/quest-daily.webp",
race: "/static/img/cards/guild/quest-race.webp",
mirror: "/static/img/cards/guild/quest-mirror.webp",
expeditions: "/static/img/cards/guild/quest-expeditions.webp"
};
@ -52,6 +53,15 @@ function RaceQuest({ summary: team, pending, content }) {
primary={pending && !locked} locked={locked} done={team.race === "finished"} sign={locked ? content.groupSign : ""} />;
}
// Miroir brisé : le Normal, puis le Difficile du jour, le même pour tous.
function MirrorQuest({ summary: mirror, pending, content }) {
const done = mirrorDone(mirror);
const playing = mirror.normal === "playing" || mirror.hard === "playing";
const status = done ? content.mirrorDone : playing ? content.mirrorPlaying : mirror.normal === "none" ? content.mirrorToPlay : content.mirrorHard;
return <QuestTile id="mirror" art={ART.mirror} kind={content.mirrorKind} title={content.mirrorTitle} description={content.mirrorDescription} status={status}
action={done ? content.mirrorResult : playing ? content.mirrorResume : content.mirrorAction} href="#/cards/mirror" primary={pending} done={done} />;
}
function ExpeditionsQuest({ summary, pending, content, now }) {
const returned = summary.returned > 0 || (summary.nextReturnAt != null && summary.nextReturnAt <= now);
return <QuestTile id="expeditions" art={ART.expeditions} kind={content.expeditionsKind} title={content.expeditionsTitle} description={content.expeditionsDescription}
@ -59,8 +69,8 @@ function ExpeditionsQuest({ summary, pending, content, now }) {
action={returned ? content.expeditionsClaim : summary.running ? content.expeditionsInProgress : summary.enabled ? content.expeditionsAction : content.expeditionsOpen} />;
}
const QUEST_TILES = { daily: DailyQuest, race: RaceQuest, expeditions: ExpeditionsQuest };
const BOARD = ["daily", "race"];
const QUEST_TILES = { daily: DailyQuest, race: RaceQuest, mirror: MirrorQuest, expeditions: ExpeditionsQuest };
const BOARD = ["daily", "race", "mirror"];
// Le comptoir : le dragon des Veilleurs, ce qu'il conseille de faire, et à droite l'avancée des quêtes du jour.
function GuildCounter({ state, quests, content, now }) {