Add solo Expeditions, the second Guilde des Veilleurs quest of Sokko TCG

- Every catalog card carries expedition tags and every collection a stat profile, validated at load; twelve destinations live server-side so hidden ones stay secret.
- Pure rules compute card power, per-slot requirements, roles, dangers, the long-trip malus, the score (one more star never raises it) and loot proportional to the chosen duration.
- A simulator script and a balance test guard the design thresholds; agent docs and a new-card skill explain how to tag new cards.
- Migration 8 adds Éclats d'étoile, expedition settings stored as one validated JSON, daily destinations, expeditions, members and slots, and rebuilds gift_packs so a pack can come from an expedition.
- Players launch a solo expedition from the Guild, see an exact preview, and claim their loot when it returns; the card sheet shows cards away on an expedition.
- Administration › Guilde tunes every value with server-side bounds, toggles destinations and cancels running expeditions; expeditions stay closed until an administrator opens them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-15 14:29:05 +01:00
parent 0ef213cf4f
commit 8bb1d53d70
46 changed files with 4752 additions and 213 deletions

View file

@ -0,0 +1,44 @@
// Rôle : règles d'affichage des Expéditions Sokko TCG (libellés des stats, rôles et paliers, conditions, statut de la tuile de Guilde).
import { fillTemplate, formatCountdown } from "./dailyShare.js";
export const STAT_IDS = ["bravoure", "endurance", "fortune", "orientation"];
export const formatEclats = (value) => Number(value).toLocaleString("fr-FR", { maximumFractionDigits: 1 });
export const formatDecimal = (value) => Number(value).toLocaleString("fr-FR", { maximumFractionDigits: 1 });
export function tagLabel(catalog, tagId) {
return catalog.expeditionTags?.find((tag) => tag.id === tagId)?.label || tagId;
}
// Condition de 3 ★ : une carte qui porte une étiquette, ou une carte d'une collection.
export function conditionText(condition, catalog, content) {
if (!condition) return "";
if (condition.type === "collection") return fillTemplate(content.conditionCollection, { collection: catalog.collections.find((item) => item.id === condition.collectionId)?.name || condition.collectionId });
return fillTemplate(content.conditionTag, { tag: tagLabel(catalog, condition.tag) });
}
export function dangerText(danger, catalog, content) {
return fillTemplate(content.dangerText, { label: danger.label, stat: content.stats[danger.stat], tags: danger.unlessTags.map((tag) => tagLabel(catalog, tag)).join(content.or) });
}
// Statut de la tuile Expéditions dans la Guilde (textes cards.guild).
export function expeditionQuestStatus(summary, content, now = Date.now()) {
if (!summary.enabled && !summary.running && !summary.returned) return content.expeditionsClosed;
if (summary.returned > 0 || (summary.nextReturnAt != null && summary.nextReturnAt <= now)) return content.expeditionsReturned;
if (summary.running) return fillTemplate(content.expeditionsRunning, { time: formatCountdown(summary.nextReturnAt - now) });
if (summary.eligible < summary.soloCards) return fillTemplate(content.expeditionsNoCards, { count: summary.soloCards });
return summary.launchedToday ? content.expeditionsIdle : content.expeditionsToLaunch;
}
// Édition de référence d'une carte (la standard), pour illustrer une destination.
export function coverEntry(catalog, cardId) {
const card = catalog.cards.find((item) => item.id === cardId);
const edition = catalog.editions.find((item) => item.cardId === cardId && item.rarity !== "mythic" && !item.promotional);
return card && edition ? { editionId: edition.id, edition, card } : null;
}
export function editionEntry(catalog, editionId) {
const edition = catalog.editions.find((item) => item.id === editionId);
const card = edition && catalog.cards.find((item) => item.id === edition.cardId);
return card ? { editionId, edition, card } : null;
}