sokko-g/scripts/simulate-expeditions.mjs
Shinuwa fb951e4510 Balance the remaining powers per real hour, scale loot caps and field experience with duration, and count each resonance once
- The spyglass trades a quarter more travel for more cards and one more at the cap, rations are neutral per hour, the shooting-star net scales with the chosen hours and costs Fortune per place, the storm lantern adds 10 % of travel instead of a fixed hour, and the fog bell's group bonus sits outside the synergy cap.
- Card and object caps grow with each 6 hours chosen, and field experience with each 2 hours, so long expeditions are no longer held back by the caps of short ones.
- Each resonance needs its own pair of cards, "Étoiles sœurs" becomes "Thème partagé", and the bonuses say when the cap absorbs part of them.
- Every stat is a secondary stat for two vocations, and the simulator's reflected builds can pick Adaptation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 23:03:42 +01:00

33 lines
2.8 KiB
JavaScript

// Rôle : 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(" / ")}`);