diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-06-22 13:42:36 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-16 19:19:38 +0100 |
commit | bcb7e9f778fa4dde78d04b0db5545390a35de558 (patch) | |
tree | a5d7a17c3dbc0be368fcefc8ba34ad4d61fa033d /ui.js | |
parent | 84317c155f58704d118cee1580cc3520912db7f7 (diff) | |
download | crusader-rex-bcb7e9f778fa4dde78d04b0db5545390a35de558.tar.gz |
crusader: Fix attacker when storming.
Diffstat (limited to 'ui.js')
-rw-r--r-- | ui.js | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -1,7 +1,7 @@ "use strict"; -const FRANK = "Franks"; -const SARACEN = "Saracens"; +const FRANKS = "Franks"; +const SARACENS = "Saracens"; const ASSASSINS = "Assassins"; const ENEMY = { Saracens: "Franks", Franks: "Saracens" } const DEAD = "Dead"; @@ -379,7 +379,7 @@ function layout_blocks_spread(town, north, south) { let wrap = TOWNS[town].wrap; let rows = []; - if (north.length + south.length > wrap * 3) { + if (north.length + south.length > wrap * 2) { north = north.concat(south); south = []; } @@ -616,7 +616,7 @@ function update_cards() { function update_battle() { function fill_cell(name, list, reserve) { - let cell = window[name]; + let cell = document.getElementById(name); ui.present.clear(); @@ -693,24 +693,24 @@ function update_battle() { } } - if (player == FRANK) { + if (player == FRANKS) { fill_cell("FR", game.battle.FR, true); - fill_cell("FA", game.battle.FA, false); - fill_cell("FB", game.battle.FB, false); fill_cell("FC", game.battle.FC, false); - fill_cell("EA", game.battle.SA, false); - fill_cell("EB", game.battle.SB, false); + fill_cell("FF", game.battle.FF, false); + fill_cell("EF", game.battle.SF, false); fill_cell("EC", game.battle.SC, false); fill_cell("ER", game.battle.SR, true); + document.getElementById("FC").className = "c" + game.battle.FCS; + document.getElementById("EC").className = "c" + game.battle.SCS; } else { fill_cell("ER", game.battle.FR, true); - fill_cell("EA", game.battle.FA, false); - fill_cell("EB", game.battle.FB, false); fill_cell("EC", game.battle.FC, false); - fill_cell("FA", game.battle.SA, false); - fill_cell("FB", game.battle.SB, false); + fill_cell("EF", game.battle.FF, false); + fill_cell("FF", game.battle.SF, false); fill_cell("FC", game.battle.SC, false); fill_cell("FR", game.battle.SR, true); + document.getElementById("EC").className = "c" + game.battle.FCS; + document.getElementById("FC").className = "c" + game.battle.SCS; } } |