Add destination cards, starting with Le Cœur du Nuage Cosmique for the Primordial Nebula
A destination card is a rare that unlocks an expedition destination: it never joins a team (no tags, profile or equipment) and always shows as a full-art card. The catalog checks that it is rare and names an existing destination, and that no two cards unlock the same one. Le Cœur du Nuage Cosmique is the first one: a new destination at the heart of the cosmic dust cloud, where a new sun may be about to form, with its landscape and its card in the Primordial Nebula packs. Full-art names at large size now keep clear of the rarity symbol. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
250e0633cf
commit
89eee7ce2a
18 changed files with 113 additions and 21 deletions
|
|
@ -23,6 +23,11 @@ export const EQUIPMENT_BUDGET = 6;
|
|||
const EQUIPMENT_FORMS = new Set(["6", "3,3", "2,2,2", "8,-2"]);
|
||||
// Chaque carte rare ou mieux doit partager une étiquette avec au moins ce nombre de communes (ses équipements en synergie).
|
||||
export const MIN_COMPATIBLE_COMMONS = 3;
|
||||
// Carte de destination : elle débloque une destination des Expéditions. Toujours rare, elle ne part jamais en équipe
|
||||
// (ni étiquettes, ni profil, ni équipement) et s'affiche en pleine illustration.
|
||||
export const DESTINATION_CARD_KIND = "destination";
|
||||
const DESTINATION_ID_PATTERN = /^[a-z0-9-]+$/;
|
||||
export const isDestinationCard = (card) => card?.kind === DESTINATION_CARD_KIND;
|
||||
|
||||
function requireUnique(items, label) {
|
||||
const ids = new Set();
|
||||
|
|
@ -77,14 +82,14 @@ function validateCardExpedition(card, tagIds) {
|
|||
function validateEquipmentCoverage(catalog) {
|
||||
const rarityOf = new Map(catalog.editions.filter((edition) => !edition.promotional && edition.rarity !== "mythic").map((edition) => [edition.cardId, edition.rarity]));
|
||||
const commons = [];
|
||||
for (const card of catalog.cards) {
|
||||
for (const card of catalog.cards.filter((item) => !isDestinationCard(item))) {
|
||||
const common = rarityOf.get(card.id) === "common";
|
||||
if (common && !card.expedition.equipment) throw new TypeError(`Common card ${card.id} needs equipment stats.`);
|
||||
if (!common && card.expedition.equipment) throw new TypeError(`Card ${card.id} is not a common and cannot be equipment.`);
|
||||
if (common) commons.push(card);
|
||||
}
|
||||
for (const card of catalog.cards) {
|
||||
if (!rarityOf.get(card.id) || rarityOf.get(card.id) === "common") continue;
|
||||
if (isDestinationCard(card) || !rarityOf.get(card.id) || rarityOf.get(card.id) === "common") continue;
|
||||
const compatible = commons.filter((common) => common.expedition.tags.some((tag) => card.expedition.tags.includes(tag))).length;
|
||||
if (compatible < MIN_COMPATIBLE_COMMONS) throw new TypeError(`Card ${card.id} shares a tag with only ${compatible} commons (at least ${MIN_COMPATIBLE_COMMONS} needed for equipment synergies).`);
|
||||
}
|
||||
|
|
@ -198,14 +203,24 @@ export function validateCardsCatalog(catalog) {
|
|||
throw new TypeError(`Card ${card.id} ${cutoutKey === "cutoutImage" ? "cutout" : "full cutout"} image must be its ${label} suffixed with __cutout.`);
|
||||
}
|
||||
}
|
||||
validateCardExpedition(card, expeditionTagIds);
|
||||
if (card.kind != null && card.kind !== DESTINATION_CARD_KIND) throw new TypeError(`Card ${card.id} has an unknown kind.`);
|
||||
if (isDestinationCard(card)) {
|
||||
if (!DESTINATION_ID_PATTERN.test(card.destinationId ?? "")) throw new TypeError(`Destination card ${card.id} needs a destinationId.`);
|
||||
if (card.expedition != null) throw new TypeError(`Destination card ${card.id} never joins a team and takes no expedition data.`);
|
||||
} else {
|
||||
if (card.destinationId != null) throw new TypeError(`Card ${card.id} is not a destination card and cannot name a destination.`);
|
||||
validateCardExpedition(card, expeditionTagIds);
|
||||
}
|
||||
}
|
||||
const destinationCards = catalog.cards.filter(isDestinationCard);
|
||||
requireUnique(destinationCards.map((card) => ({ id: card.destinationId })), "destination cards");
|
||||
|
||||
for (const edition of catalog.editions) {
|
||||
if (!cardIds.has(edition.cardId)) throw new TypeError(`Unknown card for edition ${edition.id}.`);
|
||||
if (!RARITY_IDS.has(edition.rarity)) throw new TypeError(`Unknown rarity for edition ${edition.id}.`);
|
||||
if (!Array.isArray(edition.finishIds) || edition.finishIds.some((id) => !finishIds.has(id))) throw new TypeError(`Unknown finish for edition ${edition.id}.`);
|
||||
if (edition.retired != null && typeof edition.retired !== "boolean") throw new TypeError(`Edition ${edition.id} retired flag must be a boolean.`);
|
||||
if (destinationCards.some((card) => card.id === edition.cardId) && edition.rarity !== "rare") throw new TypeError(`Destination card edition ${edition.id} must be rare.`);
|
||||
if (edition.promotional && edition.legendaryEditionId) throw new TypeError(`Promotional edition ${edition.id} cannot require a legendary parent.`);
|
||||
if (edition.rarity === "mythic" && !edition.promotional) {
|
||||
const parent = catalog.editions.find((candidate) => candidate.id === edition.legendaryEditionId);
|
||||
|
|
|
|||
|
|
@ -191,6 +191,22 @@
|
|||
],
|
||||
"hidden": false
|
||||
},
|
||||
{
|
||||
"id": "cosmic-cloud-heart",
|
||||
"name": "Le Cœur du Nuage Cosmique",
|
||||
"description": "Au cœur du Nuage de Poussière Cosmique, des morceaux d'îles tournent autour d'une lumière qui grandit. Un nouveau soleil va peut-être naître.",
|
||||
"coverCardId": "cosmic-dust-cloud",
|
||||
"image": "/static/img/expeditions/destinations/cosmic-cloud-heart.webp",
|
||||
"themeTags": ["lieu:nebuleuse", "theme:poussiere"],
|
||||
"logbookCards": [],
|
||||
"stats": ["endurance", "orientation", "bravoure", "fortune"],
|
||||
"conditions": [{ "type": "collection", "collectionId": "primordial-nebula" }],
|
||||
"dangers": [
|
||||
{ "id": "orbiting-debris", "label": "Débris en orbite", "stat": "bravoure", "unlessTags": ["lieu:vide"]},
|
||||
{ "id": "blinding-dust", "label": "Poussière aveuglante", "stat": "orientation", "unlessTags": ["theme:constellations"]}
|
||||
],
|
||||
"hidden": false
|
||||
},
|
||||
{
|
||||
"id": "crimson-passage",
|
||||
"name": "Le Passage Écarlate",
|
||||
|
|
|
|||
|
|
@ -76,6 +76,10 @@ export function validateExpeditionDestinations(destinations, catalog) {
|
|||
}
|
||||
}
|
||||
if (!destinations.some((destination) => !destination.hidden)) throw new TypeError("Expedition destinations need at least one visible destination.");
|
||||
// Une carte de destination débloque une destination qui existe.
|
||||
for (const card of catalog.cards.filter((item) => item.kind === "destination")) {
|
||||
if (!ids.has(card.destinationId)) throw new TypeError(`Destination card ${card.id} names unknown destination ${card.destinationId}.`);
|
||||
}
|
||||
return destinations;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,9 +46,10 @@ export function splitPower(power, profile) {
|
|||
}
|
||||
|
||||
// Données d'expédition d'une carte : son profil (ou celui de sa collection), ses étiquettes et sa collection.
|
||||
// Une carte de destination ne part jamais en équipe : elle n'a pas de données d'expédition.
|
||||
export function cardExpeditionData(catalog, cardId) {
|
||||
const card = catalog.cards.find((item) => item.id === cardId);
|
||||
if (!card) return null;
|
||||
if (!card || card.kind === "destination") return null;
|
||||
const collection = catalog.collections.find((item) => item.id === card.collectionId);
|
||||
return {
|
||||
cardId,
|
||||
|
|
@ -68,7 +69,7 @@ export function editionExpeditionData(catalog, editionId, level, settings) {
|
|||
return { ...data, editionId, rarity: edition.rarity, level, power, stats: splitPower(power, data.profile) };
|
||||
}
|
||||
|
||||
export const isExpeditionCard = (catalog, cardId) => EXPEDITION_RARITIES.includes(cardRarity(catalog, cardId));
|
||||
export const isExpeditionCard = (catalog, cardId) => EXPEDITION_RARITIES.includes(cardRarity(catalog, cardId)) && Boolean(cardExpeditionData(catalog, cardId));
|
||||
|
||||
// Rôles des places en solo : la destination fixe ceux de ses deux premières stats.
|
||||
export function soloRoles(destination, slotCount) {
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ export function simulationCards(catalog) {
|
|||
const cards = [];
|
||||
for (const card of catalog.cards) {
|
||||
const rarity = cardRarity(catalog, card.id);
|
||||
if (!EXPEDITION_RARITIES.includes(rarity)) continue;
|
||||
const data = cardExpeditionData(catalog, card.id);
|
||||
if (!EXPEDITION_RARITIES.includes(rarity) || !data) continue;
|
||||
cards.push({ ...data, rarity });
|
||||
if (rarity === "legendary") cards.push({ ...data, rarity: "mythic" });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue