Reword bulk recycling and awakening texts, and list only the recycled rarities
The confirmation said "rareté Commun ou plus commune": it now names the recycled rarities ("Vos doublons communs, rares et épiques deviennent …") and its value list keeps only those rarities. The box no longer reads "0 doublon … +0 poussière", and the awakening texts say "6 doublons rares" instead of "doublons de rareté Rare". The history no longer shows "−undefined Éclats" for an awakening with duplicates of the collection.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0533a8f766
commit
83ac709907
8 changed files with 69 additions and 26 deletions
|
|
@ -10,6 +10,7 @@ import { Tabs } from "../../components/Tabs.jsx";
|
|||
import { recycleDuplicates, setFavorite, upgradeCard } from "./cardsApi.js";
|
||||
import { AwakeningPicker } from "./AwakeningPicker.jsx";
|
||||
import { CardPlan } from "./CardPlan.jsx";
|
||||
import { frenchList, rarityAdjective } from "./rarityWords.js";
|
||||
import { CurrencyAmount } from "./Currency.jsx";
|
||||
import { readCollection } from "./collectionState.js";
|
||||
import { fillTemplate } from "./dailyShare.js";
|
||||
|
|
@ -57,8 +58,9 @@ function CardAwakening({ catalog, progress, busy, runMutation, content }) {
|
|||
const { awakening } = progress;
|
||||
const own = catalog.editions.find((edition) => edition.id === progress.editionId);
|
||||
const card = catalog.cards.find((item) => item.id === own?.cardId);
|
||||
const rarityLabel = (id) => catalog.rarities.find((item) => item.id === id)?.label ?? id;
|
||||
const accepted = own?.rarity === "mythic" ? `${rarityLabel("legendary")} ou ${rarityLabel("mythic")}` : rarityLabel(own?.rarity);
|
||||
// « rare », « légendaires ou mythiques » : les raretés acceptées, accordées avec le nombre de doublons.
|
||||
const acceptedIds = own?.rarity === "mythic" ? ["legendary", "mythic"] : [own?.rarity];
|
||||
const accepted = (count) => frenchList(acceptedIds.map((id) => rarityAdjective(catalog, id, count)), "disjunction");
|
||||
const collectionName = catalog.collections.find((item) => item.id === card?.collectionId)?.name ?? "";
|
||||
const exactIsOther = awakening.exact && awakening.exact !== progress.editionId;
|
||||
const plural = awakening.needed > 1 ? "s" : "";
|
||||
|
|
@ -67,10 +69,10 @@ function CardAwakening({ catalog, progress, busy, runMutation, content }) {
|
|||
<p className="nebula-form-help">{content.awakeningText}</p>
|
||||
<div className="nds-toolbar">
|
||||
<button className="nds-button" data-variant="primary" type="button" disabled={busy || !awakening.exact} onClick={() => runMutation(() => upgradeCard(progress.editionId, "duplicate"))}>{exactIsOther ? content.awakenLegendary : content.awakenExact}</button>
|
||||
<button className="nds-button" data-variant="secondary" type="button" disabled={busy} onClick={() => setChoosing(true)}>{fillTemplate(content.awakenChoose, { count: awakening.needed, s: plural })}</button>
|
||||
<button className="nds-button" data-variant="secondary" type="button" disabled={busy} onClick={() => setChoosing(true)}>{fillTemplate(content.awakenChoose, { count: awakening.needed, s: plural, rarity: accepted(awakening.needed) })}</button>
|
||||
</div>
|
||||
<p className="nebula-form-help">{fillTemplate(content.awakenPoolCount, { available: Math.min(awakening.available, awakening.needed), count: awakening.needed, s: plural, rarity: accepted, collection: collectionName })}</p>
|
||||
{choosing && <AwakeningPicker catalog={catalog} cardName={card?.name ?? ""} awakening={awakening} rarityLabel={accepted} collectionName={collectionName} content={content} busy={busy}
|
||||
<p className="nebula-form-help">{fillTemplate(content.awakenPoolCount, { available: Math.min(awakening.available, awakening.needed), count: awakening.needed, rarity: accepted(2), collection: collectionName })}</p>
|
||||
{choosing && <AwakeningPicker catalog={catalog} cardName={card?.name ?? ""} awakening={awakening} rarityWords={accepted} collectionName={collectionName} content={content} busy={busy}
|
||||
onAwaken={(editionIds) => runMutation(() => upgradeCard(progress.editionId, "awaken", editionIds))} onClose={() => setChoosing(false)} />}
|
||||
</section>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue