diff options
Diffstat (limited to 'tools/gencards.js')
-rw-r--r-- | tools/gencards.js | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/tools/gencards.js b/tools/gencards.js new file mode 100644 index 0000000..ee88c70 --- /dev/null +++ b/tools/gencards.js @@ -0,0 +1,52 @@ +var ix = 0 +var xx = 0 + +const M = 0 +const S = 1 +const P = 2 + +const CARD_INDEX = [] +const CARD_INFO = [] + +function mk(n, type, cost, name, event) { + CARD_INFO[xx] = { name, type, cost, event } + var a = ix + var b = ix + n - 1 + for (let i = 0; i < n; ++i) + CARD_INDEX[a + i] = xx + console.log("const CARD_" + name + " = [ " + a + ", " + b + " ]") + ix = b + 1 + xx += 1 +} + +mk(12, M, 1, "M1", "None") +mk(12, S, 1, "S1", "None") +mk(12, P, 1, "P1", "None") + +mk(9, M, 2, "M2", "Castra") +mk(9, S, 2, "S2", "Tribute") +mk(9, P, 2, "P2", "Quaestor") + +mk(9, M, 2, "M2X", "Cavalry") +mk(9, S, 2, "S2X", "Princeps Senatus") +mk(9, P, 2, "P2X", "Ambitus") + +mk(8, M, 3, "M3", "Flanking Maneuver") +mk(8, S, 3, "S3", "Foederati") +mk(8, P, 3, "P3", "Mob") + +mk(8, M, 3, "M3X", "Force March") +mk(8, S, 3, "S3X", "Frumentarii") +mk(8, P, 3, "P3X", "Mobile Vulgus") + +mk(6, M, 4, "M4", "Praetorian Guard") +mk(6, S, 4, "S4", "Damnatio Memoriae") +mk(6, S, 4, "S4B", "Damnatio Memoriae (exp)") +mk(6, P, 4, "P4", "Pretender") + +mk(6, M, 4, "M4X", "Spiculum") +mk(6, S, 4, "S4X", "Triumph") +mk(6, P, 4, "P4X", "Demagogue") + +console.log("const CARD_INDEX = " + JSON.stringify(CARD_INDEX)) +console.log("const CARD_INFO = " + JSON.stringify(CARD_INFO)) |