summaryrefslogtreecommitdiff
path: root/tools/gendata.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-14 15:12:03 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-08 16:36:48 +0100
commit1b3c32195d2741ac44aa35271b399c3fa2e6f2c2 (patch)
tree97a1c6b24aa2cdae40b1a872ae689e3e7fe98153 /tools/gendata.js
parent55eae227cb5eb04d03814137ebe6f6a13a93c92c (diff)
downloadtable-battles-1b3c32195d2741ac44aa35271b399c3fa2e6f2c2.tar.gz
Squeeze layout.
Diffstat (limited to 'tools/gendata.js')
-rw-r--r--tools/gendata.js22
1 files changed, 20 insertions, 2 deletions
diff --git a/tools/gendata.js b/tools/gendata.js
index d96d46e..1df67b1 100644
--- a/tools/gendata.js
+++ b/tools/gendata.js
@@ -24,6 +24,9 @@ h1{color: white}
const WING = { red: 0, pink: 1, blue: 2, dkblue: 3 }
const WING_ICON = [ "\u2666", "\u2665", "\u2663", "\u2660" ]
+const SQUEEZE_BOXES = [ "82A", "128A", "136B" , "274B", "291A" ]
+const SQUEEZE_MARGINS = [ "91B", "239B", "274B", "291A", "69B", "82A" ]
+
var cards = [ ]
var card_index = {}
var cards_show = [ ]
@@ -83,7 +86,21 @@ for (let c of card_records) {
card.dice = c.dice
card.actions = []
- result.push(`<div class="formation card">`)
+ let squeeze = 0
+ if (c.action1_effect && c.action2_effect && (c.rule_text || c.lore_text))
+ squeeze |= 1
+ else if (SQUEEZE_BOXES.includes(c.number))
+ squeeze |= 1
+ if (SQUEEZE_MARGINS.includes(c.number))
+ squeeze |= 2
+
+ if (squeeze) {
+ card.squeeze = squeeze
+ result.push(`<div class="formation card squeeze${squeeze}">`)
+ } else {
+ result.push(`<div class="formation card">`)
+ }
+
if (c.symbol)
result.push(`<div class="name with_symbol ${c.wing}">${c.name}</div>`)
else
@@ -200,7 +217,7 @@ for (let c of card_records) {
if (card.retire && card.reserve)
result.push(`<div class="reserve">RETIRE; RESERVE (${card.reserve.join(", ")})</div>`)
else if (card.retire && card.pursuit)
- result.push(`<div class="reserve">RETIRE, PURSUIT)})</div>`)
+ result.push(`<div class="reserve">RETIRE, PURSUIT</div>`)
else if (card.retire)
result.push(`<div class="reserve">RETIRE</div>`)
else if (card.pursuit)
@@ -376,6 +393,7 @@ for (let s of scenario_records) {
],
rule: s.rule || undefined,
rule_text: s.rule_text || undefined,
+ lore_text: s.lore_text || undefined,
})
result.push(`
<div id="scenario_${s.number}" class="scenario card">