diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gendata.js | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/tools/gendata.js b/tools/gendata.js index 1740f70..0a8ab7c 100644 --- a/tools/gendata.js +++ b/tools/gendata.js @@ -356,23 +356,22 @@ function process_card(c, ix) { a.target_list = null else a.target_list = tname.split(/, | OR | or | and /).map(name => find_card(c.scenario, name)) - - // 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 === "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 (/, /.test(a.target) || !a.target_list || a.target_list.length < 2) + a.choice = 0 + else + a.choice = 1 } + + // Hohenfriedberg invisible charles last target in list! + if (c.number === "267A" || c.number === "268A" || c.number === "269A") + c.actions[0].target_list.push(find_card(c.scenario, "Charles")) + if (c.rules) { for (let key in c.rules) { let val = c.rules[key] |