From 02da527ebfd7455706e0adf79f1ee1a0ec699e1f Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 16 Dec 2023 16:54:20 +0100 Subject: Strict order for Absorb with "," --- tools/gendata.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'tools') 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] -- cgit v1.2.3