summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-11-11 13:29:44 +0100
committerTor Andersson <tor@ccxvii.net>2024-11-11 13:29:44 +0100
commit0f2bf12735e758f04202b7d92edc58845b726cbf (patch)
treef94e792dd048d2e805c936d621ddb0c8a3c1e6ab
parent950863cd9ba72d7c72fb7b3b6e4c7051412e33c7 (diff)
downloadtable-battles-0f2bf12735e758f04202b7d92edc58845b726cbf.tar.gz
local re-ordering of cards in displayHEADmaster
-rw-r--r--play.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/play.js b/play.js
index ae2cc20..a5f455b 100644
--- a/play.js
+++ b/play.js
@@ -13,6 +13,17 @@ const dice_text_map = {
"(4-6)": "(4/5/6)",
}
+function remap_card(c) {
+ // Renumber 34B (spanish left cav) to same place as 29B (Conde - its reserve)
+ if (c === 76)
+ return 71
+ return c
+}
+
+function remap_card_cmp(a, b) {
+ return remap_card(a) - remap_card(b)
+}
+
const wing_name = [ "red", "pink", "blue", "dkblue" ]
const side_color = [ "red", "red", "blue", "blue" ]
const reactions = [ "Screen", "Counterattack", "Absorb" ]
@@ -289,6 +300,7 @@ function create_formation_card(id, tip=false) {
}
function fill_card_row(parent, list) {
+ list = list.slice().sort(remap_card_cmp)
parent.replaceChildren()
for (let id of list) {
let n, x