summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-14 11:18:52 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-08 16:36:48 +0100
commiteabedf314dfedd2ee5f641bf2e10564304d9d3f0 (patch)
treeea72a8ff938e6b367ab4c34a5b0c314ced912304 /tools
parentda0130446329b1419d54904e1ab43aebefbfd3de (diff)
downloadtable-battles-eabedf314dfedd2ee5f641bf2e10564304d9d3f0.tar.gz
fizzle -> null.
Diffstat (limited to 'tools')
-rw-r--r--tools/gendata.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/gendata.js b/tools/gendata.js
index 283449d..d96d46e 100644
--- a/tools/gendata.js
+++ b/tools/gendata.js
@@ -132,7 +132,10 @@ for (let c of card_records) {
if (c.action1_type) {
card.actions.push(make_action(c.action1_type, c.action1_req, c.action1_target, c.action1_effect))
result.push(`<div class="action_row">`)
- result.push(`<div class="action_type">${c.action1_type}</div>`)
+ if (/Screen|Absorb|Counterattack/.test(c.action1_type))
+ result.push(`<div class="action_type reaction">${c.action1_type}</div>`)
+ else
+ result.push(`<div class="action_type">${c.action1_type}</div>`)
result.push(`<div class="action_requirement">${c.action1_req}</div>`)
result.push(`<div class="action_target">${c.action1_target}</div>`)
if (c.action1_effect)
@@ -143,7 +146,10 @@ for (let c of card_records) {
if (c.action2_type || c.action2_effect) {
card.actions.push(make_action(c.action2_type, c.action2_req, c.action2_target, c.action2_effect))
result.push(`<div class="action_row">`)
- result.push(`<div class="action_type reaction">${c.action2_type}</div>`)
+ if (/Screen|Absorb|Counterattack/.test(c.action2_type))
+ result.push(`<div class="action_type reaction">${c.action2_type}</div>`)
+ else
+ result.push(`<div class="action_type">${c.action2_type}</div>`)
result.push(`<div class="action_requirement">${c.action2_req}</div>`)
result.push(`<div class="action_target">${c.action2_target}</div>`)
if (c.action2_effect)
@@ -278,11 +284,11 @@ function process_card(c, ix) {
else if (tname === "Any friendly but Little Round Top")
a.target_list = find_friendly_cards(c.scenario, c.wing).filter(x => x !== find_card(c.scenario, "Little Round Top"))
else if (tname === 'Activate "Retreat to Nivelles"')
- a.target_list = [ "Retreat to Nivelles" ]
+ a.target_list = null
else if (tname === "The Fog Lifts...")
- a.target_list = [ "The Fog" ]
+ a.target_list = null
else if (tname === "See Below")
- a.target_list = [ ]
+ a.target_list = null
else
a.target_list = tname.split(/, | OR | or | and /).map(name => find_card(c.scenario, name))
}