Add the Carnets des Veilleurs, the expedition-only Sokko TCG collection with power commons
- A new watchers-logbooks collection of category expedition never comes from packs, the shop or codes, and administrators cannot open it as a pack. - Its six commons carry powers instead of stats (Longue-vue, Provisions, Carte au trésor, Talisman, Boussole folle, Filet à étoiles filantes); a card holds one power and each counts once per team. - Powers change travel time, loot, score or tier, hide requirements, or catch a logbook card; each destination lists the logbook cards it can bring back. - A workshop turns a plan and three duplicate commons into a power common. - The fifteen cards ship without images with ready ChatGPT prompts; a card only drops or gets crafted once illustrated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ae23adfdd9
commit
21827a252b
38 changed files with 939 additions and 76 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// Rôle : présente les Expéditions, quête de la Guilde : expéditions du joueur (retour, butin) et préparation d'une expédition solo.
|
||||
import { useEffect, useState } from "react";
|
||||
import { addBonusDestination, claimExpedition, convertStardust, recallExpedition, departExpedition, joinExpedition, leaveExpedition, loadExpeditions, startExpedition } from "./cardsApi.js";
|
||||
import { addBonusDestination, claimExpedition, convertStardust, craftPowerCommon, recallExpedition, departExpedition, joinExpedition, leaveExpedition, loadExpeditions, startExpedition } from "./cardsApi.js";
|
||||
import { fillTemplate, formatCountdown } from "./dailyShare.js";
|
||||
import { ExpeditionGroupCard } from "./ExpeditionGroupCard.jsx";
|
||||
import { ExpeditionPlanner } from "./ExpeditionPlanner.jsx";
|
||||
|
|
@ -21,7 +21,25 @@ const expeditionCall = (call) => async () => {
|
|||
};
|
||||
|
||||
// Sac du Veilleur : objets rapportés ; les destinations bonus s'ouvrent ici, l'ancre et le burin depuis l'expédition et la fiche de carte.
|
||||
function ItemBag({ view, content, busy, onBonus }) {
|
||||
// Atelier : 3 doublons de communes (une même commune peut compter autant de fois qu'elle a de doublons libres).
|
||||
function Atelier({ catalog, state, content, busy, onCraft }) {
|
||||
const [chosen, setChosen] = useState([]);
|
||||
const commons = state.collection.filter((entry) => entry.spare > 0 && entry.edition?.rarity === "common");
|
||||
const count = (editionId) => chosen.filter((id) => id === editionId).length;
|
||||
return <div className="nebula-expedition-atelier">
|
||||
<p className="nebula-form-help">{fillTemplate(content.atelierHelp, { count: chosen.length })}</p>
|
||||
{commons.length ? <ul>{commons.map((entry) => <li key={entry.editionId}>
|
||||
<button className="nds-button" data-size="sm" data-variant={count(entry.editionId) ? "primary" : "secondary"} type="button" disabled={busy || (chosen.length >= 3 && !count(entry.editionId))}
|
||||
onClick={() => setChosen(count(entry.editionId) < entry.spare && chosen.length < 3 ? [...chosen, entry.editionId] : chosen.filter((id) => id !== entry.editionId))}>
|
||||
{entry.card?.name || catalog.cards.find((card) => card.id === entry.edition?.cardId)?.name}{count(entry.editionId) ? ` ×${count(entry.editionId)}` : ""}
|
||||
</button>
|
||||
</li>)}</ul> : <p className="nebula-form-help">{content.atelierNoCommons}</p>}
|
||||
<button className="nds-button" data-size="sm" data-variant="primary" type="button" disabled={busy || chosen.length !== 3} onClick={async () => { if (await onCraft(chosen)) setChosen([]); }}>{content.atelierAction}</button>
|
||||
</div>;
|
||||
}
|
||||
|
||||
function ItemBag({ catalog, state, view, content, busy, onBonus, onCraft }) {
|
||||
const [crafting, setCrafting] = useState(false);
|
||||
const { items } = view;
|
||||
const used = new Set(view.destinations.map((destination) => destination.bonusSlot).filter(Boolean));
|
||||
const actions = { guideStar: ["5", content.useGuideStar, 1], skyChart: ["6", content.useSkyChart, 1], fragment: ["hidden", content.useFragments, view.fragmentsForMap] };
|
||||
|
|
@ -33,6 +51,8 @@ function ItemBag({ view, content, busy, onBonus }) {
|
|||
return <li key={id} className="nds-list-row">
|
||||
<span><strong>{content.items[id]}</strong> ×{count}<span className="nebula-form-help">{content.itemHelp[id]}</span></span>
|
||||
{action && view.enabled && <button className="nds-button" data-size="sm" data-variant="secondary" type="button" disabled={busy || count < action[2] || used.has(action[0])} onClick={() => onBonus(id)}>{action[1]}</button>}
|
||||
{id === "plan" && view.atelierAvailable && <button className="nds-button" data-size="sm" data-variant="secondary" type="button" aria-pressed={crafting} disabled={busy} onClick={() => setCrafting(!crafting)}>{content.atelierOpen}</button>}
|
||||
{id === "plan" && crafting && <Atelier catalog={catalog} state={state} content={content} busy={busy} onCraft={async (ids) => { const done = await onCraft(ids); if (done) setCrafting(false); return done; }} />}
|
||||
</li>;
|
||||
})}</ul> : <p className="nebula-form-help">{content.bagEmpty}</p>}
|
||||
</section>;
|
||||
|
|
@ -100,6 +120,12 @@ export function ExpeditionsPanel({ catalog, state, runMutation, busy, content })
|
|||
return Boolean(result);
|
||||
};
|
||||
const bonus = async (item) => handle(await runMutation(expeditionCall(() => addBonusDestination(item))), content.bonusAdded);
|
||||
const craft = async (editionIds) => {
|
||||
const result = await runMutation(expeditionCall(() => craftPowerCommon(editionIds)));
|
||||
if (result?.crafted) setNotice({ variant: "success", text: fillTemplate(content.crafted, { card: catalog.cards.find((card) => card.id === catalog.editions.find((edition) => edition.id === result.crafted)?.cardId)?.name || "" }) });
|
||||
else if (result?.expeditionError) setNotice({ variant: "warning", text: result.expeditionError.message });
|
||||
return Boolean(result?.crafted);
|
||||
};
|
||||
const recall = async (id) => handle(await runMutation(expeditionCall(() => recallExpedition(id))), content.recalled);
|
||||
const depart = async (id) => handle(await runMutation(expeditionCall(() => departExpedition(id))), content.departed);
|
||||
|
||||
|
|
@ -117,7 +143,7 @@ export function ExpeditionsPanel({ catalog, state, runMutation, busy, content })
|
|||
</div>
|
||||
</div>
|
||||
<p className="nebula-form-help">{content.eclatsHelp}</p>
|
||||
<ItemBag view={view} content={content} busy={busy} onBonus={bonus} />
|
||||
<ItemBag catalog={catalog} state={state} view={view} content={content} busy={busy} onBonus={bonus} onCraft={craft} />
|
||||
<BridgeForm rate={view.progression.stardustPerEclat} stardust={state.wallet.stardust} busy={busy} content={content} onConvert={convert} />
|
||||
{notice && <p className="nds-inline-notice" data-variant={notice.variant} role="status">{notice.text}</p>}
|
||||
{expired && <div className="nds-inline-notice nebula-daily-expired" data-variant="warning" role="status"><span>{content.expired}</span><button className="nds-button" data-size="sm" data-variant="primary" type="button" onClick={reload}>{content.reload}</button></div>}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue