| 1 | // The art pack (viewer/art/, built by src/art.py from 无名杀's files): which picture each general and each card of the |
| 2 | // upstream engine gets, as data in art.json (general → 无名杀 character id, card → 无名杀 card id). Anything not in it |
| 3 | // falls back to a drawn face: the faction's colour and the name for a general, the name for a card. |
| 4 | import art from './art.json'; |
| 5 | |
| 6 | const GENERALS: Record<string, string> = art.generals; |
| 7 | const CARDS: Record<string, string> = art.cards; |
| 8 | |
| 9 | export const portrait = (name?: string): string | null => (name && GENERALS[name] ? `art/general/${GENERALS[name]}.webp` : null); |
| 10 | export const cardArt = (name?: string): string | null => (name && CARDS[name] ? `art/card/${CARDS[name]}.webp` : null); |
| 11 | export const CARD_BACK = 'art/theme/cardback.webp'; |
| 12 | |
| 13 | /** 魏蜀吴群神 → the class suffix of the faction's frame and badge. */ |
| 14 | export const FACTION_KEY: Record<string, string> = { 魏: 'wei', 蜀: 'shu', 吴: 'wu', 群: 'qun', 神: 'shen' }; |
