summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/gendata.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/gendata.js b/tools/gendata.js
index ff38695..b2405ec 100644
--- a/tools/gendata.js
+++ b/tools/gendata.js
@@ -327,6 +327,7 @@ function process_card(c, ix) {
for (let a of c.actions) {
if (a.target) {
let tname = a.target.replace(" out of reserve", "")
+
if (tname === "Any enemy attack" || tname === "Any enemy formation" || tname === "Any enemy attacking it")
a.target_list = find_enemy_cards(c.scenario, c.wing)
else if (tname === "Any friendly formation")
@@ -356,12 +357,21 @@ function process_card(c, ix) {
else
a.target_list = tname.split(/, | OR | or | and /).map(name => find_card(c.scenario, name))
- // Hothenfriedberg invisible charles last target in list!
+ // Hohenfriedberg invisible charles last target in list!
if (c.number === "267A" || c.number === "268A" || c.number === "269A")
a.target_list.push(find_card(c.scenario, "Charles"))
}
- if (a.type === "Absorb")
+
+ if (a.type === "Counterattack") {
+ if (/, /.test(a.target))
+ a.choice = 0
+ else
+ a.choice = 1
+ }
+
+ 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) {