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:
parent
0ef213cf4f
commit
8bb1d53d70
46 changed files with 4752 additions and 213 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// Rôle : démarre le build avec une base Sokko TCG temporaire pour les parcours Playwright.
|
||||
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
|
||||
|
|
@ -34,11 +34,30 @@ insertVariation.run("mythic-card-pull-spectral-prism-solar", "mythic-card-pull",
|
|||
seedService.addCard(partner.id, "starvoid-dragon-spectral-prism-aurora");
|
||||
seedDatabase.close();
|
||||
|
||||
// Horloge du serveur décalable par les parcours (retour d'une expédition sans attendre des heures) : le décalage, en millisecondes,
|
||||
// est lu dans ce fichier, relu au plus toutes les 200 ms. Il repart de zéro à chaque démarrage.
|
||||
const clockFile = join(tmpdir(), "sokkog-cards-e2e-clock.json");
|
||||
writeFileSync(clockFile, JSON.stringify({ offsetMs: 0 }));
|
||||
let clockOffset = 0;
|
||||
let clockReadAt = 0;
|
||||
function now() {
|
||||
const real = Date.now();
|
||||
if (real - clockReadAt > 200) {
|
||||
clockReadAt = real;
|
||||
try {
|
||||
clockOffset = Number(JSON.parse(readFileSync(clockFile, "utf8")).offsetMs) || 0;
|
||||
} catch {
|
||||
clockOffset = 0;
|
||||
}
|
||||
}
|
||||
return real + clockOffset;
|
||||
}
|
||||
|
||||
const { startServer } = await import("../server.mjs");
|
||||
const draws = [0.999, 0, 0.999, 0.999, 0.999, 0];
|
||||
let drawIndex = 0;
|
||||
// Tous les parcours et leurs deux comptes partagent la même adresse IP : la limite par minute les ferait échouer au hasard.
|
||||
const server = startServer({ cardsApiOptions: { allowProductionDevAuth: true, apiRateLimit: 100_000, random: (max) => Math.min(max - 1, Math.floor(draws[drawIndex++ % draws.length] * max)) } });
|
||||
const server = startServer({ cardsApiOptions: { allowProductionDevAuth: true, apiRateLimit: 100_000, now, random: (max) => Math.min(max - 1, Math.floor(draws[drawIndex++ % draws.length] * max)) } });
|
||||
let stopping = false;
|
||||
|
||||
function stop() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue