feat: implement core Foundry VTT system framework, including actor/item data models, spellcasting logic, dice mechanics, and automation scripts

This commit is contained in:
Octoturge
2026-06-14 10:12:47 +02:00
parent fb42c6e8cc
commit 624fe2ee1a
70 changed files with 1645 additions and 1146 deletions
+3 -3
View File
@@ -5,7 +5,7 @@ import type { ParsedDoc, ParserContext, ParserFn, SourceBookId } from './types';
import { slugify } from './helpers';
import yaml from 'js-yaml';
/** Looser zod schema mirrors `SpellData` defaults; build pipeline converts to system payload. */
/** Looser zod schema - mirrors `SpellData` defaults; build pipeline converts to system payload. */
const SpellSystemSchema = z.object({
castingMode: z.enum(['standard', 'sacred', 'witch', 'blood']),
school: z.string(),
@@ -101,7 +101,7 @@ export const parseSpells: ParserFn = async (ctx: ParserContext): Promise<ParsedD
}
const payload = { ...frontmatter, description: bodyRaw.trim() };
const nameMatch = payload.description.match(/^#\s+(.+)$/m);
const spellName = nameMatch ? nameMatch[1].trim() : basename(file, '.md');
payload.description = payload.description.replace(/^#\s+.+$/m, '').trim();
@@ -113,7 +113,7 @@ export const parseSpells: ParserFn = async (ctx: ParserContext): Promise<ParsedD
}
const baseId = basename(file, '.md');
let pack = 'spells-academic';
const relativePath = file.substring(spellsDir.length).replace(/\\/g, '/');
if (relativePath.includes('/general/')) pack = 'spells-general';