Support named ordinary cards in Advanced Voice

This commit is contained in:
Quintine committed 2026-10-28 00:08:16 +11:00
1 parent b00d720e40
commit a244aeb5f8
20 files changed
+514 -41

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
import { VOICE_KINDS } from './battle-cards';
import { voiceChoices } from './battle-cards';
export type NativeBattlePower = 'voice' | 'prescience';
export type BattlePowerClaim =
@@ -51,7 +51,7 @@ const identifier = (value: unknown): value is string =>
typeof value === 'string' && value.length > 0 && value === value.trim();
const keys = (value: Record<string, unknown>, expected: string): boolean =>
Object.keys(value).sort().join(',') === expected;
const cardType = (value: unknown): value is string => typeof value === 'string' && VOICE_KINDS.includes(value);
const cardType = (value: unknown): value is string => typeof value === 'string' && voiceChoices(true).includes(value);
const field = (value: unknown): value is 'leader' | 'weapon' | 'defense' | 'dial' =>
value === 'leader' || value === 'weapon' || value === 'defense' || value === 'dial';