diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-09-16 00:13:20 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-17 12:53:18 +0100 |
commit | 02591e34c384be9e0785eb5f1d1482ac8310b66a (patch) | |
tree | f382e5d8f86c54b53336187b3b82473740e54835 | |
parent | 3e258bd20fe6d369c3b4d235da6338275b3b46cb (diff) | |
download | hammer-of-the-scots-02591e34c384be9e0785eb5f1d1482ac8310b66a.tar.gz |
Show eliminated/out-of-game blocks in separate row.
-rw-r--r-- | play.js | 28 |
1 files changed, 22 insertions, 6 deletions
@@ -449,23 +449,39 @@ function update_map() { layout[area] = { north: [], south: [] } for (let b in view.location) { + if (view.location[b] === null && BLOCKS[b].mortal) { + let element = ui.blocks[b] + if (BLOCKS[b].owner === SCOTLAND) + layout[SCOTLAND_BAG].north.push(element) + else + layout[ENGLAND_BAG].south.push(element) + } + } + + for (let b in view.location) { let info = BLOCKS[b] let element = ui.blocks[b] let area = view.location[b] - if (area in AREAS) { + if (area in AREAS || BLOCKS[b].mortal) { let moved = view.moved[b] ? " moved" : "" - if (is_known_block(b)) { + if (is_known_block(b) || area === null) { let image = " block_" + info.image let steps = " r" + (info.steps - view.steps[b]) let known = " known" + if (area === null) { + moved = " moved" + steps = " r0" + } element.classList = info.owner + known + " block" + image + steps + moved } else { element.classList = info.owner + " block" + moved } - if (info.owner === SCOTLAND) - layout[area].north.push(element) - else - layout[area].south.push(element) + if (area !== null) { + if (info.owner === SCOTLAND) + layout[area].north.push(element) + else + layout[area].south.push(element) + } show_block(element) } else { hide_block(element) |