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
45
website/src/features/cards/ExpeditionReport.jsx
Normal file
45
website/src/features/cards/ExpeditionReport.jsx
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
// Rôle : présente une expédition du joueur : en route (compte à rebours), revenue (butin à récupérer), terminée ou annulée.
|
||||
import { fillTemplate, formatCountdown } from "./dailyShare.js";
|
||||
import { coverEntry, editionEntry, formatEclats } from "./expeditionFormat.js";
|
||||
import { NebulaCard } from "./NebulaCard.jsx";
|
||||
import { formatStardust } from "./stardustFormat.js";
|
||||
|
||||
const TIER_VARIANTS = { struggle: "neutral", success: "success", triumph: "gold" };
|
||||
|
||||
function RewardBadges({ reward, content }) {
|
||||
return <div className="nebula-expedition-rewards">
|
||||
<span className="nds-badge" data-variant="gold">{fillTemplate(content.rewardEclats, { value: formatEclats(reward.eclats) })}</span>
|
||||
{reward.stardust > 0 && <span className="nds-badge" data-variant="neutral">{fillTemplate(content.rewardStardust, { value: formatStardust(reward.stardust) })}</span>}
|
||||
{reward.packs.length > 0 && <span className="nds-badge" data-variant="success">{fillTemplate(content.rewardPacks, { count: reward.packs.length, s: reward.packs.length > 1 ? "s" : "" })}</span>}
|
||||
</div>;
|
||||
}
|
||||
|
||||
export function ExpeditionReport({ catalog, expedition, content, now, busy, onClaim }) {
|
||||
// Le serveur dit « en route » au chargement ; passé l'heure du retour, la page propose déjà de récupérer le butin.
|
||||
const status = expedition.status === "running" && expedition.returnsAt <= now ? "returned" : expedition.status;
|
||||
const cover = expedition.destination.coverCardId && coverEntry(catalog, expedition.destination.coverCardId);
|
||||
const stars = "★".repeat(expedition.stars);
|
||||
return <article className="nds-card nebula-expedition-report" data-status={status} aria-labelledby={`nebula-expedition-${expedition.id}`}>
|
||||
{cover && <div className="nds-card-cover nebula-expedition-report-cover" aria-hidden="true"><img src={cover.card.image} alt="" /></div>}
|
||||
<div className="nds-card-body nebula-expedition-report-body">
|
||||
<p className="eyebrow">{fillTemplate(content.reportMeta, { stars, hours: expedition.hours })}</p>
|
||||
<h3 id={`nebula-expedition-${expedition.id}`}>{expedition.destination.name}</h3>
|
||||
{status === "running" && <p className="nebula-expedition-report-status">{fillTemplate(content.running, { time: formatCountdown(expedition.returnsAt - now) })}</p>}
|
||||
{status === "returned" && <p className="nebula-expedition-report-status">{content.returned}</p>}
|
||||
{status === "completed" && <p className="nebula-expedition-report-status">{content.completed}</p>}
|
||||
{status === "cancelled" && <p className="nebula-expedition-report-status">{content.cancelled}</p>}
|
||||
{expedition.result && <div className="nebula-expedition-rewards">
|
||||
<span className="nds-badge" data-variant={TIER_VARIANTS[expedition.result.tier]}>{content.tiers[expedition.result.tier]}</span>
|
||||
<span className="nds-badge" data-variant="neutral">{fillTemplate(content.score, { score: formatEclats(expedition.result.scorePct) })}</span>
|
||||
</div>}
|
||||
{expedition.reward && <RewardBadges reward={expedition.reward} content={content} />}
|
||||
<ul className="nebula-expedition-report-team" aria-label={content.teamTitle}>{expedition.slots.filter((slot) => slot.editionId).map((slot) => {
|
||||
const entry = editionEntry(catalog, slot.editionId);
|
||||
return entry && <li key={slot.position}><NebulaCard catalog={catalog} entry={entry} size="sm" /><span>{slot.role ? content.roles[slot.role] : content.noRole}</span></li>;
|
||||
})}</ul>
|
||||
{status === "returned" && !expedition.claimedAt && <div className="nds-card-actions">
|
||||
<button className="nds-button" data-size="sm" data-variant="primary" type="button" disabled={busy} onClick={() => onClaim(expedition.id)}>{content.claim}</button>
|
||||
</div>}
|
||||
</div>
|
||||
</article>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue