Add ARCHITECTURE.md (layers, flows, folder map, glossary), CONTRIBUTING.md (setup and step-by-step recipes) and a README in each main folder, with an index of docs/. Convert the 511 JavaScript headers from "// Rôle :" lines to JSDoc @file blocks, define a three-level header template in website/AGENTS.md and check the header in tests/file-headers.test.mjs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
2.8 KiB
JavaScript
39 lines
2.8 KiB
JavaScript
/**
|
|
* @file Affiche le rapport d'équilibrage des Expéditions Sokko TCG (réglages par défaut, catalogue et
|
|
* destinations du dépôt).
|
|
*
|
|
* Usage : node scripts/simulate-expeditions.mjs. À relancer après l'ajout de cartes, d'étiquettes, de
|
|
* destinations ou un changement de réglages.
|
|
*/
|
|
|
|
import { fileURLToPath } from "node:url";
|
|
import { loadCardsCatalog } from "../services/cards/catalog.js";
|
|
import { loadExpeditionDestinations } from "../services/cards/expedition-content.js";
|
|
import { DEFAULT_EXPEDITION_SETTINGS, mergeExpeditionSettings } from "../services/cards/expedition-settings.js";
|
|
import { buildCommons, simulate, simulationCards, soloBuildShares } from "../services/cards/expedition-simulation.js";
|
|
|
|
const root = fileURLToPath(new URL("..", import.meta.url));
|
|
const catalog = loadCardsCatalog(`${root}website/public/data/cards/catalog.json`);
|
|
const destinations = loadExpeditionDestinations(`${root}services/cards/content/expedition-destinations.json`, catalog);
|
|
const settings = mergeExpeditionSettings(DEFAULT_EXPEDITION_SETTINGS, destinations.map((destination) => destination.id));
|
|
const report = simulate(catalog, destinations, settings);
|
|
const pct = (value) => `${value.toFixed(0).padStart(3)} %`;
|
|
|
|
console.log(`Paliers : Réussite à ${settings.score.successPct} %, Triomphe à ${settings.score.triumphPct} %.\n`);
|
|
console.log("Score d'une carte partie seule, par rareté (minimum / médiane / maximum sur les cartes et les destinations, 2 h) :");
|
|
for (const row of report.byRarity) {
|
|
console.log(` ${row.level.padEnd(10)} ${row.rarity.padEnd(9)} ${row.stars} ★ ${pct(row.min)} / ${pct(row.median)} / ${pct(row.max)}`);
|
|
}
|
|
const weakest = [...report.cardBest].sort((a, b) => a.scorePct - b.scorePct).slice(0, 10);
|
|
console.log("\nCartes au meilleur score le plus bas en 2 ★ (niveau 0, seules) :");
|
|
for (const card of weakest) console.log(` ${pct(card.scorePct)} ${card.cardId} (${card.rarity}) à ${card.destinationId}`);
|
|
const commons = buildCommons(catalog);
|
|
const cards = simulationCards(catalog);
|
|
console.log("\nCartes seules, part des situations réussies sans équipement / avec un build réfléchi (vocation et communes choisies pour la destination) :");
|
|
for (const [power, stars] of [[55, 3], [70, 3], [85, 4], [100, 4], [100, 5]]) {
|
|
const { bare, built } = soloBuildShares(cards, destinations, power, stars, commons, settings);
|
|
console.log(` Puissance ${String(power).padStart(3)}, ${stars} ★ : ${pct(bare * 100)} / ${pct(built * 100)}`);
|
|
}
|
|
console.log(`Puissance au plafond : rare ${report.rareVsMythicAtMax.rare}, mythique ${report.rareVsMythicAtMax.mythic}`);
|
|
console.log("\nÉclats espérés par heure (durées " + settings.durations.hours.join(" / ") + " h) :");
|
|
for (const row of report.lootPerHour) console.log(` ${row.stars} ★ ${row.tier.padEnd(9)} ${row.perHour.map((value) => value.toFixed(2)).join(" / ")}`);
|