From 0659b78aa31e23c8feb6d4ff57a1cd349021b28f Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 15 Dec 2023 14:00:05 +0100 Subject: x --- tools/gendata.js | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'tools/gendata.js') diff --git a/tools/gendata.js b/tools/gendata.js index f471387..4f091b5 100644 --- a/tools/gendata.js +++ b/tools/gendata.js @@ -164,16 +164,17 @@ for (let c of card_records) { result.push(`
${c.dice}
`) } - function make_action(type, requirement, target, effect) { + function make_action(type, requirement, target, effect, rule_text) { let a = { type } if (requirement) a.requirement = requirement if (target) a.target = target if (effect) a.effect = effect + if (rule_text) a.rule_text = rule_text return a } if (c.action1_type) { - card.actions.push(make_action(c.action1_type, c.action1_req, c.action1_target, c.action1_effect)) + card.actions.push(make_action(c.action1_type, c.action1_req, c.action1_target, c.action1_effect, c.action1_rule_text)) result.push(`
`) if (/Screen|Absorb|Counterattack/.test(c.action1_type)) result.push(`
${c.action1_type}
`) @@ -181,13 +182,19 @@ for (let c of card_records) { result.push(`
${c.action1_type}
`) result.push(`
${c.action1_req}
`) result.push(`
${c.action1_target}
`) - if (c.action1_effect) - result.push(`
${c.action1_effect}
`) + if (c.action1_effect) { + if (c.action1_rule_text) + result.push(`
${c.action1_effect}
`) + else + result.push(`
${c.action1_effect}
`) + } result.push(`
`) + if (c.action1_rule_text) + result.push(`
${c.action1_rule_text}
`) } if (c.action2_type || c.action2_effect) { - card.actions.push(make_action(c.action2_type, c.action2_req, c.action2_target, c.action2_effect)) + card.actions.push(make_action(c.action2_type, c.action2_req, c.action2_target, c.action2_effect, c.action2_rule_text)) result.push(`
`) if (/Screen|Absorb|Counterattack/.test(c.action2_type)) result.push(`
${c.action2_type}
`) @@ -195,9 +202,15 @@ for (let c of card_records) { result.push(`
${c.action2_type}
`) result.push(`
${c.action2_req}
`) result.push(`
${c.action2_target}
`) - if (c.action2_effect) - result.push(`
${c.action2_effect}
`) + if (c.action2_effect) { + if (c.action2_rule_text) + result.push(`
${c.action2_effect}
`) + else + result.push(`
${c.action2_effect}
`) + } result.push(`
`) + if (c.action2_rule_text) + result.push(`
${c.action2_rule_text}
`) } if (c.rule) { -- cgit v1.2.3