summaryrefslogtreecommitdiff
path: root/tools/gencards.js
blob: 1ca352d163176405245a55b5f512ff0880fbc35b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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, value, name, event) {
	CARD_INFO[xx] = { name, type, value, 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))