From 759b5f2c7ece5e5e5140dd3c8048495e29330b35 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 14 Dec 2023 19:17:01 +0100 Subject: WIP reference card page --- tools/gendata.js | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'tools/gendata.js') diff --git a/tools/gendata.js b/tools/gendata.js index e593eac..f471387 100644 --- a/tools/gendata.js +++ b/tools/gendata.js @@ -15,7 +15,10 @@ var result = [ @@ -33,12 +36,34 @@ var card_index = {} var cards_show = [ ] var scenarios = [] +var a_seq = 0 +var b_seq = 0 + +function remap(x) { + if (x >= 42 && x <= 50) return (x - 42) + 51 + if (x >= 51) x += 9 + if (x >= 91 && x <= 99) return -1 + if (x >= 99) x -= 9 + if (x >= 216 && x <= 224) return x - 216 + 42 + if (x >= 224) x -= 5 + return x +} + +let last_wing = null + for (let c of card_records) { if (!c.number) { result.push(`

${c.scenario}

`) + last_wing = null continue } + if ((c.wing === "blue" || c.wing === "dkblue") && (last_wing === "red" || last_wing === "pink")) + result.push(`
`) + if ((last_wing === "blue" || last_wing === "dkblue") && (c.wing === "red" || c.wing === "pink")) + result.push(`
`) + last_wing = c.wing + if (!c.name) continue @@ -231,6 +256,11 @@ for (let c of card_records) { result.push(`
${WING_ICON[card.wing]}
`) result.push(`
`) + + if (c.number.endsWith("A")) + result.push(``) + else + result.push(``) } function find_card(scenario, name) { -- cgit v1.2.3