# Disney Lorcana

# Disney Lorcana

> _Dernière mise à jour : 2026-05-10_

## Source

- **LorcanaJSON.org** : <https://github.com/LorcanaJSON/LorcanaJSON> (MIT, JSON bulk FR + EN)
- **Collection Qdrant** : `lorcana-cards`
- **Data dir** : `LORCANA_CARDS_DATA_DIR` (défaut `/app/data/lorcana-cards`)
  - `en/allCards.json`, `fr/allCards.json`

## Code

| Fichier | Rôle |
|---|---|
| `src/services/cards/sources/lorcana.ts` | CardSource (load, normalize, getImageUrl) |
| `src/services/cards/sources/lorcana-normalize.ts` | Symboles ink/lore/willpower normalisés |
| `scripts/lorcana-cards/download.ts` | Télécharge allCards.json FR + EN |
| `scripts/lorcana-cards/ingest.ts` | Push Qdrant |
| `scripts/lorcana-cards/ingest-symbols.ts` | Symboles spécialisés (ink, lore, willpower) |

## Payload Qdrant `lorcana-cards`

```typescript
{
  id: pointId,
  name: string,            // FR
  name_en: string,         // EN
  version: string,         // "Bandit rusé"
  set_label: string,
  rarity: string,
  card_type: 'Character' | 'Item' | 'Action' | 'Location' | 'Song',
  ink: number,             // coût en ink (mana)
  willpower: number,
  strength: number,
  lore: number,            // points de lore générés
  text: string,            // abilities
  image_url: string,       // CDN Ravensburger officiel (api.lorcana.ravensburger.com)
}
```

## Symboles UI

| Token texte | Symbole | PNG |
|---|---|---|
| `{E}` | Exert | `/lorcana-icons/exert.png` |
| `{I}` | Ink | `/lorcana-icons/ink.png` |
| `{L}` | Lore | `/lorcana-icons/lore.png` |
| `{S}` | Strength | `/lorcana-icons/strength.png` |
| `{W}` | Willpower | `/lorcana-icons/willpower.png` |

PNG officiels Ravensburger (vérifier les ToS si on les redistribue publiquement, pour usage perso self-host c'est OK).

Helper : `frontend/src/lib/lorcana-symbols.ts`. Activé uniquement si `game.hasCardDatabase === 'lorcana-cards'`.

## ⚠️ Méta : DotGG figée nov 2025

L'API DotGG (api.dotgg.gg/cgfw/) servait pour Lorcana méta-game (tier list, archétypes), mais sa data est figée au **21 novembre 2025**. Le projet a tenté l'intégration 2× (cf. mémoire `project_lorcana_integration.md`), refermée chaque fois.

**Action** : ne pas relancer une sync méta Lorcana tant que DotGG ne reprend pas. Si une autre source apparaît (Mobalytics? officiel Disney?), créer un nouveau service `services/meta/<source>.ts`.

## Deckbuilding (partiel)

Le deckbuilding fonctionne sur les axes :
- Total carte (60 max copies 4)
- Couleurs (ink colors : Amber, Amethyst, Emerald, Ruby, Sapphire, Steel)
- Types (Character/Item/Action/Location/Song)

Mais sans méta dispo, les decklists d'inspiration ne sont pas alimentées. Tu auras une liste cohérente mais pas forcément alignée sur le métagame compétitif.

## Pièges connus

- **Apostrophes typographiques dans les noms** ("Mickey Mouse - Bandit rusé") : utiliser `normalizeCardKey()` (NFC + lowercase + apostrophe normalization). `\b` regex sans flag `u` rate les noms finissant par `é`.
- **Versions multiples** : "Mickey Mouse" peut avoir 5+ versions différentes (variantes par set + version artistique). Le `name` est unique seulement avec `version` en suffixe (`Mickey Mouse - Bandit rusé`).

## Source images

CDN officiel Ravensburger : <https://api.lorcana.ravensburger.com/v1/...>. Pas de cache local pour images cartes (proxy direct via `/api/cards/image/:pointId`).