summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data.js57
-rw-r--r--tools/gendata.js10
2 files changed, 19 insertions, 48 deletions
diff --git a/data.js b/data.js
index 2f932af..14daafd 100644
--- a/data.js
+++ b/data.js
@@ -2728,8 +2728,7 @@ cards: [
"target_list": [
38,
39,
- 40,
- 41
+ 40
]
},
{
@@ -3083,8 +3082,7 @@ cards: [
50,
51,
52,
- 53,
- 54
+ 53
]
}
]
@@ -3479,8 +3477,7 @@ cards: [
65,
66,
67,
- 68,
- 69
+ 68
]
}
]
@@ -3599,7 +3596,6 @@ cards: [
71,
72,
73,
- 74,
75,
76
]
@@ -4736,8 +4732,7 @@ cards: [
112,
113,
114,
- 115,
- 116
+ 115
]
}
]
@@ -4954,8 +4949,7 @@ cards: [
119,
120,
121,
- 122,
- 123
+ 122
]
}
],
@@ -5746,7 +5740,6 @@ cards: [
"target_list": [
153,
154,
- 155,
156
]
}
@@ -5932,7 +5925,6 @@ cards: [
159,
160,
161,
- 162,
163
]
}
@@ -6095,8 +6087,7 @@ cards: [
164,
165,
166,
- 167,
- 168
+ 167
]
}
]
@@ -7499,7 +7490,6 @@ cards: [
214,
215,
216,
- 217,
218,
219
]
@@ -7697,7 +7687,6 @@ cards: [
220,
221,
222,
- 223,
224,
225
]
@@ -9171,7 +9160,6 @@ cards: [
273,
274,
275,
- 276,
277
]
},
@@ -9187,7 +9175,6 @@ cards: [
273,
274,
275,
- 276,
277
]
}
@@ -10140,7 +10127,6 @@ cards: [
303,
304,
305,
- 306,
307
]
}
@@ -10954,7 +10940,6 @@ cards: [
332,
333,
334,
- 335,
336,
337
]
@@ -11285,8 +11270,7 @@ cards: [
344,
345,
346,
- 347,
- 348
+ 347
]
}
],
@@ -11507,7 +11491,6 @@ cards: [
"effect": "When target suffers Hits, this unit suffers 1 hit ONLY instead.",
"target_list": [
356,
- 357,
358
]
}
@@ -11932,7 +11915,6 @@ cards: [
"target_list": [
370,
371,
- 372,
373,
374,
375
@@ -12439,7 +12421,6 @@ cards: [
"target_list": [
388,
389,
- 390,
391,
392
]
@@ -14445,7 +14426,6 @@ cards: [
457,
458,
459,
- 460,
461,
462,
463
@@ -14912,8 +14892,7 @@ cards: [
"effect": "When target suffers Hits, this card suffers them instead.",
"target_list": [
476,
- 477,
- 478
+ 477
]
}
],
@@ -14993,8 +14972,7 @@ cards: [
"effect": "When target suffers Hits, this card suffers them instead.",
"target_list": [
479,
- 480,
- 481
+ 480
]
}
],
@@ -15403,8 +15381,7 @@ cards: [
"effect": "When target suffers Hits, this unit suffers 1 less hit per die.",
"target_list": [
493,
- 494,
- 495
+ 494
]
}
],
@@ -15891,7 +15868,6 @@ cards: [
"target_list": [
510,
511,
- 512,
513
]
}
@@ -16572,7 +16548,6 @@ cards: [
"effect": "When target suffers Hits, this card suffers 1 less hit per die.",
"target_list": [
535,
- 536,
537,
538,
539,
@@ -16895,7 +16870,6 @@ cards: [
"target_list": [
544,
545,
- 546,
547
]
}
@@ -17478,8 +17452,7 @@ cards: [
561,
562,
563,
- 564,
- 565
+ 564
]
}
],
@@ -17659,7 +17632,6 @@ cards: [
568,
569,
570,
- 571,
572
]
}
@@ -18255,7 +18227,6 @@ cards: [
588,
589,
590,
- 591,
592
]
}
@@ -18447,8 +18418,7 @@ cards: [
594,
595,
596,
- 597,
- 598
+ 597
]
}
],
@@ -18664,8 +18634,7 @@ cards: [
601,
602,
603,
- 604,
- 605
+ 604
]
}
],
diff --git a/tools/gendata.js b/tools/gendata.js
index c4f6efb..1e73c07 100644
--- a/tools/gendata.js
+++ b/tools/gendata.js
@@ -254,7 +254,7 @@ function find_wing_cards(scenario, wing) {
}
/* process action and reserve targets */
-function process_card(c) {
+function process_card(c, ix) {
for (let a of c.actions) {
if (a.target) {
let tname = a.target.replace(" out of reserve", "")
@@ -287,6 +287,8 @@ function process_card(c) {
else
a.target_list = tname.split(/, | OR | or | and /).map(name => find_card(c.scenario, name))
}
+ if (a.type === "Absorb")
+ a.target_list = a.target_list.filter(x => x !== ix) // never absorb for self
}
if (c.rules) {
for (let key in c.rules) {
@@ -307,14 +309,14 @@ function process_card(c) {
}
let failed = false
-for (let c of cards) {
+cards.forEach((c, ix) => {
try {
- process_card(c)
+ process_card(c, ix)
} catch (err) {
console.log(err)
failed = true
}
-}
+})
fs.writeFileSync("info/all-cards.html", result.join("\n"))