import { camelToSpace } from "./camelToSpace.ts"; import { card } from "./types.ts"; const series = 1; const template = (cards: string[]) => ` Blood Red Skies Cards Series ${series}
${cards.join('\n')}
` const decoder = new TextDecoder(); const cards: card[] = JSON.parse(decoder.decode(Deno.readFileSync(`./series${series}.json`))); const html = template(cards.map((c, i) => `

${c.type}

${c.attacks.length || c.maneuvers.length ? `

Select either one maneuver or one attack to make. If you can't complete one action from this card, you must take one penalty listed. If there are no penalties listed, discard this card.

` : `

Bad luck! You must take one of the following penalties

` } ${c.maneuvers.length > 0 ? `

Maneuvers: ${c.maneuvers.map(a => camelToSpace(a.name)).join(', ')}

` : ''} ${c.attacks.length > 0 ? `

Attacks: ${c.attacks.map(a => camelToSpace(a)).join(', ')}

` : ''} ${c.penalties.length > 0 ? `

Penalties: ${c.penalties.join(', ')}

` : ''}

Series ${series}

${i + 1}/${cards.length}

© ${new Date().getFullYear()} Cyborg Grizzly Games

`)) const encoder = new TextEncoder(); Deno.writeFile(`./series${series}.html`, encoder.encode(html));