diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-07-20 20:38:47 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-16 19:19:39 +0100 |
commit | 783823b98b2df65a1ce55ef43f0fd5dbebdcb8a5 (patch) | |
tree | 12644735cbeecc8f87cbe7b80e46886a5e2feeeb /ui.js | |
parent | 022e525c09f2d724a55d2a4400d682c61aed1ade (diff) | |
download | crusader-rex-783823b98b2df65a1ce55ef43f0fd5dbebdcb8a5.tar.gz |
crusader: Rewrite logic of revealing and hiding blocks in battle.
Diffstat (limited to 'ui.js')
-rw-r--r-- | ui.js | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -671,6 +671,10 @@ function update_battle() { if (game.battle.jihad === block_owner(block)) class_name += " jihad"; + if (game.battle.sallying.includes(block)) + show = true; + if (game.battle.storming.includes(block)) + show = true; if (show || block_owner(block) === player) { class_name += " known"; ui.battle_block[block].className = class_name; @@ -690,21 +694,21 @@ function update_battle() { } if (player === FRANKS) { - fill_cell("FR", game.battle.FR, true); - fill_cell("FC", game.battle.FC, true); - fill_cell("FF", game.battle.FF, game.battle.show_castle); // saracens in frank castle - fill_cell("EF", game.battle.SF, game.battle.show_field); // saracens in field battle - fill_cell("EC", game.battle.SC, game.battle.show_castle); // saracens in saracen castle fill_cell("ER", game.battle.SR, false); + fill_cell("EC", game.battle.SC, game.battle.show_castle); + fill_cell("EF", game.battle.SF, game.battle.show_field); + fill_cell("FF", game.battle.FF, game.battle.show_field); + fill_cell("FC", game.battle.FC, game.battle.show_castle); + fill_cell("FR", game.battle.FR, false); document.getElementById("FC").className = "c" + game.battle.FCS; document.getElementById("EC").className = "c" + game.battle.SCS; } else { fill_cell("ER", game.battle.FR, false); fill_cell("EC", game.battle.FC, game.battle.show_castle); fill_cell("EF", game.battle.FF, game.battle.show_field); - fill_cell("FF", game.battle.SF, game.battle.show_castle); - fill_cell("FC", game.battle.SC, true); - fill_cell("FR", game.battle.SR, true); + fill_cell("FF", game.battle.SF, game.battle.show_field); + fill_cell("FC", game.battle.SC, game.battle.show_castle); + fill_cell("FR", game.battle.SR, false); document.getElementById("EC").className = "c" + game.battle.FCS; document.getElementById("FC").className = "c" + game.battle.SCS; } |