Add the Prismatic Backdrop holographic effect for cutout artwork

The new mythic effect works on two levels. An opaque iridescent film is
painted under the artwork and only shows through its transparent areas,
while a light overlay makes the whole card shine. Both follow the card
tilt without any running animation, like the Diffraction Sheen.

Cards can declare cutout versions of their artwork with the __cutout
suffix: cutoutImage for the standard format and fullCutoutImage for the
full-art format. The catalog only accepts the format's own image name
followed by __cutout. Prismatic Backdrop finishes use them when present
and fall back to the opaque artwork otherwise. The Mythic Card Pull gets
both cutout versions, and the admin visual lab previews the effect on them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-08 21:33:35 +01:00
parent 24992e5502
commit bd1da42c7f
9 changed files with 76 additions and 7 deletions

View file

@ -128,7 +128,17 @@ test("full-art mythics need a full image and declare one per legendary card", as
assert.ok(card.fullImage, `${cardId} needs a full image`);
await access(`website/public${card.image}`);
await access(`website/public${card.fullImage}`);
if (card.cutoutImage) await access(`website/public${card.cutoutImage}`);
if (card.fullCutoutImage) await access(`website/public${card.fullCutoutImage}`);
}
// Une illustration à zones vides reprend le nom de l'illustration pleine, suffixé `__cutout`.
assert.ok(baseCatalog.cards.some((card) => card.fullCutoutImage?.endsWith("__full__cutout.webp")));
const wrongCutout = structuredClone(rawCatalog);
wrongCutout.cards.find((card) => card.id === "mythic-card-pull").fullCutoutImage = "/static/img/cards/astral-genesis/legendary/mythic_card_pull__cutout.webp";
assert.throws(() => prepareVersionedCatalog(wrongCutout), /suffixed with __cutout/);
const wrongStandardCutout = structuredClone(rawCatalog);
wrongStandardCutout.cards.find((card) => card.id === "mythic-card-pull").cutoutImage = "/static/img/cards/astral-genesis/legendary/mythic_card_pull__full__cutout.webp";
assert.throws(() => prepareVersionedCatalog(wrongStandardCutout), /cutout image must be its image suffixed/);
const directory = await mkdtemp(join(tmpdir(), "sokkog-cards-full-art-"));
const database = new CardsDatabase(join(directory, "cards.sqlite"));
t.after(async () => {
@ -232,7 +242,7 @@ test("finishes are generated: standard plus one per holographic effect and seven
assert.equal("finishes" in rawCatalog, false);
const preset = catalog.effectPresets.find((effect) => effect.id === "spectral-prism");
assert.equal(preset.kind, "holographic");
assert.deepEqual(catalog.finishes.map((finish) => finish.id), ["standard", ...["", "full-art-"].flatMap((format) => ["spectral-prism", "diffraction-sheen"].flatMap((effect) => ["rainbow", "solar", "dusk", "crimson", "nature", "aurora", "winter", "cosmic", "darkness"].map((palette) => `${format}${effect}-${palette}`)))]);
assert.deepEqual(catalog.finishes.map((finish) => finish.id), ["standard", ...["", "full-art-"].flatMap((format) => ["spectral-prism", "diffraction-sheen", "prismatic-backdrop"].flatMap((effect) => ["rainbow", "solar", "dusk", "crimson", "nature", "aurora", "winter", "cosmic", "darkness"].map((palette) => `${format}${effect}-${palette}`)))]);
assert.deepEqual(catalog.finishes[0], { id: "standard", label: "Standard", effectPresetId: null, paletteId: null, formatId: "standard" });
assert.ok(catalog.finishes.every((finish) => !("particlePresetId" in finish)));
assert.ok(catalog.effectPalettes.every((palette) => palette.colors.length === 7 && new Set(palette.colors).size === 7));
@ -245,7 +255,7 @@ test("finishes are generated: standard plus one per holographic effect and seven
withNewEffect.effectPresets.push({ id: "effect-x", kind: "holographic", label: "Effet X" });
withNewEffect.effectPalettes.push({ id: "ember", label: "Braise", colors: ["#7f1d1d", "#b91c1c", "#ef4444", "#f97316", "#fb923c", "#fdba74", "#fff7ed"], highlight: "#ffffff" });
const generated = prepareVersionedCatalog(withNewEffect).finishes;
assert.equal(generated.length, 1 + 2 * 3 * 10);
assert.equal(generated.length, 1 + 2 * 4 * 10);
assert.deepEqual(generated.find((finish) => finish.id === "effect-x-ember"), { id: "effect-x-ember", label: "Effet X — Braise", effectPresetId: "effect-x", paletteId: "ember", formatId: "standard" });
const invalidPalette = structuredClone(rawCatalog);