From bba2352b38b5ad5d25bb07198eed2d426ce1831d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 23 Jun 2021 15:42:49 +0200 Subject: caesar: Pick Mars and Neptune battles after movement. This is like the Jihad card in Crusader Rex where the rules clarify that the surprise attack is declared before player two moves. We can then also mark the surprise attacking blocks on the map. --- ui.js | 54 ++++++++++-------------------------------------------- 1 file changed, 10 insertions(+), 44 deletions(-) (limited to 'ui.js') diff --git a/ui.js b/ui.js index 4629578..362408c 100644 --- a/ui.js +++ b/ui.js @@ -454,8 +454,17 @@ function update_map() { element.classList.remove('moved'); else element.classList.add('moved'); - element.style.visibility = 'visible'; + if (color == game.mars && location == game.surprise) + element.classList.add("mars"); + else + element.classList.remove("mars"); + if (color == game.neptune && location == game.surprise) + element.classList.add("neptune"); + else + element.classList.remove("neptune"); + + element.style.visibility = 'visible'; layout[location].secret.push(element); } } @@ -679,49 +688,6 @@ function on_update() { for (let b in BLOCKS) if (!ui.seen.has(b)) ui.battle_steps[b] = 0; - - if (game.spaceList) { - if (game.actionList.includes("secret")) { - for (let o in ui.secret) { - for (let s in ui.secret[o]) { - if (game.spaceList.includes(s)) { - for (let e of ui.secret[o][s]) - e.classList.add("highlight"); - } else { - for (let e of ui.secret[o][s]) - e.classList.remove("highlight"); - } - } - } - for (let s in SPACES) - if (game.spaceList.includes(s)) - ui.spaces[s].classList.remove("highlight"); - } else { - for (let o in ui.secret) - for (let s in ui.secret[o]) - for (let e of ui.secret[o][s]) - e.classList.remove("highlight"); - for (let s in SPACES) { - if (game.spaceList.includes(s)) - ui.spaces[s].classList.add("highlight"); - else - ui.spaces[s].classList.remove("highlight"); - } - } - } - - if (game.blockList) { - for (let b in BLOCKS) { - if (game.blockList.includes(b)) - ui.known[b].classList.add("highlight"); - else - ui.known[b].classList.remove("highlight"); - if (b == game.who) - ui.known[b].classList.add("selected"); - else - ui.known[b].classList.remove("selected"); - } - } } function select_card(c) { -- cgit v1.2.3