Play liveChoose your opponent
Join
14 lines · 986 Bytes Raw Permalink History
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.
4import art from './art.json';
5
6const GENERALS: Record<string, string> = art.generals;
7const CARDS: Record<string, string> = art.cards;
8
9export const portrait = (name?: string): string | null => (name && GENERALS[name] ? `art/general/${GENERALS[name]}.webp` : null);
10export const cardArt = (name?: string): string | null => (name && CARDS[name] ? `art/card/${CARDS[name]}.webp` : null);
11export const CARD_BACK = 'art/theme/cardback.webp';
12
13/** 魏蜀吴群神 → the class suffix of the faction's frame and badge. */
14export const FACTION_KEY: Record<string, string> = { 魏: 'wei', 蜀: 'shu', 吴: 'wu', 群: 'qun', 神: 'shen' };