import { mkdirSync, writeFileSync } from "node:fs"; import { dirname, resolve } from "node:path"; import { PARTY_TALENT_SPECIALIZATIONS, partyTalentAllocationPlan, } from "../src/game/partyTalents"; const outputPath = resolve("src/game/generated/partyTalentRuntimePlans.json"); const plans = Object.fromEntries(PARTY_TALENT_SPECIALIZATIONS.map(({ classId, specialization }) => [ `${classId}:${specialization}`, partyTalentAllocationPlan(classId, specialization).map((selection) => selection.nodeId), ])); const output = { schemaVersion: 1, generatedFrom: "src/game/partyTalents.ts", plans, }; mkdirSync(dirname(outputPath), { recursive: true }); writeFileSync(outputPath, `${JSON.stringify(output, null, 2)}\n`, "utf8"); console.log(`Wrote ${Object.keys(plans).length} party talent plans to ${outputPath}`);