Show a destination's affinity themes next to its condition and dangers
The destination panel now lists the themes that grant Affinité, with the score it adds and whether the chosen card carries one. A theme that is also the condition shows once, in the condition line, since a single card then meets both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
74021342eb
commit
c6eb638b9e
3 changed files with 25 additions and 4 deletions
|
|
@ -173,6 +173,8 @@ export class ExpeditionService {
|
|||
return {
|
||||
id: destination.id, name: destination.name, description: destination.description, coverCardId: destination.coverCardId ?? null, image: destination.image ?? null, stats: destination.stats, bonusSlot,
|
||||
specialty: destination.specialty ?? null, rewardCollectionId: destination.rewardCollectionId ?? null, themeTags: destination.themeTags ?? [],
|
||||
// Bonus de score de l'Affinité, affiché avec les thèmes de la destination.
|
||||
affinityPct: settings.synergy.affinityPct,
|
||||
level, star,
|
||||
condition: hasCondition(star) ? entry.condition : null,
|
||||
dangers: entry.dangers.slice(0, dangerCount(star)),
|
||||
|
|
|
|||
|
|
@ -367,11 +367,17 @@
|
|||
"starsLabel": "Difficulté : {stars}",
|
||||
"durationLabel": "Durée",
|
||||
"hours": "{hours} h",
|
||||
"hazardsTitle": "Condition et dangers",
|
||||
"hazardsTitle": "Condition, affinité et dangers",
|
||||
"conditionShort": "Condition · «\u00a0{name}\u00a0»",
|
||||
"conditionDetail": "Une carte qui la remplit, sinon le score baisse.",
|
||||
"conditionOk": "remplie",
|
||||
"conditionKo": "non remplie",
|
||||
"conditionAffinity": "Elle donne aussi l’Affinité : score +{value} %.",
|
||||
"affinityShort": "Affinité · « {tags} »",
|
||||
"affinityDetail": "Une carte qui le porte : score +{value} %.",
|
||||
"affinityText": "Affinité : une carte de l’équipe qui porte « {tags} » augmente le score de {value} %.",
|
||||
"affinityOk": "obtenue",
|
||||
"affinityKo": "non obtenue",
|
||||
"dangerShort": "Danger · {label}",
|
||||
"dangerDetail": "{stat} en baisse, sauf avec «\u00a0{tags}\u00a0».",
|
||||
"dangerOk": "paré",
|
||||
|
|
|
|||
|
|
@ -80,16 +80,29 @@ function DestinationHazards({ catalog, destination, card, content }) {
|
|||
? catalog.collections.find((item) => item.id === condition.collectionId)?.name || condition.collectionId
|
||||
: tagLabel(catalog, condition.tag));
|
||||
const conditionMet = card && condition && (condition.type === "collection" ? card.collectionId === condition.collectionId : card.tags?.includes(condition.tag));
|
||||
// Nom et état sur la première ligne, ce qui la remplit ou le pare dessous, sur toute la largeur.
|
||||
// Condition, Affinité (les thèmes de la destination) et dangers : nom et état sur la première ligne, ce qui la remplit, l'obtient
|
||||
// ou le pare dessous, sur toute la largeur.
|
||||
const row = ({ key, text, detail, title, ok, okText, koText }) => <span key={key} role="listitem" className="nebula-destination-hazard" data-met={card ? String(Boolean(ok)) : undefined}
|
||||
title={title} aria-label={`${title}${card ? ` ${ok ? okText : koText}` : ""}`}>
|
||||
<strong aria-hidden="true">{text}</strong>
|
||||
{card && <span className="nebula-destination-hazard-state" data-ok={ok ? "true" : "false"} aria-hidden="true" title={ok ? okText : koText}><MaskIcon name="thumb" /></span>}
|
||||
<small aria-hidden="true">{detail}</small>
|
||||
</span>;
|
||||
// Un thème qui est aussi la condition ne s'affiche qu'une fois : la condition dit qu'elle donne l'Affinité, la ligne Affinité ne
|
||||
// garde que les autres thèmes (tous en 1 et 2 ★, sans condition).
|
||||
const themes = destination.themeTags || [];
|
||||
const conditionTheme = condition?.type === "tag" && themes.includes(condition.tag);
|
||||
const otherThemes = themes.filter((tag) => !(conditionTheme && tag === condition.tag));
|
||||
const conditionDetail = conditionTheme ? `${content.conditionDetail} ${fillTemplate(content.conditionAffinity, { value: destination.affinityPct ?? "" })}` : content.conditionDetail;
|
||||
return <span className="nebula-destination-hazards" role="list" aria-label={content.hazardsTitle}>
|
||||
{condition && row({ key: "condition", text: fillTemplate(content.conditionShort, { name: conditionLabel }), detail: content.conditionDetail,
|
||||
{condition && row({ key: "condition", text: fillTemplate(content.conditionShort, { name: conditionLabel }), detail: conditionDetail,
|
||||
title: conditionText(condition, catalog, content), ok: conditionMet, okText: content.conditionOk, koText: content.conditionKo })}
|
||||
{otherThemes.length > 0 && (() => {
|
||||
const tags = otherThemes.map((tag) => tagLabel(catalog, tag)).join(content.or);
|
||||
const values = { tags, value: destination.affinityPct ?? "" };
|
||||
return row({ key: "affinity", text: fillTemplate(content.affinityShort, values), detail: fillTemplate(content.affinityDetail, values),
|
||||
title: fillTemplate(content.affinityText, values), ok: card?.tags?.some((tag) => otherThemes.includes(tag)), okText: content.affinityOk, koText: content.affinityKo });
|
||||
})()}
|
||||
{destination.dangers.map((danger) => row({ key: danger.id, text: fillTemplate(content.dangerShort, { label: danger.label }),
|
||||
detail: fillTemplate(content.dangerDetail, { stat: content.stats[danger.stat], tags: danger.unlessTags.map((tag) => tagLabel(catalog, tag)).join(content.or) }),
|
||||
title: dangerText(danger, catalog, content), ok: card?.tags?.some((tag) => danger.unlessTags.includes(tag)), okText: content.dangerOk, koText: content.dangerKo }))}
|
||||
|
|
@ -165,7 +178,7 @@ function DestinationOption({ catalog, item, selected, card, view, content, onSel
|
|||
<span className="nebula-destination-fact">
|
||||
<span className="nebula-destination-fact-title">{content.requirementsFactTitle}</span>
|
||||
<DestinationRequirements requirements={item.requirements} card={card} content={content} />
|
||||
{(item.condition || item.dangers.length > 0) && <DestinationHazards catalog={catalog} destination={item} card={card} content={content} />}
|
||||
{(item.condition || item.dangers.length > 0 || (item.themeTags || []).length > 0) && <DestinationHazards catalog={catalog} destination={item} card={card} content={content} />}
|
||||
</span>
|
||||
</button>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue