Rework the expedition screens: in-place return, illustrated bag and workshop, card sheet tabs and an engraving workshop

Expeditions
- The journey keeps the destination landscape still while a sky scenery
  (clouds, floating isles, shards, sparkles) drifts behind the cards.
- A returned expedition shows only what the player receives, in place and
  without a window; claiming it removes the card and confirms with a notice,
  and the page reloads by itself when an expedition comes back.
- The Guild Keeper slots are gone: group requirements scale with the players.
- Local development adds a 20-second test duration, a test player for groups
  and keeps the dev account stocked with every item.
- The Wind Rose has no daily limit and is used from the destinations step.
- The Guide Star opens a destination one level below the player's highest daily
  level, the Sky Chart one at that level; bonus destinations are badged with
  the item that opened them.

Bag and workshop
- The Watcher's bag is a grid of illustrated item cards, ordered from the
  destination items, with a short "Utiliser" button; the six missing item
  illustrations are added.
- The workshop opens in a window with illustrated commons, spare counts on the
  cards, cancel without spending anything, and shows the crafted card with its
  description and power.
- The engraving workshop picks a common first, then a tag from a chosen
  character card (in its tag colours) or from every tag, filtered by name and
  family; card lists filter by name, collection and stat.

Card sheet
- Two tabs: the card and its lore (default from the collection), and its
  improvement (default from the expeditions) with a summary of power, level,
  experience and stats.
- "Répartition des statistiques" offers Par défaut, Personnalisé and profiles,
  previews the change in the summary, and a Parchemin d'oubli resets it to
  Personnalisé so the next choice is free again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-18 13:36:01 +01:00
parent 7a0d19da75
commit 30413de036
48 changed files with 1506 additions and 433 deletions

View file

@ -281,6 +281,14 @@ export function validateSiteContent(site) {
"cards.expeditions.atelierHelp",
"cards.expeditions.atelierNoCommons",
"cards.expeditions.atelierAction",
"cards.expeditions.atelierTitle",
"cards.expeditions.atelierSelection",
"cards.expeditions.atelierCommons",
"cards.expeditions.atelierAdd",
"cards.expeditions.atelierRemove",
"cards.expeditions.atelierCancel",
"cards.expeditions.atelierClose",
"cards.expeditions.atelierPower",
"cards.expeditions.crafted",
"cards.expeditions.bagTitle",
"cards.expeditions.items.fragment",
@ -295,9 +303,45 @@ export function validateSiteContent(site) {
"cards.expeditions.itemHelp.anchor",
"cards.expeditions.itemHelp.guideStar",
"cards.expeditions.itemHelp.skyChart",
"cards.expeditions.useGuideStar",
"cards.expeditions.useSkyChart",
"cards.expeditions.useFragments",
"cards.expeditions.useItem",
"cards.expeditions.useItemLabel",
"cards.expeditions.improveCard",
"cards.expeditions.engraveTitle",
"cards.expeditions.engraveHelp",
"cards.expeditions.engraveCommon",
"cards.expeditions.engraveChoose",
"cards.expeditions.engraveCommonTags",
"cards.expeditions.engraveChange",
"cards.expeditions.engraveForCard",
"cards.expeditions.engraveForCardHelp",
"cards.expeditions.engravePickCard",
"cards.expeditions.engraveChangeCard",
"cards.expeditions.engravePickCardTitle",
"cards.expeditions.engraveCardFull",
"cards.expeditions.engraveSynergyLabel",
"cards.expeditions.engraveAllTags",
"cards.expeditions.tagFiltersLabel",
"cards.expeditions.tagSearch",
"cards.expeditions.tagFamilies",
"cards.expeditions.tagOnlyCharacter",
"cards.expeditions.tagEmpty",
"cards.expeditions.engraveTagGroups.personnage",
"cards.expeditions.engraveTagGroups.lieu",
"cards.expeditions.engraveTagGroups.theme",
"cards.expeditions.engraveTagGroups.objet",
"cards.expeditions.engraveConfirm",
"cards.expeditions.engraveForever",
"cards.expeditions.engraveNoCommons",
"cards.expeditions.engraveBack",
"cards.expeditions.filtersLabel",
"cards.expeditions.filterSearch",
"cards.expeditions.filterCollection",
"cards.expeditions.filterStats",
"cards.expeditions.filterEmpty",
"cards.expeditions.engraveButton",
"cards.expeditions.engraveButtonLabel",
"cards.expeditions.improvePickerHelp.oblivion",
"cards.expeditions.improvePickerEmpty.oblivion",
"cards.expeditions.bonusAdded",
"cards.expeditions.bonusSlots.5",
"cards.expeditions.bonusSlots.6",
@ -332,7 +376,7 @@ export function validateSiteContent(site) {
"cards.expeditions.groupOutcomeBonuses",
"cards.expeditions.groupMembers",
"cards.expeditions.groupFreeRole",
"cards.expeditions.groupKeeper",
"cards.expeditions.groupScaling",
"cards.expeditions.groupProjected",
"cards.expeditions.groupRecapTitle",
"cards.expeditions.cohesion",
@ -344,13 +388,14 @@ export function validateSiteContent(site) {
"cards.expeditions.dissolve",
"cards.expeditions.depart",
"cards.expeditions.groupLimit",
"cards.expeditions.soloKeeper",
"cards.expeditions.groupOpened",
"cards.expeditions.joined",
"cards.expeditions.left",
"cards.expeditions.departed",
"cards.expeditions.testPlayer",
"cards.expeditions.testDuration",
"cards.expeditions.testPlayerAdded",
"cards.expeditions.reportPlayers",
"cards.expeditions.keeper",
"cards.expeditions.you",
"cards.expeditions.eyebrow",
"cards.expeditions.title",
@ -449,7 +494,9 @@ export function validateSiteContent(site) {
"cards.expeditions.journeyCards",
"cards.expeditions.journeyProgress",
"cards.expeditions.claimedTitle",
"cards.expeditions.claimedClose",
"cards.expeditions.claimedNotice",
"cards.expeditions.returnTeam",
"cards.expeditions.returnCards",
"cards.expeditions.starterEyebrow",
"cards.expeditions.starterTitle",
"cards.expeditions.starterHint",
@ -474,7 +521,6 @@ export function validateSiteContent(site) {
"cards.expeditions.loot.cards",
"cards.expeditions.loot.items",
"cards.expeditions.useWindRose",
"cards.expeditions.windRoseUsed",
"cards.expeditions.rerolled",
"cards.expeditions.rewardCollection",
"cards.expeditions.difficultyTitle",

View file

@ -27,10 +27,10 @@ const editionsOf = (rarity, collectionId = "primordial-nebula") => published.edi
// Par défaut, le joueur a toutes les cartes de destination : ses 4 destinations du jour sont tirées parmi toutes.
const destinationEditions = published.editions.filter((edition) => published.cards.find((card) => card.id === edition.cardId).kind === "destination").map((edition) => edition.id);
function expeditionService({ start = Date.parse("2026-11-15T09:00:00Z"), random = () => 0, catalog = baseCatalog, allDestinations = true } = {}) {
function expeditionService({ start = Date.parse("2026-11-15T09:00:00Z"), random = () => 0, catalog = baseCatalog, allDestinations = true, devPerks = false } = {}) {
const clock = { now: start };
const database = new CardsDatabase(":memory:");
const service = new CardsService({ database, catalog, now: () => clock.now, random });
const service = new CardsService({ database, catalog, now: () => clock.now, random, devPerks });
const admin = service.upsertPlayer({ discordId: "expedition-admin", displayName: "Admin", isAdmin: true });
const player = service.upsertPlayer({ discordId: "expedition-player", displayName: "Player" });
const open = (changes = {}) => service.expeditions.updateSettings(admin.id, { ...service.expeditions.settings, enabled: true, ...changes });
@ -65,12 +65,11 @@ test("expeditions stay closed until an administrator opens them", () => {
assert.equal(view.day, "2026-11-15");
assert.equal(view.destinations.length, 4);
// La difficulté est tirée avec les destinations : un niveau de chaque, les mêmes étoiles seul ou en groupe. Exigences d'une carte
// seule (la part d'une place), et du groupe complet (une part par place).
// seule (la part d'une place) ; en groupe, une part par joueur.
assert.deepEqual(view.destinations.map((item) => item.level).sort(), [0, 1, 2, 3]);
assert.ok(view.destinations.every((item) => item.star === item.level + 1 && item.groupRequirements.length === item.requirements.length));
assert.ok(view.destinations.every((item) => item.star === item.level + 1 && !("groupRequirements" in item)));
const sample = view.destinations.find((item) => item.star === 2);
assert.deepEqual(sample.requirements.map((item) => item.value), DEFAULT_EXPEDITION_SETTINGS.requirements.star2);
assert.deepEqual(sample.groupRequirements.map((item) => item.value), DEFAULT_EXPEDITION_SETTINGS.requirements.star2.map((value) => value * DEFAULT_GROUP.slots));
assert.equal(view.destinations.find((item) => item.star === 4).dangers.length, 1);
assert.equal(sample.condition, null);
assert.equal(view.cards.length, 4);
@ -94,7 +93,8 @@ test("each player draws the day among the destinations their cards unlock", () =
// Première visite : la carte de départ (random() = 0, les Courants) ouvre une seule destination, au niveau le plus facile.
const before = service.expeditions.getExpeditions(player.id);
assert.deepEqual(before.destinations.map((item) => [item.id, item.level, item.star]), [["light-currents", 0, 1]]);
assert.deepEqual(before.unlocked.count >= 1 && before.unlocked.total, 14);
assert.ok(before.unlocked.count >= 1);
assert.equal(before.unlocked.total, 15);
// Sa carte du Cœur du Nuage complète le tirage du jour, avec les niveaux 1 et 2 ; l'autre joueur, sans la carte, ne la voit pas.
database.transaction(() => service.addCard(player.id, "cosmic-cloud-heart-standard"));
const after = service.expeditions.getExpeditions(player.id).destinations;
@ -281,6 +281,64 @@ test("reward cards come from the Carnets, or mostly from the destination's colle
assert.equal(draw(isles, linked, newcomer), "dream-arcade");
});
// Serveur Vite local : une durée de test, aux règles de la plus courte, revient au bout de vingt secondes pour suivre un trajet et
// son retour sans attendre ; l'inscription garde sa vraie durée. Ailleurs, cette durée est refusée.
test("in local development a test duration returns after twenty seconds with the rules of the shortest one", () => {
const { service, player, open, rares, clock } = expeditionService({ devPerks: true });
open();
const view = service.expeditions.getExpeditions(player.id);
assert.equal(view.testDuration, "test");
const body = soloBody(view, rares[0], { durationHours: view.testDuration });
assert.equal(service.expeditions.preview(player.id, body).preview.travelHours, null);
const opened = service.expeditions.createGroup(player.id, body, "test-open");
const group = opened.expeditions.groups.find((item) => item.isCreator);
assert.equal(group.hours, view.durations[0]);
assert.equal(group.recruitUntil, clock.now + service.expeditions.settings.group.recruitHours * 3_600_000);
const [expedition] = service.expeditions.departGroup(player.id, group.id).expeditions.expeditions;
assert.equal(expedition.returnsAt - expedition.departsAt, 20_000);
const plain = expeditionService();
plain.open();
const plainView = plain.service.expeditions.getExpeditions(plain.player.id);
assert.equal(plainView.testDuration, null);
assert.throws(() => plain.service.expeditions.createGroup(plain.player.id, soloBody(plainView, plain.rares[0], { durationHours: "test" }), "test-closed"), (error) => error.code === "EXPEDITION_INVALID");
});
// Serveur Vite local : le compte de développement a toujours au moins un exemplaire de chaque objet (et assez de fragments pour une
// carte au trésor), complété au chargement et après chaque usage ; les autres joueurs ne reçoivent rien.
test("in local development the dev account always keeps every item", () => {
const { service, player, open } = expeditionService({ devPerks: true });
open();
const dev = service.upsertPlayer({ discordId: "dev-admin", displayName: "Dev", isAdmin: true });
service.getState(dev.id);
const items = service.expeditions.itemsOf(dev.id);
assert.ok(Object.entries(items).every(([id, count]) => count >= (id === "fragment" ? service.expeditions.settings.items.fragmentsForMap : 1)));
service.expeditions.rerollDestinations(dev.id);
service.expeditions.rerollDestinations(dev.id);
assert.equal(service.expeditions.itemsOf(dev.id).windRose, 1);
service.getState(player.id);
assert.ok(Object.values(service.expeditions.itemsOf(player.id)).every((count) => count === 0));
});
// Serveur Vite local : un joueur de test rejoint une expédition ouverte au groupe, avec une carte reçue s'il n'en a pas ; un joueur
// de test déjà en expédition laisse la place à un nouveau. Ailleurs, l'action n'existe pas.
test("in local development a test player joins a group expedition with a card of its own", () => {
const { service, player, open, rares } = expeditionService({ devPerks: true });
open();
const view = service.expeditions.getExpeditions(player.id);
assert.equal(view.testPlayers, true);
const opened = service.expeditions.createGroup(player.id, soloBody(view, rares[0]), "test-player");
const group = opened.expeditions.groups.find((item) => item.isCreator);
service.expeditions.addTestPlayer(player.id, group.id);
const joined = service.expeditions.addTestPlayer(player.id, group.id).expeditions.groups.find((item) => item.id === group.id);
assert.deepEqual(joined.members.map((member) => member.playerName).sort(), ["Joueur de test 1", "Joueur de test 2", "Player"]);
const departed = service.expeditions.departGroup(player.id, group.id).expeditions.expeditions[0];
assert.equal(departed.mode, "group");
const plain = expeditionService();
plain.open();
assert.equal(plain.service.expeditions.getExpeditions(plain.player.id).testPlayers, false);
assert.throws(() => plain.service.expeditions.addTestPlayer(plain.player.id, group.id), (error) => error.code === "NOT_FOUND");
});
// Une carte de destination est unique : jamais en double, remplacée dans un paquet, jamais échangée ni donnée.
test("destination cards are unique: never twice in a collection, replaced in packs, never traded", () => {
const { service, player, database } = expeditionService({ allDestinations: false });
@ -347,7 +405,7 @@ test("administrators tune settings with bounds and history, and can cancel an ex
assert.ok(service.getAdminHistory(admin.id).entries.some((entry) => entry.type === "expedition_settings_updated"));
const dashboard = service.getAdminDashboard(admin.id);
assert.equal(dashboard.expeditionSettings.settings.enabled, true);
assert.equal(dashboard.expeditionSettings.destinations.length, 16);
assert.equal(dashboard.expeditionSettings.destinations.length, 17);
assert.ok(dashboard.expeditionSettings.schema.some((field) => field.path === "loot.eclatsPerHourCents"));
const view = service.expeditions.getExpeditions(player.id);
@ -473,7 +531,7 @@ test("a group opens on the Guild board, fills its places and leaves when its cre
assert.equal(group.canDepart, true);
assert.equal(group.freeSlots, DEFAULT_GROUP.slots - 1);
assert.equal(created.state.expeditions.busyEditions[0].editionId, rares[0]);
// Seule, l'expédition a les exigences d'une carte ; dès qu'un joueur rejoint, celles du groupe complet.
// Seule, l'expédition a les exigences d'une carte ; chaque joueur qui rejoint ajoute la part d'une place.
assert.deepEqual(group.requirements.map((item) => item.value), view.destinations[0].requirements.map((item) => item.value));
// La carte du créateur est occupée : elle ne peut pas partir dans une autre expédition en même temps.
assert.throws(() => service.expeditions.createGroup(player.id, soloBody(view, rares[0], { destinationId: view.destinations[1].id }), "solo-busy"), (error) => error.code === "EXPEDITION_CARD_BUSY");
@ -491,15 +549,15 @@ test("a group opens on the Guild board, fills its places and leaves when its cre
const before = service.expeditions.getExpeditions(player.id).groups[0];
assert.equal(before.members.length, 2);
assert.equal(before.canDepart, true);
assert.deepEqual(before.requirements.map((item) => item.value), view.destinations[0].groupRequirements.map((item) => item.value));
assert.deepEqual(before.requirements.map((item) => item.value), view.destinations[0].requirements.map((item) => item.value * 2));
// Collections différentes : bonus de cohésion.
assert.equal(before.projected.cohesionPct, 10);
service.expeditions.departGroup(player.id, group.id);
assert.deepEqual(service.expeditions.getExpeditions(third.id).groups, []);
const slots = database.db.prepare("SELECT player_id FROM expedition_slots WHERE expedition_id = ? ORDER BY position").all(group.id);
assert.equal(slots.length, 4);
// Le Veilleur tient les deux places vides.
assert.equal(slots.filter((slot) => slot.player_id == null).length, 2);
// Une place par joueur : les places restées libres disparaissent au départ.
assert.equal(slots.length, 2);
assert.ok(slots.every((slot) => slot.player_id != null));
assert.throws(() => service.expeditions.joinGroup(third.id, group.id, { editionId: rares[5] }), (error) => error.code === "EXPEDITION_GROUP_DEPARTED");
clock.now += 2 * HOUR;
@ -683,6 +741,14 @@ test("progression plans spread level points by vocation or by hand, and a Parche
database.db.prepare("UPDATE card_progress SET level = 5 WHERE player_id = ? AND edition_id = ?").run(player.id, card);
assert.deepEqual([progressOf().plan.points, sum(progressOf().stats)], [25, 60]);
// Réinitialiser (un Parchemin) remet la carte en libre sans point placé : le choix suivant, un profil par exemple, est gratuit.
database.db.prepare("UPDATE players SET stardust = 400 WHERE id = ?").run(player.id);
service.expeditions.buyShopItem(player.id, { item: "oblivion", count: 1 });
const reset = service.expeditions.setCardPlan(player.id, { editionId: card, plan: "free", allocation: allocation(0, 0) }).progress;
assert.deepEqual([reset.plan.id, reset.plan.paid, service.expeditions.itemsOf(player.id).oblivion], ["free", false, 0]);
assert.equal(service.expeditions.setCardPlan(player.id, { editionId: card, plan: "seeker" }).progress.plan.paid, true);
assert.equal(service.expeditions.itemsOf(player.id).oblivion, 0);
// Le plan d'une carte en expédition ne change pas avant son retour.
const view = service.expeditions.getExpeditions(player.id);
goSolo(service, player.id, soloBody(view, card), "planned");
@ -691,17 +757,16 @@ test("progression plans spread level points by vocation or by hand, and a Parche
const history = service.getState(player.id).history;
assert.deepEqual(history.filter((entry) => entry.type === "card_plan_changed").map((entry) => [entry.details.plan, entry.details.oblivion]),
[["guardian", false], ["navigator", true], ["free", true], ["free", false]]);
[["guardian", false], ["navigator", true], ["free", true], ["free", false], ["free", true], ["seeker", false]]);
assert.ok(history.some((entry) => entry.type === "item_bought" && entry.details.item === "oblivion" && entry.details.count === 2 && entry.details.stardust === 300));
assert.equal(service.getState(player.id).shop.oblivionPrice, 150);
});
test("a Rose des vents draws new destinations for the day once a day, and bonus destinations stay", () => {
const { clock, service, player, open, database } = expeditionService();
test("each Rose des vents draws new destinations for the day, as many times as the player has some, and bonus destinations stay", () => {
const { service, player, open, database } = expeditionService();
open();
const daily = (view) => view.destinations.filter((item) => !item.bonusSlot).map((item) => item.id);
const bonusOf = (view) => view.destinations.filter((item) => item.bonusSlot).map((item) => item.id);
assert.equal(service.expeditions.getExpeditions(player.id).rerolledToday, false);
assert.throws(() => service.expeditions.rerollDestinations(player.id), (error) => error.code === "NOT_ENOUGH_ITEMS");
// La Rose des vents s'achète en boutique, comme le Parchemin.
database.db.prepare("UPDATE players SET stardust = 200 WHERE id = ?").run(player.id);
@ -713,19 +778,18 @@ test("a Rose des vents draws new destinations for the day once a day, and bonus
// De nouvelles destinations, aucune déjà vue aujourd'hui, un niveau de chaque ; la 5e destination reste.
const after = service.expeditions.rerollDestinations(player.id).expeditions;
assert.equal(after.rerolledToday, true);
assert.equal(daily(after).length, daily(before).length);
assert.ok(daily(after).every((id) => !daily(before).includes(id) && !bonusOf(before).includes(id)));
assert.deepEqual(bonusOf(after), bonusOf(before));
assert.deepEqual(after.destinations.filter((item) => !item.bonusSlot).map((item) => item.level).sort(), [0, 1, 2, 3]);
assert.throws(() => service.expeditions.preview(player.id, { day: after.day, destinationId: daily(before)[0], durationHours: 2, slots: [] }), (error) => error.code === "EXPEDITION_INVALID");
// Une fois par jour : la seconde Rose attend le lendemain.
assert.throws(() => service.expeditions.rerollDestinations(player.id), (error) => error.code === "REROLL_ALREADY_USED");
// Pas de limite par jour : la seconde Rose tire aussitôt d'autres destinations ; sans Rose, plus de tirage.
assert.equal(service.expeditions.itemsOf(player.id).windRose, 1);
clock.now += 24 * HOUR;
assert.equal(service.expeditions.getExpeditions(player.id).rerolledToday, false);
service.expeditions.rerollDestinations(player.id);
const again = service.expeditions.rerollDestinations(player.id).expeditions;
assert.equal(daily(again).length, daily(after).length);
assert.deepEqual(bonusOf(again), bonusOf(before));
assert.equal(service.expeditions.itemsOf(player.id).windRose, 0);
assert.throws(() => service.expeditions.rerollDestinations(player.id), (error) => error.code === "NOT_ENOUGH_ITEMS");
const history = service.getState(player.id).history;
assert.equal(history.filter((entry) => entry.type === "item_used" && entry.details.item === "windRose").length, 2);
assert.ok(history.some((entry) => entry.type === "item_bought" && entry.details.item === "windRose" && entry.details.stardust === 120));
@ -928,16 +992,20 @@ test("objects add bonus destinations, recall an expedition with an anchor and en
const { clock, service, player, open, rares, database } = expeditionService();
open();
const give = (items) => database.transaction(() => service.expeditions.addItemsInTx(player.id, items));
// Étoile guide : une 5e destination, pour ce joueur seulement ; une seule par jour.
give(["guideStar", "guideStar", "anchor", "engraving", "fragment", "fragment", "fragment", "fragment"]);
// Étoile guide : une destination de plus, un niveau sous le plus haut de ses destinations du jour (★★★★ avec 4 destinations),
// pour ce joueur seulement ; une seule par jour. Carte céleste : une autre, au plus haut niveau du jour.
give(["guideStar", "guideStar", "skyChart", "anchor", "engraving", "fragment", "fragment", "fragment", "fragment"]);
const before = service.expeditions.getExpeditions(player.id);
assert.equal(before.items.guideStar, 2);
const added = service.expeditions.addBonusDestination(player.id, { item: "guideStar" }).expeditions;
assert.equal(added.destinations.length, 5);
const bonus = added.destinations.find((destination) => destination.bonusSlot === "5");
assert.ok(!before.destinations.some((destination) => destination.id === bonus.id));
assert.deepEqual([bonus.level, bonus.star], [2, 3]);
assert.throws(() => service.expeditions.addBonusDestination(player.id, { item: "guideStar" }), (error) => error.code === "BONUS_ALREADY_USED");
assert.throws(() => service.expeditions.addBonusDestination(player.id, { item: "skyChart" }), (error) => error.code === "NOT_ENOUGH_ITEMS");
const sky = service.expeditions.addBonusDestination(player.id, { item: "skyChart" }).expeditions.destinations.find((destination) => destination.bonusSlot === "6");
assert.deepEqual([sky.level, sky.star], [3, 4]);
assert.throws(() => service.expeditions.addBonusDestination(player.id, { item: "skyChart" }), (error) => error.code === "BONUS_ALREADY_USED");
assert.throws(() => service.expeditions.addBonusDestination(player.id, { item: "anchor" }), (error) => error.code === "ITEM_INVALID");
// Carte au trésor : 4 fragments ouvrent une destination cachée, au butin multiplié.
const hidden = service.expeditions.addBonusDestination(player.id, { item: "fragment" }).expeditions.destinations.find((destination) => destination.bonusSlot === "hidden");

View file

@ -8,7 +8,7 @@ import {
applyHazards, cardPower, drawExpeditionDay, editionExpeditionData, efficiency, evaluateTeam, expectedLoot, maxLevel,
requirementsFor, resolveDayEntry, rollLoot, roundStochastic, scoreExpedition, splitPower, STAT_IDS, teamStats, upgradeCost, gainProgress,
equipmentBonus, LINEAGES, resonancesOf, teamSynergy, unlockedSlots, bonusLootPct, pickItems, HIDDEN_ITEMS, teamPowers, travelHours, rollRequirementFactor,
bonusLevel, levelCount, starsForLevel, planStats, vocationProfile, clampAllocation, allocationError, levelPoints, maxStatPoints
bonusSlotLevel, levelCount, starsForLevel, planStats, vocationProfile, clampAllocation, allocationError, levelPoints, maxStatPoints
} from "../services/cards/expedition-rules.js";
import { drawCollectionCard } from "../services/cards/game-rules.js";
import {
@ -285,9 +285,12 @@ test("each daily destination draws a difficulty level, one of each", () => {
const six = drawExpeditionDay(destinations, { ...settings, day: { ...settings.day, destinationsPerDay: 6 } }, [], () => 0).map((entry) => entry.level);
assert.deepEqual(six.slice(0, 5).sort(), [0, 1, 2, 3, 4]);
assert.deepEqual(six.slice(5), six.slice(0, 1));
// Une destination bonus garde son niveau toute la journée ; un tirage d'avant les niveaux prend celui de sa place.
assert.equal(bonusLevel("player:2026-11-15:5:great-void", settings), bonusLevel("player:2026-11-15:5:great-void", settings));
assert.ok(bonusLevel("player:2026-11-15:5:great-void", settings) < 5);
// Destinations bonus : la Carte céleste au plus haut niveau du jour du joueur, l'Étoile guide juste en dessous (jamais sous le
// premier), la destination cachée au plus haut du jeu ; un tirage d'avant les niveaux prend celui de sa place.
assert.deepEqual(["5", "6", "hidden"].map((slot) => bonusSlotLevel(slot, settings, 3)), [2, 3, 4]);
assert.deepEqual(["5", "6", "hidden"].map((slot) => bonusSlotLevel(slot, settings, 1)), [0, 1, 4]);
assert.deepEqual(["5", "6"].map((slot) => bonusSlotLevel(slot, settings, 0)), [0, 0]);
assert.equal(bonusSlotLevel("6", settings, 9), 4);
assert.equal(resolveDayEntry(destinations, { destinationId: destinations[0].id, conditionIndex: 0, dangerIndexes: [0, 0] }, 2).level, 2);
});

View file

@ -112,7 +112,8 @@ test("large sass files stay split by stable responsibility", async () => {
"website/src/styles/toolboxes/calendar/_form-actions.scss",
"website/src/styles/_nebula-expeditions.scss",
"website/src/styles/_nebula-expedition-destinations.scss",
"website/src/styles/_nebula-expedition-loadout.scss"
"website/src/styles/_nebula-expedition-loadout.scss",
"website/src/styles/_nebula-expedition-journey.scss"
];
for (const path of orchestrators) {